[Asterisk-Users] Cllecting digits.

Ing. Angel Gomez Garcia angom at telnor.net
Sat Jul 5 16:21:32 MST 2003


    It did work, here how  i did it, just in case.

[validateuser]
exten => s,1,SetVar(Attempts=0)
exten => s,2,DigitTimeout(5)            ; Set Digit Timeout to 5 seconds
exten => s,3,ResponseTimeout(10)        ; Set Response Timeout to 10 seconds
exten => s,4,SetVar(NExten=s1)
exten => s,5,SetVar(NPriority=1)
exten => s,6,SetVar(Exten=s)
exten => s,7,SetVar(Priority=9)
exten => s,8,Answer
exten => s,9,BackGround(extension)

exten => s1,1,SetVar(NExten=s2)
exten => s1,2,SetVar(NPriority=1)
exten => s1,3,SetVar(Exten=s1)
exten => s1,4,SetVar(Priority=6)
exten => s1,5,SetVar(MSExten=${Value})
exten => s1,6,BackGround(password)

exten => s2,1,SetVar(NExten=s1)
exten => s2,2,SetVar(NPriority=1)
exten => s2,3,SetVar(Exten=s)
exten => s2,4,SetVar(Priority=9)
exten => s2,5,SetVar(MSPassword=${Value})
exten => s2,6,AGI(validateuser.tcl)

exten => _X,1,SetVar(Value=${EXTEN})
exten => _X,2,Goto(validateuser,${NExten},${NPriority})

exten => _X.,1,SetVar(Value=${EXTEN})
exten => _X.,2,Goto(validateuser,${NExten},${NPriority})

exten => t,1,SetVar(Attempts=$[${Attempts} + 1])
exten => t,2,GotoIf($[${Attempts} = 2]?8:3)
exten => t,3,Goto(validateuser,${Exten},${Priority})
exten => t,8,BackGround(accessdenied)
exten => t,9,Goto(default,s,1)



Steven Critchfield wrote:

>On Sat, 2003-07-05 at 05:43, Ing. Angel Gomez Garcia wrote:
>  
>
>>    Thank's
>>
>>    Mmmmhhhh. that example assumes that you are making the change to 
>>call-transfer dialing from your extension, what if you are away, even 
>>away from the office and you want to transfer all the calls to the phone 
>>where you're at ?
>>
>>    But I agree, I think it can be done with pattern matching, altough 
>>its going to be a 'messy' solution.
>>    
>>
>
>You don't need to use AGI if you are willing to use postgres or the db
>functions. On my system, we have a postgres table that we can remap our
>oncall phone number. Of course we use a web page to change the number,
>but it could easily be done from extension.
>
>An option you might want to think about, is having your users call from
>the phone they want it to be transfered to, and then use the callerid
>number to do the forward to. Then you don't have to worry about user
>miskeying.
>
>If you are insterested in still having the user key in the data, you
>probably want to go all AGI then where you can do several more
>interesting things with data collection.
>
>
>  
>
>>Brancaleoni Matteo wrote:
>>
>>    
>>
>>>basically, you need to do call transfer, right?
>>>why not using pattern matching?
>>>When your user wants to change is def. exten, it will
>>>be dropped in a submenu (ie another context) with pattern matching.
>>>      
>>>
>>>from here you could match a number and store it in a db.
>>    
>>
>>>see http://www.junghanns.net/asterisk/page6.html
>>>(the great capigod asterisk page)
>>>
>>>Matteo.
>>>
>>>Il sab, 2003-07-05 alle 12:00, Ing. Angel Gomez Garcia ha scritto:
>>> 
>>>
>>>      
>>>
>>>>   Hi all.
>>>>
>>>>   Is there a way to collect the digits dialled in asterisk and stored 
>>>>them in a variable ? I'm setting a submenu for the user to change his 
>>>>extension dial in treatment from a standard extension to something like 
>>>>'automatic transfer' and I need to ask for the number where to transfer 
>>>>the calls, pass it to an AGI and store it in a DB for later use.
>>>>
>>>>   I also need to ask the user for his extension/password to validate 
>>>>it before making the change.
>>>>
>>>>   Thank's in advance for any help.
>>>>
>>>>
>>>>_______________________________________________
>>>>Asterisk-Users mailing list
>>>>Asterisk-Users at lists.digium.com
>>>>http://lists.digium.com/mailman/listinfo/asterisk-users
>>>>   
>>>>
>>>>        
>>>>
>>>_______________________________________________
>>>Asterisk-Users mailing list
>>>Asterisk-Users at lists.digium.com
>>>http://lists.digium.com/mailman/listinfo/asterisk-users
>>>
>>> 
>>>
>>>      
>>>
>>_______________________________________________
>>Asterisk-Users mailing list
>>Asterisk-Users at lists.digium.com
>>http://lists.digium.com/mailman/listinfo/asterisk-users
>>    
>>





More information about the asterisk-users mailing list