mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-06-03 03:50:10 +00:00
fix hold on ua's that send sendonly in the m instead of the a line and unhold without a sendrecv.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5449 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
a039d870c3
commit
33ec66f396
@ -1055,6 +1055,7 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t *
|
|||||||
sdp_attribute_t *a;
|
sdp_attribute_t *a;
|
||||||
int first = 0, last = 0;
|
int first = 0, last = 0;
|
||||||
int ptime = 0, dptime = 0;
|
int ptime = 0, dptime = 0;
|
||||||
|
int sendonly = 0;
|
||||||
int greedy = 0, x = 0, skip = 0, mine = 0;
|
int greedy = 0, x = 0, skip = 0, mine = 0;
|
||||||
switch_channel_t *channel = NULL;
|
switch_channel_t *channel = NULL;
|
||||||
char *val;
|
char *val;
|
||||||
@ -1080,33 +1081,44 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t *
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (((m = sdp->sdp_media)) && m->m_mode == sdp_sendonly) {
|
||||||
|
sendonly = 1;
|
||||||
|
}
|
||||||
|
|
||||||
for (a = sdp->sdp_attributes; a; a = a->a_next) {
|
for (a = sdp->sdp_attributes; a; a = a->a_next) {
|
||||||
if (switch_strlen_zero(a->a_name)) {
|
if (switch_strlen_zero(a->a_name)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strcasecmp(a->a_name, "sendonly")) {
|
if (!strcasecmp(a->a_name, "sendonly")) {
|
||||||
if (!switch_test_flag(tech_pvt, TFLAG_SIP_HOLD)) {
|
sendonly = 1;
|
||||||
char *stream;
|
} else if (!strcasecmp(a->a_name, "sendrecv")) {
|
||||||
switch_set_flag_locked(tech_pvt, TFLAG_SIP_HOLD);
|
sendonly = 0;
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (!strcasecmp(a->a_name, "sendrecv")) {
|
|
||||||
if (switch_test_flag(tech_pvt, TFLAG_SIP_HOLD)) {
|
|
||||||
switch_channel_clear_flag_partner(tech_pvt->channel, CF_BROADCAST);
|
|
||||||
switch_channel_set_flag_partner(tech_pvt->channel, CF_BREAK);
|
|
||||||
switch_clear_flag_locked(tech_pvt, TFLAG_SIP_HOLD);
|
|
||||||
}
|
|
||||||
} else if (!strcasecmp(a->a_name, "ptime")) {
|
} else if (!strcasecmp(a->a_name, "ptime")) {
|
||||||
dptime = atoi(a->a_value);
|
dptime = atoi(a->a_value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sendonly) {
|
||||||
|
if (!switch_test_flag(tech_pvt, TFLAG_SIP_HOLD)) {
|
||||||
|
char *stream;
|
||||||
|
switch_set_flag_locked(tech_pvt, TFLAG_SIP_HOLD);
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (switch_test_flag(tech_pvt, TFLAG_SIP_HOLD)) {
|
||||||
|
switch_channel_clear_flag_partner(tech_pvt->channel, CF_BROADCAST);
|
||||||
|
switch_channel_set_flag_partner(tech_pvt->channel, CF_BREAK);
|
||||||
|
switch_clear_flag_locked(tech_pvt, TFLAG_SIP_HOLD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
for (m = sdp->sdp_media; m; m = m->m_next) {
|
for (m = sdp->sdp_media; m; m = m->m_next) {
|
||||||
sdp_connection_t *connection;
|
sdp_connection_t *connection;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user