name mode size
..
Makefile 100644 176B
README 100644 2.13kB
config.h 100644 1.09kB
exec.c 100644 4.92kB
exec.h 100644 1.2kB
exec_hf.c 100644 14.13kB
exec_hf.h 100644 3.59kB
exec_mod.c 100644 3.37kB
kill.c 100644 4.34kB
kill.h 100644 1.4kB
README
# # $Id$ # Exec module allows to start an external command when from a ser script. The commands may be any valid shell commands -- the command string is passed to shell using 'popen' command. ser passes additionaly lot of information about request in environment variables: - SIP_HF_<hf_name> contains value of each header field in request; if a header field occured multiple times, values are concatenated and comma-separated; <hf_name> is in capital letters; if a header-field name occured in compact form, <hf_name> is canonical - SIP_TID is transaction identifier; all request retransmissions or CANCELs/ACKs associated with a previous INVITE result in the same value - SIP_DID is dialog identifier, which is the same as to-tag; initially, it is empty - SIP_SRCIP is source IP address from which request came - SIP_ORURI is original request URI - SIP_RURI is _current_ request URI (if unchanged, equal to original) - SIP_USER is userpart of _current_ request URI - SIP_OUSER is userpart of original request URI Exported parameters: --------------------- Name: setvars Type: int Default: 1 Desc: turn off to disable setting environment variables for executed commands Name: exec_timer (**** UNUSED *** placeholder only) Type: int Default: 0 Desc: specifies the longest time a program is allows to execute; if the time is exceeded, the program is killed Exported functions: ------------------- Name: exec_dst Params: command -- command to be executed; Desc: executes an external command; current uri is passed to the command as parameter; output of the command is considered URI set (separated by lines) Name: exec_msg Params: command -- command to be executed Desc: executes an external command; the whole message is passed to it in input, no command-line parameters are added, output of the command is not processed Example of use: see etc/exec.cfg Known Issues ------------ - there is currently no guarantee that scripts ever return and stop blocking SIP server; (there is kill.c but it is not used along with the current mechanisms based on popen; besides that kill.c is ugly)