now in the key portion you can say 'exec' and in the file portion say '<application> <args>'
if the channel is not hungup when that application ends it's the winner so you can 
run an ivr on the channels to determine who gets the call

      <extension name="3002">
        <condition field="destination_number" expression="^3002$">
          <action application="set" data="call_timeout=60"/>
          <action application="set" data="group_confirm_key=exec"/>
          <action application="set" data="group_confirm_file=javascript test.js"/>
          <action application="bridge" data="exosip/1000@domain.com&exosip/1001@mydomain.com"/>
        </condition>
      </extension>



git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2314 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2006-08-17 03:18:51 +00:00
parent afdaac9b22
commit 502c84d072
1 changed files with 35 additions and 0 deletions

View File

@ -1154,6 +1154,41 @@ static void *SWITCH_THREAD_FUNC collect_thread_run(switch_thread_t *thread, void
char buf[10] = "";
char *p, term;
if (!strcasecmp(collect->key, "exec")) {
char *data;
const switch_application_interface_t *application_interface;
char *app_name, *app_data;
if (!(data = collect->file)) {
goto wbreak;
}
app_name = data;
if ((app_data = strchr(app_name, ' '))) {
*app_data++ = '\0';
}
if ((application_interface = switch_loadable_module_get_application_interface(app_name)) == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Application %s\n", app_name);
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
goto wbreak;
}
if (!application_interface->application_function) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No Function for %s\n", app_name);
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
goto wbreak;
}
application_interface->application_function(collect->session, app_data);
if (switch_channel_get_state(channel) < CS_HANGUP) {
switch_channel_set_flag(channel, CF_WINNER);
}
goto wbreak;
}
while(switch_channel_ready(channel)) {
memset(buf, 0, sizeof(buf));