mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-11 03:57:14 +00:00
update
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4229 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
dcb452bcf7
commit
9a870c5fb6
8 files changed
+59
-56
No files matched your search
@@ -63,12 +63,12 @@ static void detect_speech_function(switch_core_session_t *session, char *data)
|
||||
|
||||
}
|
||||
|
||||
static void ringback_function(switch_core_session_t *session, char *data)
|
||||
static void ring_ready_function(switch_core_session_t *session, char *data)
|
||||
{
|
||||
switch_channel_t *channel;
|
||||
channel = switch_core_session_get_channel(session);
|
||||
assert(channel != NULL);
|
||||
switch_channel_ringback(channel);
|
||||
switch_channel_ring_ready(channel);
|
||||
}
|
||||
|
||||
static void queue_dtmf_function(switch_core_session_t *session, char *data)
|
||||
@@ -538,11 +538,11 @@ static const switch_application_interface_t detect_speech_application_interface
|
||||
/*.next */ &ivr_application_interface
|
||||
};
|
||||
|
||||
static const switch_application_interface_t ringback_application_interface = {
|
||||
/*.interface_name */ "ringback",
|
||||
/*.application_function */ ringback_function,
|
||||
/* long_desc */ "Indicate Ringback on a channel.",
|
||||
/* short_desc */ "Indicate Ringback",
|
||||
static const switch_application_interface_t ring_ready_application_interface = {
|
||||
/*.interface_name */ "ring_ready",
|
||||
/*.application_function */ ring_ready_function,
|
||||
/* long_desc */ "Indicate Ring_Ready on a channel.",
|
||||
/* short_desc */ "Indicate Ring_Ready",
|
||||
/* syntax */ "",
|
||||
/*.next */ &detect_speech_application_interface
|
||||
};
|
||||
@@ -553,7 +553,7 @@ static const switch_application_interface_t unset_application_interface = {
|
||||
/* long_desc */ "Unset a channel varaible for the channel calling the application.",
|
||||
/* short_desc */ "Unset a channel varaible",
|
||||
/* syntax */ "<varname>",
|
||||
/*.next */ &ringback_application_interface
|
||||
/*.next */ &ring_ready_application_interface
|
||||
};
|
||||
|
||||
static const switch_application_interface_t set_application_interface = {
|
||||
|
||||
@@ -2810,25 +2810,27 @@ static void sip_i_state(int status,
|
||||
break;
|
||||
case nua_callstate_proceeding:
|
||||
if (channel) {
|
||||
if (status == 180 && !(switch_channel_test_flag(channel, CF_NO_INDICATE))) {
|
||||
if (status == 180) {
|
||||
switch_channel_mark_ring_ready(channel);
|
||||
if (switch_test_flag(tech_pvt, TFLAG_NOMEDIA)) {
|
||||
if ((uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE)) && (other_session = switch_core_session_locate(uuid))) {
|
||||
switch_core_session_message_t msg;
|
||||
msg.message_id = SWITCH_MESSAGE_INDICATE_RINGING;
|
||||
msg.from = __FILE__;
|
||||
switch_core_session_receive_message(other_session, &msg);
|
||||
switch_core_session_rwunlock(other_session);
|
||||
}
|
||||
|
||||
} else {
|
||||
switch_core_session_message_t *msg;
|
||||
if ((msg = malloc(sizeof(*msg)))) {
|
||||
memset(msg, 0, sizeof(*msg));
|
||||
msg->message_id = SWITCH_MESSAGE_INDICATE_RINGING;
|
||||
msg->from = __FILE__;
|
||||
switch_core_session_queue_message(session, msg);
|
||||
switch_set_flag(msg, SCSMF_DYNAMIC);
|
||||
if (!switch_channel_test_flag(channel, CF_GEN_RINGBACK)) {
|
||||
if (switch_test_flag(tech_pvt, TFLAG_NOMEDIA)) {
|
||||
if ((uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE)) && (other_session = switch_core_session_locate(uuid))) {
|
||||
switch_core_session_message_t msg;
|
||||
msg.message_id = SWITCH_MESSAGE_INDICATE_RINGING;
|
||||
msg.from = __FILE__;
|
||||
switch_core_session_receive_message(other_session, &msg);
|
||||
switch_core_session_rwunlock(other_session);
|
||||
}
|
||||
|
||||
} else {
|
||||
switch_core_session_message_t *msg;
|
||||
if ((msg = malloc(sizeof(*msg)))) {
|
||||
memset(msg, 0, sizeof(*msg));
|
||||
msg->message_id = SWITCH_MESSAGE_INDICATE_RINGING;
|
||||
msg->from = __FILE__;
|
||||
switch_core_session_queue_message(session, msg);
|
||||
switch_set_flag(msg, SCSMF_DYNAMIC);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2837,12 +2839,13 @@ static void sip_i_state(int status,
|
||||
if (switch_test_flag(tech_pvt, TFLAG_NOMEDIA)) {
|
||||
switch_set_flag_locked(tech_pvt, TFLAG_EARLY_MEDIA);
|
||||
switch_channel_mark_pre_answered(channel);
|
||||
if ((uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE)) && (other_session = switch_core_session_locate(uuid))) {
|
||||
if (!switch_channel_test_flag(channel, CF_GEN_RINGBACK) &&
|
||||
(uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE)) && (other_session = switch_core_session_locate(uuid))) {
|
||||
other_channel = switch_core_session_get_channel(other_session);
|
||||
if (!switch_channel_get_variable(other_channel, SWITCH_B_SDP_VARIABLE)) {
|
||||
switch_channel_set_variable(other_channel, SWITCH_B_SDP_VARIABLE, (char *)r_sdp);
|
||||
}
|
||||
|
||||
|
||||
switch_channel_pre_answer(other_channel);
|
||||
switch_core_session_rwunlock(other_session);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user