[asterisk-users] IAX2: Incoming calls answered prematurely?

Alan Lord alanslists at gmail.com
Fri Oct 19 10:11:42 CDT 2007


Hello,

This message is similar to one I posted before, but with a different 
subject line and I've revised the description to hopefully make it clearer.

The basic problem is I am trying to dial 2 numbers simultaneously using 
the & construct. One device is a "locally attached" soft SIP phone. The 
other device is also a soft SIP phone, but it is on a different Asterisk 
server connected over the Internet using IAX. Normal calls between our 
servers work fine. However, when I try to dial *both* devices, the 
remote Asterisk server answers the call on the IAX channel before it has 
checked to see if the real destination device (the SIP phone) is on, 
available or busy etc.

This is a problem because I am trying to route calls to a common 
voicemail box if both lines are unavailable, busy or go unanswered. Once 
the IAX channel answers the incoming call, the dialplan's job is 
effectively done. Unfortunately, the remote Asterisk server clears the 
call almost immediately, as it finds the real destination extension is 
actually not available.

Can anyone see where the problem is? Or suggest a better way?

Many thanks.

Alan

Logs and configuration below:

Here's the last bit of the log (I've edited out the IP address) - we are
both deliberately NOT answering our phones...

  Executing [s at tolc:1] Macro("SIP/101-081d1050",
"belllord|SIP/101&IAX2/alanb/201|tolc") in new stack
     -- Executing [s at macro-belllord:1] Dial("SIP/101-081d1050",
"SIP/101&IAX2/alanb/201|10|tr") in new stack
     -- Called 101
     -- Called alanb/201
[Oct 17 16:09:47] WARNING[2836]: channel.c:2634 ast_indicate_data:
Unable to handle indication 3 for 'SIP/101-081d1050'
     -- SIP/101-081d4fc0 is ringing
     -- Call accepted by 80.XXX.XX.XX (format alaw)
     -- Format for call is alaw
     -- IAX2/alanb-3 answered SIP/101-081d1050
[Oct 17 16:09:47] NOTICE[2836]: cdr.c:434 ast_cdr_free: CDR on channel
'SIP/101-081d4fc0' not posted
[Oct 17 16:09:47] DEBUG[1419]: chan_iax2.c:7435 socket_process:
Immediately destroying 3, having received hangup
[Oct 17 16:09:47] DEBUG[2836]: chan_iax2.c:3176 iax2_hangup: We're
hanging up IAX2/alanb-3 now...
[Oct 17 16:09:47] DEBUG[2836]: chan_iax2.c:3191 iax2_hangup: Really
destroying IAX2/alanb-3 now...
     -- Hungup 'IAX2/alanb-3'
   == Spawn extension (macro-belllord, s, 1) exited non-zero on
'SIP/101-081d1050' in macro 'belllord'
   == Spawn extension (macro-belllord, s, 1) exited non-zero on
'SIP/101-081d1050'

And here's the relevant bits of my extension.conf

[globals]
ALANL=SIP/101 ; My Soft Phone
ALANB=IAX2/alanb/201 ; Alan's Extension

[main_menu] ; Test Dialplan for IVR
exten => s,1,Answer()
exten => s,n,Set(TIMEOUT(digit)=5) ; Max time between digits
exten => s,n,Set(TIMEOUT(response)=15) ; Max time to wait
exten => s,n,Wait(1)
exten => s,n,Background(welcome-to-bell-lord)
exten => s,n(resume),Background(press-3-for-tolc) ; Short dialogues,
exten => s,n,Background(press-4-for-fondoo) ; rather than one long one
exten => s,n,Background(press-5-for-arrowtees) ; might need to change
exten => s,n,Background(press-6-for-gen-enq) ; frequently.
exten => s,n,WaitExten()

exten => 3,1,Goto(tolc,s,1) ; Dial 3 For The Open Learning Centre
exten => 4,1,Goto(fondoo,s,1) ; Dial 4 for Fondoo Internet
exten => 5,1,Goto(arrowtees,s,1) ; Dial 5 for ArrowTees
exten => 6,1,Goto(gen_enq,s,1) ; For all other enquiries press 6

exten => i,1,Playback(pbx-invalid)
exten => i,n,Goto(resume)

exten => t,1,Playback(vm-goodbye)
exten => t,n,Hangup() ; Might change this section to go to [gen_enq]
voicemail rather than just hangup.

[tolc]
exten => s,1,Macro(belllord,${ALANL}&${ALANB},${CONTEXT}) ; Calls the
belllord Macro with the channel(s) to dial and the current context (for
business voicemail)

[fondoo]
exten => s,1,Macro(belllord,${ALANL}&${ALANB},${CONTEXT})

[arrowtees]
exten => s,1,Macro(belllord,${ALANL},${CONTEXT})

[gen_enq]
exten => s,1,Macro(belllord,${ALANL}&${ALANB},${CONTEXT})

; Call with Macro(belllord,channel,vmbox)
[macro-belllord] ; Uses macro and DIALSTATUS for local devices
exten => s,1,Dial(${ARG1},10,tr)
exten => s,n,Goto(s-${DIALSTATUS},1)
exten => s-NOANSWER,1,Voicemail(${ARG2}@business,u) ; business is the
voicemail context, ${ARG2} is the context from which this call came
exten => s-BUSY,1,Voicemail(${ARG2}@business,b)
exten => _s-.,1,Goto(s-NOANSWER,1)

==============================

-- 
The way out is open!
http://www.theopensourcerer.com




-- 
The way out is open!
http://www.theopensourcerer.com




More information about the asterisk-users mailing list