[asterisk-users] extensions ending with "#"...

flux at hotbox.ru flux at hotbox.ru
Thu Feb 5 23:58:11 CST 2009


flux at hotbox.ru wrote:
> Benoit wrote:
>> flux at hotbox.ru a écrit :
>>> Hi everyone!
>>>
>>> I've set up asterisk ip-pbx to implement IVR menu and encountered such a 
>>> problem: when users dial the destinaion phone number and end it up with 
>>> "#" asterisk still waits until timeout in WaitExten() is reached.
>>>   
>> Well i don't see anything in the doc implying that the pound key should 
>> terminate the WaitExten timeout,
>> however this is the case for Read() but it's not the same use
>>> // Here comes the context where user is prompted for a dest. number:
>>> context ivr-dialout {
>>>      s => {
>>> 	Background(enter-your-dest-number);
>>>          WaitExten(15);
>>>      };
>>>
>>>      _X. => {
>>>          Dial(SIP/${EXTEN});
>>>          Hangup;
>>>      };
>>>
>>> How should I avoid this behavior and force asterisk not to wait for 15 
>>> seconds everytime and proceed dialing immediatly after pound key is 
>>> pressed? Any suggestions would be appreciated.
>>>   
>> Maybe a extension pattern like that:
>>         _X.# =>
>> This would help asterisk know that they he has a full extension match 
>> when reach the pound sign
>>
> 
> Actually _X.# won't work, bacause this pattern will match any number. 
> "#" at the end of the pattern won't make sense. I've tried. So the thing 
> is I had to create an external application to handle numbers with "#" 
> and without "#" to issue a correct dial.
> 
>      _X. => {
>          AGI(parseExten.agi);
>          if(${AGISTATUS} = SUCCESS) {
>              Dial(SIP/${EXTEN});
>              Hangup;
>          }
>          Dial(SIP/${EXTEN:0:-1});
>          Hangup;
>      };
> 
> parseExten.agi in my case returns SUCCESS when a user didn't append "#" 
> and FAILURE when there's "#" symbol. If FAILURE is returned I get rid of 
> ending "#" and perform Dial().
> AFAICS asterisk can't handle immediate dialing after a pound key is 
> pressed. The extension _X.[#]! that would perform this function doesn't 
> work.
> 
> Watch this:
> http://www.mail-archive.com/asterisk-dev@lists.digium.com/msg28135.html
> 
>> Or use Read() instead

I've tried to use Read() function just like you said, Benoit.

context ivr-dialout {
     s => {

Read(dest-num,prepaid-enter-dest,16);
Dial(SIP/${dest-num})

It works now and I don't need any external app to handle # now. Thank 
you very much.


>>> Thank you.
>>>   
>> Your welcome
>>
>> _______________________________________________
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>    http://lists.digium.com/mailman/listinfo/asterisk-users
>>
>>
>>
>>
>>
>>
> 
> 
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> 
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
> 
> 
> 
> 
> 
> 




More information about the asterisk-users mailing list