# SMS not receiving after adl\_smssubscribe

**URL:** <https://forum.sierrawireless.com/t/sms-not-receiving-after-adl-smssubscribe/3506>\
**Category:** Open AT\
**Created:** [July 30, 2009, 9:43am UTC](https://forum.sierrawireless.com/t/sms-not-receiving-after-adl-smssubscribe/3506 "2009-07-30T09:43:53Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![chiduprakash](https://avatars.discourse-cdn.com/v4/letter/c/c37758/32.png) [@chiduprakash](https://forum.sierrawireless.com/u/chiduprakash)\
**Post date:** [July 30, 2009, 9:43am UTC](https://forum.sierrawireless.com/t/sms-not-receiving-after-adl-smssubscribe/3506/1 "2009-07-30T09:43:53Z")

</div>

In Q24plus

```
  If already SMS is there in the inbox (inbox not full) before adl_smssubscribe() then my application not receiving SMS from handler.

```

Step1: After starting my application and sim initialization i am subscribing to SMS and deleting the Inbox AT+CMGD=1,4) during that time If any new SMS comes and stored inbox then my sms data handler will not receive any sms.

If i check with AT+CMGL=“REC UNREAD” i can see the message from my hyperterminal but this sms not given to my application. And also no sms after this will come to my application.

What could be the problem?

my handler returns FALSE (inorder to not to store in memory of sim or module) after receiving SMS when it works properly.

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [July 30, 2009, 10:41am UTC](https://forum.sierrawireless.com/t/sms-not-receiving-after-adl-smssubscribe/3506/2 "2009-07-30T10:41:57Z")

</div>

> [@chiduprakash](#):
>
> ```
> If already SMS is there in the inbox (inbox not full) before adl_smssubscribe() then my application not receiving SMS from handler.
> 
> ```

Correct.

> [@](#):
>
> What could be the problem?

There is no problem - this is the correct operation.

To retrieve messages that have already been received and placed onto the SIM, you will have to use the AT+CMGR, etc, commands.

---

<div class="post-metadata">

**Author:** ![chiduprakash](https://avatars.discourse-cdn.com/v4/letter/c/c37758/32.png) [@chiduprakash](https://forum.sierrawireless.com/u/chiduprakash)\
**Post date:** [July 30, 2009, 11:08am UTC](https://forum.sierrawireless.com/t/sms-not-receiving-after-adl-smssubscribe/3506/3 "2009-07-30T11:08:31Z")

</div>

> [@](#):
>
> > [@awneil](#):
> >
> > > [@chiduprakash](#):
> > >
> > > ```
> > > If already SMS is there in the inbox (inbox not full) before adl_smssubscribe() then my application not receiving SMS from handler.
> > > 
> > > ```
> > 
> > Correct.

Not the existing one apart from this any new messages comes i am not receiving through sms data handler i can see messages in the inbox from hyperterminal ( it gives “REC UNREAD” ) during running . but not given to openat application currently running.

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [July 30, 2009, 11:14am UTC](https://forum.sierrawireless.com/t/sms-not-receiving-after-adl-smssubscribe/3506/4 "2009-07-30T11:14:31Z")

</div>

> [@chiduprakash](#):
>
> new messages comes i am not receiving through sms data handler

Did you check that the subscription actually worked?

---

<div class="post-metadata">

**Author:** ![chiduprakash](https://avatars.discourse-cdn.com/v4/letter/c/c37758/32.png) [@chiduprakash](https://forum.sierrawireless.com/u/chiduprakash)\
**Post date:** [July 30, 2009, 11:34am UTC](https://forum.sierrawireless.com/t/sms-not-receiving-after-adl-smssubscribe/3506/5 "2009-07-30T11:34:38Z")

</div>

> [@awneil](#):
>
> > [@chiduprakash](#):
> >
> > new messages comes i am not receiving through sms data handler
> 
> Did you check that the subscription actually worked?

Yes i am getting return status OK after calling adl\_smssubscribe().

Please see the code below.

```auto
Siminit_handler(u8 event)
{
             switch(event)
	{
	case ADL_SIM_EVENT_FULL_INIT:
smsHandler = adl_smsSubscribe( (adl_smsHdlr_f) smsDataHandler, (adl_smsCtrlHdlr_f) smsCtrlHandler, ADL_SMS_MODE_TEXT);
             if(smsHandler<0)			
	  _AT_RSP_TRUE( "\r\n SMS subscribe error\r\n");    
		else		
		  _AT_RSP_TRUE( "\r\n SMS SUBSCRIBE OK\r\n"); 

               adl_atCmdCreate("AT+CMGD=1,4",ADL_AT_PORT_TYPE( ADL_AT_UART1, TRUE),(adl_atRspHandler_t) atCmdRspHandler, "*", NULL);
           break;
     }      
}
```

The scenario is if any new sms comes during processing of command AT+cmgd=1,4 ( deletion already started). There onwards any new sms comming will be not giving to SMS data handler this i can see thro my HT. Only AT+CMGR will work to read the SMSs received.

---

<div class="post-metadata">

**Author:** ![fer.caballero](https://avatars.discourse-cdn.com/v4/letter/f/ba9def/32.png) [@fer.caballero](https://forum.sierrawireless.com/u/fer.caballero)\
**Post date:** [July 30, 2009, 12:27pm UTC](https://forum.sierrawireless.com/t/sms-not-receiving-after-adl-smssubscribe/3506/6 "2009-07-30T12:27:50Z")

</div>

Why do you wait for deletion until subscription?  
I think it’s better, start deleting and subcribe after.  
Anyway, do you recieve unsolicited “+CMTI: …” when new SMS came?

---

<div class="post-metadata">

**Author:** ![chiduprakash](https://avatars.discourse-cdn.com/v4/letter/c/c37758/32.png) [@chiduprakash](https://forum.sierrawireless.com/u/chiduprakash)\
**Post date:** [July 30, 2009, 1:05pm UTC](https://forum.sierrawireless.com/t/sms-not-receiving-after-adl-smssubscribe/3506/7 "2009-07-30T13:05:11Z")

</div>

> [@](#):
>
> > [@fer.caballero](#):
> >
> > Why do you wait for deletion until subscription?
> 
> Is the problem causing for not receiving in the smsdatahandler?
> 
> > [@](#):
> >
> > I think it’s better, start deleting and subcribe after.
> 
> Is possible to delete before SIM initialization?
> 
> > [@](#):
> >
> > Anyway, do you recieve unsolicited “+CMTI: …” when new SMS came?

My application not receives any Unsolicited codes like +CMTI and also i have not subscribed to adl\_atUnSoSubscribe().

---

<div class="post-metadata">

**Author:** ![fer.caballero](https://avatars.discourse-cdn.com/v4/letter/f/ba9def/32.png) [@fer.caballero](https://forum.sierrawireless.com/u/fer.caballero)\
**Post date:** [July 31, 2009, 9:14am UTC](https://forum.sierrawireless.com/t/sms-not-receiving-after-adl-smssubscribe/3506/8 "2009-07-31T09:14:46Z")

</div>

> [@](#):
>
> Is the problem causing for not receiving in the smsdatahandler?

Not necessarily. But I find better to do it in that order.

> [@](#):
>
> Is possible to delete before SIM initialization?

Not sure, but I don’t think so. Anyway, I sugested to do it before SMS subscription, not before SIM subscription.

> [@](#):
>
> My application not receives any Unsolicited codes like +CMTI and also i have not subscribed to adl\_atUnSoSubscribe().

Subscribe to the unsolicited +CMTI, to check the SMS are recieved.

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [July 31, 2009, 10:56am UTC](https://forum.sierrawireless.com/t/sms-not-receiving-after-adl-smssubscribe/3506/9 "2009-07-31T10:56:35Z")

</div>

> [@chiduprakash](#):
>
> Is the problem causing for not receiving in the smsdatahandler?

From what you’ve described, it sounds like there may be some issue about using both the ADL SMS Service and “manual” AT commands at the same time.

This doesn’t seem entirely unreasonable: it is conceivable that your “manual” AT commands could mess with ADL’s assumptions about the state of the system.  
If it’s a real concern to you, you should raise it with your Distributor or Wavecom FAE; otherwise, play it safe!

> [@chiduprakash](#):
>
> Is possible to delete before SIM initialization?

> [@fer.caballero](#):
>
> Not sure, but I don’t think so.

No, of course it’s not!  
Deleting SMS from the SIM obviously requires interaction with the SIM - and you obviously can’t do that before the SIM is ready! 8)

> [@fer.caballero](#):
>
> Anyway, I sugested to do it before SMS subscription, not before SIM subscription.

You did!

> [@chiduprakash](#):
>
> My application not receives any Unsolicited codes like +CMTI

The +CMTI unsolicited responses are not enabled by default - you have to explicitly request them!

> [@chiduprakash](#):
>
> and also i have not subscribed to adl\_atUnSoSubscribe().

Your application will obviously not know about any unsolicited responses if you don’t subscribe them!

> [@fer.caballero](#):
>
> Subscribe to the unsolicited +CMTI, to check the SMS are recieved.

I’m not sure how much of a good idea this is if the ADL SMS Service is alreay trying to manage incoming SMS…

---

<div class="post-metadata">

**Author:** ![chiduprakash](https://avatars.discourse-cdn.com/v4/letter/c/c37758/32.png) [@chiduprakash](https://forum.sierrawireless.com/u/chiduprakash)\
**Post date:** [July 31, 2009, 12:36pm UTC](https://forum.sierrawireless.com/t/sms-not-receiving-after-adl-smssubscribe/3506/10 "2009-07-31T12:36:52Z")

</div>

> [@](#):
>
> > [@fer.caballero](#):
> >
> > > [@](#):
> > >
> > > Is the problem causing for not receiving in the smsdatahandler?
> > 
> > Not necessarily. But I find better to do it in that order.
> 
> I will do that
> 
> > [@](#):
> >
> > > [@](#):
> > >
> > > Is possible to delete before SIM initialization?
> > 
> > Not sure, but I don’t think so. Anyway, I sugested to do it before SMS subscription, not before SIM subscription.

I will do it afet simint and before SMS subscription

> [@](#):
>
> My application not receives any Unsolicited codes like +CMTI and also i have not subscribed to adl\_atUnSoSubscribe().

Subscribe to the unsolicited +CMTI, to check the SMS are recieved.  
[/quote]  
i check in the document +CMTI is not in the list of unsolicited cmd string of adl\_UnSoSubscribe().

Please see the list below

typedef enum  
{  
ADL\_STR\_NO\_STRING, // Unknown string  
ADL\_STR\_OK, // “OK”  
ADL\_STR\_BUSY, // “BUSY”  
ADL\_STR\_NO\_ANSWER, // “NO ANSWER”  
ADL\_STR\_NO\_CARRIER, // “NO CARRIER”  
ADL\_STR\_CONNECT, // “CONNECT”  
ADL\_STR\_ERROR, // “ERROR”  
ADL\_STR\_CME\_ERROR, // “+CME ERROR:”  
ADL\_STR\_CMS\_ERROR, // “+CMS ERROR:”  
ADL\_STR\_CPIN, // “+CPIN:”  
ADL\_STR\_LAST\_TERMINAL, // Terminal resp. are before this line  
ADL\_STR\_RING = ADL\_STR\_LAST\_TERMINAL, // “RING”  
ADL\_STR\_WIND, // “+WIND:”  
ADL\_STR\_CRING, // “+CRING:”  
ADL\_STR\_CPINC, // “+CPINC:”  
ADL\_STR\_WSTR, // “+WSTR:”  
ADL\_STR\_CMEE, // “+CMEE:”  
ADL\_STR\_CREG, // “+CREG:”  
ADL\_STR\_CGREG, // “+CGREG:”  
ADL\_STR\_CRC, // “+CRC:”  
ADL\_STR\_CGEREP, // “+CGEREP:”  
// Last string ID  
ADL\_STR\_LAST  
} adl\_strID\_e;

Even though if it works i have to take care of string manipulations isn’t it? chances of freezing SMS data is more

---

<div class="post-metadata">

**Author:** ![chiduprakash](https://avatars.discourse-cdn.com/v4/letter/c/c37758/32.png) [@chiduprakash](https://forum.sierrawireless.com/u/chiduprakash)\
**Post date:** [August 3, 2009, 6:45am UTC](https://forum.sierrawireless.com/t/sms-not-receiving-after-adl-smssubscribe/3506/11 "2009-08-03T06:45:40Z")

</div>

I have one more query please.

If my sim inbox is full and my application starts and subscribes to SMS without deleting the inbox content through AT cmmds. Can i recieve new SMS in my sms handler?  
I am returning FALSE from my sms handler.

---

<div class="post-metadata">

**Author:** ![fer.caballero](https://avatars.discourse-cdn.com/v4/letter/f/ba9def/32.png) [@fer.caballero](https://forum.sierrawireless.com/u/fer.caballero)\
**Post date:** [August 3, 2009, 1:39pm UTC](https://forum.sierrawireless.com/t/sms-not-receiving-after-adl-smssubscribe/3506/12 "2009-08-03T13:39:26Z")

</div>

> [@](#):
>
> awneil wrote:  
> You did!

Could you please quote where? 😕

> [@](#):
>
> i check in the document +CMTI is not in the list of unsolicited cmd string of adl\_UnSoSubscribe().

I’m not sure I’ve tried it, but I think the ID is used only for typical AT’s. Just use a different handler for +CMTI, you would not need complicated text handling.
