Skinny: set BOND variable early to have call info during ring

This is hackish
This commit is contained in:
Mathieu Parent 2010-05-21 02:08:17 +02:00
parent 23766e36e0
commit 14fee6c798
2 changed files with 11 additions and 8 deletions

View File

@ -1047,6 +1047,10 @@ switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, swi
switch_safe_free(sql);
}
/* FIXME: ring_lines need BOND before switch_core_session_outgoing_channel() set it */
switch_channel_set_variable(switch_core_session_get_channel(session), SWITCH_SIGNAL_BOND_VARIABLE, switch_core_session_get_uuid(nsession));
switch_channel_set_variable(switch_core_session_get_channel(nsession), SWITCH_SIGNAL_BOND_VARIABLE, switch_core_session_get_uuid(session));
cause = skinny_ring_lines(tech_pvt, session);
if(cause != SWITCH_CAUSE_SUCCESS) {

View File

@ -527,14 +527,13 @@ int skinny_ring_lines_callback(void *pArg, int argc, char **argv, char **columnN
switch_channel_set_variable(channel, "effective_callee_id_number", value);
switch_channel_set_variable(channel, "effective_callee_id_name", caller_name);
if (helper->remote_session) {
switch_core_session_message_t *msg;
msg = switch_core_session_alloc(helper->remote_session, sizeof(*msg));
MESSAGE_STAMP_FFL(msg);
msg->message_id = SWITCH_MESSAGE_INDICATE_DISPLAY;
msg->string_array_arg[0] = switch_core_session_strdup(helper->remote_session, caller_name);
msg->string_array_arg[1] = switch_core_session_strdup(helper->remote_session, value);
msg->from = __FILE__;
if (switch_core_session_queue_message(helper->remote_session, msg) != SWITCH_STATUS_SUCCESS) {
switch_core_session_message_t msg = { 0 };
msg.message_id = SWITCH_MESSAGE_INDICATE_DISPLAY;
msg.string_array_arg[0] = switch_core_session_strdup(helper->remote_session, caller_name);
msg.string_array_arg[1] = switch_core_session_strdup(helper->remote_session, value);
msg.from = __FILE__;
if (switch_core_session_receive_message(helper->remote_session, &msg) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(helper->tech_pvt->session), SWITCH_LOG_WARNING,
"Unable to send SWITCH_MESSAGE_INDICATE_DISPLAY message to channel %s\n",
switch_core_session_get_uuid(helper->remote_session));