[OpenSIPS-Users] BYE in a load balancing with asterisk scenario

Bogdan-Andrei Iancu bogdan at voice-system.ro
Fri Oct 8 13:37:09 CEST 2010


Hi Alexandr,

The problem is with the Contact in INVITE - it carries a private IP 
which cannot be route. So from asterisk point of view, the other 
end-point has a private IP.

What you need to do is to fix the private contact in INVITE by using 
fix_nated_contact() function (see nathelper module):
       
http://www.opensips.org/html/docs/modules/1.6.x/nathelper.html#id270980

Regards,
Bogdan

Alexandr A. Alexandrov wrote:
> Hi!
>
> I also have another problem: since opensips is configured as asterisk 
> peer is *'s config, the BYE asterisk sends does not get to the load 
> balanced UA when it is NATed. Obviously, this is because there is no Via 
> header in the BYE message with received and rport fields (sip trace 
> below). Is there any way to solve this? Somehow remember the Via header 
> for this call and add it to BYE when it passes through opensips (and 
> matches the call)?
> Here is the trace from *'s point of view:
>
> <--- SIP read from xxx.yyy.zzz.90:5060 --->
> INVITE sip:to at xxx.yyy.zzz.90 SIP/2.0
> Record-Route: <sip:xxx.yyy.zzz.90;lr;ftag=dwage;did=643.3986f963>
> Via: SIP/2.0/UDP xxx.yyy.zzz.90;branch=z9hG4bK931f.33d7e6f4.0
> Via: SIP/2.0/UDP 
> 192.168.128.205;received=cli.ent.i.p;rport=5060;branch=z9hG4bKhkaqxvra
> Max-Forwards: 69
> Proxy-Authorization: Digest 
> username="from",realm="asterisk",nonce="51e71e69",uri="sip:to at xxx.yyy.zzz.90",response="c643612
> 2f92fe7cf08006dc154705638",algorithm=MD5
> To: <sip:to at xxx.yyy.zzz.90>
> From: "aaa" <sip:from at xxx.yyy.zzz.90>;tag=dwage
> Call-ID: vpdjrkrfbsmjkvy at aalexandrov.site
> CSeq: 131 INVITE
> Contact: <sip:from at 192.168.128.205>
> Content-Type: application/sdp
> Allow: 
> INVITE,ACK,BYE,CANCEL,OPTIONS,PRACK,REFER,NOTIFY,SUBSCRIBE,INFO,MESSAGE
> Supported: replaces,norefersub,100rel
> User-Agent: Twinkle/1.4.2
> Content-Length: 313
>
> v=0
> o=twinkle 830887642 558243211 IN IP4 192.168.128.205
> s=-
> c=IN IP4 192.168.128.205
> t=0 0
> m=audio 8000 RTP/AVP 98 97 8 0 3 101
> a=rtpmap:98 speex/16000
> a=rtpmap:97 speex/8000
> a=rtpmap:8 PCMA/8000
> a=rtpmap:0 PCMU/8000
> a=rtpmap:3 GSM/8000
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-15
> a=ptime:20
>
> <--- Transmitting (NAT) to xxx.yyy.zzz.90:5060 --->
> SIP/2.0 100 Trying
> Via: SIP/2.0/UDP 
> xxx.yyy.zzz.90;branch=z9hG4bK931f.33d7e6f4.0;received=xxx.yyy.zzz.90
> Via: SIP/2.0/UDP 
> 192.168.128.205;received=cli.ent.i.p;rport=5060;branch=z9hG4bKhkaqxvra
> Record-Route: <sip:xxx.yyy.zzz.90;lr;ftag=dwage;did=643.3986f963>
> From: "aaa" <sip:from at xxx.yyy.zzz.90>;tag=dwage
> To: <sip:to at xxx.yyy.zzz.90>
> Call-ID: vpdjrkrfbsmjkvy at aalexandrov.site
> CSeq: 131 INVITE
> User-Agent: Asterisk PBX
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
> Supported: replaces
> Contact: <sip:to at xxx.yyy.zzz.94>
> Content-Length: 0
>
>
> <--- Reliably Transmitting (NAT) to xxx.yyy.zzz.90:5060 --->
> SIP/2.0 200 OK
> Via: SIP/2.0/UDP 
> xxx.yyy.zzz.90;branch=z9hG4bK931f.33d7e6f4.0;received=xxx.yyy.zzz.90
> Via: SIP/2.0/UDP 
> 192.168.128.205;received=cli.ent.i.p;rport=5060;branch=z9hG4bKhkaqxvra
> Record-Route: <sip:xxx.yyy.zzz.90;lr;ftag=dwage;did=643.3986f963>
> From: "aaa" <sip:from at xxx.yyy.zzz.90>;tag=dwage
> To: <sip:to at xxx.yyy.zzz.90>;tag=as671f3653
> Call-ID: vpdjrkrfbsmjkvy at aalexandrov.site
> CSeq: 131 INVITE
> User-Agent: Asterisk PBX
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
> Supported: replaces
> Contact: <sip:to at xxx.yyy.zzz.94>
> Content-Type: application/sdp
> Content-Length: 264
>
> v=0
> o=root 29029 29029 IN IP4 xxx.yyy.zzz.94
> s=session
> c=IN IP4 xxx.yyy.zzz.94
> t=0 0
> m=audio 15576 RTP/AVP 0 8 3 101
> a=rtpmap:0 PCMU/8000
> a=rtpmap:8 PCMA/8000
> a=rtpmap:3 GSM/8000
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-16
> a=ptime:20
> a=sendrecv
>
>
> <--- SIP read from xxx.yyy.zzz.90:5060 --->
> ACK sip:to at xxx.yyy.zzz.94 SIP/2.0
> Via: SIP/2.0/UDP xxx.yyy.zzz.90;branch=z9hG4bK931f.33d7e6f4.2
> Via: SIP/2.0/UDP 
> 192.168.128.205;received=cli.ent.i.p;rport=5060;branch=z9hG4bKgvysatjo
> Max-Forwards: 69
> Proxy-Authorization: Digest 
> username="from",realm="asterisk",nonce="51e71e69",uri="sip:to at xxx.yyy.zzz.90",response="c6436122f92fe7cf08006dc154705638",algorithm=MD5
> To: <sip:to at xxx.yyy.zzz.90>;tag=as671f3653
> From: "aaa" <sip:from at xxx.yyy.zzz.90>;tag=dwage
> Call-ID: vpdjrkrfbsmjkvy at aalexandrov.site
> CSeq: 131 ACK
> User-Agent: Twinkle/1.4.2
> Content-Length: 0
>
>
> Reliably Transmitting (NAT) to xxx.yyy.zzz.90:5060:
> BYE sip:from at 192.168.128.205 SIP/2.0
> Via: SIP/2.0/UDP xxx.yyy.zzz.94:5060;branch=z9hG4bK1890cc40;rport
> Route: <sip:xxx.yyy.zzz.90;lr;ftag=dwage;did=643.3986f963>
> From: <sip:to at xxx.yyy.zzz.90>;tag=as671f3653
> To: "aaa" <sip:from at xxx.yyy.zzz.90>;tag=dwage
> Call-ID: vpdjrkrfbsmjkvy at aalexandrov.site
> CSeq: 102 BYE
> User-Agent: Asterisk PBX
> Max-Forwards: 70
> X-Asterisk-HangupCause: Unknown
> X-Asterisk-HangupCauseCode: 0
> Content-Length: 0
>
> Retransmitting #1 (NAT) to xxx.yyy.zzz.90:5060:
> BYE sip:from at 192.168.128.205 SIP/2.0
> Via: SIP/2.0/UDP xxx.yyy.zzz.94:5060;branch=z9hG4bK1890cc40;rport
> Route: <sip:xxx.yyy.zzz.90;lr;ftag=dwage;did=643.3986f963>
> From: <sip:to at xxx.yyy.zzz.90>;tag=as671f3653
> To: "aaa" <sip:from at xxx.yyy.zzz.90>;tag=dwage
> Call-ID: vpdjrkrfbsmjkvy at aalexandrov.site
> CSeq: 102 BYE
> User-Agent: Asterisk PBX
> Max-Forwards: 70
> X-Asterisk-HangupCause: Unknown
> X-Asterisk-HangupCauseCode: 0
> Content-Length: 0
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>   


-- 
Bogdan-Andrei Iancu
OpenSIPS Bootcamp
15 - 19 November 2010, Edison, New Jersey, USA
www.voice-system.ro




More information about the Users mailing list