[sr-dev] [SDPOPS] sdp_get_line_startswith removes \r in messages

Tuan Viet Nguyen ntvietvn at gmail.com
Thu Dec 5 18:37:03 CET 2013


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,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20131205/67cb6205/attachment.html>


More information about the sr-dev mailing list