[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 11:03:04 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 11:03 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
======================================================================
----------------------------------------------------------------------
chappell - 07-19-07 11:03
----------------------------------------------------------------------
I think the file upload system may be a little buggy. One file was visible
and the other not. There was no indication that this was deliberate.
I will correct the problems which you have identified and resubmit.
About the auto-jumping: You are right of course, but I may have a simpler
way to do it. ReadExten() was created by hacking Background(). I intend
it to act like Background() in the sense that it collects digits and tests
them against a specified extension, but unlike Background() it should leave
the jumping to the caller. I am not sure we need READEXTENSTATUS since we
already have a variable for returning the result. Why not return "i" for
invalid and "t" for timeout. That way the sequence:
exten => s,n,ReadExten(number,dial-extension,target-context)
exten => s,n,Goto(target-context,${number},1)
does exactly the same thing as:
exten => s,n,Background(dial-extension,,,target-context)
In other words, ReadExten() would return the extension to which
Background() would have jumped. This may be a special extension.
Issue History
Date Modified Username Field Change
======================================================================
07-19-07 11:03 chappell Note Added: 0067593
======================================================================
More information about the asterisk-bugs
mailing list