[OpenSIPS-Users] Using remove_hf/insert_hf leads to garbage in SIP message

Max Mühlbronner mm at 42com.com
Mon Jul 11 17:07:10 CEST 2011


Hi,


quick guess, dont know why, but could it be related to "insert_hf"?
I always used "append_hf" which adds the header after the last header 
field. I never tried insert_hf, append_hf worked fine for me.


BR


Max M.


Am 11.07.2011 15:47, schrieb nick at uni-petrol.com:
> Forgot to add, that problem exists on opensips rev 7915 and latest 
> opensips rev 8151 from trunk.
> OS: CentOS 5.6 x86_64
> Hope that's help.
>
> On Mon, 11 Jul 2011 17:41:02 +0400, nick at uni-petrol.com wrote:
>
>> Dear All!
>>
>> I need to replace Contact header receiving from UAC to new one.
>>
>> I have strange problem with all Yealink phones.
>>
>> When I use remove_hf/insert_hf in onreply route opensips didn't proper
>> strip header.
>>
>> My config:
>>
>> onreply_route[1]
>> {
>>
>> if(is_present_hf("Contact"))
>> {
>> if(remove_hf("Contact"))
>> {
>> insert_hf("Contact: rn", "From");
>> }
>> else
>> {
>> xlog("L_ERR", "Error removing Contact header: M=$rm RURI=$ru F=$fu T=$tu
>> IP=$si ID=$ci UA=$ua CT=$ct TO=$tUn");
>> }
>> }
>>
>> }
>>
>> As you can see from trace below opensips proper remove Contact header,
>> but leave "sip:username at UAC-WAN-IP:1197" before "Content-Type:
>> application/sdp"
>>
>> SIP/2.0 200 OK
>> Via: SIP/2.0/TCP
>>
> SIP-UPLINK-GW-IP:5092;received=SIP-UPLINK-GW-IP;branch=z9hG4bK-d8754z-cf461413f8f8b92e-1---d8754z-;rport=35007 
>
>> Record-Route:
>> Record-Route:
>> Contact:
>> From: "1234567" ;tag=ff571748
>> To: ;tag=193729847
>> Call-ID: NzkxZjNjNzUxNjVhMGZkMjZkZDY5M2RkNTk2NWE1ODU.
>> CSeq: 1 INVITE
>> sip:username at UAC-WAN-IP:1197Content-Type: application/sdp
>> Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER,
>> SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE
>> User-Agent: Yealink SIP-T20P 9.60.14.8
>> Content-Length: 203
>>
>> v=0
>> o=- 20000 20000 IN IP4 UAC-LAN-IP
>> s=SDP data
>> c=IN IP4 192.168.30.4
>> t=0 0
>> m=audio 17264 RTP/AVP 8 96
>> a=rtpmap:8 PCMA/8000
>> a=fmtp:96 0-15
>> a=rtpmap:96 telephone-event/8000
>> a=sdpmangled:yes
>>
>> Trace without Contact manipulations:
>>
>> SIP/2.0 200 OK
>> Via: SIP/2.0/TCP
>>
> SIP-UPLINK-GW-IP:5092;received=SIP-UPLINK-GW-IP;branch=z9hG4bK-d8754z-37e3024aff94374c-1---d8754z-;rport=35030 
>
>> Record-Route:
>> Record-Route:
>> From: "1234567" ;tag=71ab6c06
>> To: ;tag=1956700973
>> Call-ID: NzliOWI0OTAzYjk0NmIwZDM4ZWFkZDI4Yjg5NWUxNjQ.
>> CSeq: 1 INVITE
>> Contact:
>> Content-Type: application/sdp
>> Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER,
>> SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE
>> User-Agent: Yealink SIP-T20P 9.60.14.8
>> Content-Length: 203
>>
>> v=0
>> o=- 20001 20001 IN IP4 UAC-LAN-IP
>> s=SDP data
>> c=IN IP4 192.168.30.4
>> t=0 0
>> m=audio 17188 RTP/AVP 8 96
>> a=rtpmap:8 PCMA/8000
>> a=fmtp:96 0-15
>> a=rtpmap:96 telephone-event/8000
>> a=sdpmangled:yes
>>
>> Please help.
>>
>> Thanks in advance!
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>




More information about the Users mailing list