[SR-Users] How to check If Alias is already Set in Contact Header

Terry Tailor terry at fullduplex.co.uk
Thu Jul 8 12:28:04 CEST 2021


Hi,
I'm having the following scenario
UA <---> Prox1 <----> Proxy2 <-----> B2BUA <------> UA

Proxy2 and B2BUA are connected on LAN and Proxy1 is adding his own Contact
Alias and Proxy 2 is adding his own Contact Alias
I'm adding Alias via using the following function set_contact_alias("1") as
it will remove other contact alias but is causing the problem in the case
of BYE coming from B2BUA.

Is there is a way to find if the contact alias is already set?
How I can replace the local IP alias with domain name when request is
coming from B2BUA and alias is added by Proxy2.



Here are logs to show problem

in 200 sent by B2BUA and proxy2 add alias 10.44.44.2~6000~1 Now in ACK it
is causing the problem

SIP/2.0 200 OK
Via: SIP/2.0/UDP sip.prox1.example.com:5060
;rport=5060;received=3.18.1.21;branch=z9hG4bK2d66.a89039bedfe3d1113132f04c94b8a757.0
Via: SIP/2.0/UDP 192.168.1.168:50279
;received=109.8.2.1;rport=45607;branch=z9hG4bKPj84875d08eafc48bfa6c29de5fe245cea
Record-Route: <sip:sip.proxy2.example;lr;did=e84.87e2;rtp=bridge>
Record-Route: <sip:sip.prox1.example.com;lr;did=e84.7452;rtp=bridge>
From: "8001" <sip:8001 at sip.example.com>;tag=0b9915abae654e21845fd4d7f577ede9
To: <sip:2501 at sip.example.com>;tag=as1f4f6b1c
Call-ID: a0095b9868924b0681225a8884a06c22
CSeq: 3687 INVITE
Server: Voip
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO,
PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:2501 at 10.44.44.2:6000;alias=10.44.44.2~6000~1>
Content-Type: application/sdp
Require: timer
Content-Length: 281

Ack for 200

ACK sip:2501 at 10.44.44.2:6000 SIP/2.0
Via: SIP/2.0/UDP sip.proxy2.example.com:5060
;branch=z9hG4bK2d66.3c10a3b45e5c8caacbc5853d5e6418b2.0
Via: SIP/2.0/UDP sip.proxy1.example.com:5060;rport=5060;received= 3.18.1.21
;branch=z9hG4bK2d66.788312006d5f7aedc058435cd203fed3.0
Via: SIP/2.0/UDP 192.168.1.168:50279;received= 109.8.2.1
;rport=45607;branch=z9hG4bKPjf003c3bfe4ba423e9a0dedd647511dd3
Max-Forwards: 68
From: "8001" <sip:8001 at sip.example.com>;tag=0b9915abae654e21845fd4d7f577ede9
To: <sip:2501 at sip.example.com>;tag=as1f4f6b1c
Call-ID: a0095b9868924b0681225a8884a06c22
CSeq: 3687 ACK
Content-Length:  0


Thanks in advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20210708/7eb72c1a/attachment.htm>


More information about the sr-users mailing list