From f0d16d0d18a09793353d1b21eb4e789bfcda3980 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 2 Jul 2014 04:49:16 +0500 Subject: [PATCH] expand positioning api usage --- .../mod_conference/mod_conference.c | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index 5ccf10ce55..35a412fcdf 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -6277,9 +6277,28 @@ static switch_status_t conf_api_sub_energy(conference_member_t *member, switch_s static switch_status_t conf_api_sub_auto_position(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { #ifdef OPENAL_POSITIONING - gen_arc(conference, stream); + char *arg = NULL; + int set = 0; - stream->write_function(stream, "+OK\n"); + if (argc > 2) { + arg = argv[2]; + } + + + if (!zstr(arg)) { + if (!strcasecmp(arg, "on")) { + switch_set_flag(conference, CFLAG_POSITIONAL); + set = 1; + } else if (!strcasecmp(arg, "off")) { + switch_clear_flag(conference, CFLAG_POSITIONAL); + } + } + + if (set && switch_test_flag(conference, CFLAG_POSITIONAL)) { + gen_arc(conference, stream); + } + + stream->write_function(stream, "+OK positioning %s\n", switch_test_flag(conference, CFLAG_POSITIONAL) ? "on" : "off"); #else stream->write_function(stream, "-ERR not supported\n"); @@ -7908,7 +7927,7 @@ static api_command_t conf_api_sub_commands[] = { {"volume_in", (void_fn_t) & conf_api_sub_volume_in, CONF_API_SUB_MEMBER_TARGET, "volume_in", " []"}, {"volume_out", (void_fn_t) & conf_api_sub_volume_out, CONF_API_SUB_MEMBER_TARGET, "volume_out", " []"}, {"position", (void_fn_t) & conf_api_sub_position, CONF_API_SUB_MEMBER_TARGET, "position", " ,,"}, - {"auto-3d-position", (void_fn_t) & conf_api_sub_auto_position, CONF_API_SUB_ARGS_SPLIT, "auto-3d-position", ""}, + {"auto-3d-position", (void_fn_t) & conf_api_sub_auto_position, CONF_API_SUB_ARGS_SPLIT, "auto-3d-position", "[on|off]"}, {"play", (void_fn_t) & conf_api_sub_play, CONF_API_SUB_ARGS_SPLIT, "play", " [async| [nomux]]"}, {"pause_play", (void_fn_t) & conf_api_sub_pause_play, CONF_API_SUB_ARGS_SPLIT, "pause", ""}, {"file_seek", (void_fn_t) & conf_api_sub_file_seek, CONF_API_SUB_ARGS_SPLIT, "file_seek", "[+-]"},