Robert DeVries
2007-Feb-08 14:08 UTC
[asterisk-users] Any Way to Get # Functionality in DISA
When using a SIP phone with Asterisk, hitting the # key (pound or hash depending on where in the world you happen to be) tells Asterisk that there are no more digits coming, and to put the call through immediately based on the digits already entered. This is the same functionality as the PSTN (at least in North America). However, DISA just sees the # as another digit, and therefore pressing # produces an error. I suppose it would be possible to write something in the dial plan that looks for a # then strips the # and puts the call through, but I'm curious if there is any other way to do this. For one thing, this would require having a special context for DISA, rather than just having DISA place calls through an existing context. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070208/35f50609/attachment.htm
>From: "Robert DeVries" <rdlists@gmail.com> >Date: Thu, 8 Feb 2007 13:09:06 -0800 > >When using a SIP phone with Asterisk, hitting the # key (pound or hash >depending on where in the world you happen to be) tells Asterisk that there >are no more digits coming, and to put the call through immediately based on >the digits already entered. This is the same functionality as the PSTN (at >least in North America).Not quite. This behaviour is more than likely a configurable feature in a hard SIP phone. (At least in my GrandStream it is.) When you dial into PSTN, it doesn't matter what else you punch after matching the dial plans your telco configured at their end (NANP in North America, usually 7- and 10-digit; cell phones do 9-digit because there is no concept of "dial", only "send"). # is used as a customary terminator only in some IVR systems. (Banking, calling card, ...)>However, DISA just sees the # as another digit, and therefore pressing # >produces an error. I suppose it would be possible to write something in >the dial plan that looks for a # then strips the # and puts the call >through, but I'm curious if there is any other way to do this. For one >thing, this would require having a special context for DISA, rather than >just having DISA place calls through an existing context.Not necessarily. You only have to program your existing context to handle trailing # when it comes along. For example, this simplistic example ignores trailing #'s: exten => _Z., 1, GotoIf($[${EXTEN:-1} = #]?${EXTEN:1},1:2) exten => _Z., 2, whatever... You can use regular expressions to do more sophisticated handling. Note this example will not emulate a common IVR convention of stop reading when # is pressed; that one is implemented in Read(). You'll have to decide whether Read() is more appropriate for your application. (Read() will force users to press #, I think.) Hope this helps. Yuan Liu