set bracket vars before firing the CHANNEL_ORIGINATE event

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8110 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-04-14 17:30:45 +00:00
parent 4eed4f88e1
commit 466bbe70c5
1 changed files with 13 additions and 13 deletions

View File

@ -826,19 +826,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
peer_channels[i] = switch_core_session_get_channel(new_session);
switch_channel_set_flag(peer_channels[i], CF_ORIGINATING);
if (var_event) {
switch_event_t *event;
switch_event_header_t *header;
/* install the vars from the {} params */
for (header = var_event->headers; header; header = header->next) {
switch_channel_set_variable(peer_channels[i], header->name, header->value);
}
switch_event_create(&event, SWITCH_EVENT_CHANNEL_ORIGINATE);
switch_assert(event);
switch_channel_event_set_data(peer_channels[i], event);
switch_event_fire(&event);
}
if (vdata) {
char *var_array[1024] = { 0 };
int var_count = 0;
@ -857,6 +844,19 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
}
}
if (var_event) {
switch_event_t *event;
switch_event_header_t *header;
/* install the vars from the {} params */
for (header = var_event->headers; header; header = header->next) {
switch_channel_set_variable(peer_channels[i], header->name, header->value);
}
switch_event_create(&event, SWITCH_EVENT_CHANNEL_ORIGINATE);
switch_assert(event);
switch_channel_event_set_data(peer_channels[i], event);
switch_event_fire(&event);
}
if (!table) {
table = &originate_state_handlers;
}