[Freeswitch-users] How to detect DTMF and generate an event?

Michael Collins msc at freeswitch.org
Wed Oct 22 03:32:55 MSD 2014


In this case I believe that ${last_matching_digits} is empty at the time
the bind_digit_action is executed. I would suggest that instead of
executing the log app you instead create a new dialplan context and then
use the execute_extension app. Execute the extension in your new context
(so that you don't have to parse through your main dialplan context) that
performs the log app and it should evaluate ${last_matching_digits} fresh.

Let us know how that goes.

-MC


On Tue, Oct 21, 2014 at 10:31 AM, Szeto, Steven <steven_szeto at mitel.com>
wrote:

> As Michael suggested, I have tried the bind_digit_action application.
>
> To display a DTMF keystroke in the logs, I added this action to my dial
> plan:
>
> <action application="bind_digit_action"
> data="my_digits,~^\d+,exec:log,INFO DTMF digits detected
> ${last_matching_digits};;my UUID is ${uuid}"/>
>
> I get logs that look like this:
>
> Info: 2014-Oct-20 13:55:01.250   Received Freeswitch EventName: [[LOG,
> INFO DTMF digits detected ;;my UUID is
> 6b29cba9-64e4-481d-af56-7a218714d460]] - CallId:
> [6b29cba9-64e4-481d-af56-7a218714d460] ()
>
> Notice that the ${last_matching_digits} variable is always blank.
>
> Is there another variable that I can use to display the detected DTMF digits?
> Is this a bug that needs to be raised & fixed?
>
> On Thu, Oct 16, 2014 at 9:15 PM, Michael Collins <msc at freeswitch.org>
> wrote:
>
>> I believe bind_digit_action (BDA) will do what you need. I think the
>> trick for you is to specify the detection leg and the action leg, that is,
>> where does BDA listen for a DTMF (self, peer, both) and where does it
>> execute the action (again on self, peer, or both).
>>
>> There are some examples here:
>> https://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_bind_digit_action
>>
>> However, I recommend you set up some simple call bridges where you
>> explicitly set the detect and event action legs differently so that you can
>> see it first hand. Once you have it working in simple cases, like pressing
>> a digit executing a dp app log, then you can move on to more interesting
>> endeavors. It's been a while, but I recall doing stuff like setting various
>> targets on various legs that printed log lines to the console, kinda like,
>> "Hey, this should be on the b-leg! UUID is '${uuid}'"
>>
>> Let us know how it goes.
>>
>> -MC
>>
>>
>> On Thu, Oct 16, 2014 at 2:08 PM, Szeto, Steven <steven_szeto at mitel.com>
>> wrote:
>>
>>> If I establish a call between two registered endpoints, and then press a
>>> DTMF key, I can see a DTMF key press event from the originator's call id:
>>>
>>> Freeswitch EventName: [[EVENT-NAME, DTMF]] - CallId:
>>> [694eb613-6b97-4197-a951-5288066ffbf5] ()
>>>
>>> GenerateDTMFEvent - CallID: [694eb613-6b97-4197-a951-5288066ffbf5] -
>>> TimeStamp: [10/17/2014 01:03:34.993 AM] - DTMF: [5] ()
>>>
>>>
>>> How can I get equivalent DTMF events on the terminator's call id? I hear
>>> the DTMF key on the phone, but I need to process the keystroke in my own
>>> application.
>>>
>>> Can the bind_digit_action application do what I need? If so, can I
>>> please get an example?
>>>
>>> --
>>>
>>> Regards,
>>>
>>> Steve Szeto
>>> *MiContact Center IVR Team*
>>> Software Design
>>>
>>> *Phone:613-592-2122 <613-592-2122>*
>>> Mobile:
>>>
>>>
>>>
>>> *Mitel*
>>> 350 Legget Drive,
>>> Kanata, Ontario, K2K 2W7, Canada
>>>
>>> mitel.com
>>> steven.szeto at mitel.com
>>>
>>> [image: Facebook] <http://www.facebook.com/mitel.networks>[image:
>>> Twitter] <http://www.twitter.com/Mitel>[image: Google Plus]
>>> <http://plus.google.com/+mitel>[image: Linkedin]
>>> <http://www.linkedin.com/company/mitel>
>>>
>>> This e-mail (including any attachments) is for the sole use of the
>>> intended recipient(s) and may contain information that is confidential
>>> and/or protected by legal privilege. Any unauthorized review, use, copy,
>>> disclosure or distribution of this e-mail is strictly prohibited. If you
>>> are not the intended recipient, please notify Mitel immediately and destroy
>>> all copies of this e-mail.  Mitel does not accept any liability for breach
>>> of security, error or virus that may result from the transmission of this
>>> message.
>>> _________________________________________________________________________
>>> Professional FreeSWITCH Consulting Services:
>>> consulting at freeswitch.org
>>> http://www.freeswitchsolutions.com
>>>
>>> Official FreeSWITCH Sites
>>> http://www.freeswitch.org
>>> http://confluence.freeswitch.org
>>> http://www.cluecon.com
>>>
>>> 
>>> 
>>>
>>> FreeSWITCH-users mailing list
>>> FreeSWITCH-users at lists.freeswitch.org
>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>> http://www.freeswitch.org
>>>
>>
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://confluence.freeswitch.org
>> http://www.cluecon.com
>>
>> 
>> 
>>
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>>
>
>
>
> --
>
> Regards,
>
> Steve Szeto
> *MiContact Center IVR Team*
> Software Design
>
> *Phone:613-592-2122 <613-592-2122>*
> Mobile:
>
>
>
> *Mitel*
> 350 Legget Drive,
> Kanata, Ontario, K2K 2W7, Canada
>
> mitel.com
> steven.szeto at mitel.com
>
> [image: Facebook] <http://www.facebook.com/mitel.networks>[image: Twitter]
> <http://www.twitter.com/Mitel>[image: Google Plus]
> <http://plus.google.com/+mitel>[image: Linkedin]
> <http://www.linkedin.com/company/mitel>
>
> This e-mail (including any attachments) is for the sole use of the
> intended recipient(s) and may contain information that is confidential
> and/or protected by legal privilege. Any unauthorized review, use, copy,
> disclosure or distribution of this e-mail is strictly prohibited. If you
> are not the intended recipient, please notify Mitel immediately and destroy
> all copies of this e-mail.  Mitel does not accept any liability for breach
> of security, error or virus that may result from the transmission of this
> message.
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
>
> 
> 
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20141021/985ebb11/attachment.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list