Link to home
Start Free TrialLog in
Avatar of THEROMPSTER2000
THEROMPSTER2000

asked on

Asterisk DTMF Read digits and dial.

I need to create a listener for asterisk.  Basically, only during an active call, the agent can transfer to a predefined number by pressing * or # or any
DTMF tone.

Basically if during a call the agent presses * it will transfer them to a specific number i have predefined.

What i have so far is in the code box.

I would assume it would be something like :
exten => 10,1,Read(digit,,1)
exten => if digit is * then dial (SIP/context/number)

i just dont know the syntax.
exten => 100,1,Read(digit,,1)
exten => 100,2,Dial(${digit})

Open in new window

Avatar of tkalchev
tkalchev
Flag of Germany image

MAybe something like this :

exten => 10,1,Answer()
exten => 10,n,Read(DIALEDDIGIT||1)
exten => 10,n,GotoIf("${DIALEDDIGIT}" = "*"?dialmy,1)

exten => dialmy,1,Dial(SIP/context/number)
ASKER CERTIFIED SOLUTION
Avatar of Member_2_1968385
Member_2_1968385
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of THEROMPSTER2000
THEROMPSTER2000

ASKER

Ok this is what i have in features.conf

transferdigittimeout => 6
[featuremap]
blindxfer=##
atxfer=*2
automon=*1
disconnect=**

how can i do what you mean with the transfer_context, where would i do that?
First, you would need to create a new context in the dial plan. Call it, say, [mytransfers]

Then you would set the transfer_context in a step just before the Dial command that sets up the original call. For example:
exten => 123,n,Set(__TRANSFER_CONTEXT=mytransfers)
exten => 123,n,Dial(...,t)

While the call is active, the execution of the steps in your dial plan is effectively paused, waiting for the Dial command to complete (i.e. it won't return from the Dial command and execute more steps if the call has been established successfully). However, if a caller presses ## or *2 your dial plan should resume execution in the context [mytransfers]. If you want the trigger to be a single key press then edit the blindxfer or atxfer parameters in features.conf.
Thank you very much your answer guided me in the right direction.