]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Skinny: set BOND variable early to have call info during ring
authorMathieu Parent <math.parent@gmail.com>
Fri, 21 May 2010 00:08:17 +0000 (02:08 +0200)
committerMathieu Parent <math.parent@gmail.com>
Fri, 21 May 2010 00:09:09 +0000 (02:09 +0200)
This is hackish

src/mod/endpoints/mod_skinny/mod_skinny.c
src/mod/endpoints/mod_skinny/skinny_server.c

index df0aaddbf2756d8d45489465ac037f715ece24aa..79eb8eee06bdc7bdfbc8103ebee4590012198dd4 100644 (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) {
index f808ab188c656fae0ceb7a2588ea6628a8168587..fb71ddddd5b49fc69285bb0725e1ae7ba1cf78eb 100644 (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));