Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] schedule a DTMF tone into bridge


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
brian at freeswitch.org
Guest





PostPosted: Fri Dec 12, 2008 6:56 pm    Post subject: [Freeswitch-users] schedule a DTMF tone into bridge Reply with quote

sched_api (hint uuid_send_dtmf)


API CALL [sched_api()] output:
-ERR Invalid syntax. USAGE: [+@]<time> <group_name> <command_string>




/b


On Dec 12, 2008, at 5:51 PM, Frank @ Impact wrote:
Quote:
Is there a way to schedule a certain DTMF tone to be played into a bridge (both a and b legs) after a scheduled number of seconds into the call?

_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

Back to top
frank at impactfax.com
Guest





PostPosted: Fri Dec 12, 2008 6:58 pm    Post subject: [Freeswitch-users] schedule a DTMF tone into bridge Reply with quote

Is there a way to schedule a certain DTMF tone to be played into a bridge (both a and b legs) after a scheduled number of seconds into the call?
Back to top
frank at impactfax.com
Guest





PostPosted: Fri Dec 12, 2008 10:45 pm    Post subject: [Freeswitch-users] schedule a DTMF tone into bridge Reply with quote

Not much written in the wiki on this. Also searched the list and not much on either sched_api or uuid_send_dtmf.
So from an xml dialplan, can sched_api as an application?
Is there any way to have the time offset reference the point at which the call started ? ie. When the called party answers?

Ultimately, I was trying to insert some xml into my dial plan that would play a dtmf tone 10 seconds after the called party picked up the phone. But from the little that has been written so far that I can find, it is not clear to me how to piece this together. Am I being dense and missing anything that has already been written?

/f
-----Original Message-----
From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Brian West <![if !supportLineBreakNewLine]> <![endif]>
sched_api (hint uuid_send_dtmf)


API CALL [sched_api()] output:

-ERR Invalid syntax. USAGE: [+@]<time> <group_name> <command_string>





/b



On Dec 12, 2008, at 5:51 PM, Frank @ Impact wrote:

<![if !supportLineBreakNewLine]> <![endif]>
Is there a way to schedule a certain DTMF tone to be played into a bridge (both a and b legs) after a scheduled number of seconds into the call?


_______________________________________________
Back to top
msc at freeswitch.org
Guest





PostPosted: Fri Dec 12, 2008 11:24 pm    Post subject: [Freeswitch-users] schedule a DTMF tone into bridge Reply with quote

Frank,

I'm sure this is possible. Please give me a little bit to look into
this. I'm going to see if I can lab it up and give you a sample
dialplan. Also, thanks for the heads up on the wiki not having this
information. I will put that on my not-so-short wiki todo list.

Thanks,
MC

On Fri, Dec 12, 2008 at 7:37 PM, Frank @ Impact <frank@impactfax.com> wrote:
Quote:
Not much written in the wiki on this. Also searched the list and not much
on either sched_api or uuid_send_dtmf.

So from an xml dialplan, can sched_api as an application?

Is there any way to have the time offset reference the point at which the
call started ? ie. When the called party answers?



Ultimately, I was trying to insert some xml into my dial plan that would
play a dtmf tone 10 seconds after the called party picked up the phone. But
from the little that has been written so far that I can find, it is not
clear to me how to piece this together. Am I being dense and missing
anything that has already been written?



/f

-----Original Message-----
From: freeswitch-users-bounces@lists.freeswitch.org
[mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Brian
West

sched_api (hint uuid_send_dtmf)



API CALL [sched_api()] output:

-ERR Invalid syntax. USAGE: [+@]<time> <group_name> <command_string>





/b



On Dec 12, 2008, at 5:51 PM, Frank @ Impact wrote:

Is there a way to schedule a certain DTMF tone to be played into a bridge
(both a and b legs) after a scheduled number of seconds into the call?

_______________________________________________




_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
msc at freeswitch.org
Guest





PostPosted: Sat Dec 13, 2008 1:42 am    Post subject: [Freeswitch-users] schedule a DTMF tone into bridge Reply with quote

Frank,

I found a simple way to handle this scenario. I decided just to create
a small Lua script that would do the job. It's committed in latest
trunk. Look in src/scripts/contrib/mcollins for uuid_send_dtmf.lua. It
has comments on how to call it, including a sample dp call.

The way I would use this in your scenario is to setup a destination
using the execute_on_answer variable.
http://wiki.freeswitch.org/wiki/Channel_Variables#execute_on_answer

Have the destination be an extension that does something like this:
<extension...>
<condition...>
<action application="answer"/>
<action application="lua" data="uuid_send_dtmf ${uuid} 10 123"/>
...rest of diaplan...
</condition>
</extension>

The 10 means ten seconds, the 123 means send the dtmf digits 1,2,3 in
order. You can tinker with the settings as you see fit.

Please let me know how it goes. BTW, be sure to put the Lua script in
/usr/local/freeswitch/scripts or specify the complete path name when
calling the lua app in the dialplan.

-MC

On Fri, Dec 12, 2008 at 7:37 PM, Frank @ Impact <frank@impactfax.com> wrote:
Quote:
Not much written in the wiki on this. Also searched the list and not much
on either sched_api or uuid_send_dtmf.

So from an xml dialplan, can sched_api as an application?

Is there any way to have the time offset reference the point at which the
call started ? ie. When the called party answers?



Ultimately, I was trying to insert some xml into my dial plan that would
play a dtmf tone 10 seconds after the called party picked up the phone. But
from the little that has been written so far that I can find, it is not
clear to me how to piece this together. Am I being dense and missing
anything that has already been written?



/f

-----Original Message-----
From: freeswitch-users-bounces@lists.freeswitch.org
[mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Brian
West

sched_api (hint uuid_send_dtmf)



API CALL [sched_api()] output:

-ERR Invalid syntax. USAGE: [+@]<time> <group_name> <command_string>





/b



On Dec 12, 2008, at 5:51 PM, Frank @ Impact wrote:

Is there a way to schedule a certain DTMF tone to be played into a bridge
(both a and b legs) after a scheduled number of seconds into the call?

_______________________________________________




_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
msc at freeswitch.org
Guest





PostPosted: Sat Dec 13, 2008 1:48 am    Post subject: [Freeswitch-users] schedule a DTMF tone into bridge Reply with quote

On Fri, Dec 12, 2008 at 8:21 PM, Michael Collins <msc@freeswitch.org> wrote:
Quote:
Frank,

I'm sure this is possible. Please give me a little bit to look into
this. I'm going to see if I can lab it up and give you a sample
dialplan. Also, thanks for the heads up on the wiki not having this
information. I will put that on my not-so-short wiki todo list.

Thanks,
MC

On Fri, Dec 12, 2008 at 7:37 PM, Frank @ Impact <frank@impactfax.com> wrote:
Quote:
Not much written in the wiki on this. Also searched the list and not much
on either sched_api or uuid_send_dtmf.

So from an xml dialplan, can sched_api as an application?

Is there any way to have the time offset reference the point at which the
call started ? ie. When the called party answers?



Ultimately, I was trying to insert some xml into my dial plan that would
play a dtmf tone 10 seconds after the called party picked up the phone. But
from the little that has been written so far that I can find, it is not
clear to me how to piece this together. Am I being dense and missing
anything that has already been written?



/f

-----Original Message-----
From: freeswitch-users-bounces@lists.freeswitch.org
[mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Brian
West

sched_api (hint uuid_send_dtmf)



API CALL [sched_api()] output:

-ERR Invalid syntax. USAGE: [+@]<time> <group_name> <command_string>





/b



On Dec 12, 2008, at 5:51 PM, Frank @ Impact wrote:

Is there a way to schedule a certain DTMF tone to be played into a bridge
(both a and b legs) after a scheduled number of seconds into the call?

_______________________________________________




_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org




_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
frank at impactfax.com
Guest





PostPosted: Sat Dec 13, 2008 4:22 pm    Post subject: [Freeswitch-users] schedule a DTMF tone into bridge Reply with quote

Michael,

Got it working. Just a little simpler then you outlined.
I just added to my xml dialplan this line.

<action application="set" data="execute_on_answer=lua uuid_send_dtmf.lua
${uuid} 20 123"/>

I added this just before the bridge application.

I did this instead of adding an extra extension to transfer to on
answer. Everything worked well. The DTMF was played to the calling
party. Out of curiosity, if we wanted also to play the DTMF to the
called party also, what would we have to give uuid_send_dtmf?
Particularly since we call it before the bridge.

Can uuid_send_dtmf accept anything like "w" for wait or anything else
special for DTMF stuff?

Also, I got an error output to the console when the sched_api was run.
See below.
******
2008-12-13 16:07:28 [NOTICE] switch_cpp.cpp:1050 console_log() apicmd:
sched_api
2008-12-13 16:07:28 [NOTICE] switch_cpp.cpp:1050 console_log() apiarg:
+20 none uuid_send_dtmf 37618e54-c959-11dd-bc73-0923daa880b2 123

2008-12-13 16:07:28 [ERR] switch_cpp.cpp:1050 console_log() Result is
+OK Added: 49751
******
is this ERR anything to worry about even though we got a result ok?

Thanks again for the help.

-----Original Message-----
From: freeswitch-users-bounces@lists.freeswitch.org
[mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of
Michael Collins

Frank,

I found a simple way to handle this scenario. I decided just to create
a small Lua script that would do the job. It's committed in latest
trunk. Look in src/scripts/contrib/mcollins for uuid_send_dtmf.lua. It
has comments on how to call it, including a sample dp call.

The way I would use this in your scenario is to setup a destination
using the execute_on_answer variable.
http://wiki.freeswitch.org/wiki/Channel_Variables#execute_on_answer

Have the destination be an extension that does something like this:
<extension...>
<condition...>
<action application="answer"/>
<action application="lua" data="uuid_send_dtmf ${uuid} 10 123"/>
...rest of diaplan...
</condition>
</extension>

The 10 means ten seconds, the 123 means send the dtmf digits 1,2,3 in
order. You can tinker with the settings as you see fit.

Please let me know how it goes. BTW, be sure to put the Lua script in
/usr/local/freeswitch/scripts or specify the complete path name when
calling the lua app in the dialplan.

-MC




_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
msc at freeswitch.org
Guest





PostPosted: Sat Dec 13, 2008 6:09 pm    Post subject: [Freeswitch-users] schedule a DTMF tone into bridge Reply with quote

On Sat, Dec 13, 2008 at 1:20 PM, Frank @ Impact <frank@impactfax.com> wrote:
Quote:
Michael,

Got it working. Just a little simpler then you outlined.
I just added to my xml dialplan this line.

<action application="set" data="execute_on_answer=lua uuid_send_dtmf.lua
${uuid} 20 123"/>

I added this just before the bridge application.

Nice - simpler is almost always better! Smile

Quote:

I did this instead of adding an extra extension to transfer to on
answer. Everything worked well. The DTMF was played to the calling
party. Out of curiosity, if we wanted also to play the DTMF to the
called party also, what would we have to give uuid_send_dtmf?
Particularly since we call it before the bridge.


Definitely need the uuid of the leg in question. Could you pastebin or
email a sample dialplan? We could probably work it out together.

Quote:
Can uuid_send_dtmf accept anything like "w" for wait or anything else
special for DTMF stuff?

The uuid_send_dtmf api cannot, but you could easily modify or create a
new version of my Lua script that accepts more (or different)
arguments. I suppose the trick there is that you'd need to read up on
Lua, which I highly recommend anyway because if you know Lua then you
can leverage some serious power in your dialplans.

Quote:

Also, I got an error output to the console when the sched_api was run.
See below.
******
2008-12-13 16:07:28 [NOTICE] switch_cpp.cpp:1050 console_log() apicmd:
sched_api
2008-12-13 16:07:28 [NOTICE] switch_cpp.cpp:1050 console_log() apiarg:
+20 none uuid_send_dtmf 37618e54-c959-11dd-bc73-0923daa880b2 123

2008-12-13 16:07:28 [ERR] switch_cpp.cpp:1050 console_log() Result is
+OK Added: 49751
******
is this ERR anything to worry about even though we got a result ok?


I believe this "error" is innocuous. Sometimes the devs will log
certain events to the console as ERR so that they stand out during
debugging.
-MC
Quote:
Thanks again for the help.

-----Original Message-----
From: freeswitch-users-bounces@lists.freeswitch.org
[mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of
Michael Collins

Frank,

I found a simple way to handle this scenario. I decided just to create
a small Lua script that would do the job. It's committed in latest
trunk. Look in src/scripts/contrib/mcollins for uuid_send_dtmf.lua. It
has comments on how to call it, including a sample dp call.

The way I would use this in your scenario is to setup a destination
using the execute_on_answer variable.
http://wiki.freeswitch.org/wiki/Channel_Variables#execute_on_answer

Have the destination be an extension that does something like this:
<extension...>
<condition...>
<action application="answer"/>
<action application="lua" data="uuid_send_dtmf ${uuid} 10 123"/>
...rest of diaplan...
</condition>
</extension>

The 10 means ten seconds, the 123 means send the dtmf digits 1,2,3 in
order. You can tinker with the settings as you see fit.

Please let me know how it goes. BTW, be sure to put the Lua script in
/usr/local/freeswitch/scripts or specify the complete path name when
calling the lua app in the dialplan.

-MC




_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
frank at impactfax.com
Guest





PostPosted: Sat Dec 13, 2008 11:55 pm    Post subject: [Freeswitch-users] schedule a DTMF tone into bridge Reply with quote

Pretty simple actually...

<?xml version="1.0"?>
<document type="freeswitch/xml">
<section name="dialplan" description="Regex/XML Dialplan">
<context name="default">
<extension name="myextension">
<condition>
<action application="enum" data="15555551212"/>
<action application="set" data="execute_on_answer=lua
uuid_send_dtmf.lua ${uuid} 10 55"/>
<!-- use this if to wrap just sections you want to test -->
<action application="tone_detect" data="test 941,1336 rw
+100000 hangup normal_clearing"/>
<action application="bridge" data="${enum_auto_route}"/>
<action application="hangup"/>
</condition>
</extension>
</context>
</section>
</document>

BTW, this darn tone_detect is something I never could get working. It
did not matter which side I sent the tone from, it never got trapped by
my test here. The call never hung up on the tone, a 0.


-----Original Message-----
From: freeswitch-users-bounces@lists.freeswitch.org
[mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of
Michael Collins
Sent: Saturday, December 13, 2008 6:04 PM
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] schedule a DTMF tone into bridge

Quote:

I did this instead of adding an extra extension to transfer to on
answer. Everything worked well. The DTMF was played to the calling
party. Out of curiosity, if we wanted also to play the DTMF to the
called party also, what would we have to give uuid_send_dtmf?
Particularly since we call it before the bridge.


Definitely need the uuid of the leg in question. Could you pastebin or
email a sample dialplan? We could probably work it out together.




_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services