Ejemplo n.º 1
0
	void onHub_IncomingCommand(dcpp::interfaces::Hub* h, const char* line, bool& handled) throw() { 
		if(!handled) {
			bool isAdc = strncmp(h->getHubURL(), "adc://", 6) == 0 || strncmp(h->getHubURL(), "adcs://", 7) == 0;
			MakeCall((isAdc ? "adch" : "nmdch"), "DataArrival", 1, h, line);
			handled = GetLuaBool();
		}
	}
Ejemplo n.º 2
0
	void onHub_OutgoingMessage(dcpp::interfaces::Hub* h, dcpp::interfaces::ChatMessage* cm, bool& handled) throw() {
		if(!handled) {
			if(cm->getReplyTo() == 0) {
				// hub message
				MakeCall("dcpp", "OnCommandEnter", 1, h, (const char*)cm->getText());
				handled = GetLuaBool();
			} else {
				// private message
				/*dcppChatMessage* cm = (dcppChatMessage*)p1;
				if(!cm || !cm->replyTo) return DCPP_FALSE;
				//bool isAdc = strncmp(url, "adc://", 6) == 0 || strncmp(url, "adcs://", 7) == 0;
				dcppBuffer buf = { 0 };
				buf.buf = new char[40];
				buf.size = 40;
				memset(buf.buf, 0, (size_t)buf.size);

				LuaManager::dcppLib->call(DCPP_CALL_USER_GET_CID, cm->replyTo, (dcpp_param)&buf, 0);

				MakeCall("dcpp", cm->incoming ? "OnPrivateMessageIn" : "OnPrivateMessageOut", 1, (const char*)buf.buf, cm->message);

				delete buf.buf;
				return GetLuaBool() ? DCPP_TRUE : DCPP_FALSE;*/
			}
		}
	}
Ejemplo n.º 3
0
/**************************************************************

	FUNCTION NAME		: FdlMakeCall(void)
  	PURPOSE				: make call from FDL
	INPUT PARAMETERS	: nil
	OUTPUT PARAMETERS	: nil
	RETURNS				: void
  	Author				: Vanita Jain
 

**************************************************************/
void FdlMakeCall() 
{
	if(gpFDLBDLContext->HighlightedFDN != 255)
	{
		g_phb_cntx.dial_from_list  = MMI_PHB_FDN;
		MakeCall((PS8)gpFDLBDLContext->FDLBDLEntries[gpFDLBDLContext->HighlightedFDN].tel.number);
	}

}
Ejemplo n.º 4
0
/**************************************************************

	FUNCTION NAME		: SendCallBarrActivate(void)

  	PURPOSE				: function to send req for call barring activate 

	INPUT PARAMETERS	: nil

	OUTPUT PARAMETERS	: nil

	RETURNS				: void

 

**************************************************************/
void SendCallBarrActivate(void)
{

	S8 input_string[(MAX_DIGITS_USSD * ENCODING_LENGTH)];
	PS8 hash_string = NULL ;
	S8 string_out[20];
	memset(string_out,0,20);
	 
	memset(input_string,0, (MAX_DIGITS_USSD * ENCODING_LENGTH));
	hash_string = (PS8) GetString(STR_HASH_VALUE);
	switch(g_callset_cntx_p->SSBarType)
	{
	/* incase of call barring all outgoing calls */
	case BARRING_OUTGOING_ALLCALLS:
		strcpy((S8*) string_out, "*33*");
		AnsiiToUnicodeString((PS8) input_string,(PS8)string_out);		
		break;
	/* incase of call barring all outgoing international calls */
	case BARRING_OUTGOING_INTERCALL :
		strcpy((S8*) string_out, "*331*");
		AnsiiToUnicodeString((PS8) input_string,(PS8)string_out);		
		break;
	/* incase of call barring all outgoing international calls expect home */
	case BARRING_OUTGOING_INTEREXCEPTHOME :
		strcpy((S8*) string_out, "*332*");
		AnsiiToUnicodeString((PS8) input_string,(PS8)string_out);		
		break;
	/* incase of call barring all incoming calls */
	case BARRING_INCOMING_ALLCALLS :
		strcpy((S8*) string_out, "*35*");
		AnsiiToUnicodeString((PS8) input_string,(PS8)string_out);		
		break;
	/* incase of call barring all incoming roaming calls */
	case BARRING_INCOMING_ROAMING :
		strcpy((S8*) string_out, "*351*");
		AnsiiToUnicodeString((PS8) input_string,(PS8)string_out);		
		break;
	}
	pfnUnicodeStrcat((PS8) input_string,(PS8) g_callset_cntx_p->SSBarPassOld);
	pfnUnicodeStrcat((PS8) input_string,(PS8) hash_string);
	/* set protocol event handler for the call barring response */
#ifdef __MMI_MULTI_SIM__
	MTPNP_CallSetSetProtocolEventHandler(CALLSETBarringRsp, PRT_MMI_SS_CALL_BARRING_RSP);
#else
	SetProtocolEventHandler(CALLSETBarringRsp, PRT_MMI_SS_CALL_BARRING_RSP);
#endif

	#ifdef __MMI_MULTI_SIM__
	MTPNP_AD_Set_Channel(MTPNP_AD_CALL_CHANNEL, g_callset_cntx_p->nSimId);
	#endif

	/* make a corresponding ss string for call barring option */
	MakeCall((PS8) input_string);
	return;	
}
Ejemplo n.º 5
0
string ClientScriptInstance::formatChatMessage(const tstring& aLine) {
        Lock l(cs);
        // this string is probably in UTF-8.  Does lua want/need strings in the active code page?
        string processed = Text::fromT(aLine);
        MakeCall("dcpp", "FormatChatText", 1, (Client*)this, processed);

        if (lua_isstring(L, -1)) processed = lua_tostring(L, -1);

        lua_settop(L, 0);
        return Text::toT(processed);
}
Ejemplo n.º 6
0
//arbitary URL version
CRemoteCall::CRemoteCall ( const char * szURL, CLuaArguments * arguments, CLuaMain * luaMain, const CLuaFunctionRef& iFunction )
{
    m_VM = luaMain;
    m_iFunction = iFunction;

    arguments->WriteToJSONString ( m_strData, true );

    m_strURL = szURL;

    MakeCall();
}
Ejemplo n.º 7
0
CRemoteCall::CRemoteCall ( const char * szServerHost, const char * szResourceName, const char * szFunctionName, CLuaArguments * arguments, CLuaMain * luaMain, const CLuaFunctionRef& iFunction )
{
    m_VM = luaMain;
    m_iFunction = iFunction;

    arguments->WriteToJSONString ( m_strData, true );
   
    m_strURL = SString ( "http://%s/%s/call/%s", szServerHost, szResourceName, szFunctionName );

    MakeCall();
}
Ejemplo n.º 8
0
//arbitary URL version
CRemoteCall::CRemoteCall ( char * szURL, CLuaArguments * arguments, CLuaMain * luaMain, int iFunction )
{
    m_VM = luaMain;
    m_iFunction = iFunction;

    arguments->WriteToJSONString ( m_strData, true );
    
    strncpy ( m_szURL, szURL, 511 );
    m_szURL[511] = '\0';

    MakeCall();
}
Ejemplo n.º 9
0
Smt_Uint TBaseDevice::OnCmdMakeCall(Smt_Pdu &pdu)
{
	Smt_Uint channel;
    Smt_String ani;
	Smt_String dnis;
	pdu.GetUint(Key_IVR_ChannelID, &channel);
	pdu.GetString(Key_IVR_ANI, &ani);
	pdu.GetString(Key_IVR_DNIS, &dnis);
	if(!CheckUserAndChannel(channel))return Smt_Fail;

	MakeCall(channel, ani, dnis);
	return Smt_Success;
}
Ejemplo n.º 10
0
/**************************************************************

	FUNCTION NAME		: SendBarrQuery(void)

  	PURPOSE				: function to send req for call barring query status.

	INPUT PARAMETERS	: nil

	OUTPUT PARAMETERS	: nil

	RETURNS				: void

 

**************************************************************/
void SendBarrQuery(void)
{
	S8 input_string[(MAX_DIGITS_USSD * ENCODING_LENGTH)];
	S8 string_type[30];
	 
	memset(input_string,0,( MAX_DIGITS_USSD * ENCODING_LENGTH));
	memset(string_type,0,30);
	switch(g_callset_cntx_p->SSBarType)
	{
	/* incase of call barring all outgoing calls */
	case BARRING_OUTGOING_ALLCALLS:
		strcpy((S8*) string_type, "*#33#");
		AnsiiToUnicodeString((PS8) input_string,(PS8)string_type);		
		break;
	/* incase of call barring all outgoing international calls */
	case BARRING_OUTGOING_INTERCALL :
		strcpy((S8*) string_type, "*#331#");
		AnsiiToUnicodeString((PS8) input_string,(PS8)string_type);		
		break;
	/* incase of call barring all outgoing international calls expect home */
	case BARRING_OUTGOING_INTEREXCEPTHOME :
		strcpy((S8*)string_type, "*#332#");
		AnsiiToUnicodeString((PS8) input_string,(PS8)string_type);		
		break;
	/* incase of call barring all incoming calls */
	case BARRING_INCOMING_ALLCALLS :
		strcpy((S8*) string_type, "*#35#");
		AnsiiToUnicodeString((PS8) input_string,(PS8)string_type);		
		break;
	/* incase of call barring all incoming roaming calls */
	case BARRING_INCOMING_ROAMING :
		strcpy((S8*) string_type, "*#351#");
		AnsiiToUnicodeString((PS8) input_string,(PS8)string_type);		
		break;
	}
	/* set protocol event handler for the call barring response */
#ifdef __MMI_MULTI_SIM__
	MTPNP_CallSetSetProtocolEventHandler(CALLSETBarringRsp, PRT_MMI_SS_CALL_BARRING_RSP);
#else
	SetProtocolEventHandler(CALLSETBarringRsp, PRT_MMI_SS_CALL_BARRING_RSP);
#endif

	#ifdef __MMI_MULTI_SIM__
	MTPNP_AD_Set_Channel(MTPNP_AD_CALL_CHANNEL, g_callset_cntx_p->nSimId);
	#endif

	/* make a corresponding ss string for call barring option */
	MakeCall((PS8) input_string);
	return;
}
Ejemplo n.º 11
0
void CTAPIServerConnection::OnReceive(int nErrorCode)
{
	char buf[10000];
	int i=Receive(&buf,10000);
	buf[i]=0;
	CString msg = buf;
	if (msg.Left(8)=="OUTCALL:") {
		CString Number = msg.Right(msg.GetLength()-8);
		dlg->Log("Making call to "+Number);
		MakeCall(Number);
	}
	//m_pData->OnReceive(buf);
	
	
}
Ejemplo n.º 12
0
CRemoteCall::CRemoteCall ( char * szServerHost, char * szResourceName, char * szFunctionName, CLuaArguments * arguments, CLuaMain * luaMain, int iFunction )
{
    m_szServerHost = szServerHost;
    m_szResourceName = szResourceName;
    m_szFunctionName = szFunctionName;
    m_VM = luaMain;
    m_iFunction = iFunction;

    arguments->WriteToJSONString ( m_strData, true );
   
    _snprintf ( m_szURL, 511, "http://%s/%s/call/%s", m_szServerHost, m_szResourceName, m_szFunctionName );
    m_szURL[511] = '\0';

    MakeCall();
}
Ejemplo n.º 13
0
/*****************************************************************************
 * FUNCTION
 *  mmi_vrsi_redial_dial_number
 * DESCRIPTION
 *  Call call management function and dial out the number
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_vrsi_redial_dial_number(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    LOG_CALL *redial_call = NULL;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (g_vrsi_redial_type == PHB_LND)
    {
        redial_call = &chis_p->dialedCalls[0];
    }
    else if (g_vrsi_redial_type == PHB_LNM)
    {
        redial_call = &chis_p->missedCalls[0];
    }
    else if (g_vrsi_redial_type == PHB_LNR)
    {
        redial_call = &chis_p->recvdCalls[0];
    }

    if (redial_call->numLength)
    {
   	#ifdef __MMI_DUAL_SIM_MASTER__
		mmi_ucm_app_entry_dial_option((U8*)redial_call->number,NULL,NULL);
	#else 
        MakeCall((S8*) redial_call->number);
	#endif /*__MMI_DUAL_SIM_MASTER__*/         
    }
    else
    {
        DisplayPopup(
            (PU8) GetString(STR_GLOBAL_ERROR),
            IMG_GLOBAL_ERROR,
            TRUE,
            UI_POPUP_NOTIFYDURATION_TIME,
            ERROR_TONE);
    }
}
Ejemplo n.º 14
0
/**************************************************************

	FUNCTION NAME		: SendChangePswdReq(void )

  	PURPOSE				: function for sending req for cancel all (call barring) .

	INPUT PARAMETERS	: nil

	OUTPUT PARAMETERS	: nil

	RETURNS				: void

 

**************************************************************/
void SendCancelAllReq(void)
{
	U8 input_string[MAX_DIGITS_USSD];
	PS8 hash_string = NULL ;
	U8 string_type[20];
	/* format the string for the ss string handling */	
	memset(input_string,0, MAX_DIGITS_USSD);
	memset(string_type,0,20);
	hash_string= (PS8) GetString(STR_HASH_VALUE);
	strcpy((PS8) string_type,(PS8)"#330*");
	AnsiiToUnicodeString((PS8) input_string,(PS8)string_type);		
	pfnUnicodeStrcat((S8*) input_string,(S8*) g_callset_cntx_p->SSBarPassOld);
	pfnUnicodeStrcat((S8*) input_string,(S8*) hash_string);
#ifdef __MMI_MULTI_SIM__
	MTPNP_AD_Set_Channel(MTPNP_AD_CALL_CHANNEL, g_callset_cntx_p->nSimId);	
#endif

	/* make a corresponding ss string for call fwd option */
	MakeCall((PS8) input_string);
	return;
}
Ejemplo n.º 15
0
/**************************************************************

	FUNCTION NAME		: SendChangePswdReq(void )

  	PURPOSE				: function for sending req for call barring change passwd.

	INPUT PARAMETERS	: nil

	OUTPUT PARAMETERS	: nil

	RETURNS				: void

 

**************************************************************/
void SendChangePswdReq(void)
{
	U8 input_string[MAX_DIGITS_USSD];
	U8 string_type[20];
	PS8 hash_string = NULL ;
	U8 uni_string[10];
	memset(uni_string,0,10);
	/* format the string for the ss string handling */	
	memset(input_string,0, MAX_DIGITS_USSD);
	memset(string_type,0,20);
	strcpy((PS8) string_type,(PS8)"*03**");
	hash_string = (PS8) GetString(STR_HASH_VALUE);
	AnsiiToUnicodeString((PS8) input_string,(PS8)string_type);		
	pfnUnicodeStrcat((PS8) input_string,(PS8) g_callset_cntx_p->SSBarPassOld);
	strcpy((PS8) string_type,(PS8) "*");
	AnsiiToUnicodeString((PS8) uni_string,(PS8)string_type);	
	pfnUnicodeStrcat((PS8) input_string,(PS8) uni_string);
	pfnUnicodeStrcat((PS8) input_string,(PS8) g_callset_cntx_p->SSBarPassNew);
	pfnUnicodeStrcat((PS8) input_string,(PS8) uni_string);
	pfnUnicodeStrcat((PS8) input_string,(PS8) g_callset_cntx_p->SSBarPassCfrm);
	pfnUnicodeStrcat((PS8) input_string,(PS8) hash_string);
	/* set protocol event handler for the call barring passwd change response */
#ifdef __MMI_MULTI_SIM__
	MTPNP_CallSetSetProtocolEventHandler(CALLSETBarringPassRsp, PRT_MMI_SS_CHANGE_PASSWORD_RSP);
#else
	SetProtocolEventHandler(CALLSETBarringPassRsp, PRT_MMI_SS_CHANGE_PASSWORD_RSP);
#endif

	#ifdef __MMI_MULTI_SIM__
	MTPNP_AD_Set_Channel(MTPNP_AD_CALL_CHANNEL, g_callset_cntx_p->nSimId);
	#endif

	/* make a corresponding ss string for call barring passwd change response option */
	MakeCall((PS8) input_string);
	return;
}
Ejemplo n.º 16
0
	void onTimer_Second(uint64_t) throw() { 
		if(LuaManager::timerActive) {
			MakeCall("dcpp", "OnTimer");
		}
	}
Ejemplo n.º 17
0
	void onUserConnection_OutgoingLine(dcpp::interfaces::UserConnection* uc, const char* line, bool& handled) throw() {
		if(!handled) {
			MakeCall("dcpp", "UserDataOut", 1, uc, line);
			handled = GetLuaBool();
		}
	}
Ejemplo n.º 18
0
	void onHubManager_HubDisconnected(dcpp::interfaces::Hub* h) throw() { 
		bool isAdc = strncmp(h->getHubURL(), "adc://", 6) == 0 || strncmp(h->getHubURL(), "adcs://", 7) == 0;
		MakeCall((isAdc ? "adch" : "nmdch"), "OnHubRemoved", 0, h);
		h->remEventListener((dcpp::interfaces::HubListener*)this);
	}
Ejemplo n.º 19
0
void jWap_MakeCallHandler(void* pvCallbackInfo)
 	{

	JC_CHAR					*pszURLWithScheme ;
	ST_BE_SCHEME_LISTENER 	*pstSchemeListener ;
	JC_CHAR					*pszURL ;
	JC_CHAR				    	*pszFilterdURLWithScheme ;
	JC_CHAR 					*pszNumber ;
	JC_CHAR 					*pmNumPtr  ;
	JC_CHAR 					*pmNamePtr ;
	JC_CHAR					*pmNum ;
	JC_UINT8 					ucNumLen ;
	JC_UINT8 					ucNameLen ;
	JC_CHAR					*pmName ;

	pszURLWithScheme	= NULL ;
	pszURL				= NULL ;
	pstSchemeListener 	= (ST_BE_SCHEME_LISTENER *)pvCallbackInfo ;
	pszFilterdURLWithScheme = JC_NULL ;
	pmNamePtr = JC_NULL ;
	pmNum = JC_NULL ;
	pmName = NULL ;

	pszURL = jc_wstrchr(pstSchemeListener->pmURI, '!');

	if(NULL != pszURL)
	{
		mmi_trace (1, "@@@  pszurl not null @@@") ;

		pszFilterdURLWithScheme = (JC_CHAR *)  jdd_MemAlloc ((jc_wstrlen (pstSchemeListener->pmURI) - \
			jc_wstrlen(pszURL)) + 1, sizeof (JC_CHAR));

		if (JC_NULL != pszFilterdURLWithScheme)
		{
			mmi_trace (1, "@@@  alloc clear @@@") ;
		  jc_wstrncpy(pszFilterdURLWithScheme,pstSchemeListener->pmURI, jc_wstrlen(pstSchemeListener->pmURI)- jc_wstrlen(pszURL));
		}
	}
	else
	{
		pszFilterdURLWithScheme = (JC_CHAR *)  jdd_MemAlloc (jc_wstrlen (pstSchemeListener->pmURI)  + 1, sizeof (JC_CHAR)) ;
		jc_wstrcpy (pszFilterdURLWithScheme, pstSchemeListener->pmURI) ;
	}


	if (jdi_CUtilsTcsStrStartsWith (pszFilterdURLWithScheme, WTAI_MC_SCHEME))
	{
		mmi_trace (1, "@@@  WTAI_MC_SCHEME @@@")  ;
		pszNumber = pszFilterdURLWithScheme + 13 ;
		MakeCall((PS8) pszNumber) ;
		}
	else if (jdi_CUtilsTcsStrStartsWith (pszFilterdURLWithScheme, WTAI_SD_SCHEME))
	{
			/* Display Popup. DTMF NOT SUPPORTED */
	}
	else if (jdi_CUtilsTcsStrStartsWith (pszFilterdURLWithScheme, WTAI_AP_SCHEME))
	{
		pmNumPtr = pszFilterdURLWithScheme + 13 ;
		pmNamePtr = jdi_CUtilsTcsStrStr  (pmNumPtr, ";")  ;

		ucNumLen = pmNamePtr -  pmNumPtr ;

		if (pmNamePtr)
		{
			pmNamePtr ++ ;
		}

		ucNameLen = jc_wstrlen(pmNamePtr) ;

		if(MAX_TEL_NAME <= ucNameLen)
			{
				ucNameLen = MAX_TEL_NAME ;
			}

		pmName = jdd_MemAlloc (ucNameLen + 1, sizeof (JC_CHAR)) ;

		jc_wstrncpy (pmName, pmNamePtr, ucNameLen) ;


		if(MAX_TEL_NUM <= ucNumLen  )
			{
				ucNumLen = MAX_TEL_NUM ;
			}
		pmNum = jdd_MemAlloc (ucNumLen + 1, sizeof (JC_CHAR)) ;

		if (pmNum)
		{

			jc_wstrncpy (pmNum, pmNumPtr, ucNumLen) ;

			mmi_phb_op_add_entry_Directly_req((S8*)pmName, (S8*)pmNum) ;

			//jdd_MemFree(pmName) ;
			//jdd_MemFree(pmNum) ;
		}
	}

	if (pszFilterdURLWithScheme)
			{
		jdd_MemFree (pszFilterdURLWithScheme) ;
	}

	if (pmNum)
	{
		jdd_MemFree (pmNum) ;
	}
}
Ejemplo n.º 20
0
bool UserConnectionScriptInstance::onUserConnectionMessageOut(UserConnection* aConn, const string& aLine) {
        Lock l(cs);
        MakeCall("dcpp", "UserDataOut", 1, aConn, aLine);
        return GetLuaBool();
}
Ejemplo n.º 21
0
bool ClientScriptInstance::onHubFrameEnter(Client* aClient, const string& aLine) {
        Lock l(cs);
        // ditto the comment above
        MakeCall("dcpp", "OnCommandEnter", 1, aClient, aLine);
        return GetLuaBool();
}
Ejemplo n.º 22
0
 BaseCaller( Trace& Tr, SimpleMatrix<int>& Peak, int nPos, int nAmbiguityWindow ) { MakeCall(Tr,Peak,nPos,nAmbiguityWindow); }
Ejemplo n.º 23
0
/*****************************************************************************

	FUNCTION NAME		: Sp_Make_Call

  PURPOSE	:make call.
	INPUT PARAMETERS	: void
	OUTPUT PARAMETERS	: void

	RETURNS				:

******************************************************************************/
void Sp_Make_Call (void)
{
    mmi_trace(g_sw_SP,"niej Sp_Make_Call");
    MakeCall(g_msg_cntx.smsPhoneNumber);
}