<div dir="ltr">in my scenario call coming from sbc to kamailio proxy and we route to pbx server in that when <div>kamailio proxy get the call at that time i am removing Contact header using remove_hf("Contact") and adding contact Header using append_hf("$uac_req(hdrs)") for route to PBX server . in that signaling i am getting modified Contact header but old contact header not removed properly some junks are remain in the signaling </div><div><br></div><div>scenario : </div><div><br></div><div>SBC ---------> Kamailio proxy ------> PBX</div><div><br></div><div>before using remove_hf("Contact") </div><div><br></div><div>INVITE <a href="mailto:sip%3A5678@opensips.org" target="_blank">sip:user2@</a><a href="http://domain.org/" target="_blank">domain.org</a>;transport=UDP SIP/2.0<br>Via: SIP/2.0/UDP 10.212.xxx.xxx:port;branch=z9hG4bK-524287-1---8c5ac8642f321a9e<br>Max-Forwards: 70<br>Contact: <sip:user1@10.212.xxx.xxx:39931;transport=UDP><br>To: <<a href="mailto:sip%3A5678@opensips.org" target="_blank">sip:user2@</a><a href="http://domain.org/" target="_blank">domain.org</a>;transport=UDP><br>From: <<a href="mailto:sip%3A1234@opensips.org" target="_blank">sip:user1@</a><a href="http://domain.org/" target="_blank">domain.org</a>;transport=UDP>;tag=891fd646<br>Call-ID: t9Ff-fCrin_VN1IO9Xf1mA..<br>CSeq: 2 INVITE<br>Content-Type: application/sdp<br>Proxy-Authorization: Digest username="user1",realm="domain<a href="http://opensips.org/" target="_blank">.org</a>",nonce="5ff5a660afc72502212b4a611bb0d689efadafab",uri="<a href="mailto:sip%3A5678@opensips.org" target="_blank">sip:user2@domain.org</a>;transport=UDP",response="f926e3742cbdcb8c68ea9b5<br>82ac2dc",cnonce="9b3276d6d37aaa6107a835df8e5b3a87",nc=00000001,qop=auth,algorithm=MD5<br>User-Agent: Z 3.15.40006 rv2.8.20<br>Allow-Events: presence, kpml, talk<br>Content-Length: 243<br><br>v=0<br>o=Z 0 0 IN IP4 10.212.xxx.xxx<br>s=Z<br>c=IN IP4 10.212.xxx.xxx<br>t=0 0<br>m=audio 8000 RTP/AVP 3 110 8 0 97 101<br>a=rtpmap:110 speex/8000<br>a=rtpmap:97 iLBC/8000<br>a=fmtp:97 mode=30<br>a=rtpmap:101 telephone-event/8000<br>a=fmtp:101 0-16<br>a=sendrecv<br></div><div><br></div><div><br></div><div>after using remove-hf("Contact") function removing contact header but some junks are left and that eats next To header line and breaks Invite packet </div><div><br></div><div><span id="gmail-m_2800480046008257173m_6086192861765755615gmail-docs-internal-guid-08b58fff-7fff-3787-298f-839fdb972470"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt">INVITE sip:user2@domain.org:;transport=UDP SIP/2.0<br>Record-Route: <sip:172.xx.xx.xxx;lr=on;ftag=891fd646;vst=AAAAAFFTQVkuCENVXUEpHwNLAQEOSwdcDhwUcG9ydD1VRFA-;vsf=AAAAAFVCQ1U0ChwlAQMMHgBHHwFJVAYVYW5zcG9ydD1VRFA-><br>Via: SIP/2.0/UDP 172.xx.xx.xxx;branch=z9hG4bKbe4c.9743b885ad3452287530994a2cad6e50.0<br>Via: SIP/2.0/UDP 10.212.xxx.xxx:39931;rport=39931;received=172.xx.xx.x;branch=z9hG4bK-524287-1---8c5ac8642f321a9e<br>Max-Forwards: 69<br>sip:user1@172.xx.xx.x:39931;transport=UDPTo: <<a href="mailto:sip%3Adevang3032@opensips.org" target="_blank">sip:user2@domain.org</a>><br>From: <<a href="mailto:sip%3Adppatel@opensips.org" target="_blank">sip:user1@domain.org</a>>;tag=891fd646<br>Call-ID: t9Ff-fCrin_VN1IO9Xf1mA..<br>CSeq: 2 INVITE<br>Content-Type: application/sdp<br>User-Agent: Z 3.15.40006 rv2.8.20<br>Allow-Events: presence, kpml, talk<br>Content-Length: 534<br>Contact: <<a href="http://sip:dppatel@172.16.16.163:5060/" target="_blank">sip:user2@172.xx.xx.xxx:5060</a>><br><br>v=0<br>o=Z 0 0 IN IP4 10.212.xxx.xxx<br>s=Z<br>c=IN IP4 172.xx.xx.xxx<br>t=0 0<br>m=audio 11210 RTP/AVP 3 110 8 0 97 101<br>a=rtpmap:3 GSM/8000<br>a=rtpmap:110 speex/8000<br>a=rtpmap:8 PCMA/8000<br>a=rtpmap:0 PCMU/8000<br>a=rtpmap:97 iLBC/8000<br>a=rtpmap:101 telephone-event/8000<br>a=fmtp:97 mode=30<br>a=fmtp:101 0-16<br>a=sendrecv<br>a=rtcp:11211<br>a=ice-ufrag:lzjregPe<br>a=ice-pwd:RtA9x3jUWk4yNpJlzPL60nsRck<br>a=candidate:LhtmUSbPt9BJs4ZC 1 UDP 2130706431 172.xx.xx.xxx 11210 typ host<br>a=candidate:LhtmUSbPt9BJs4ZC 2 UDP 2130706430 172.xx.xx.xxx 11211 typ host<br></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><br></p><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt">As you can see Contact header is gone but sip:1234@172.xx.xx.x:39931;transport=UDP part left before To header . and its breake invite packet .</p><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><br></p><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="color:rgb(0,0,0);white-space:pre-wrap">Any suggestion will be highly appreciated.</span></p></span></div></div>

<br>
<div><font face="Arial" size="2" style="background-color:white" color="#808080"><b>Disclaimer</b></font></div><div><div><span style="background-color:white;color:rgb(128,128,128);font-family:Arial;font-size:small">In addition to generic Disclaimer which you have agreed on our website, any views or opinions presented in this email are solely those of the originator and do not necessarily represent those of the Company or its sister concerns. Any liability (in negligence, contract or otherwise) arising from any third party taking any action, or refraining from taking any action on the basis of any of the information contained in this email is hereby excluded.</span></div></div><div><span style="background-color:white;color:rgb(128,128,128);font-family:Arial;font-size:small"><br></span></div><div><font face="Arial" size="2" style="background-color:white" color="#808080"><b>Confidentiality</b></font></div><div><font face="Arial" size="2" style="background-color:white" color="#808080">This communication (including any attachment/s) is intended only for the use of the addressee(s) and contains information that is PRIVILEGED AND CONFIDENTIAL. Unauthorized reading, dissemination, distribution, or copying of this communication is prohibited. Please inform originator if you have received it in error.</font></div><div><font face="Arial" size="2" style="background-color:white" color="#808080"><br></font></div><div><span style="background-color:white;color:rgb(128,128,128);font-family:Arial;font-size:small"><b>Caution for viruses, malware etc.</b></span></div><div><font face="Arial" size="2" style="background-color:white" color="#808080">This communication, including any attachments, may not be free of viruses, trojans, similar or new contaminants/malware, interceptions or interference, and may not be compatible with your systems. You shall carry out virus/malware scanning on your own before opening any attachment to this e-mail. The sender of this e-mail and Company including its sister concerns shall not be liable for any damage that may incur to you as a result of viruses, incompleteness of this message, a delay in receipt of this message or any other computer problems. </font></div>