switch_core_session_t *b_session;
char name[128];
switch_caller_profile_t *caller_profile;
+ switch_event_t *vars = NULL;
tech_pvt = switch_core_session_get_private(session);
switch_assert(tech_pvt != NULL);
switch_channel_set_flag(channel, CF_ACCEPT_CNG);
- //switch_ivr_transfer_variable(session, tech_pvt->other_session, "process_cdr");
- switch_ivr_transfer_variable(session, tech_pvt->other_session, NULL);
+
+ if ((vars = (switch_event_t *) switch_channel_get_private(channel, "__loopback_vars__"))) {
+ switch_event_header_t *h;
+
+ switch_channel_set_private(channel, "__loopback_vars__", NULL);
+
+ for (h = vars->headers; h; h = h->next) {
+ switch_channel_set_variable(tech_pvt->other_channel, h->name, h->value);
+ }
+
+ switch_event_destroy(&vars);
+ }
if (switch_test_flag(tech_pvt, TFLAG_APP)) {
switch_set_flag(b_tech_pvt, TFLAG_APP);
switch_channel_t *channel = NULL;
private_t *tech_pvt = NULL;
void *pop;
+ switch_event_t *vars;
channel = switch_core_session_get_channel(session);
switch_assert(channel != NULL);
tech_pvt = switch_core_session_get_private(session);
+ if ((vars = (switch_event_t *) switch_channel_get_private(channel, "__loopback_vars__"))) {
+ switch_channel_set_private(channel, "__loopback_vars__", NULL);
+ switch_event_destroy(&vars);
+ }
+
if (tech_pvt) {
switch_core_timer_destroy(&tech_pvt->timer);
{
switch_channel_t *channel;
private_t *tech_pvt;
- int done = 1;
+ int done = 1, pass = 0;
channel = switch_core_session_get_channel(session);
switch_assert(channel != NULL);
}
- if (!done && tech_pvt->other_session && switch_test_flag(tech_pvt, TFLAG_RUNNING_APP)) {
+ switch (msg->message_id) {
+ case SWITCH_MESSAGE_INDICATE_DISPLAY:
+ {
+
+ if (!zstr(msg->string_array_arg[0])) {
+ switch_channel_set_profile_var(tech_pvt->other_channel, "callee_id_name", msg->string_array_arg[0]);
+ }
+
+ if (!zstr(msg->string_array_arg[1])) {
+ switch_channel_set_profile_var(tech_pvt->other_channel, "callee_id_number", msg->string_array_arg[1]);
+ }
+
+ pass = 1;
+ }
+ break;
+ default:
+ break;
+ }
+
+
+ if (!done && tech_pvt->other_session && (pass || switch_test_flag(tech_pvt, TFLAG_RUNNING_APP))) {
switch_status_t r = SWITCH_STATUS_FALSE;
switch_core_session_t *other_session;
private_t *tech_pvt;
switch_channel_t *channel;
switch_caller_profile_t *caller_profile;
+ switch_event_t *clone = NULL;
switch_core_session_add_stream(*new_session, NULL);
return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
}
+ if (switch_event_dup(&clone, var_event) == SWITCH_STATUS_SUCCESS) {
+ switch_channel_set_private(channel, "__loopback_vars__", clone);
+ }
+
if (outbound_profile) {
char *dialplan = NULL, *context = NULL;
case SWITCH_MESSAGE_INDICATE_DISPLAY:
{
const char *name = msg->string_array_arg[0], *number = msg->string_array_arg[1];
- char *arg = NULL;
- char *argv[2] = { 0 };
- //int argc;
-
- if (zstr(name) && !zstr(msg->string_arg)) {
- arg = strdup(msg->string_arg);
- switch_assert(arg);
-
- switch_separate_string(arg, '|', argv, (sizeof(argv) / sizeof(argv[0])));
- name = argv[0];
- number = argv[1];
-
- }
-
+
if (!zstr(name)) {
char message[256] = "";
const char *ua = switch_channel_get_variable(tech_pvt->channel, "sip_user_agent");
tech_pvt->last_sent_callee_id_name = switch_core_session_strdup(tech_pvt->session, name);
tech_pvt->last_sent_callee_id_number = switch_core_session_strdup(tech_pvt->session, number);
-
- switch_channel_set_variable(channel, "last_sent_callee_id_name", name);
- switch_channel_set_variable(channel, "last_sent_callee_id_number", number);
if (switch_event_create(&event, SWITCH_EVENT_CALL_UPDATE) == SWITCH_STATUS_SUCCESS) {
}
}
}
-
- switch_safe_free(arg);
}
break;
switch_channel_clear_flag(session->channel, CF_EARLY_MEDIA);
}
- if (message->message_id == SWITCH_MESSAGE_INDICATE_DISPLAY &&
- switch_true(switch_channel_get_variable(session->channel, SWITCH_IGNORE_DISPLAY_UPDATES_VARIABLE))) {
- switch_log_printf(SWITCH_CHANNEL_ID_LOG, message->_file, message->_func, message->_line,
- switch_core_session_get_uuid(session), SWITCH_LOG_DEBUG1, "Ignoring display update.\n");
- status = SWITCH_STATUS_SUCCESS;
- goto end;
+ if (message->message_id == SWITCH_MESSAGE_INDICATE_DISPLAY) {
+ char *arg = NULL;
+
+ if (zstr(message->string_array_arg[0]) && !zstr(message->string_arg)) {
+ arg = switch_core_session_strdup(session, message->string_arg);
+ switch_separate_string(arg, '|', (char **)message->string_array_arg, 2);
+ }
+
+ if (!zstr(message->string_array_arg[0])) {
+ switch_channel_set_variable(session->channel, "last_sent_callee_id_name", message->string_array_arg[0]);
+ }
+
+ if (!zstr(message->string_array_arg[1])) {
+ switch_channel_set_variable(session->channel, "last_sent_callee_id_number", message->string_array_arg[1]);
+ }
+
+
+ if (switch_true(switch_channel_get_variable(session->channel, SWITCH_IGNORE_DISPLAY_UPDATES_VARIABLE))) {
+ switch_log_printf(SWITCH_CHANNEL_ID_LOG, message->_file, message->_func, message->_line,
+ switch_core_session_get_uuid(session), SWITCH_LOG_DEBUG1, "Ignoring display update.\n");
+ status = SWITCH_STATUS_SUCCESS;
+ goto end;
+ }
+
}
if (switch_channel_down_nosig(session->channel) && message->message_id != SWITCH_MESSAGE_INDICATE_SIGNAL_DATA) {