Hello,
It seems that when calling the function sdp_get_line_startswith, it removes the \r (0d in hexa) from the SIP message before forwarding it. In the code (sdpops_mod.c) from line 1402 to 1406, we see that
// remove ending \r\n if exists if (avp_val.s.s[line.len-2] == '\r' && avp_val.s.s[line.len-1] == '\n') { avp_val.s.s[line.len-2] = '\0'; avp_val.s.len -= 2; }
As avp_val is a reference to the found line which is also a reference to the line in the message, all modification made to this var will also be applied to the message. Am I wrong?
Thank you,
Hello,
thanks, it was fixed on master and backported to 4.1 branch.
Cheers, Daniel
On 12/5/13 6:37 PM, Tuan Viet Nguyen wrote:
Hello,
It seems that when calling the function sdp_get_line_startswith, it removes the \r (0d in hexa) from the SIP message before forwarding it. In the code (sdpops_mod.c) from line 1402 to 1406, we see that
// remove ending \r\n if exists if (avp_val.s.s[line.len-2] == '\r' && avp_val.s.s[line.len-1] == '\n') { avp_val.s.s[line.len-2] = '\0'; avp_val.s.len -= 2; }
As avp_val is a reference to the found line which is also a reference to the line in the message, all modification made to this var will also be applied to the message. Am I wrong?
Thank you,
sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
Thanks Daniel,
I've just tested the patch, it works now.
Regards,
On Fri, Dec 6, 2013 at 11:38 AM, Daniel-Constantin Mierla <miconda@gmail.com
wrote:
Hello,
thanks, it was fixed on master and backported to 4.1 branch.
Cheers, Daniel
On 12/5/13 6:37 PM, Tuan Viet Nguyen wrote:
Hello,
It seems that when calling the function sdp_get_line_startswith, it removes the \r (0d in hexa) from the SIP message before forwarding it. In the code (sdpops_mod.c) from line 1402 to 1406, we see that
// remove ending \r\n if exists if (avp_val.s.s[line.len-2] == '\r' && avp_val.s.s[line.len-1] == '\n') { avp_val.s.s[line.len-2] = '\0'; avp_val.s.len -= 2; }
As avp_val is a reference to the found line which is also a reference to the line in the message, all modification made to this var will also be applied to the message. Am I wrong?
Thank you,
sr-dev mailing listsr-dev@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
-- Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev