# Execute control

**URL:** <https://forum.sierrawireless.com/t/execute-control/2949>\
**Category:** Open AT\
**Created:** [February 18, 2009, 12:56pm UTC](https://forum.sierrawireless.com/t/execute-control/2949 "2009-02-18T12:56:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mag\_knu](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@mag\_knu](https://forum.sierrawireless.com/u/mag_knu)\
**Post date:** [February 18, 2009, 12:56pm UTC](https://forum.sierrawireless.com/t/execute-control/2949/1 "2009-02-18T12:56:28Z")

</div>

I want to execute my application on every recived sms, i have developed an application that reply’s if SMS contains a keyword.

I have looked at the adl\_atUnSoSubscribe(ASCII \*UnSostr, adl\_atUnSoHandler\_t UnSohdl) function, and subscribe to +CMTI. Then run the autoreply code as the callback function.

Any suggestions on how I can make my application execute on incomming sms?

Thanks!!

Current main

```auto
void adl_main( adl_InitType_e InitType )
{
	delay();

    TRACE (( 1, "Start SMS_Automaton application" ));
    bool handle;

    handle=smsauto_recive;
    if(handle)
    {
    	smsauto_answer();
    	smsauto_stop();
    }
    else
    {
    	smsauto_stop();
    	TRACE (( 1, "Does nothing" ));
    }
}
```

---

<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:** [February 18, 2009, 2:53pm UTC](https://forum.sierrawireless.com/t/execute-control/2949/2 "2009-02-18T14:53:22Z")

</div>

Why don’t you just use the ADL SMS Service?

---

<div class="post-metadata">

**Author:** ![tomalex](https://avatars.discourse-cdn.com/v4/letter/t/71e660/32.png) [@tomalex](https://forum.sierrawireless.com/u/tomalex)\
**Post date:** [February 18, 2009, 6:52pm UTC](https://forum.sierrawireless.com/t/execute-control/2949/3 "2009-02-18T18:52:50Z")

</div>

> [@](#):
>
> void adl\_main( adl\_InitType\_e InitType )  
> {  
> delay();

And avoid “delay()” in OpenAT C! You should study at least the first chapters of Open AT documentation before you start programming in it!

Best Regards,

tom

---

<div class="post-metadata">

**Author:** ![daav](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/daav/32/2767_2.png) [@daav](https://forum.sierrawireless.com/u/daav)\
**Post date:** [February 19, 2009, 6:06am UTC](https://forum.sierrawireless.com/t/execute-control/2949/4 "2009-02-19T06:06:59Z")

</div>

I guess that this is not the right place for such a post: we are discussing here about M2M Studio tool, not about how to write Open AT applications…
