# Sending multiple sms

**URL:** <https://forum.sierrawireless.com/t/sending-multiple-sms/4981>\
**Category:** Open AT\
**Created:** [March 28, 2011, 10:00am UTC](https://forum.sierrawireless.com/t/sending-multiple-sms/4981 "2011-03-28T10:00:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![diste](https://avatars.discourse-cdn.com/v4/letter/d/bcef8e/32.png) [@diste](https://forum.sierrawireless.com/u/diste)\
**Post date:** [March 28, 2011, 10:00am UTC](https://forum.sierrawireless.com/t/sending-multiple-sms/4981/1 "2011-03-28T10:00:05Z")

</div>

Hello,

I tried to send multiple sms using

```auto
sms_handle = adl_smsSubscribe(sms_handler, sms_ctrl_handler,
				ADL_SMS_MODE_TEXT);
		TRACE (( WD_TRACE_LEVEL, "WD: Subscribed sms handler: %d", sms_handle ));

		for (i = 0; i < phone_numbers_count; ++i) {
	                ret = adl_smsSend(sms_handle, number[i], msg, ADL_SMS_MODE_TEXT);
	                TRACE ((WD_TRACE_LEVEL, "WD: SMS sent to numlen %d text len %d ret %d\n",wm_strlen(number), wm_strlen(msg), ret));
		}

		// Unsubscribe SMS Service
		i = adl_smsUnsubscribe(sms_handle);
```

the effect is that only the first sms is sent.

Is adl\_smsSubscribe function asynchronous? Should i wait the ADL\_SMS\_EVENT\_SENDING\_OK event before to send the further sms?

thanks,

Luca

---

<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:** [March 28, 2011, 11:03am UTC](https://forum.sierrawireless.com/t/sending-multiple-sms/4981/2 "2011-03-28T11:03:06Z")

</div>

> [@diste](#):
>
> the effect is that only the first sms is sent.

I’m not surprised!

> [@](#):
>
> Is adl\_smsSubscribe function asynchronous?

No.

> [@](#):
>
> Should i wait the ADL\_SMS\_EVENT\_SENDING\_OK event before to send the further sms?

What does the return value from adl\_smsSend tell you…?

---

<div class="post-metadata">

**Author:** ![diste](https://avatars.discourse-cdn.com/v4/letter/d/bcef8e/32.png) [@diste](https://forum.sierrawireless.com/u/diste)\
**Post date:** [April 4, 2011, 8:44am UTC](https://forum.sierrawireless.com/t/sending-multiple-sms/4981/3 "2011-04-04T08:44:45Z")

</div>

hello,

sorry for late reply.

I was meaning Is adl\_smsSend function asynchronous, not not adl\_smsSubscribe.

It seems to work correctly using the sent event callback for to send the next messages.

but now I have another problem:  
what happens if the openat app tries to send an sms and concurrently the modem receives an at command for to send the sms?  
It seems the whole fasttrack hangs and not answers anymore. It is reasonable?

thanks!

---

<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:** [April 4, 2011, 8:57am UTC](https://forum.sierrawireless.com/t/sending-multiple-sms/4981/4 "2011-04-04T08:57:28Z")

</div>

> [@diste](#):
>
> I was meaning Is adl\_smsSend function asynchronous

Yes.

Just like sending an SMS “manually” using AT commands, An OK response from adl\_smsSend just indicates that the request was accepted with no immediate errors in the parameters.

It then takes time to submit the SMS over the air, and to receive the network’s response.

The operation is not complete & ready for another SMS until you have received the final confimration (the message reference) or failure code.

> [@](#):
>
> It seems to work correctly using the sent event callback for to send the next messages.

Yes - that’s what it’s there for!

> [@](#):
>
> but now I have another problem…

Better to start a new thread for the new problem, then.

You can always give a link to this one for reference…
