Add ability to choose uuid from originate string (use at your own risk)

[origination_uuid=someid]sofia/default/100@dom.com

it's only valid in [], cannot be used on 2 existing calls at once and is not
reccommended if you don't need it.

event_socket users can use it to do

api create_uuid   
#### (then save uuid into a local variable say $uuid) ###
filter unique-id $uuid
events all
originate [origination_uuid=$uuid]sofia/default/100@dom.com

Then you can get all the events in anticipation on that channel.

Anything people do to cause problems misusing this will not be supported.




git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10239 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2008-11-04 16:46:33 +00:00
parent 807bef81ed
commit c9a24dd36e
8 changed files with 88 additions and 8 deletions

View File

@@ -1043,6 +1043,19 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
myflags |= SOF_NO_EFFECTIVE_CID_NAME;
}
if (vdata && (var_begin = switch_stristr("origination_uuid=", vdata))) {
char tmp[512] = "";
var_begin += strlen("origination_uuid=");
var_end = strchr(var_begin, '|');
if (var_end) {
strncpy(tmp, var_begin, var_end-var_begin);
} else {
strncpy(tmp, var_begin, strlen(var_begin));
}
new_profile->caller_id_name = switch_core_strdup(new_profile->pool, tmp);
switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "origination_uuid", tmp);
}
switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "originate_early_media", early_ok ? "true" : "false");