in my scenario call coming from sbc to kamailio proxy and we route to pbx
server in that when
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
scenario :
SBC ---------> Kamailio proxy ------> PBX
before using remove_hf("Contact")
INVITE sip:user2@ <sip%3A5678(a)opensips.org>domain.org;transport=UDP SIP/2.0
Via: SIP/2.0/UDP
10.212.xxx.xxx:port;branch=z9hG4bK-524287-1---8c5ac8642f321a9e
Max-Forwards: 70
Contact: <sip:user1@10.212.xxx.xxx:39931;transport=UDP>
To: <sip:user2@ <sip%3A5678(a)opensips.org>domain.org;transport=UDP>
From: <sip:user1@ <sip%3A1234(a)opensips.org>domain.org
;transport=UDP>;tag=891fd646
Call-ID: t9Ff-fCrin_VN1IO9Xf1mA..
CSeq: 2 INVITE
Content-Type: application/sdp
Proxy-Authorization: Digest
username="user1",realm="domain.org
<http://opensips.org/>
",nonce="5ff5a660afc72502212b4a611bb0d689efadafab",uri="sip:user2@domain.org
<sip%3A5678@opensips.org>;transport=UDP",response="f926e3742cbdcb8c68ea9b5
82ac2dc",cnonce="9b3276d6d37aaa6107a835df8e5b3a87",nc=00000001,qop=auth,algorithm=MD5
User-Agent: Z 3.15.40006 rv2.8.20
Allow-Events: presence, kpml, talk
Content-Length: 243
v=0
o=Z 0 0 IN IP4 10.212.xxx.xxx
s=Z
c=IN IP4 10.212.xxx.xxx
t=0 0
m=audio 8000 RTP/AVP 3 110 8 0 97 101
a=rtpmap:110 speex/8000
a=rtpmap:97 iLBC/8000
a=fmtp:97 mode=30
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=sendrecv
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
INVITE sip:user2@domain.org:;transport=UDP SIP/2.0
Record-Route:
<sip:172.xx.xx.xxx;lr=on;ftag=891fd646;vst=AAAAAFFTQVkuCENVXUEpHwNLAQEOSwdcDhwUcG9ydD1VRFA-;vsf=AAAAAFVCQ1U0ChwlAQMMHgBHHwFJVAYVYW5zcG9ydD1VRFA->
Via: SIP/2.0/UDP
172.xx.xx.xxx;branch=z9hG4bKbe4c.9743b885ad3452287530994a2cad6e50.0
Via: SIP/2.0/UDP
10.212.xxx.xxx:39931;rport=39931;received=172.xx.xx.x;branch=z9hG4bK-524287-1---8c5ac8642f321a9e
Max-Forwards: 69
sip:user1@172.xx.xx.x:39931;transport=UDPTo: <sip:user2@domain.org
<sip%3Adevang3032(a)opensips.org>>
From: <sip:user1@domain.org <sip%3Adppatel(a)opensips.org>>;tag=891fd646
Call-ID: t9Ff-fCrin_VN1IO9Xf1mA..
CSeq: 2 INVITE
Content-Type: application/sdp
User-Agent: Z 3.15.40006 rv2.8.20
Allow-Events: presence, kpml, talk
Content-Length: 534
Contact: <sip:user2@172.xx.xx.xxx:5060
<http://sip:dppatel@172.16.16.163:5060/>>
v=0
o=Z 0 0 IN IP4 10.212.xxx.xxx
s=Z
c=IN IP4 172.xx.xx.xxx
t=0 0
m=audio 11210 RTP/AVP 3 110 8 0 97 101
a=rtpmap:3 GSM/8000
a=rtpmap:110 speex/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:97 iLBC/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:97 mode=30
a=fmtp:101 0-16
a=sendrecv
a=rtcp:11211
a=ice-ufrag:lzjregPe
a=ice-pwd:RtA9x3jUWk4yNpJlzPL60nsRck
a=candidate:LhtmUSbPt9BJs4ZC 1 UDP 2130706431 172.xx.xx.xxx 11210 typ host
a=candidate:LhtmUSbPt9BJs4ZC 2 UDP 2130706430 172.xx.xx.xxx 11211 typ host
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 .
Any suggestion will be highly appreciated.
--
*Disclaimer*
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.
*Confidentiality*
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.
*Caution for viruses, malware etc.*
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.