[Asterisk-bugs] [Asterisk 0010082]: Application and function to determine existence of extensions but not jump to it yet

noreply at bugs.digium.com noreply at bugs.digium.com
Thu Jul 19 16:52:38 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=10082 
====================================================================== 
Reported By:                chappell
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   10082
Category:                   Applications/General
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     new
Asterisk Version:            SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  1.4  
SVN Revision (number only!): 59300 
Disclaimer on File?:        Yes 
Request Review:              
====================================================================== 
Date Submitted:             06-28-2007 12:05 CDT
Last Modified:              07-19-2007 16:52 CDT
====================================================================== 
Summary:                    Application and function to determine existence of
extensions but not jump to it yet
Description: 
Attached are a new dialplan command (application) and a new dialplan
function.

The command ReadExten works much like Read.  However, instead of simply
accepting digits until an inter-digit time runs out, it tests the dialed
digits against a specified context and returns when it determines that a
number valid in that context has been dialed.

The function ISEXTEN determines whether a given context, extension, and
priority exist or not.

We use this new features in a calling-card IVR.  It invites the caller to
dial a number.  When a valid number is detected, it plays "connecting..."
and jumps to the context, like so:

[ivr-system-access]
exten => s,1,Answer

; Let the user dial a number in this context.
exten =>
s,n(repeat),ReadExten(number,custom/system-access-dial-extension,,n)
exten => s,n,GotoIf(${ISNULL(${number})}?i,1)

; Dispatch non-extension menu items.
exten => s,n,GotoIf(${ISEXTEN(phones,${number})}?:phones,${number},1)

; Put thru call to the dialed extension.
exten => s,n,Verbose(2,${CALLERID(all)} (${CDR(accountcode)}) dialed
${number})
exten => s,n,Background(custom/system-access-connecting,noanswer)
exten => s,n,Dial(Local/${number}@ivr-system-access-extensions/n,,Hg)

; Call ended.  Go bad so that the user can dial again.
exten => s,n,Verbose(2,${CALLERID(all)} (${CDR(accountcode)}) ended call
to ${number})
exten => s,n,Goto(s,begin)

exten => 1,1,Playback(option-one)
exten => 1,n,Hangup

exten => i,1,Playback(custom/system-access-invalid-extension)
exten => i,n,Goto(s,repeat)

include => phones


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

---------------------------------------------------------------------- 
 Corydon76 - 07-19-07 16:52  
---------------------------------------------------------------------- 
While that sounds very clever, I think we'd prefer if you set a status
variable.

If you did go ahead and set the variable to the strings 't' or 'i' anyway
(which you're certainly welcome to do, in addition to setting a status
variable), you should also set INVALID_EXTEN to the extension entered. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
07-19-07 16:52  Corydon76      Note Added: 0067611                          
======================================================================




More information about the asterisk-bugs mailing list