[Asterisk-Users] 482 Loop Detected on sip calls

Joshua Colp jcolp at digium.com
Fri Apr 28 07:54:28 MST 2006


Ajit wrote:
> Hi,
>  I am trying to use the manager API to originate a SIP call from one
> asterisk extension to another. eg extension 600 at myasteriskserver calls
> extension 800 at myasteriskserver.However this fails with a 482 "Loop
> detected".
> 
> I beleive this behaviour is incorrect according to rfc3261 :
>  The UAS processes the first such request received and responds with a 482
> (Loop
>       Detected) to the rest of them.
> 
> In this case its a sent request colliding with the first recieved request.
> Can people on the dev list comment on if this is a bug and where in the code
> it may be fixed.
> 
> Note that i do not need SIP proxy functionality or NAT  from asterix.
>  Any ideas on workarounds?? I think if i can have two SIP stacks on
> different ports calling each other this behaviour can be avoided.Is this
> possible and if so how can i configure this.
> 
> Regards,
> Ajit
> 
> P.S: Here is the SIP debug (ip addresses modified)
> LI> sip debug
> SIP Debugging enabled
>   == Parsing '/etc/asterisk/manager.conf': Found
>   == Manager 'manager' logged on from xxx.yyy.xxx.yyy
> We're at myasteriskserver port 10878
> Adding codec 0x4 (ulaw) to SDP
> Adding non-codec 0x1 (telephone-event) to SDP
> 13 headers, 10 lines
> Reliably Transmitting (no NAT) to myasteriskserver:5060:
> INVITE sip:800 at myasteriskserver SIP/2.0
> Via: SIP/2.0/UDP myasteriskserver:5060;branch=z9hG4bK7aa5b7b4;rport
> From: "asterisk" <sip:asterisk at myasteriskserver>;tag=as7c2a32b7
> To: <sip:800 at myasteriskserver>
> Contact: <sip:asterisk at myasteriskserver>
> Call-ID: 454c631c1c01dff40cc65d314584a1f1 at myasteriskserver
> CSeq: 102 INVITE
> User-Agent: Asterisk PBX
> Max-Forwards: 70
> Date: Fri, 28 Apr 2006 13:14:47 GMT
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
> Content-Type: application/sdp
> Content-Length: 212
> 
> v=0
> o=root 5351 5351 IN IP4 myasteriskserver
> s=session
> c=IN IP4 myasteriskserver
> t=0 0
> m=audio 10878 RTP/AVP 0 101
> a=rtpmap:0 PCMU/8000
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-16
> a=silenceSupp:off - - - -
> 
> ---
> 
> <-- SIP read from myasteriskserver:5060:
> INVITE sip:800 at myasteriskserver SIP/2.0
> Via: SIP/2.0/UDP myasteriskserver:5060;branch=z9hG4bK7aa5b7b4;rport
> From: "asterisk" <sip:asterisk at myasteriskserver>;tag=as7c2a32b7
> To: <sip:800 at myasteriskserver>
> Contact: <sip:asterisk at myasteriskserver>
> Call-ID: 454c631c1c01dff40cc65d314584a1f1 at myasteriskserver
> CSeq: 102 INVITE
> User-Agent: Asterisk PBX
> Max-Forwards: 70
> Date: Fri, 28 Apr 2006 13:14:47 GMT
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
> Content-Type: application/sdp
> Content-Length: 212
> 
> v=0
> o=root 5351 5351 IN IP4 myasteriskserver
> s=session
> c=IN IP4 myasteriskserver
> t=0 0
> m=audio 10878 RTP/AVP 0 101
> a=rtpmap:0 PCMU/8000
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-16
> a=silenceSupp:off - - - -
> 
> --- (13 headers 10 lines)---
> Transmitting (no NAT) to myasteriskserver:5060:
> SIP/2.0 482 Loop Detected
> Via: SIP/2.0/UDP
> myasteriskserver:5060;branch=z9hG4bK7aa5b7b4;rport;received=myasteriskserver
> From: "asterisk" <sip:asterisk at myasteriskserver>;tag=as7c2a32b7
> To: <sip:800 at myasteriskserver>;tag=as7c2a32b7
> Call-ID: 454c631c1c01dff40cc65d314584a1f1 at myasteriskserver
> CSeq: 102 INVITE
> User-Agent: Asterisk PBX
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
> Contact: <sip:asterisk at myasteriskserver>
> Content-Length: 0
> 
> 
> ---
> 
> <-- SIP read from myasteriskserver:5060:
> SIP/2.0 482 Loop Detected
> Via: SIP/2.0/UDP
> myasteriskserver:5060;branch=z9hG4bK7aa5b7b4;rport;received=myasteriskserver
> From: "asterisk" <sip:asterisk at myasteriskserver>;tag=as7c2a32b7
> To: <sip:800 at myasteriskserver>;tag=as7c2a32b7
> Call-ID: 454c631c1c01dff40cc65d314584a1f1 at myasteriskserver
> CSeq: 102 INVITE
> User-Agent: Asterisk PBX
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
> Contact: <sip:asterisk at myasteriskserver>
> Content-Length: 0
> 
> 
> --- (10 headers 0 lines)---
>     -- Got SIP response 482 "Loop Detected" back from myasteriskserver
> Transmitting (no NAT) to myasteriskserver:5060:
> ACK sip:800 at myasteriskserver SIP/2.0
> Via: SIP/2.0/UDP myasteriskserver:5060;branch=z9hG4bK7aa5b7b4;rport
> From: "asterisk" <sip:asterisk at myasteriskserver>;tag=as7c2a32b7
> To: <sip:800 at myasteriskserver>;tag=as7c2a32b7
> Contact: <sip:asterisk at myasteriskserver>
> Call-ID: 454c631c1c01dff40cc65d314584a1f1 at myasteriskserver
> CSeq: 102 ACK
> User-Agent: Asterisk PBX
> Max-Forwards: 70
> Content-Length: 0
> 
> 
> ---
> 
> <-- SIP read from myasteriskserver:5060:
> ACK sip:800 at myasteriskserver SIP/2.0
> Via: SIP/2.0/UDP myasteriskserver:5060;branch=z9hG4bK7aa5b7b4;rport
> From: "asterisk" <sip:asterisk at myasteriskserver>;tag=as7c2a32b7
> To: <sip:800 at myasteriskserver>;tag=as7c2a32b7
> Contact: <sip:asterisk at myasteriskserver>
> Call-ID: 454c631c1c01dff40cc65d314584a1f1 at myasteriskserver
> CSeq: 102 ACK
> User-Agent: Asterisk PBX
> Max-Forwards: 70
> Content-Length: 0
> 
> 
> --- (10 headers 0 lines)---
> Destroying call '454c631c1c01dff40cc65d314584a1f1 at myasteriskserver'
>   == Manager 'manager' logged off from xxx.yyy.xxx.yyy
> 
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
> 
> Asterisk-Users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users

Why don't you use something like the chan_local channel driver to send 
the call into the dialplan where it will then execute the extension? If 
you don't you're going to see what you're getting above. You're looping 
an outbound call back inbound to the same box, with the same callid... 
so it's perceiving it as a loop.

-- 
Joshua Colp
Software Developer
Digium
P - 256-428-6066
C - 506-878-0147
jcolp at digium.com



More information about the asterisk-users mailing list