Module: sip-router Branch: 4.1 Commit: e48703bd1cb12d5e8f2c29baf90d0c5e6af09b32 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e48703bd...
Author: Torrey Searle tsearle@gmail.com Committer: Torrey Searle tsearle@gmail.com Date: Thu Jan 16 12:02:09 2014 +0100
modules/sipt: optional pointer should be updated when modifying called party (cherry picked from commit ed33effd4a65302cd893ef2e8f0f8fcc3e88fb57)
---
modules/sipt/ss7_parser.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/modules/sipt/ss7_parser.c b/modules/sipt/ss7_parser.c index c8fc239..3c6d8ff 100644 --- a/modules/sipt/ss7_parser.c +++ b/modules/sipt/ss7_parser.c @@ -308,11 +308,15 @@ int isup_update_destination(struct sdp_mangler * mangle, char * dest, int hops,
// modify the mandatory fixed header - res2 = encode_called_party(dest, buf+offset+1, nai, tmp_buf+1, 255-1); - tmp_buf[0] = (char)res2; + res2 = encode_called_party(dest, buf+offset+1, nai, tmp_buf+2, 255-1); + tmp_buf[1] = (char)res2; res = buf[offset]+1; + + // set the new optional part pointer + tmp_buf[0] = (char)res2+2; - replace_body_segment(mangle, offset,res,tmp_buf, res2+1); + // replace the mandatory fixed header + optional pointer + replace_body_segment(mangle, offset - 1,res+1,tmp_buf, res2+2);
offset += res; len -= res;