} else {
/* This if statement check and handles the 3pcc proxy mode */
if (sofia_test_pflag(tech_pvt->profile, PFLAG_3PCC_PROXY) && sofia_test_flag(tech_pvt, TFLAG_3PCC)) {
+
+ tech_pvt->num_codecs = 0;
+ sofia_glue_tech_prepare_codecs(tech_pvt);
+ tech_pvt->local_sdp_str = NULL;
+ sofia_glue_tech_choose_port(tech_pvt, 0);
+ sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 0);
+
/* Send the 200 OK */
if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
char *extra_headers = sofia_glue_get_extra_headers(channel, SOFIA_SIP_PROGRESS_HEADER_PREFIX);
switch_mutex_lock(tech_pvt->sofia_mutex);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "3PCC-PROXY, Done waiting for ACK\n");
+ return SWITCH_STATUS_SUCCESS;
}
if ((is_proxy && !b_sdp) || sofia_test_flag(tech_pvt, TFLAG_LATE_NEGOTIATION) || !tech_pvt->iananame) {
}
break;
case SWITCH_MESSAGE_INDICATE_RINGING:
+
+ if (sofia_test_pflag(tech_pvt->profile, PFLAG_3PCC_PROXY) && sofia_test_flag(tech_pvt, TFLAG_3PCC)) {
+ switch_channel_mark_ring_ready(channel);
+ status = SWITCH_STATUS_SUCCESS;
+ switch_log_printf(SWITCH_CHANNEL_ID_LOG, msg->_file, msg->_func, msg->_line, NULL, SWITCH_LOG_INFO,
+ "Pretending to send ringing. Not available for 3pcc calls\n");
+ goto end_lock;
+ }
+
if (!switch_channel_test_flag(channel, CF_RING_READY) && !sofia_test_flag(tech_pvt, TFLAG_BYE) &&
!switch_channel_test_flag(channel, CF_EARLY_MEDIA) && !switch_channel_test_flag(channel, CF_ANSWERED)) {
char *extra_header = sofia_glue_get_extra_headers(channel, SOFIA_SIP_PROGRESS_HEADER_PREFIX);
char *sticky = NULL;
const char *val = NULL;
+ if (sofia_test_pflag(tech_pvt->profile, PFLAG_3PCC_PROXY) && sofia_test_flag(tech_pvt, TFLAG_3PCC)) {
+ sofia_set_flag_locked(tech_pvt, TFLAG_EARLY_MEDIA);
+ switch_channel_mark_pre_answered(channel);
+ status = SWITCH_STATUS_SUCCESS;
+ switch_log_printf(SWITCH_CHANNEL_ID_LOG, msg->_file, msg->_func, msg->_line, NULL, SWITCH_LOG_INFO,
+ "Pretending to send early media. Not available for 3pcc calls\n");
+ goto end_lock;
+ }
+
if (!sofia_test_flag(tech_pvt, TFLAG_ANS) && !sofia_test_flag(tech_pvt, TFLAG_EARLY_MEDIA)) {
sofia_set_flag_locked(tech_pvt, TFLAG_EARLY_MEDIA);
//3PCC proxy mode delays the 200 OK until the call is answered
switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "RECEIVED_NOSDP");
sofia_set_flag_locked(tech_pvt, TFLAG_3PCC);
- sofia_glue_tech_choose_port(tech_pvt, 0);
- sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 0);
+ //sofia_glue_tech_choose_port(tech_pvt, 0);
+ //sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 0);
switch_channel_set_flag(channel, TFLAG_LATE_NEGOTIATION);
//Moves into CS_INIT so call moves forward into the dialplan
switch_channel_set_state(channel, CS_INIT);