while reading rtpproxy module readme, i found this kind of example:
if (is_method("INVITE")) { if (has_sdp()) { if (rtpproxy_offer()) t_on_reply("1"); } else { t_on_reply("2"); } } if (is_method("ACK") && has_sdp()) rtpproxy_answer();
does has_sdp() function really exist? it is not listed on wiki page:
http://www.kamailhttp://www.kamailio.org/wiki/alphaindexes/3.4.x/modfunction...
-- juha
I use kamailio 3.3 and it does not exist. Instead I use: if(has_body("application/sdp")){
On 10/17/2012 9:38 AM, Juha Heinanen wrote:
while reading rtpproxy module readme, i found this kind of example:
if (is_method("INVITE")) { if (has_sdp()) { if (rtpproxy_offer()) t_on_reply("1"); } else { t_on_reply("2"); } } if (is_method("ACK") && has_sdp()) rtpproxy_answer();
does has_sdp() function really exist? it is not listed on wiki page:
http://www.kamailhttp://www.kamailio.org/wiki/alphaindexes/3.4.x/modfunction...
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Ron Hopson writes:
I use kamailio 3.3 and it does not exist. Instead I use: if(has_body("application/sdp")){
ron,
thanks for your reply although i don't understand how has_body("application/sdp") would work, because textops readme on has_body tells:
If a parameter is given, the mime described will be also checked against the “Content-Type” header.
the reason is that content-type can very well be, for example, multipart/mixed (or something like that) and still the body can contain sdp.
in my opinion rtpproxy functions should tell via return value if sdp existed, i.e., if they did something, rather than requiring script writer to check it beforehand.
-- juha
That could be relatively easy to implement because the sdp parser is able to handle SDP in a multipart/mixed body.
-ovidiu
On Wed, Oct 17, 2012 at 11:57 AM, Juha Heinanen jh@tutpro.com wrote:
Ron Hopson writes:
I use kamailio 3.3 and it does not exist. Instead I use: if(has_body("application/sdp")){
ron,
thanks for your reply although i don't understand how has_body("application/sdp") would work, because textops readme on has_body tells:
If a parameter is given, the mime described will be also checked against the “Content-Type” header.
the reason is that content-type can very well be, for example, multipart/mixed (or something like that) and still the body can contain sdp.
in my opinion rtpproxy functions should tell via return value if sdp existed, i.e., if they did something, rather than requiring script writer to check it beforehand.
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Ovidiu Sas writes:
That could be relatively easy to implement because the sdp parser is able to handle SDP in a multipart/mixed body.
ovidiu,
do you mean a new textops function that tells if sdp application/sdp bodypart exists in the body or making rtpproxy functions user friendly?
-- juha
Making the rtpproxy user friendly would be the right approach here. Then based on return code, the script admin should be able to handle all scenarios.
-ovidiu
On Wed, Oct 17, 2012 at 12:09 PM, Juha Heinanen jh@tutpro.com wrote:
Ovidiu Sas writes:
That could be relatively easy to implement because the sdp parser is able to handle SDP in a multipart/mixed body.
ovidiu,
do you mean a new textops function that tells if sdp application/sdp bodypart exists in the body or making rtpproxy functions user friendly?
-- juha
On the other hand, is_audio_on_hold(): http://kamailio.org/docs/modules/devel/modules_k/textops.html#id2523065 could be re-worked/re-named to provide media status.
-ovidiu
On Wed, Oct 17, 2012 at 12:16 PM, Ovidiu Sas osas@voipembedded.com wrote:
Making the rtpproxy user friendly would be the right approach here. Then based on return code, the script admin should be able to handle all scenarios.
-ovidiu
On Wed, Oct 17, 2012 at 12:09 PM, Juha Heinanen jh@tutpro.com wrote:
Ovidiu Sas writes:
That could be relatively easy to implement because the sdp parser is able to handle SDP in a multipart/mixed body.
ovidiu,
do you mean a new textops function that tells if sdp application/sdp bodypart exists in the body or making rtpproxy functions user friendly?
-- juha
Ovidiu Sas writes:
On the other hand, is_audio_on_hold(): http://kamailio.org/docs/modules/devel/modules_k/textops.html#id2523065 could be re-worked/re-named to provide media status.
i looked at the code and it has this:
if (0 == parse_sdp(msg)) { ... } return -1;
the problem is that parse_sdp returns -1 if there is no sdp, but also when there is some error.
-- juha
Then parse_sdp needs to be updated to return explicit error codes :(
-ovidiu
On Wed, Oct 17, 2012 at 12:35 PM, Juha Heinanen jh@tutpro.com wrote:
Ovidiu Sas writes:
On the other hand, is_audio_on_hold(): http://kamailio.org/docs/modules/devel/modules_k/textops.html#id2523065 could be re-worked/re-named to provide media status.
i looked at the code and it has this:
if (0 == parse_sdp(msg)) { ... } return -1;
the problem is that parse_sdp returns -1 if there is no sdp, but also when there is some error.
-- juha
At some point I updated it to return 1 if there is no body, to avoid some annoying log message. But perhaps it can still be extended to detect when there is no sdp in a multi-part body.
rtpproxy_manage() is supposed to work nicely when called for requests/replies with no sdp, just not to care if is INVITE or ACK with no sdp, or such similar situations.
Cheers, Daniel
On 10/17/12 6:40 PM, Ovidiu Sas wrote:
Then parse_sdp needs to be updated to return explicit error codes :(
-ovidiu
On Wed, Oct 17, 2012 at 12:35 PM, Juha Heinanen jh@tutpro.com wrote:
Ovidiu Sas writes:
On the other hand, is_audio_on_hold(): http://kamailio.org/docs/modules/devel/modules_k/textops.html#id2523065 could be re-worked/re-named to provide media status.
i looked at the code and it has this:
if (0 == parse_sdp(msg)) { ... } return -1;
the problem is that parse_sdp returns -1 if there is no sdp, but also when there is some error.
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
On 10/17/12 8:30 PM, Juha Heinanen wrote:
Daniel-Constantin Mierla writes:
rtpproxy_manage() is supposed to work nicely when called for requests/replies with no sdp, just not to care if is INVITE or ACK with no sdp, or such similar situations.
does using rtpproxy_manage() avoid the cancel problem klaus described?
rtpproxy_manage() is a wrapper around rtpproxy_offer(), rtpproxy_answer() and unforce_rtp_proxy(), trying to hide all logic that otherwise would have to be in config to handle all possible situations, like invite with no sdp, but 200ok and ack with sdp.
It takes same kind of flags as for rtpproxy_offer().
Looking at the code, I see that flags 1 or 2 are not propagated to unforce_rtp_rproxy() (which used to have no flags before) -- probably omitted by the committer of these flags. Cheers, Daniel
Ovidiu Sas writes:
Making the rtpproxy user friendly would be the right approach here. Then based on return code, the script admin should be able to handle all scenarios.
i thought that using rtpproxy is the mainstream thing. now it appears that it cannot be used with currently existing script functions (if we leave raw regex matching out) without getting "Unable to parse sdp" errors to syslog.
-- juha
I guess not many rtpproxy deployments are handling SIP traffic with multipart/mixed body content and therefor has_body("application/sdp") works just fine. In the case that multipart/mixed body is present, blindly invoking rtpproxy_offer for INVITE will work ok if SDP is present (and that's the most used pattern: SDP in INVITE/200ok as opposed to 200ok/AC.
So ... yes, not all cases are covered, but it seems that most common scenarios are covered.
-ovidiu
On Wed, Oct 17, 2012 at 12:57 PM, Juha Heinanen jh@tutpro.com wrote:
Ovidiu Sas writes:
Making the rtpproxy user friendly would be the right approach here. Then based on return code, the script admin should be able to handle all scenarios.
i thought that using rtpproxy is the mainstream thing. now it appears that it cannot be used with currently existing script functions (if we leave raw regex matching out) without getting "Unable to parse sdp" errors to syslog.
-- juha