[Asterisk-Dev] Strcit Routing vs Loose Routing

Chuck Ramirez chuck_ramirez at yahoo.com
Fri Feb 11 13:12:17 MST 2005


Hello,

I was interconnecting Asterisk (v1.0) with a strict
router (ie, no ;lr in routes) and I think I found a
bug in the way Asterisk prepare new requests inside a
dialog.

I'm sending some captures (ngrep) along with my
comments.

This is a 200 OK (INVITE) received by Asterisk

=========================
U 2005/02/10 16:41:55.065538 143.173.202.82:5060 ->
143.173.202.83:5070
  SIP/2.0 200 OK..Via: SIP/2.0/UDP
143.173.202.83:5070;branch=z9hG4bK42c78895..Record-Route:
<sip:001178612341106 at 143.173.
  202.81;ftag=as182aa61c;lr>..Record-Route:
<sip:001178612341106 at 143.173.202.82:5060>..From: "Call
Center 1" <sip:55512 at si
  p.trdc.telenova.com.br>;tag=as182aa61c..To:
<sip:001178612341106 at sip.com>;tag=281B1720-1D3C..Call-ID:
3
  e3b393c407188e9311d01a03e43f144 at sip.com..CSeq: 103
INVITE..Contact: <sip:747#1178612341106 at 143.173.194.
  37:5060>..date: Thu, 10 Feb 2005 20:41:43
GMT..server: Cisco-SIPGateway/IOS-12.x..allow-events:
telephone-event..Allow:
   INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, COMET,
REFER, SUBSCRIBE, NOTIFY, INFO..Content-Type:
application/sdp..Conten
  t-Length:  
257....v=0..o=CiscoSystemsSIP-GW-UserAgent 2591 2076
IN IP4 143.173.194.37..s=SIP Call..c=IN IP4 143.173.19
  4.37..t=0 0..m=audio 19458 RTP/AVP 18 100..c=IN IP4
143.173.194.37..a=rtpmap:18 G729/8000..a=fmtp:18
annexb=no..a=rtpma
  p:100 X-NSE/8000..a=fmtp:100 192-194..
=================================

At this point Asterisk builds a route list for
subsequent requests (record routes + contacts):

sip:001178612341106 at 143.173.202.82:5060
sip:001178612341106 at 143.173.202.81;ftag=as182aa61c;lr
sip:747#1178612341106 at 143.173.194.37:5060

But when Asterisk sends a BYE for this call:

=======================================
U 2005/02/10 16:41:57.400529 143.173.202.83:5070 ->
143.173.202.82:5060
  BYE sip:747#1178612341106 at 143.173.194.37:5060
SIP/2.0..Via: SIP/2.0/UDP
143.173.202.83:5070;branch=z9hG4bK67ce783e..Rout
  e:
<sip:001178612341106 at 143.173.202.81;ftag=as182aa61c;lr>,<sip:747#1178612341106 at 143.173.194.37:5060>..From:
"Call Cente
  r 1" <sip:55512 at sip.com>;tag=as182aa61c..To:
<sip:001178612341106 at sip.com>;tag=281B172
  0-1D3C..Contact:
<sip:55512 at 143.173.202.83:5070>..Call-ID:
3e3b393c407188e9311d01a03e43f144 at sip.com..C
  Seq: 104 BYE..User-Agent: Asterisk
PBX..Proxy-Authorization: Digest username="55512",
realm="sip.com",
   algorithm=MD5,
uri="sip:747#1178612341106 at 143.173.194.37:5060",
nonce="420bc833181bca085f953885ace7fc72c107c8e0",
respo
  nse="75fcd1bf185ae29becd0b4f715f5cb17",
opaque=""..Content-Length: 0....
===========================================

As we can see it is using the contact as the URI of
this request, which also appears as the last route
header.

As per RFC3261 (16.12.1) if the next hop is a strict
router (no ;lr in route header) it should use that
information as the R-URI, which is not the behaviour
of Asterisk.

Moreover, it should include all routes learned in the
request Route header (including the one that will
receive the request) when we are treating with loose
routers.

I have changed the source code and in my test bed (at
least) is working fine.

Am I missing something? 

Regards,

Chuck.





		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Helps protect you from nasty viruses. 
http://promotions.yahoo.com/new_mail



More information about the asterisk-dev mailing list