Table of Contents
List of Examples
workers
parameterasync_sleep
usageasync_sleep
usageTable of Contents
This module provides asynchornous operations for handling SIP requests in configuration file.
It uses t_suspend() and t_continue() from TM module.
Note that after invoking the an asyncronous operation, the processing will continue later, in another application process. Therefore, do not rely on variables stored in private memory, used shared memory if you want to get values after the processing is resumend (e.g., $avp(...), $xavp(...), $shv(...), htable $sht(...)).
The following modules must be loaded before this module:
tm - transaction management.
Simulate a sleep of 'seconds' and then continue the processing of SIP request with the route[routename]. In case of internal errors, the function returns false, otherwise the function exits the execution of config at that moment (return 0 behaviour).
The routename parameter can be a static string or a dynamic string value with config variables.
The sleep parameter represent the number of seconds to suppend the processing of SIP request. Maximum value is 100. The parameter can be a static integer or a varaible holding an integer.
Since the SIP request handling is resumed in another process, practically the config file execution state is lost. Therefore beware that the execution of config after resume will end once the route[routename] is finished.
This function can be used from REQUEST_ROUTE.
Example 1.2. async_sleep
usage
... async_route("RESUME", "4"); ... route[RESUME] { send_reply("404", "Not found"); exit; } ...
Simulate a sleep of 'seconds' and then continue the processing of SIP request with the next action. In case of internal errors, the function returns false, otherwise the function exits the execution of config at that moment (return 0 behaviour).
The sleep parameter represent the number of seconds to suppend the processing of SIP request. Maximum value is 100. The parameter can be a static integer or a varaible holding an integer.
Since the SIP request handling is resumed in another process, practically the config file execution state is lost. Therefore beware that the execution of config after resume will end once the route block where async_sleep() is called is finished.
This function can be used from REQUEST_ROUTE.