< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index  

Re: [reSIProcate-users] Using Application Timers


Cyril,

 

Here is how I do timers:

 

Create a class that derives from ApplicationMessage

 

Then post it to the stack using the timer post overload:

 

      void post(const std::auto_ptr<ApplicationMessage> message,

                unsigned int secondsLater,

                TransactionUser* tu=0);

 

If you are using DUM, you can create your own version of DumThread which checks for your type of message and does whatever you want else calls the mDum.internalProcess(msg)

 

If you are not using DUM then in your main loop which retrieves messages from the Fifo, you can check for your type there (using dynamic_cast)

 

There may be another easier way but this works for me.

 

David

 

From: resiprocate-users-bounces@xxxxxxxxxxxxxxxxxxxx [mailto:resiprocate-users-bounces@xxxxxxxxxxxxxxxxxxxx] On Behalf Of Cyril Raymond
Sent: Monday, August 06, 2007 11:44 PM
To: resiprocate-users@xxxxxxxxxxxxxxxxxxxx
Subject: Re: [reSIProcate-users] Using Application Timers

 

   Am trying to add a timer on my OnNewSession for an incoming INVITE. The timer is to determine the session expiry. Should I write my own Timer class for this or can I use the addTimer provided in DUM. If I use the DUM timer, which is the callback that gets invoked on expiry of the timer. Have been struggling a bit on this. Any help on this is greatly appreciated.

 

Thanks,

  Cyril

 

From: Cyril Raymond
Sent: Friday, August 03, 2007 7:03 PM
To: resiprocate-users@xxxxxxxxxxxxxxxxxxxx
Subject: [reSIProcate-users] Using Application Timers

 

Hi,

   Am writing a B2BUA where I need to set a session expiry on the incoming INVITE. Can someone throw some light on what timers I can use and how?

 

Thanks,

     Cyril