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
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
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:
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.
tia best regards --Joachim
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users
Hi Klaus,
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.
I agree with you that exec is not the kind of technology to be used in production systems. ;)
Can you describe the task of the external script? Maybe we can find a better solution.
Our focus is on what I suppose the exec interface was primarily intended to do: lowest-cost testing mechanism. Basically it's (or at least should be) a way to test features before they are implemented - as you suggested - within dedicated modules.
Alternatively, a specific example: integration of an existing Diameter client into OpenSER for testing purposes.
Most of the tasks we'd like to do can probably be implemented using operations supported by avpops. My initial question was more conceptual in nature - is the exec() module intended to be used bidirectionally or not. The answer is: apparently not, as I see some kind of triangle routing via avpops and databases. ;)
My personal opinion is that for OpenSER module prototyping a bidirectional exec interface can be an excellent help.
Thanks to you and Daniel for your replies, regards --Joachim
Hi,
Again, complete newbie question (honestly, I searched the OpenSER and SER archives and did not find an answer ;):
(How) can OpenSER add a new header field into the registrar's 200 OK status message in reply to a successful REGISTER? (New header field meaning that the header line was not present in the REGISTER).
What I tried so far is to add the field in two ways:
- Added the field to the incoming REGISTER message while doing the main processing using append_hf(). The new header field is not included into the 200 OK. - Added the field within the OnReply_Route[1] block (triggered). But apparently OpenSER does invoke the OnReply_Route only for incoming status messages. When the code is invoked by a proxy on traversing status messages it works perfectly, for the registrar it does not.
Any idea how to modify Registrar-outgoing status messages?
Many thanks in advance, --Joachim
Hi Joachim,
see append_to_reply() function http://www.openser.org/docs/modules/0.10.x/textops.html#AEN168
note that save() internally sends the 200 ok, so you need to call append_to_reply() before save()
regards, bogdan
Joachim Fabini wrote:
Hi,
Again, complete newbie question (honestly, I searched the OpenSER and SER archives and did not find an answer ;):
(How) can OpenSER add a new header field into the registrar's 200 OK status message in reply to a successful REGISTER? (New header field meaning that the header line was not present in the REGISTER).
What I tried so far is to add the field in two ways:
- Added the field to the incoming REGISTER message
while doing the main processing using append_hf(). The new header field is not included into the 200 OK.
- Added the field within the OnReply_Route[1] block
(triggered). But apparently OpenSER does invoke the OnReply_Route only for incoming status messages. When the code is invoked by a proxy on traversing status messages it works perfectly, for the registrar it does not.
Any idea how to modify Registrar-outgoing status messages?
Many thanks in advance, --Joachim
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users
Hi Bogdan,
see append_to_reply() function http://www.openser.org/docs/modules/0.10.x/textops.html#AEN168
Excellent, that's what I was looking for.
note that save() internally sends the 200 ok, so you need to call append_to_reply() before save()
Good to know...
thanks again, best regards --Joachim
Hello,
I see that the nathelper module of openser has the possibility to have multiple rtpproxy, but I don't have found any example.
How can I configure this?
Thanks Laurent
Hi Laurent,
I'm afraid there is no much documentation about this - actually not at all. Can you please submit a request on the project for documentation? http://sourceforge.net/tracker/?group_id=139143
regards, bogdan
Schweizer Laurent wrote:
Hello,
I see that the nathelper module of openser has the possibility to have multiple rtpproxy, but I don't have found any example.
How can I configure this?
Thanks Laurent
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users
Just mention other possibility, you can use avp_pushto() to add dynamic content to the headers, in both replies or requests. See: http://www.voice-system.ro/docs/avpops/ar01s06.html#avp_pushto
Cheers, Daniel
On 10/18/05 14:09, Joachim Fabini wrote:
Hi Bogdan,
see append_to_reply() function http://www.openser.org/docs/modules/0.10.x/textops.html#AEN168
Excellent, that's what I was looking for.
note that save() internally sends the 200 ok, so you need to call append_to_reply() before save()
Good to know...
thanks again, best regards --Joachim
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users