← Volver al índice de módulos

async

This module provides asynchronous operations for handling SIP requests in the configuration file. Async uses t_suspend() and t_continue() from the TM and TMX modules.
⚙️ Scripting e Integración Kamailio 6.1 8 parámetros 18 funciones

Descripción general

This module provides asynchronous operations for handling SIP requests in the configuration file. Async uses t_suspend() and t_continue() from the TM and TMX modules. Note that after invoking the asynchronous operation, the processing will continue later in another application process. Therefore variables stored in private memory should not be used, try to use shared memory if you want to get values after the processing is resumed (e.g., $avp(...), $xavp(...), $shv(...), htable $sht(...)).

Documentación oficial: https://www.kamailio.org/docs/modules/stable/modules/async.html
Código fuente: https://github.com/kamailio/kamailio/tree/master/src/modules/async

Parámetros de configuración

ParámetroTipoDescripción
workers int 3.2. ms_timer (int) 3.3. return (int) 3.4. mode (int)
ms_timer int 3.3. return (int) 3.4. mode (int)
return int 3.4. mode (int)
mode int 3.1. workers (int)
workers int Number of worker processes to be started to handle the asynchronous tasks for async_route() and async_sleep().
ms_timer int Enables millisecond timer for async_ms_sleep() and async_ms_route() functions. The integer value is the timer resolution in milliseconds. A smaller timer resolution will generate a higher load on the
return int The value to be returned by async functions on success. It does not apply for async data functions, only for those that suspend the SIP transaction.
mode int Control if the module should bind (0) to tm or not (1). It may not be needed to use tm functions (e.g., when needing async_tkv_emit() only).

Funciones exportadas

async_route(routename, seconds)

4.2. async_ms_route(routename, milliseconds) 4.3. async_sleep(seconds) 4.4. async_ms_sleep(milliseconds) 4.5. async_task_route(routename) 4.6. async_task_group_route(routename, groupname) 4.7. async_task_data(routename, data) 4.8. async_task_group_da

async_ms_route(routename, milliseconds)

4.3. async_sleep(seconds) 4.4. async_ms_sleep(milliseconds) 4.5. async_task_route(routename) 4.6. async_task_group_route(routename, groupname) 4.7. async_task_data(routename, data) 4.8. async_task_group_data(routename, groupname, data) 4.9. async_tkv

async_sleep(seconds)

4.4. async_ms_sleep(milliseconds) 4.5. async_task_route(routename) 4.6. async_task_group_route(routename, groupname) 4.7. async_task_data(routename, data) 4.8. async_task_group_data(routename, groupname, data) 4.9. async_tkv_emit(type, key, value)

async_ms_sleep(milliseconds)

4.5. async_task_route(routename) 4.6. async_task_group_route(routename, groupname) 4.7. async_task_data(routename, data) 4.8. async_task_group_data(routename, groupname, data) 4.9. async_tkv_emit(type, key, value)

async_task_route(routename)

4.6. async_task_group_route(routename, groupname) 4.7. async_task_data(routename, data) 4.8. async_task_group_data(routename, groupname, data) 4.9. async_tkv_emit(type, key, value)

async_task_group_route(routename, groupname)

4.7. async_task_data(routename, data) 4.8. async_task_group_data(routename, groupname, data) 4.9. async_tkv_emit(type, key, value)

async_task_data(routename, data)

4.8. async_task_group_data(routename, groupname, data) 4.9. async_tkv_emit(type, key, value)

async_task_group_data(routename, groupname, data)

4.9. async_tkv_emit(type, key, value)

async_tkv_emit(type, key, value)

4.1. async_route(routename, seconds)

async_route(routename, seconds)

Simulate a sleep of 'seconds' and then continue the processing of the SIP request with the route[routename]. In case of internal errors, the function returns false, otherwise the function exits the execution of the script at that moment (return 0 beh

async_ms_route(routename, milliseconds)

Simulate a sleep of 'milliseconds' and then continue the processing of the SIP request with the route[routename]. In case of internal errors, the function returns false, otherwise the function exits the execution of the script at that moment (return

async_sleep(seconds)

Simulate a sleep of 'seconds' and then continue the processing of SIP request with the next action. Note that the processing continues till the last action in the current route block. Consider using async_route() instead if you want to control better

async_ms_sleep(milliseconds)

Similar to async_sleep(), but with a 'milliseconds' parameter. This function works only if the ms_timer parameter has a value greater than 0.

async_task_route(routename)

Continue the processing of the SIP request with the route[routename] in one of the processes from first group of core asynchronous framework. The core parameter async_workers has to be set to enable asynchronous framework. The task is executed as soo

async_task_group_route(routename, groupname)

Similar to async_task_route(), but allows to specify the name of the group for asynchronous workers. See also 'async_workers_group' core global parameter.

async_task_data(routename, data)

Send the data to an asynchronous task process (in the first group) that executes the route[rountename] and makes the data available via $async(data).

async_task_group_data(routename, groupname, data)

Similar to async_task_route(), but allows to specify the name of the group for asynchronous workers. See also 'async_workers_group' core global parameter.

async_tkv_emit(type, key, value)

Emit a type-key-value event.

Autores y contribuidores

Daniel-Constantin Mierla <miconda@gmail.com>

Copyright © 2011-2016 asipto.com

Módulos relacionados

app_lua app_perl app_python app_python3 app_python3s app_ruby app_ruby_proc evapi