Discussion:
[SR-Users] SDP ending with CRLF and a=nortpproxy:yes
Narsay, Deep
2014-08-12 15:49:02 UTC
Permalink
Hello,

Please let me know if there is any work around for this.

Details of the issue:


kamailio.cfg has this sequence in kamailio.cfg,

......
modparam("rtpproxy", "ice_candidate_priority_avp",
"$avp(ice_priority)" )
........

sdp_remove_line_by_prefix("a=candidate");
set_iattr("ice_priority", "1");
rtpproxy_manage("frwie");

I'm seeing an issue towards the bottom of the SDP message.

....
a=ssrc:738345272 mslabel:VPELrlXvdfGmtevlYLEeVm6zq4JHvI4g
a=ssrc:738345272 label:VPELrlXvdfGmtevlYLEeVm6zq4JHvI4ga0
a=ice-ufrag:YJuJWr9clIJHhENw
a=ice-pwd:3v1D1ShCg8xIlDZ9
a=candidate:1297581420 1 udp 659136 10.1.2.3 17534 typ host
generation 0
a=candidate:1297581420 2 udp 659136 10.1.2.3 17535 typ host
generation 0
a=ptime:20
\r\n
a=nortpproxy:yes\r\n

The call gets rejected by UA due to an invalid (empty) line in SDP.

Very old but somewhat similar issue:
http://lists.sip-router.org/pipermail/users/2008-September/019605.html

(Module authors, I'll be happy to code/test or assist in any way possible
if needed.)

Just to test it, I commented the following code snippet and the call
worked.
But that can't be the permanent fix.


Thank you,
- Deep N


Code snippet:rtp_proxy.c::force_rtp_proxy starting from line 2850

* if (proxied == 0 && nortpproxy_str.len) { cp =
pkg_malloc((nortpproxy_str.len + CRLF_LEN) * sizeof(char));
if (cp == NULL) { LM_ERR("out of pkg memory\n");
return -1; } anchor =
anchor_lump(msg, body.s + body.len - msg->buf, 0, 0); if
(anchor == NULL) { LM_ERR("anchor_lump failed\n");
pkg_free(cp); return -1;
} memcpy(cp, CRLF, CRLF_LEN);
memcpy(cp + CRLF_LEN, nortpproxy_str.s, nortpproxy_str.len);
if (insert_new_lump_after(anchor, cp, nortpproxy_str.len + CRLF_LEN, 0) ==
NULL) { LM_ERR("insert_new_lump_after failed\n");
pkg_free(cp); return -1;
} }*
Daniel-Constantin Mierla
2014-08-12 17:11:39 UTC
Permalink
Hello,

use msg_apply_changes() after sdp_remove_line_by_prefix().


Also, you should do record_route() after applying changes.

Cheers,
Daniel
Post by Narsay, Deep
Hello,
Please let me know if there is any work around for this.
kamailio.cfg has this sequence in kamailio.cfg,
......
modparam("rtpproxy", "ice_candidate_priority_avp",
"$avp(ice_priority)" )
........
sdp_remove_line_by_prefix("a=candidate");
set_iattr("ice_priority", "1");
rtpproxy_manage("frwie");
I'm seeing an issue towards the bottom of the SDP message.
....
a=ssrc:738345272 mslabel:VPELrlXvdfGmtevlYLEeVm6zq4JHvI4g
a=ssrc:738345272 label:VPELrlXvdfGmtevlYLEeVm6zq4JHvI4ga0
a=ice-ufrag:YJuJWr9clIJHhENw
a=ice-pwd:3v1D1ShCg8xIlDZ9
a=candidate:1297581420 1 udp 659136 10.1.2.3 17534 typ host generation 0
a=candidate:1297581420 2 udp 659136 10.1.2.3 17535 typ host generation 0
a=ptime:20
\r\n
a=nortpproxy:yes\r\n
The call gets rejected by UA due to an invalid (empty) line in SDP.
http://lists.sip-router.org/pipermail/users/2008-September/019605.html
(Module authors, I'll be happy to code/test or assist in any way
possible if needed.)
Just to test it, I commented the following code snippet and the call
worked.
But that can't be the permanent fix.
Thank you,
- Deep N
Code snippet:rtp_proxy.c::force_rtp_proxy starting from line 2850
/
if (proxied == 0 && nortpproxy_str.len) {
cp = pkg_malloc((nortpproxy_str.len + CRLF_LEN) *
sizeof(char));
if (cp == NULL) {
LM_ERR("out of pkg memory\n");
return -1;
}
anchor = anchor_lump(msg, body.s + body.len -
msg->buf, 0, 0);
if (anchor == NULL) {
LM_ERR("anchor_lump failed\n");
pkg_free(cp);
return -1;
}
memcpy(cp, CRLF, CRLF_LEN);
memcpy(cp + CRLF_LEN, nortpproxy_str.s,
nortpproxy_str.len);
if (insert_new_lump_after(anchor, cp,
nortpproxy_str.len + CRLF_LEN, 0) == NULL) {
LM_ERR("insert_new_lump_after failed\n");
pkg_free(cp);
return -1;
}
}
/
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
Narsay, Deep
2014-08-12 18:42:54 UTC
Permalink
Thanks Daniel.

record_route() is already being done.

I will go through my test cases with your suggestion.

- Deep N
Post by Narsay, Deep
Hello,
use msg_apply_changes() after sdp_remove_line_by_prefix().
Also, you should do record_route() after applying changes.
Cheers,
Daniel
Hello,
Please let me know if there is any work around for this.
kamailio.cfg has this sequence in kamailio.cfg,
......
modparam("rtpproxy", "ice_candidate_priority_avp",
"$avp(ice_priority)" )
........
sdp_remove_line_by_prefix("a=candidate");
set_iattr("ice_priority", "1");
rtpproxy_manage("frwie");
I'm seeing an issue towards the bottom of the SDP message.
....
a=ssrc:738345272 mslabel:VPELrlXvdfGmtevlYLEeVm6zq4JHvI4g
a=ssrc:738345272 label:VPELrlXvdfGmtevlYLEeVm6zq4JHvI4ga0
a=ice-ufrag:YJuJWr9clIJHhENw
a=ice-pwd:3v1D1ShCg8xIlDZ9
a=candidate:1297581420 1 udp 659136 10.1.2.3 17534 typ host
generation 0
a=candidate:1297581420 2 udp 659136 10.1.2.3 17535 typ host
generation 0
a=ptime:20
\r\n
a=nortpproxy:yes\r\n
The call gets rejected by UA due to an invalid (empty) line in SDP.
http://lists.sip-router.org/pipermail/users/2008-September/019605.html
(Module authors, I'll be happy to code/test or assist in any way
possible if needed.)
Just to test it, I commented the following code snippet and the call
worked.
But that can't be the permanent fix.
Thank you,
- Deep N
Code snippet:rtp_proxy.c::force_rtp_proxy starting from line 2850
* if (proxied == 0 && nortpproxy_str.len) { cp =
pkg_malloc((nortpproxy_str.len + CRLF_LEN) * sizeof(char));
if (cp == NULL) { LM_ERR("out of pkg memory\n");
return -1; } anchor =
anchor_lump(msg, body.s + body.len - msg->buf, 0, 0); if
(anchor == NULL) { LM_ERR("anchor_lump failed\n");
pkg_free(cp); return -1;
} memcpy(cp, CRLF, CRLF_LEN);
memcpy(cp + CRLF_LEN, nortpproxy_str.s, nortpproxy_str.len);
if (insert_new_lump_after(anchor, cp, nortpproxy_str.len + CRLF_LEN, 0)
== NULL) { LM_ERR("insert_new_lump_after
failed\n"); pkg_free(cp);
return -1; } } *
_______________________________________________
--
Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Narsay, Deep
2014-08-12 19:13:29 UTC
Permalink
Hello Daniel,

Adding msg_apply_changes corrected the extra CRLF,

But ICE candidates (Added using set_iattr("ice_priority", "1"); ) are not
getting added anymore.

I have removed sdp_remove_line_by_prefix from kamailio.cfg for now.

Thanks,
-Deep N.
Post by Narsay, Deep
Thanks Daniel.
record_route() is already being done.
I will go through my test cases with your suggestion.
- Deep N
On Tue, Aug 12, 2014 at 1:11 PM, Daniel-Constantin Mierla <
Post by Narsay, Deep
Hello,
use msg_apply_changes() after sdp_remove_line_by_prefix().
Also, you should do record_route() after applying changes.
Cheers,
Daniel
Hello,
Please let me know if there is any work around for this.
kamailio.cfg has this sequence in kamailio.cfg,
......
modparam("rtpproxy", "ice_candidate_priority_avp",
"$avp(ice_priority)" )
........
sdp_remove_line_by_prefix("a=candidate");
set_iattr("ice_priority", "1");
rtpproxy_manage("frwie");
I'm seeing an issue towards the bottom of the SDP message.
....
a=ssrc:738345272 mslabel:VPELrlXvdfGmtevlYLEeVm6zq4JHvI4g
a=ssrc:738345272 label:VPELrlXvdfGmtevlYLEeVm6zq4JHvI4ga0
a=ice-ufrag:YJuJWr9clIJHhENw
a=ice-pwd:3v1D1ShCg8xIlDZ9
a=candidate:1297581420 1 udp 659136 10.1.2.3 17534 typ host
generation 0
a=candidate:1297581420 2 udp 659136 10.1.2.3 17535 typ host
generation 0
a=ptime:20
\r\n
a=nortpproxy:yes\r\n
The call gets rejected by UA due to an invalid (empty) line in SDP.
http://lists.sip-router.org/pipermail/users/2008-September/019605.html
(Module authors, I'll be happy to code/test or assist in any way
possible if needed.)
Just to test it, I commented the following code snippet and the call
worked.
But that can't be the permanent fix.
Thank you,
- Deep N
Code snippet:rtp_proxy.c::force_rtp_proxy starting from line 2850
* if (proxied == 0 && nortpproxy_str.len) { cp
= pkg_malloc((nortpproxy_str.len + CRLF_LEN) * sizeof(char));
if (cp == NULL) { LM_ERR("out of pkg memory\n");
return -1; } anchor
= anchor_lump(msg, body.s + body.len - msg->buf, 0, 0); if
(anchor == NULL) { LM_ERR("anchor_lump failed\n");
pkg_free(cp); return -1;
} memcpy(cp, CRLF, CRLF_LEN);
memcpy(cp + CRLF_LEN, nortpproxy_str.s, nortpproxy_str.len);
if (insert_new_lump_after(anchor, cp, nortpproxy_str.len + CRLF_LEN, 0)
== NULL) { LM_ERR("insert_new_lump_after
failed\n"); pkg_free(cp);
return -1; } } *
_______________________________________________
--
Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Loading...