[Freeswitch-dev] Question about fsctl hupall
Michael Collins
msc at freeswitch.org
Fri May 7 23:59:18 PDT 2010
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 at 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 at 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 at 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 at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20100507/08be4c80/attachment-0001.html
More information about the FreeSWITCH-dev
mailing list