cross t's and dot i's

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7075 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2008-01-03 21:34:44 +00:00
parent e790b22af1
commit 1bbeb4f706
16 changed files with 293 additions and 161 deletions
+1 -20
View File
@@ -252,30 +252,11 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session)
cause = switch_channel_get_cause(channel);
if (switch_test_flag(tech_pvt, TFLAG_SIP_HOLD) && cause != SWITCH_CAUSE_ATTENDED_TRANSFER) {
const char *buuid;
switch_core_session_t *bsession;
switch_channel_t *bchannel;
const char *lost_ext;
if (tech_pvt->max_missed_packets) {
switch_rtp_set_max_missed_packets(tech_pvt->rtp_session, tech_pvt->max_missed_packets);
}
switch_channel_presence(tech_pvt->channel, "unknown", "unhold");
if ((buuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) {
if ((bsession = switch_core_session_locate(buuid))) {
bchannel = switch_core_session_get_channel(bsession);
if (switch_channel_test_flag(bchannel, CF_BROADCAST)) {
if ((lost_ext = switch_channel_get_variable(bchannel, "left_hanging_extension"))) {
switch_ivr_session_transfer(bsession, lost_ext, NULL, NULL);
}
switch_channel_clear_flag(bchannel, CF_BROADCAST);
switch_channel_set_flag(bchannel, CF_BREAK);
}
switch_core_session_rwunlock(bsession);
}
}
switch_clear_flag_locked(tech_pvt, TFLAG_SIP_HOLD);
}
+16 -3
View File
@@ -1382,25 +1382,38 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t *
if (sendonly) {
if (!switch_test_flag(tech_pvt, TFLAG_SIP_HOLD)) {
const char *stream;
switch_set_flag_locked(tech_pvt, TFLAG_SIP_HOLD);
switch_channel_presence(tech_pvt->channel, "unknown", "hold");
if (tech_pvt->max_missed_packets) {
switch_rtp_set_max_missed_packets(tech_pvt->rtp_session, tech_pvt->max_missed_packets * 10);
}
if (!(stream = switch_channel_get_variable(tech_pvt->channel, SWITCH_HOLD_MUSIC_VARIABLE))) {
stream = tech_pvt->profile->hold_music;
}
if (stream) {
switch_ivr_broadcast(switch_core_session_get_uuid(tech_pvt->session), stream, SMF_ECHO_BLEG | SMF_LOOP);
switch_ivr_displace_session(tech_pvt->session, stream, 0, "rl");
}
}
} else {
if (switch_test_flag(tech_pvt, TFLAG_SIP_HOLD)) {
switch_channel_clear_flag_partner(tech_pvt->channel, CF_BROADCAST);
const char *stream;
if (tech_pvt->max_missed_packets) {
switch_rtp_set_max_missed_packets(tech_pvt->rtp_session, tech_pvt->max_missed_packets);
}
switch_channel_set_flag_partner(tech_pvt->channel, CF_BREAK);
if (!(stream = switch_channel_get_variable(tech_pvt->channel, SWITCH_HOLD_MUSIC_VARIABLE))) {
stream = tech_pvt->profile->hold_music;
}
if (stream) {
switch_ivr_stop_displace_session(tech_pvt->session, stream);
}
switch_clear_flag_locked(tech_pvt, TFLAG_SIP_HOLD);
switch_channel_presence(tech_pvt->channel, "unknown", "unhold");
}