Daniel,
On 07/05/2011 06:04 AM, Daniel-Constantin Mierla wrote:
Hello,
over the weekend I exported to config file the two main functions from tm that allow to suspend the execution of a SIP request and resume it in another place. They are exported through tmx module:
- t_suspend() - will suspend the execution of current sip request and
then you can do something else (like processing the next request)
- t_continue(tindex, tlabel, rtname) - continue the processing of SIP
request suspended in the transaction identified by tupple (tindex,tlable) with the actions in route[rtname]
After t_suspend() you can get the transaction identifier (tindex, tlable) via pseudo-variables $T(id_index) and $T(id_label), e.g.:
if(t_suspend()) { xlog("sip request suspended in transaction [$T(id_index)/$T(id_label)]\n"); exit; }
When transactions are continued, where do they get continued? Is it in one consuming thread? A pool of them specially allocated for this purpose? A random SIP worker thread?
Cheers,