Tim, I've tested similar dialplan on my home-server and it works perfectly. (same setting, slightly different extensions) but same idea:
exten => 418,1,Dial(SIP/55,15,trw) exten => 418,n,GotoIf($["${DIALSTATUS}"="BUSY"]?vmail:line2) exten => 418,n(line2),Dial(SIP/218,15,rw) exten => 418,n(vmail),Voicemail(55) exten => 418,n,Voicemail(55) exten => 418,n,Hangup() I think the reason the below dialpolan IS NOT WORKING is that I'm connecting (dialing) remote asterisk extension. --------not working calling remote asterisk---------- exten => 4,1,Dial(${FD_L1},25,trw) exten => 4,n,GotoIf($["${DIALSTATUS}"="BUSY"]?vmail:line2) exten => 4,n(line2),Dial(${FD_L2},20,rw) exten => 4,n(vmail),Voicemail(4) exten => 4,n,Voicemail(4) exten => 4,n,Hangup() -----end not working calling remote asterisk--------- I have two Asterisk server connected/registered over IAX and that error: "...exited non-zero on..." eg. -- SIP/54-00000006 is ringing == Spawn extension (extensions, 4, 3) exited non-zero on 'IAX2/home_server-424' I'm not the only one with this problem, this guy has the same problem as me: http://lists.digium.com/pipermail/asterisk-users/2006-January/135612.html -- Thelma On 05/08/2017 06:58 PM, Tim S wrote: > So, good, we're on the same page so far I think. > > As I last stated, the original code suggestion would be what you want to > do for the serial phone ring-down (hunt), now you just need to figure > out why your Line_2 phone is answering and then hanging up immediately > (or why Asterisk thinks it is). > > I'd recommend sniffing the network traffic with Wire Shark and turning > on some of the debug options in Asterisk to hunt down if it's the phone > or an Asterisk quirk that is tripping up the system. We'll need more > debug and error text to go any further with the Line_2 problem, unless > someone much better than me can chime in with an idea... I presume > you've already done the simple stuff like make sure your network is > solid and that the phone firmware is up to date and stable. > > I'll also take a moment as an aside to suggest that you move away from > numerical device and user names for SIP and move to text based names > which have local meaning. The numerical names are easy to be hacked, as > bad-guys scripts easily walk the possibilities sequentially. I find it > also helps to use extension names in the dial plan that have meaning so > that I can keep track of them. When a user calls an extension, the > number they enter can feature a "Goto" with a text entry in the dial > plan. This makes it harder for those at a phone to go places in your > phone system they shouldn't. > > -Tim > > On Mon, May 8, 2017 at 4:51 PM, <the...@sys-concept.com > <mailto:the...@sys-concept.com>> wrote: > > On 05/08/2017 04:37 PM, Tim S wrote: > > The "error" I was talking about was in your log: > > > > "...== Spawn extension (extensions, 4, 3) exited non-zero on > > 'IAX2/home_server-6364'..." > > > > The call terminated here in a error which prevented the dialplan from > > continuing. Something there is broken, my recommendation is to check > > you registrations first inside asterisk: > > > >> sip show peers > > "sip show peers" is showing FD_L2 (SIP/54 is registered) > Name/username Host > Dyn Forcerport Comedia ACL Port Status Description > 12 (Unspecified) > D No No 0 Unmonitored > 4/4 10.10.0.8 > D No No 5060 Unmonitored > 54/54 10.10.0.15 > D No No 5060 Unmonitored > > > Something wasn't "happy" about SIP/54 in your system when Asterisk > tried > > talking to it. > > > > So you tried this: > > > > "... > > Even when I put: > > exten => 4,n,GotoIf($["${DIALSTATUS}"="BUSY"]?line2) > > exten => 4,n(line2),Dial(${FD_L2},20,trw) > > exten => 4,n(line2),Voicemail(4) > > ..." > > > > What that will do is go to the first instance of "4,n(line2)", > which is > > the line that seems to be triggering the channel failure. If you have > > the Asterisk console open, I'll bet you see it spew some errors > when you > > try that extension routine. > > > > Asterisk dial plans are a serial processes, the first line that > Asterisk > > comes across that meets the matching for a given extension and > label is > > what it will run first. What you have is two lines that will > match both > > extension and label - that's not really good form. > > > > My dial plan suggestion from last night would result in the > functionality: > > > > Ring extension 4/Line_1, timeout 25 seconds --> if not busy then > > voicemail, else ring extension 4/Line_2, timeout 20 seconds --> > voicemail. > > > > > > Again, I think you have two problems, and the bigger one is > causing the > > annoying unexpected behavior in your dial plan > > > > Try doing the extension 4 without the Line_1 and see what happens: > > > > "... > > exten => 4,1,Dial(${FD_L2},20,trw) > > exten => 4,n(vmail),Voicemail(4) > > exten => 4,n,Hangup() > > ..." > > I have tired the above plan with small change 4,n,Voicemail(4) (as > there is no gotoif statement) > So: > exten => 4,1,Dial(${FD_L2},20,trw) > exten => 4,n,Voicemail(4) > exten => 4,n,Hangup() > > Line 2 is ring OK, and if nobody pickup the phone it goes to > "Voicemail(4)" so this part is working; there were no errors on the > command line. > > [snip] > > But I've tired it again, this dialplan) as before and you are > correct something is wrong but command line is not showing any errors: > > exten => 4,1,Dial(${FD_L1},25,trw) > exten => 4,n,GotoIf($["${DIALSTATUS}"="BUSY"]?line2:) > exten => 4,n(line2),Dial(${FD_L2},20,rw) > exten => 4,n,Voicemail(4) > exten => 4,n,Hangup() > > I've tried: > exten => 4,n,GotoIf($["${DIALSTATUS}"="BUSY"]?line2) > exten => 4,n,GotoIf($["${DIALSTATUS}"="BUSY"]?line2:) > exten => 4,n,GotoIf($["${DIALSTATUS}"="BUSY"]?:line2) > > And I get: > > -- Called SIP/4 > -- SIP/4-00000306 is ringing > -- Nobody picked up in 25000 ms > -- Executing [4@extensions:2] GotoIf("IAX2/home_server-435", > "0?line2:") in new stack > -- Executing [4@extensions:3] Dial("IAX2/home_server-435", > "SIP/54,20,rw") in new stack > == Using SIP RTP CoS mark 5 > -- Called SIP/54 > -- SIP/54-00000307 is ringing > == Spawn extension (extensions, 4, 3) exited non-zero on > 'IAX2/home_server-435' > -- Hungup 'IAX2/home_server-435' > > So FD_L1 (exten: 4) is ringing for 25sec.; nobody pickup the phone > and command line is showing it goes to: FD_L2 (SIP/54) > -- SIP/54-00000307 is ringing > > but in reality FD_L2 (SIP/54) is not ringing at all, it should ring > line_2 for 20sec and go to Voicemail but as soon as it prints line: > -- SIP/54-00000307 is ringing > > it hangs up the phone. > > -- > Thelma > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > Check out the new Asterisk community forum at: > https://community.asterisk.org/ <https://community.asterisk.org/> > > New to Asterisk? Start here: > https://wiki.asterisk.org/wiki/display/AST/Getting+Started > <https://wiki.asterisk.org/wiki/display/AST/Getting+Started> > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > <http://lists.digium.com/mailman/listinfo/asterisk-users> > > > > -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users