Failed to send SMS | developer.brewmp.com Failed to send SMS | developer.brewmp.com

Developer

Failed to send SMS

Forums:

Hi,

I'm trying to send SMS, but the application always  obtain the same error:  AEESMS_ERROR_NETWORK_OUT_OF_ORDER.

This is the code:

	/* Set the destination address type */
	pMe->SMSinfo.smo[0].nId = MSGOPT_TO_NUMBER_TYPE;
	pMe->sSMSinfo.smo[0].pVal = (void *)AEESMS_NUMBER_INTERNATIONAL;
	
	/* Set the sender's Number */
	STRCPY(pMe->SMSinfo.pDestNumber,scDestNumber);
	pMe->SMSinfo.smo[1].nId = MSGOPT_TO_DEVICE_SZ;
	pMe->SMSinfo.smo[1].pVal = pMe->SMSinfo.pDestNumber;
	 
	/* Set payload encoding */
	WEBOPT_SETVARBUFFER(smsBuffer, scSMSText, STRLEN(scSMSText));
	pMe->SMSinfo.smo[2].nId = MSGOPT_PAYLOAD_BINARY;
	pMe->SMSinfo.smo[2].pVal = smsBuffer;

	/* Set MO SMS encoding */
	pMe->SMSinfo.smo[3].nId = MSGOPT_MOSMS_ENCODING;
	pMe->SMSinfo.smo[3].pVal = (void *)AEESMS_ENC_OCTET;

	/* Set the sender's Number type */
	pMe->SMSinfo.smo[4].nId = MSGOPT_FROM_NUMBER_TYPE;
	pMe->SMSinfo.smo[4].pVal = (void *)AEESMS_NUMBER_INTERNATIONAL;

	/* Add originating MDN */
	STRCPY(pMe->SMSinfo.pSrcNumber, (char*)&ucISDN[0]);
	pMe->SMSinfo.smo[5].nId = MSGOPT_FROM_DEVICE_SZ;
	pMe->SMSinfo.smo[5].pVal = pMe->SMSinfo.pSrcNumber;
	 
	/* Set message priority */
	pMe->SMSinfo.smo[6].nId = MSGOPT_PRIORITY;
	pMe->SMSinfo.smo[6].pVal = (void*)AEESMS_PRIORITY_URGENT;

	pMe->SMSinfo.smo[7].nId = MSGOPT_PAYLOAD_ENCODING ;
	pMe->SMSinfo.smo[7].pVal = (void*)AEE_ENC_ISOLATIN1;

	/* Terminate message opt structure */
	pMe->SMSinfo.smo[8].nId = MSGOPT_END;
	pMe->SMSinfo.smo[8].pVal = NULL;

	/* Add options to the ISMSMsg (excluding error checking)*/
	ISMSMSG_AddOpt(pMe->piSMSMsg, pMe->SMSinfo.smo);

	/* Initialize callback */
	CALLBACK_Init(&pMe->SMScallback, (PFNNOTIFY)SendSMSCB, pMe);
	 
	/* Send SMS */
	ISMS_SendMsg(pMe->piSMS, pMe->piSMSMsg, &pMe->SMScallback, &pMe->m_retVal);
In simulator, the callback function return: "Successfully sent", but in device the callback return the errorType: 3 and error = 152;What is the problem?Thanks

 

i was  facing a similar issue on HTC Smart with some RUIM cards.
 
try adding the below option as a SmsOpts to the message options while sending the message(using array offset 9 just for an example, it just needs to be added to the SMS Options):
sOpts[9].nId = MSGOPT_TO_NUMBER_PLAN;
sOpts[9].pVal = (
void*)AEESMS_NUMBER_PLAN_TELEPHONY;

i was  facing a similar issue on HTC Smart with some RUIM cards.
 
try adding the below option as a SmsOpts to the message options while sending the message(using array offset 9 just for an example, it just needs to be added to the SMS Options):
sOpts[9].nId = MSGOPT_TO_NUMBER_PLAN;
sOpts[9].pVal = (
void*)AEESMS_NUMBER_PLAN_TELEPHONY;

Now it works, thank you very much

Now it works, thank you very much