# 1 second timer example

**URL:** <https://forum.sierrawireless.com/t/1-second-timer-example/1108>\
**Category:** Open AT\
**Created:** [February 19, 2007, 8:44pm UTC](https://forum.sierrawireless.com/t/1-second-timer-example/1108 "2007-02-19T20:44:26Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark.C](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Mark.C](https://forum.sierrawireless.com/u/Mark.C)\
**Post date:** [February 19, 2007, 8:44pm UTC](https://forum.sierrawireless.com/t/1-second-timer-example/1108/1 "2007-02-19T20:44:26Z")

</div>

How to define timer to start count when the adl\_call\_event\_answer\_OK ?

This is the timer method that im using:

```auto
adl_tmr_t *setTimer;
int8 Seconds;

void startTimerHandler ()	
{

}

void stopTimer(){
 adl_tmrUnSubscribe(setTimer,
			   (adl_tmrHandler_t)startTimerHandler,
			   ADL_TMR_TYPE_100MS);
}

//------------------------------------------------
s8 Call_Handler(u16 Event, u32 Call_ID)
{
    s8 sReturn;
    sReturn = ADL_CALL_FORWARD;                          
    switch (Event)
    {
        case ADL_CALL_EVENT_SETUP_OK_FROM_EXT: break;
        case ADL_CALL_EVENT_SETUP_OK: break;
        case ADL_CALL_EVENT_ANSWER_OK_FROM_EXT: break;	
        case ADL_CALL_EVENT_ANSWER_OK: break; 
        case ADL_CALL_EVENT_RING_VOICE: break;		
	case ADL_CALL_EVENT_ANSWER_OK:
        TRACE (( 2, "Call OK" ));
 	setTimer=(adl_tmr_t *)adl_tmrSubscribe,
        (FALSE,10,ADL_TMR_TYPE_100MS,
        (adl_tmrHandler_t)startTimerHandler); 
			 //Seconds++;			 
	break;
	case ADL_CALL_EVENT_HANGUP_OK:          
        TRACE (( 7, "Hangup OK" ));
        break;
    }  
    return sReturn;
}

// -------------------------- main ---------------------------------------------
void adl_main ( adl_InitType_e InitType )
{
  Seconds=0;
  adl_callSubscribe(Call_Handler);					
}
```

Question:   
I know that this wont work so the question is how to trigger the timer to start the count when adl\_call\_event\_answer\_OK occour and how to define startTimerHandler ?

---

<div class="post-metadata">

**Author:** ![OpenAT\_Fan](https://avatars.discourse-cdn.com/v4/letter/o/f07891/32.png) [@OpenAT\_Fan](https://forum.sierrawireless.com/u/OpenAT_Fan)\
**Post date:** [February 28, 2007, 12:34pm UTC](https://forum.sierrawireless.com/t/1-second-timer-example/1108/2 "2007-02-28T12:34:43Z")

</div>

Hi Mark,

You can subscribe to a cyclic timer from the event ADL\_CALL\_EVENT\_ANSWER\_OK. A cyclic timer would expire after the specified timeout interval and the timer callback function would automatically be called by the ADL library. You can use a global variable which can be incremented from the timer callback function each time the timer expires.

Hence, using this mechanism you can find out the duration for which the call existed. (I think this is the scenario that you want to achieve).

For instance,

case ADL\_CALL\_EVENT\_ANSWER\_OK:  
TRACE (( 2, “Call OK” ));  
setTimer=(adl\_tmr\_t \*)adl\_tmrSubscribe,  
(TRUE,10,ADL\_TMR\_TYPE\_100MS,  
(adl\_tmrHandler\_t)startTimerHandler);  
…  
…  
…

Now define the timer handler function as:  
void startTimerHandler (u8 id)  
{  
myCount++; //The myCount is a global integer variable  
}

When the call is hung up, you can unsubscribe from the timer that is subscribed in the ADL\_CALL\_EVENT\_ANSWER\_OK.

I hope this should solve your problem.

Best Regards,  
Open AT Fan.

---

<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 28, 2007, 5:13pm UTC](https://forum.sierrawireless.com/t/1-second-timer-example/1108/3 "2007-02-28T17:13:29Z")

</div>

“Subscribing” to a timer “starts” the timer;

“UnSubscribing” from a timer “stops” the timer.

Note that the return value from the unsubscribe call gives the length of time that was remaining until the timer would have expired…

---

<div class="post-metadata">

**Author:** ![Mark.C](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Mark.C](https://forum.sierrawireless.com/u/Mark.C)\
**Post date:** [March 1, 2007, 2:04pm UTC](https://forum.sierrawireless.com/t/1-second-timer-example/1108/4 "2007-03-01T14:04:53Z")

</div>

Everything is working except that i can not split the options.  
I other words if i define multiple if’s non of them will be triggered.

e.g.  
void startTimerHandler ()  
{  
myCount++;  
}

if (myCount \< 5)  
{ something }  
if (myCount \> 5)  
{ something else}

Beside this i can not display the myCount value so i dont know if the timer is counting or not.

---

<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 1, 2007, 7:12pm UTC](https://forum.sierrawireless.com/t/1-second-timer-example/1108/5 "2007-03-01T19:12:41Z")

</div>

> [@Mark.C.](#):
>
> void startTimerHandler ()  
> {  
> myCount++;  
> }
> 
> if (myCount \< 5)  
> { something }  
> if (myCount \> 5)  
> { something else}

Are you sure that both sections of code are using the same myCount variable?  
ie is it a proper global, or do you have 2 independent locals…?

Note also that the above code does nothing when myCount==5.

> [@](#):
>
> i can not display the myCount value

Why not?  
Can’t you use a TRACE, or send an AT repsonse…?

---

<div class="post-metadata">

**Author:** ![Mark.C](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Mark.C](https://forum.sierrawireless.com/u/Mark.C)\
**Post date:** [March 2, 2007, 1:02pm UTC](https://forum.sierrawireless.com/t/1-second-timer-example/1108/6 "2007-03-02T13:02:53Z")

</div>

This is the code that im using.  
I have tryed with different handlers to detect length of the call but i nothing happens. You get constant RING sign.

```auto
#include "adl_global.h"

const u16 wm_apmCustomStackSize = 1024;
adl_tmr_t *setTimer;
s8 myCount;
//-------------------------------------------------------
void timerHandler (u8 id)                      
{   
myCount++;
}

void stopTimer()
{
adl_tmrUnSubscribe(setTimer,(adl_tmrHandler_t)timerHandler,ADL_TMR_TYPE_100MS); 
}

s8 Call_Handler(u16 Event, u32 Call_ID)
{
s8 sReturn;
sReturn = ADL_CALL_FORWARD;                         

switch (Event)
{
case ADL_CALL_EVENT_ANSWER_OK:
TRACE (( 2, "Call OK" )); myCount= 0;
setTimer=(adl_tmr_t *)adl_tmrSubscribe,(TRUE,10,ADL_TMR_TYPE_100MS,(adl_tmrHandler_t)timerHandler);
break;
//-------------------------------------------------------------------------
case ADL_CALL_EVENT_HANGUP_OK: 
stopTimer();
if (myCount < 5){ adl_atSendResponse ( ADL_AT_UNS, "\r\n - under -\r\n" )myCount=0;}
if (myCount == 5){ /* something */ }           
if (myCount > 5){ adl_atSendResponse ( ADL_AT_UNS, "\r\n - over - \r\n" )myCount=0;}
break;   
//------------------------------------------------------------------------------------------     
case ADL_CALL_EVENT_RING_VOICE:
TRACE (( 7, "Ring OK" )); 
break;
} 
return sReturn;
}

void adl_main ( adl_InitType_e InitType )
{
myCount=0;
adl_callSubscribe(Call_Handler);                  
}
```

---

<div class="post-metadata">

**Author:** ![jan](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@jan](https://forum.sierrawireless.com/u/jan)\
**Post date:** [March 2, 2007, 1:09pm UTC](https://forum.sierrawireless.com/t/1-second-timer-example/1108/7 "2007-03-02T13:09:37Z")

</div>

> [@Mark.C.](#):
>
> ```auto
> adl_atSendResponse ( ADL_AT_UNS, "\r\n - under -\r\n" )myCount=0;
> ```

What is this supposed to do? I would say that is not even correct syntax!?!

Best Regards,  
Jan

---

<div class="post-metadata">

**Author:** ![Mark.C](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Mark.C](https://forum.sierrawireless.com/u/Mark.C)\
**Post date:** [March 2, 2007, 2:48pm UTC](https://forum.sierrawireless.com/t/1-second-timer-example/1108/8 "2007-03-02T14:48:40Z")

</div>

```auto
adl_atSendResponse ( ADL_AT_UNS, "\r\n - under -\r\n" )myCount=0;
```

Come on Jan, you know i could not compile this without ; sign.

> [@](#):
>
> What is this supposed to do?

Just to give me some notification if the call is accepted under some time.  
I’v tryed also with TRACE, ADL\_AT\_RSP.

---

<div class="post-metadata">

**Author:** ![jan](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@jan](https://forum.sierrawireless.com/u/jan)\
**Post date:** [March 2, 2007, 2:52pm UTC](https://forum.sierrawireless.com/t/1-second-timer-example/1108/9 "2007-03-02T14:52:07Z")

</div>

So why you don’t just paste it from your source code???

I thought the compiler just created a program from it by error - you never know with gcc, do you?

So how does your trace output look like?

---

<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 2, 2007, 3:34pm UTC](https://forum.sierrawireless.com/t/1-second-timer-example/1108/10 "2007-03-02T15:34:16Z")

</div>

> [@Mark.C.](#):
>
> Come on Jan, you know i could not compile this without ; sign.

Yes - so why would you post code that doesn’t even compile?! 😒

If your post contains “obvious” transcription errors like this, then who knows what others might be lurking in there?

There is really no point in posting code unless you use copy-and-paste.

Any manual typing is almost bound to introduce differences - you might even fix the problem that caused your real code to not work!

And please, lay it out legibly - and use the ‘Preview’ button to check it!

---

<div class="post-metadata">

**Author:** ![Mark.C](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Mark.C](https://forum.sierrawireless.com/u/Mark.C)\
**Post date:** [March 2, 2007, 4:31pm UTC](https://forum.sierrawireless.com/t/1-second-timer-example/1108/11 "2007-03-02T16:31:57Z")

</div>

## Jan, awneil i must apologize myself. Im bit on the edge with this, becuse it look like some standard problem and im spinning in circle…

The TMT trace output looks like:

> [@](#):
>
> Trace CUS1 3 Unable to find the string of the remote trace in the file (ID = 868271)  
> Trace CUS1 2 Unable to find the string of the remote trace in the file (ID = 868272)  
> Trace CUS1 6 Unable to find the string of the remote trace in the file (ID = 868191)  
> Trace CUS1 3 Unable to find the string of the remote trace in the file (ID = 868179)  
> Trace CUS1 1 Unable to find the string of the remote trace in the file (ID = 868098)  
> Trace CUS1 1 Unable to find the string of the remote trace in the file (ID = 868102)  
> Trace CUS1 1 Unable to find the string of the remote trace in the file (ID = 868102)  
> Trace CUS1 1 Unable to find the string of the remote trace in the file (ID = 868102)  
> Trace CUS1 1 Unable to find the string of the remote trace in the file (ID = 868102)  
> Trace CUS1 1 Unable to find the string of the remote trace in the file (ID = 868102)  
> Trace CUS1 1 Unable to find the string of the remote trace in the file (ID = 868107)  
> Trace CUS1 1 Unable to find the string of the remote trace in the file (ID = 868108)

---

<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 2, 2007, 9:31pm UTC](https://forum.sierrawireless.com/t/1-second-timer-example/1108/12 "2007-03-02T21:31:17Z")

</div>

You should be looking on CUS4 for your own Application Trace, shouldn’t you?

---

<div class="post-metadata">

**Author:** ![Mark.C](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Mark.C](https://forum.sierrawireless.com/u/Mark.C)\
**Post date:** [March 3, 2007, 8:16am UTC](https://forum.sierrawireless.com/t/1-second-timer-example/1108/13 "2007-03-03T08:16:48Z")

</div>

I restarted the target few times set CUS4 on all, and this is what i get:

> [@](#):
>
> Trace HWL 1 Unable to find the string of the remote trace in the file (ID = 869673)  
> Trace HWL 1 Unable to find the string of the remote trace in the file (ID = 869674)  
> Trace HWL 1 Unable to find the string of the remote trace in the file (ID = 869673)  
> Trace HWL 1 Unable to find the string of the remote trace in the file (ID = 869674)  
> Trace ATI 1 Unable to find the string of the remote trace in the file (ID = 866964)  
> Trace HWL 1 Unable to find the string of the remote trace in the file (ID = 869517)  
> Trace CUS4 30 [ADL PORT] subs (0021210D) : 0  
> Trace CUS4 20 [ADL] tmr subs ; id 0 ; hdlr 00210B31 ; val 10 ; cycl 0  
> Trace CUS4 30 [ADL PORT] event : 0 (port 80 ; state 0)  
> Trace CUS4 30 [ADL PORT] event : 0 (port 01 ; state 0)  
> Trace CUS4 22 [ADL] flash subs 1 : -4  
> Trace 1 Unable to find the string of the remote trace in the file (ID = 878588)  
> Trace 1 Unable to find the string of the remote trace in the file (ID = 878588)  
> Trace 1 Unable to find the string of the remote trace in the file (ID = 878588)  
> Trace 1 Unable to find the string of the remote trace in the file (ID = 878588)  
> Trace 1 Unable to find the string of the remote trace in the file (ID = 878588)  
> Trace CUS4 22 Flh Obj 0000 Len : 4  
> Trace CUS4 22 Read Flh Obj 0000 (4) : 0  
> Trace CUS4 30 SIM subs 0021192D  
> Trace CUS4 27 Call subs 0021007D : 0  
> Trace CUS4 20 [ADL] tmr subs ; id 1 ; hdlr 00216821 ; val 5 ; cycl 0  
> Trace CUS4 20 [ADL] tmr subs ; id 2 ; hdlr 00216821 ; val 5 ; cycl 0  
> Trace CUS4 20 [ADL] tmr subs ; id 3 ; hdlr 00216821 ; val 5 ; cycl 0  
> Trace CUS4 20 [ADL] tmr subs ; id 4 ; hdlr 00216821 ; val 5 ; cycl 0  
> Trace CUS4 30 SIM event 2  
> Trace CUS4 30 SIM event 6

---

<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 3, 2007, 11:39am UTC](https://forum.sierrawireless.com/t/1-second-timer-example/1108/14 "2007-03-03T11:39:22Z")

</div>

> [@Mark.C.](#):
>
> I restarted the target few times set CUS4 on all, and this is what i get:
> 
> > [@](#):
> >
> > Trace CUS4 30 [ADL PORT] subs (0021210D) : 0  
> > Trace CUS4 20 [ADL] tmr subs ; id 0 ; hdlr 00210B31 ; val 10 ; cycl 0  
> > Trace CUS4 30 [ADL PORT] event : 0 (port 80 ; state 0)  
> > Trace CUS4 30 [ADL PORT] event : 0 (port 01 ; state 0)  
> > Trace CUS4 22 [ADL] flash subs 1 : -4

These are internally generated by ADL.  
Unfortunately, as is the way with Wavecom, I can’t see anywhere where these are documented. 😠

However, they should be fairly self-explanatory:

> [@](#):
>
> Trace CUS4 20 [ADL] tmr subs ; id 0 ; hdlr 00210B31 ; val 10 ; cycl 0

Traces a non-cyclic timer subscription with value 10

> [@](#):
>
> Trace CUS4 27 Call subs 0021007D : 0

You’ve subscribed to the ADL Call Service

> [@](#):
>
> Trace CUS4 20 [ADL] tmr subs ; id 1 ; hdlr 00216821 ; val 5 ; cycl 0  
> Trace CUS4 20 [ADL] tmr subs ; id 2 ; hdlr 00216821 ; val 5 ; cycl 0  
> Trace CUS4 20 [ADL] tmr subs ; id 3 ; hdlr 00216821 ; val 5 ; cycl 0  
> Trace CUS4 20 [ADL] tmr subs ; id 4 ; hdlr 00216821 ; val 5 ; cycl 0

You are repeatedly re-subscribing the timer - with the same handler.

Note that you can turn on timestamping in the Target Monitoring Tool - so that should show you whether your timer is going at the right rate.

So now you just need to add some (more) of your own TRACE to see what’s happening with your counter…

---

<div class="post-metadata">

**Author:** ![Mark.C](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Mark.C](https://forum.sierrawireless.com/u/Mark.C)\
**Post date:** [March 4, 2007, 6:48pm UTC](https://forum.sierrawireless.com/t/1-second-timer-example/1108/15 "2007-03-04T18:48:11Z")

</div>

I added few traces, accept those two in the original post, and the output is the same. Becuse im now realy stuck on this, can you copy - paste my orginal code, test it on your maschine and post edited code back ?

I dont know, but i can not find the error and regarding to number of views on this topic i guess that this thema is interesting to other forum members…

Anyway, thank you for your respond !

---

<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 5, 2007, 11:31am UTC](https://forum.sierrawireless.com/t/1-second-timer-example/1108/16 "2007-03-05T11:31:25Z")

</div>

> [@Mark.C.](#):
>
> can you copy - paste my orginal code

Of course I can’t! 😒

It’s your code on your machine - I have no access to it! 😒

You need to post the code in the first place.  
Be sure to post code that actually compiles without errors and warnings;  
Be sure to post it by copying from your text file and pasting into the forum.

> [@](#):
>
> test it on your maschine and post edited code back ?

See above.

---

<div class="post-metadata">

**Author:** ![Mark.C](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Mark.C](https://forum.sierrawireless.com/u/Mark.C)\
**Post date:** [March 5, 2007, 6:10pm UTC](https://forum.sierrawireless.com/t/1-second-timer-example/1108/17 "2007-03-05T18:10:16Z")

</div>

dear awneil,  
the code that im talking about is sended before few posts.  
Accept that, time part is set in the voice handler and i correct error with ; signs.  
This program is compiled without errors and this is whole program.

```auto
#include "adl_global.h"

const u16 wm_apmCustomStackSize = 1024;
adl_tmr_t *setTimer;
s8 myCount;
//-------------------------------------------------------
void timerHandler (u8 id)                     
{ TRACE (( 4, "Timer started" ));
myCount++;
}

void stopTimer()
{
adl_tmrUnSubscribe(setTimer,(adl_tmrHandler_t)timerHandler,ADL_TMR_TYPE_100MS);
}

s8 Call_Handler(u16 Event, u32 Call_ID)
{
s8 sReturn;
sReturn = ADL_CALL_FORWARD;                         

switch (Event)
{
case ADL_CALL_EVENT_ANSWER_OK:
TRACE (( 2, "Call OK" )); myCount= 0;
setTimer=(adl_tmr_t *)adl_tmrSubscribe,(TRUE,10,ADL_TMR_TYPE_100MS,(adl_tmrHandler_t)timerHandler);
break;
//-------------------------------------------------------------------------
case ADL_CALL_EVENT_HANGUP_OK:
stopTimer();
break;   
//------------------------------------------------------------------------------------------     
case ADL_CALL_EVENT_RING_VOICE:
TRACE (( 7, "Ring OK" ));
if (myCount < 5){ adl_atSendResponse ( ADL_AT_UNS, "\r\n - under -\r\n" );myCount=0;}
if (myCount == 5){ /* something */ }           
if (myCount > 5){ adl_atSendResponse ( ADL_AT_UNS, "\r\n - over - \r\n" );myCount=0;}
break;
}
return sReturn;
}

void adl_main ( adl_InitType_e InitType )
{
myCount=0;
adl_callSubscribe(Call_Handler);                 
}
```

When i enter voice handler all i get is continues RING and when i look into trace then i get this what i have writen before.

---

<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 5, 2007, 8:09pm UTC](https://forum.sierrawireless.com/t/1-second-timer-example/1108/18 "2007-03-05T20:09:58Z")

</div>

> [@Mark.C.](#):
>
> the code that im talking about is sended before few posts.

The code you posted before didn’t even compile!

The code you have posted is almost unreadable - do your really format you code like that?

It doesn’t build either:

> [@The Linker](#):
>
> error LNK2001: unresolved external symbol \_wm\_apmCustomStack  
> fatal error LNK1120: 1 unresolved externals

so what other little “details” have you “forgotten” in your post…? 😒

---

<div class="post-metadata">

**Author:** ![OpenAT\_Fan](https://avatars.discourse-cdn.com/v4/letter/o/f07891/32.png) [@OpenAT\_Fan](https://forum.sierrawireless.com/u/OpenAT_Fan)\
**Post date:** [March 6, 2007, 5:07am UTC](https://forum.sierrawireless.com/t/1-second-timer-example/1108/19 "2007-03-06T05:07:22Z")

</div>

Hello,

I think Marc is using Open AT v4.xx (that’s why the wm\_apmCustomStack variable is not declared as it it not required in this version of Open AT).

From the problem that is faced by Marc, I feel that the problem lies in answering to the call. From the code, it can be seen that in the case ADL\_CALL\_EVENT\_RING\_VOICE, the call is not answered. Please note that to answer any incoming call, the API adl\_callAnswer () should be used.

Hence, the code should look something like:

```auto
case ADL_CALL_EVENT_RING_VOICE:
TRACE (( 7, "Ring OK" ));
if (myCount < 5){ adl_atSendResponse ( ADL_AT_UNS, "\r\n - under -\r\n" );myCount=0;}
if (myCount == 5){ /* something */ }           
if (myCount > 5){ adl_atSendResponse ( ADL_AT_UNS, "\r\n - over - \r\n" );myCount=0;}
adl_callAnswer();
break;
```

When the call is hung up, the time for which the call was there could be conviently printed out from the event ADL\_CALL\_EVENT\_HANGUP\_OK. The statement:  
TRACE((1,“The call was made for %d minutes”,myCount));  
can be used to print the duration for which the call was there (in minutes).

It can be noted that if the user wants to hangup the call from withing the Open AT application, the API adl\_callHangup () can also be used.

Marc, you can refer to the ADL user guide, for more information as to how to use the APIs and also find out which API suits your requirement.

Best Regards,  
Open AT Fan.

---

<div class="post-metadata">

**Author:** ![Mark.C](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Mark.C](https://forum.sierrawireless.com/u/Mark.C)\
**Post date:** [March 6, 2007, 11:28am UTC](https://forum.sierrawireless.com/t/1-second-timer-example/1108/20 "2007-03-06T11:28:39Z")

</div>

The version is 4.xx and i using VC++. I did not get any errors. When i place a call i get -under- and answer OK. So i change the \< to \> to see the difference but its the same. One RING, message, answer OK. It does not matter if its over or under 5 seconds, one RING and answer.

Btw.  
How will the ADL\_CALL\_EVENT\_RING\_VOICE know when the call is over. I mean, when i get hangup i have to go back into ADL\_CALL\_EVENT\_RING\_VOICE handler to read the myCount value, but i can not becuse the call is over so i can not go back into this handler. This could be total wrong thinking or …?

I can not see the:  
TRACE((1,“The call was made for %d minutes”,myCount)); in the trace.

Trace:

> [@](#):
>
> Trace CUS4 1 Applikation init  
> Trace CUS4 27 Call subs 0021004D : 0  
> Trace CUS4 20 [ADL] tmr subs ; id 1 ; hdlr 00216825 ; val 5 ; cycl 0  
> Trace CUS4 20 [ADL] tmr subs ; id 2 ; hdlr 00216825 ; val 5 ; cycl 0  
> Trace CUS4 20 [ADL] tmr subs ; id 3 ; hdlr 00216825 ; val 5 ; cycl 0  
> Trace CUS4 20 [ADL] tmr subs ; id 4 ; hdlr 00216825 ; val 5 ; cycl 0  
> Trace CUS4 30 SIM event 2  
> Trace CUS4 30 SIM event 6  
> Trace CUS4 30 SIM event 5  
> Trace L3RR 1 Unable to find the string of the remote trace in the file (ID = 875186)  
> Trace L3RR 1 Unable to find the string of the remote trace in the file (ID = 875186)  
> Trace CUS4 20 [ADL] tmr unsubs ; id 5 ; hdlr 00213739 (rem. time : 29)  
> Trace CUS4 2 Call OK  
> Trace CUS4 30 SIM event 3

Terminal:

> [@](#):
>
> RING  
> -under-  
> answer OK  
> NO CARRIER

[Next page](https://forum.sierrawireless.com/t/1-second-timer-example/1108.md?page=2)
