[asterisk-dev] Strange behaviour of Incomplete() application

Tilghman Lesher tlesher at digium.com
Thu Sep 10 16:33:33 CDT 2009


On Thursday 10 September 2009 15:56:33 Pavel Troller wrote:
>   I'm trying to create universal dialplan, capable of handling any
> combination of en-bloc/overlapped dialling (for channels, which support it,
> like DAHDI/PRI or SS7). I'm trying to utilize the Incomplete() application,
> but I cannot find, how it's exactly working.
>   In a context, I have a "last choice catcher", in principle like this:
> exten => _!,1,Incomplete(n). It triggers for every digit string, which is
> not matched by more specific match.
>   A part of my dialplan looks like this:
> [ Context 'subscribers_22' created by 'pbx_config' ]
>   '2200' =>         1. Answer()                                  
> [pbx_config] 2. Disa(no-password,default-ovlp)             [pbx_config]
> '2220' =>         1. Macro(stdext,SIP/2220)                    
> [pbx_config] '2229' =>         1. Macro(faxext)                            
>  [pbx_config] '2234' =>         1. Progress()                              
>   [pbx_config] 2. Set(VOLUME(TX)=6)                          [pbx_config]
> 3. MP3Player(/opt/asterisk/var/mp3/sacred_spirit_11.mp3) [pbx_config] 4.
> Hangup()                                   [pbx_config] '2244' =>        
> 1. System(/opt/asterisk/bin/callback LOCAL/${CALLERID(num)}) [pbx_config]
> 2. Hangup(17)                                 [pbx_config] '2252' =>       
>  1. Macro(stdext,IAX2/testomt/2252)            [pbx_config] '2290' =>      
>   1. Goto(volmet,s,1)                           [pbx_config] '_220[2-9]' =>
>    1. Macro(stdext,SIP/pcsoft/${EXTEN:2})        [pbx_config] '_222[1-8]'
> =>    1. Macro(answer_with_star,Local/aws${EXTEN})  [pbx_config] '_22XX' =>
>        1. Macro(stdext,DAHDI/g1/${EXTEN})            [pbx_config]
>
>   This subcontext is included to the context containing the "last choice
> catcher". And now, finally, my question:
>
> When the dialplan is entered with dial string of 224, the following occurs:
>     -- Executing [224 at default-ovlp:1] Incomplete("SIP/2112-086b4d60", "n")
> in new stack == Spawn extension (default-ovlp, 224, 1) exited INCOMPLETE on
> 'SIP/2112-086b4d60' == CDR updated on SIP/2112-086b4d60
>     -- Executing [2244 at default-ovlp:1] System("SIP/2112-086b4d60",
> "/opt/asterisk/bin/callback LOCAL/2112") in new stack You can see that the
> digit 4 was dialed in overlap mode and that the extension 2244 was properly
> executed.
>
> And now, let's try it with the initial string of 225:
>     -- Executing [225 at default-ovlp:1] Incomplete("SIP/2112-086b4d60", "n")
> in new stack == Spawn extension (default-ovlp, 225, 1) exited INCOMPLETE on
> 'SIP/2112-086b4d60' -- Sent into invalid extension '225' in context
> 'default-ovlp' on SIP/2112-086b4d60 -- Executing [i at default-ovlp:1]
> Goto("SIP/2112-086b4d60", "default,225,1") in new stack
>
>   As you can see, Incomplete() is called exactly as in the previous
> example, but it immediately terminates processing, stating that extension
> 225 is invalid and activating the "i" extension. There is no possibility to
> enter any digits, the Incomplete() app immediately quits.
>   I really cannot find, where is the difference. In both cases, exactly one
> 4-digit extension exists (2244, 2252) but the first case works and the
> second doesn't.
>   Any help ? Or is it a bug ? It's on asterisk-1.6.1.6.

I have a suspicion that you aren't showing us your entire dialplan, given that
your dialplan output doesn't match your dialplan.  In any case, if the
dialplan detects that there's only one extension that could match (i.e. that
matchmore returns false), then the invalid extension "i" is triggered.  That's
probably what is happening here, although with your incomplete dialplan, we
cannot show you why it is the case.

-- 
Tilghman Lesher
Digium, Inc. | Senior Software Developer
twitter: Corydon76 | IRC: Corydon76-dig (Freenode)
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list