[Freeswitch-dev] Question about fsctl hupall
Guys, I was digging through mod_commands.c to learn more about fsctl hupall <cause> <var> <val> syntax. However, I don't see how the proper function ever gets executed. Here's mod_commands.c, starting at line 1478, where "fsctl" arguments are parsed: if (!strcasecmp(argv[0], "hupall")) { arg = 1; switch_core_session_ctl(SCSC_HUPALL, &arg); stream->write_function(stream, "+OK\n"); I don't see where this: switch_core_session_hupall_matching_var(var, val, cause); ...ever gets called. (Same file, line 4086, inside SWITCH_STANDARD_API(hupall_api_function) defintion) Did I perhaps miss something? Thanks, MC
<361>:git grep -n SCSC_HUPALL src/include/switch_types.h:1476: SCSC_HUPALL, src/mod/applications/mod_commands/mod_commands.c:1480: switch_core_session_ctl(SCSC_HUPALL, &arg); src/mod/languages/mod_managed/managed/swig.cs:26990: SCSC_HUPALL, src/switch_core.c:1692: case SCSC_HUPALL: On May 8, 2010, at 1:44 AM, Michael Collins wrote:
Guys,
I was digging through mod_commands.c to learn more about fsctl hupall <cause> <var> <val> syntax. However, I don't see how the proper function ever gets executed. Here's mod_commands.c, starting at line 1478, where "fsctl" arguments are parsed:
if (!strcasecmp(argv[0], "hupall")) { arg = 1; switch_core_session_ctl(SCSC_HUPALL, &arg); stream->write_function(stream, "+OK\n");
I don't see where this:
switch_core_session_hupall_matching_var(var, val, cause);
...ever gets called. (Same file, line 4086, inside SWITCH_STANDARD_API(hupall_api_function) defintion)
Did I perhaps miss something?
fsctl hupall doesnt take any arguments. However, the hupall api function does, see mod_commands.c:4086 Mathieu Rene Avant-Garde Solutions Inc Office: + 1 (514) 664-1044 x100 Cell: +1 (514) 664-1044 x200 mrene@avgs.ca SWITCH_STANDARD_API(hupall_api_function) { char *mycmd = NULL, *argv[3] = { 0 }; int argc = 0; char *var = NULL; char *val = NULL; switch_call_cause_t cause = SWITCH_CAUSE_MANAGER_REQUEST; if (!zstr(cmd) && (mycmd = strdup(cmd))) { argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); switch_assert(argv[0]); if ((cause = switch_channel_str2cause(argv[0])) == SWITCH_CAUSE_NONE) { cause = SWITCH_CAUSE_MANAGER_REQUEST; } var = argv[1]; val = argv[2]; } if (!val) { var = NULL; } if (zstr(var)) { switch_core_session_hupall(cause); } else { switch_core_session_hupall_matching_var(var, val, cause); } if (zstr(var)) { stream->write_function(stream, "+OK hangup all channels with cause %s\n", switch_channel_cause2str(cause)); } else { stream->write_function(stream, "+OK hangup all channels matching [%s]=[%s] with cause: %s\n", var, val, switch_channel_cause2str(cause)); } switch_safe_free(mycmd); return SWITCH_STATUS_SUCCESS; } On 2010-05-08, at 1:44 AM, Michael Collins wrote:
Guys,
I was digging through mod_commands.c to learn more about fsctl hupall <cause> <var> <val> syntax. However, I don't see how the proper function ever gets executed. Here's mod_commands.c, starting at line 1478, where "fsctl" arguments are parsed:
if (!strcasecmp(argv[0], "hupall")) { arg = 1; switch_core_session_ctl(SCSC_HUPALL, &arg); stream->write_function(stream, "+OK\n");
I don't see where this:
switch_core_session_hupall_matching_var(var, val, cause);
...ever gets called. (Same file, line 4086, inside SWITCH_STANDARD_API(hupall_api_function) defintion)
Did I perhaps miss something?
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
Ugh. That was a noob oversight if ever there was one. Thanks for the slap upside the head. That's what I get for reading source code while trying to babysit two kids. :) -MC On Fri, May 7, 2010 at 11:21 PM, Mathieu Rene <mrene_lists@avgs.ca> wrote:
fsctl hupall doesnt take any arguments.
However, the hupall api function does, see mod_commands.c:4086
Mathieu Rene Avant-Garde Solutions Inc Office: + 1 (514) 664-1044 x100 Cell: +1 (514) 664-1044 x200 mrene@avgs.ca
SWITCH_STANDARD_API(hupall_api_function) { char *mycmd = NULL, *argv[3] = { 0 }; int argc = 0; char *var = NULL; char *val = NULL; switch_call_cause_t cause = SWITCH_CAUSE_MANAGER_REQUEST;
if (!zstr(cmd) && (mycmd = strdup(cmd))) { argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); switch_assert(argv[0]); if ((cause = switch_channel_str2cause(argv[0])) == SWITCH_CAUSE_NONE) { cause = SWITCH_CAUSE_MANAGER_REQUEST; } var = argv[1]; val = argv[2]; }
if (!val) { var = NULL; }
if (zstr(var)) { switch_core_session_hupall(cause); } else { switch_core_session_hupall_matching_var(var, val, cause); }
if (zstr(var)) { stream->write_function(stream, "+OK hangup all channels with cause %s\n", switch_channel_cause2str(cause)); } else { stream->write_function(stream, "+OK hangup all channels matching [%s]=[%s] with cause: %s\n", var, val, switch_channel_cause2str(cause)); }
switch_safe_free(mycmd); return SWITCH_STATUS_SUCCESS; }
On 2010-05-08, at 1:44 AM, Michael Collins wrote:
Guys,
I was digging through mod_commands.c to learn more about fsctl hupall <cause> <var> <val> syntax. However, I don't see how the proper function ever gets executed. Here's mod_commands.c, starting at line 1478, where "fsctl" arguments are parsed:
if (!strcasecmp(argv[0], "hupall")) { arg = 1; switch_core_session_ctl(SCSC_HUPALL, &arg); stream->write_function(stream, "+OK\n");
I don't see where this:
switch_core_session_hupall_matching_var(var, val, cause);
...ever gets called. (Same file, line 4086, inside SWITCH_STANDARD_API(hupall_api_function) defintion)
Did I perhaps miss something?
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
_______________________________________________ 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
participants (3)
-
Mathieu Rene
-
Michael Collins
-
Michael Jerris