[Users] Exec module: Use output of an external command within SER?

Klaus Darilion klaus.mailinglists at pernau.at
Thu Oct 6 14:06:22 CEST 2005


Hi Joachim!

Using exec is not a nice solution. Maybe it would be better to write a 
new module (or modify an existing module which add/rewrites headers). 
Also avops is very powerful and can rewrite and add headers.

Can you describe the task of the external script? Maybe we can find a 
better solution.

regards
klaus

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:
> 1. 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.
>    
> 2. 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.
> 
> tia
> best regards
> --Joachim
> 
> 
> _______________________________________________
> Users mailing list
> Users at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/users
> 
> 





More information about the sr-users mailing list