[asterisk-users] Re: why executed Hangup doesn't exit DialPlan?look my dialplan...

Tony Mountifield tony at softins.clara.co.uk
Tue Sep 5 03:09:39 MST 2006


In article <116fd70d0609050232s6a4515cav2da761ce776b1231 at mail.gmail.com>,
Marco Mouta <marco.mouta at gmail.com> wrote:
> 
> I've solved the problem, but still not understanding very well why do i need
> it:
> 
> I've inserted inside [ext-did-custom]
> exten=>h,1,hangup
> 
> Why do i need this? this is not usually used to run something after an
> hangupcall?
> thks!

Your problem is this line:

exten => _.,1,Goto(s,1)         ; catch-all matching for calls that have DID info (if a DID route hasn't matched them)

The pattern _. will match absolutely anything, and so when the line hangs up,
and Asterisk looks for the 'h' extension, it finds _. which matches, and does
the goto back to 's'!!!

You should never use _. as a pattern. If you want to match any NUMBER, you can
do _X. to match two or more digits, and if you also want to match a single
digit you add a second line with _X as the extension.

Using X ensures that the pattern won't match any of the special non-numeric
extensions like h, i, t and so on.

Hope this helps.

Cheers
Tony

> On 9/5/06, Marco Mouta <marco.mouta at gmail.com> wrote:
> >
> > Hi all,
> >
> > I think i'm missing something very very basic! I want my calls with DID
> > 48XX (From pstn E1 TE110P) to be answered then playback a file and hangup.
> >
> > Part of my extensions.conf where from-pstn is the context for all calls
> > from pstn line is:
> >
> > [from-pstn]
> > include => from-pstn-custom                     ; create this context in
> > extensions_custom.conf to include customizations
> > include => ext-did-custom
> > include => from-pstn-timecheck          ; this has to be included
> > otherwise it overrides ext-did
> > exten => fax,1,Goto(ext-fax,in_fax,1)
> >
> >
> > [ext-did-custom]
> > exten => _48XX,1,Answer
> > exten => _48XX,n,SetVar(FROM_DID=${EXTEN})
> > exten => _48XX,n,Playback(vm-goodbye)
> > exten => _48XX,n,Hangup
> >
> > [from-pstn-timecheck]
> > exten => _.,1,Goto(s,1)         ; catch-all matching for calls that have
> > DID info (if a DID route hasn't matched them)
> > exten => s,1,GotoIf($[${IN_OVERRIDE} =
> > forcereghours]?from-pstn-reghours,s,1:)
> > exten => s,2,GotoIf($[${IN_OVERRIDE} =
> > forceafthours]?from-pstn-afthours,s,1:)
> > exten => s,3,GotoIfTime(${REGTIME}|${REGDAYS}|*|*?from-pstn-reghours,s,1:)
> > exten => s,4,Goto(from-pstn-afthours,s,1)
> >
> >
> > Problem, look my Asterisk CLI :
> >
> >   -- Accepting call from '2132' to '4888' on channel 0/1, span 1
> >     -- Executing Answer("Zap/1-1", "") in new stack
> >     -- Executing SetVar("Zap/1-1", "FROM_DID=4888") in new stack
> >     -- Executing Playback("Zap/1-1", "vm-goodbye") in new stack
> >     -- Playing 'vm-goodbye' (language 'pt')
> >     -- Executing Hangup("Zap/1-1", "") in new stack
> >   == Spawn extension (from-pstn, 4888, 4) exited non-zero on 'Zap/1-1'
> >     -- Executing Goto("Zap/1-1", "s|1") in new stack
> >     -- Goto (from-pstn,s,1)
> >     -- Executing GotoIf("Zap/1-1", "1?from-pstn-reghours|s|1:") in new
> > stack
> >     -- Goto (from-pstn-reghours,s,1)
> >     -- Executing GotoIf("Zap/1-1", "0?from-pstn-reghours-nofax|s|1:2") in
> > new stack
> >     -- Goto (from-pstn-reghours,s,2)
> >     -- Executing Answer("Zap/1-1", "") in new stack
> >     -- Executing PlayTones("Zap/1-1", "ring") in new stack
> >     -- Executing NVFaxDetect("Zap/1-1", "8") in new stack
> >     -- Channel 0/1, span 1 got hangup request
> >
> > After the hangup the call seems to keep executing Dialplan.... why?? Does
> > this is related with autofallback option in globals???
> >
> > Why Hangup didn't exit dialplan?
> >
> > Hope some one can help me.
> >
> > --
> > Com os melhores cumprimentos,
> >
> > Marco Mouta
> >
> 
> 
> 
> -- 
> Com os melhores cumprimentos,
> 
> Marco Mouta
> 
> -=-=-=-=-=-
> [Alternative: text/html]
> -=-=-=-=-=-
> -=-=-=-=-=-
> 
> _______________________________________________
> --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
> 
> -=-=-=-=-=-


-- 
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org



More information about the asterisk-users mailing list