[Freeswitch-dev] INFO: wait_for_silence wikified; set chan var w/ result?
FYI, I started the documentation here: http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_wait_for_silence I also added it to the list of apps on the mod_dptools wiki page. Question: how easy/difficult would it be to add a channel variable that would get populated with the result of the wait_for_silence call? It could be something like ${waitstatus} with a value of "silence" or "timeout". Bonus question: if I wanted to dig in there myself and see if I could add that feature, where might I start looking for information on what is required when adding a custom channel variable inside an app or api? I'd want to make sure to follow proper protocol when creating this variable. Thanks, MC
Quick follow up: I found a reference to what looks like a great little function. Is it really this easy? switch_channel_set_variable(channel,"my_var","my_val"); Thanks, MC ________________________________ From: freeswitch-dev-bounces@lists.freeswitch.org [mailto:freeswitch-dev-bounces@lists.freeswitch.org] On Behalf Of Michael Collins Sent: Thursday, July 10, 2008 11:57 PM To: freeswitch-dev@lists.freeswitch.org Subject: [Freeswitch-dev] INFO: wait_for_silence wikified;set chan var w/ result? FYI, I started the documentation here: http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_wait_for_silence I also added it to the list of apps on the mod_dptools wiki page. Question: how easy/difficult would it be to add a channel variable that would get populated with the result of the wait_for_silence call? It could be something like ${waitstatus} with a value of "silence" or "timeout". Bonus question: if I wanted to dig in there myself and see if I could add that feature, where might I start looking for information on what is required when adding a custom channel variable inside an app or api? I'd want to make sure to follow proper protocol when creating this variable. Thanks, MC
You'll need to do this first: switch_channel_t *channel = switch_core_session_get_channel(session); Then you have the channel to pass to switch_channel_set_variable. /b On Jul 11, 2008, at 2:04 AM, Michael Collins wrote:
Quick follow up: I found a reference to what looks like a great little function. Is it really this easy?
switch_channel_set_variable(channel,”my_var”,”my_val”);
Thanks, MC
Brian West sip:brian@freeswitch.org
And all those scripting language lovers say that coding in compiled languages is so difficult. ;-) -- Yossi Neiman Cartis Solutions, Inc. http://www.cartissolutions.com Brian West wrote:
You'll need to do this first:
switch_channel_t *channel = switch_core_session_get_channel(session);
Then you have the channel to pass to switch_channel_set_variable.
/b
On Jul 11, 2008, at 2:04 AM, Michael Collins wrote:
Quick follow up: I found a reference to what looks like a great little function. Is it really this easy?
switch_channel_set_variable(channel,”my_var”,”my_val”);
Thanks, MC
Brian West sip:brian@freeswitch.org
I think libfreeswitch makes many of the tasks brain dead simple to do in C. Anthony has done a great job on the API. On Jul 11, 2008, at 2:57 PM, Yossi Neiman wrote:
And all those scripting language lovers say that coding in compiled languages is so difficult. ;-)
Brian West sip:brian@freeswitch.org
I think libfreeswitch makes many of the tasks brain dead simple to do in C. Anthony has done a great job on the API.
Amen to that, brothah! -MC
On Jul 11, 2008, at 2:57 PM, Yossi Neiman wrote:
And all those scripting language lovers say that coding in compiled languages is so difficult. ;-)
Brian West sip:brian@freeswitch.org
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
FYI, I am working on the return values for this function. I've settled on a variable name of ${waitstatus} - unless there are any objections. The return values I've got so far are: "silence" "timeout" "error" I am looking at making the error return value more meaningful but for now since this is so new I think the above three items will get us going. I'll submit the patch as soon as it is ready. -MC
-----Original Message----- From: freeswitch-dev-bounces@lists.freeswitch.org [mailto:freeswitch-dev- bounces@lists.freeswitch.org] On Behalf Of Michael Collins Sent: Monday, July 14, 2008 10:09 AM To: freeswitch-dev@lists.freeswitch.org Subject: Re: [Freeswitch-dev] INFO: wait_for_silence wikified;set chan var w/ result?
I think libfreeswitch makes many of the tasks brain dead simple to do in C. Anthony has done a great job on the API.
Amen to that, brothah! -MC
On Jul 11, 2008, at 2:57 PM, Yossi Neiman wrote:
And all those scripting language lovers say that coding in
compiled
languages is so difficult. ;-)
Brian West sip:brian@freeswitch.org
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
Bravo!! Good job! /b On Jul 11, 2008, at 1:56 AM, Michael Collins wrote:
FYI,
I started the documentation here: http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_wait_for_silence I also added it to the list of apps on the mod_dptools wiki page.
Question: how easy/difficult would it be to add a channel variable that would get populated with the result of the wait_for_silence call? It could be something like ${waitstatus} with a value of “silence” or “timeout”. Bonus question: if I wanted to dig in there myself and see if I could add that feature, where might I start looking for information on what is required when adding a custom channel variable inside an app or api? I’d want to make sure to follow proper protocol when creating this variable.
Thanks, MC _______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
Brian West sip:brian@freeswitch.org
participants (3)
-
Brian West
-
Michael Collins
-
Yossi Neiman