Hello,
On 10/06/05 12:29, Joachim Fabini wrote:
Hi,
A newbie question: Is there a way for OpenSER to use SIP headers (other than the URI set) that have been modified/processed by an external command (exec_dst, exec_msg)? Reading the documentation and mailing list archives revealed some questions similar to mine but no answer.
The problem is: Delegate the change of one or more SIP message headers (or the whole SIP message) to an external application via exec module.
Two straight-forward solutions:
- exec_rmsg() - for "replace message". A merge of the functionality
of exec_dst() and exec_msg(), i.e. OpenSER uses the output of exec_rmsg(command) to replace the current SIP message. This is imho an extremly flexible solution but slightly difficult to implement as it requires at least parsing the command's output
- similar to a message received by OpenSER.
- The command executed by exec_msg() can modify the environment
variables SIP_HF_<hf_name> and OpenSER reuses these values after the exec() returned control to SER. Setvars could be used to switch between the current, read-only meaning of env-variables (e.g., modparam("exec", "setvars", 1)) and a read-write behavior (e.g. modparam("exec", "setvars", 2).
This solution does not require any special handling except that OpenSER must read back the content of all environment variables which were passed to the command. Probably quite easy to implement but has the drawback that no new header fields can be added. Imho no major limitation as users can add their (dummy) header fields prior to invoking the command via exec()
Or is there any other existing/planned procedure for SER to use the output of external commands for rewriting an existing SIP message.
Other possibilities would be to pass the data through database (write in a table and from there load via avpops) or via fifo interface (write data to fifo file, then store it in share memory and afterwards reuse it from there -- this requires development).
Daniel
tia best regards --Joachim
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users