[sr-dev] new module: async - asynchronous SIP request processing in cfg
miconda at gmail.com
Mon Jun 27 19:09:33 CEST 2011
On Jun 27, 2011, at 4:11 PM, Olle E. Johansson <oej at edvina.net> wrote:
> 27 jun 2011 kl. 10.31 skrev Daniel-Constantin Mierla:
>> a new module is now in GIT master branch, named async.
>> Its purpose is to provide asynchronous SIP request processing using t_suspend()/t_continue() mechanism from tm module. While the tm module had it for quite some time, it was not available for usage in configuration file.
>> There are two functions implemented by now:
>> - async_route(routename, interval) - execute asynchronously a route block after a time interval
>> - aync_sleep(interval) - sleep asynchronously for a time interval and then resume SIP request processing
>> See the readme for more details:
> Seems kind of sexy.
> Do you have a good example of usage?
Delayed forwarding of requests or delayed replying - like 100 trying, 180 ringing immediately when invite comes in, then async_route() to reply 408 timeout after 20 sec when you run out of gw capacity :-).
All without blocking main sip workers.
For SIP MESSAGE to SMS you can use the mechanism just to switch to other pool of workers in case SMS gatewaying is blocking - although this can be achieved as well with mqueue and rtimer modules if you don't need the full sip request in special workers.
Just some thoughts ...
Hopefully the module will help others to contribute more functions that will work asynchronously. My todo has some more ideas here as well, just that is as long as Madrid - Berlin, so may not get in that soon :-)
Enjoy the cold Saharian daylight temperatures,
More information about the sr-dev