[core] SDP: replace SIP lingo in SDP offer/answer.
This commit is contained in:
parent
1c05719100
commit
8b7a8c4aea
|
@ -2656,10 +2656,12 @@ struct switch_live_array_s;
|
|||
typedef struct switch_live_array_s switch_live_array_t;
|
||||
|
||||
typedef enum {
|
||||
SDP_TYPE_REQUEST,
|
||||
SDP_TYPE_RESPONSE
|
||||
SDP_OFFER,
|
||||
SDP_ANSWER
|
||||
} switch_sdp_type_t;
|
||||
|
||||
#define SDP_TYPE_REQUEST SDP_OFFER
|
||||
#define SDP_TYPE_RESPONSE SDP_ANSWER
|
||||
|
||||
typedef enum {
|
||||
AEAD_AES_256_GCM_8,
|
||||
|
|
|
@ -593,7 +593,7 @@ SWITCH_STANDARD_APP(filter_codecs_function)
|
|||
r_sdp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE);
|
||||
|
||||
if (data && r_sdp) {
|
||||
switch_core_media_merge_sdp_codec_string(session, r_sdp, SDP_TYPE_REQUEST, data);
|
||||
switch_core_media_merge_sdp_codec_string(session, r_sdp, SDP_OFFER, data);
|
||||
switch_channel_set_variable(channel, "filter_codec_string", data);
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Incomplete data\n");
|
||||
|
|
|
@ -1429,7 +1429,7 @@ static switch_status_t null_tech_init(null_private_t *tech_pvt, switch_core_sess
|
|||
// switch_core_media_check_video_codecs(session);
|
||||
// switch_core_media_choose_port(session, SWITCH_MEDIA_TYPE_AUDIO, 0);
|
||||
// switch_core_media_choose_port(session, SWITCH_MEDIA_TYPE_VIDEO, 0);
|
||||
// switch_core_media_gen_local_sdp(session, SDP_TYPE_REQUEST, "127.0.0.1", 2000, NULL, 0);
|
||||
// switch_core_media_gen_local_sdp(session, SDP_OFFER, "127.0.0.1", 2000, NULL, 0);
|
||||
// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%s\n", mparams.local_sdp_str);
|
||||
}
|
||||
|
||||
|
|
|
@ -790,7 +790,7 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
|
|||
switch_core_media_prepare_codecs(tech_pvt->session, SWITCH_TRUE);
|
||||
tech_pvt->mparams.local_sdp_str = NULL;
|
||||
switch_core_media_choose_port(tech_pvt->session, SWITCH_MEDIA_TYPE_AUDIO, 0);
|
||||
switch_core_media_gen_local_sdp(session, SDP_TYPE_RESPONSE, NULL, 0, NULL, 0);
|
||||
switch_core_media_gen_local_sdp(session, SDP_ANSWER, NULL, 0, NULL, 0);
|
||||
} else if (is_3pcc_proxy) {
|
||||
|
||||
if (!(sofia_test_pflag(tech_pvt->profile, PFLAG_3PCC_PROXY))) {
|
||||
|
@ -802,7 +802,7 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
|
|||
} else {
|
||||
switch_core_media_choose_port(tech_pvt->session, SWITCH_MEDIA_TYPE_AUDIO, 0);
|
||||
switch_core_media_prepare_codecs(session, 1);
|
||||
switch_core_media_gen_local_sdp(session, SDP_TYPE_REQUEST, NULL, 0, NULL, 1);
|
||||
switch_core_media_gen_local_sdp(session, SDP_OFFER, NULL, 0, NULL, 1);
|
||||
sofia_set_flag_locked(tech_pvt, TFLAG_3PCC);
|
||||
}
|
||||
|
||||
|
@ -889,7 +889,7 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
|
|||
|
||||
switch_core_media_prepare_codecs(tech_pvt->session, SWITCH_TRUE);
|
||||
|
||||
if (zstr(r_sdp) || sofia_media_tech_media(tech_pvt, r_sdp, SDP_TYPE_REQUEST) != SWITCH_STATUS_SUCCESS) {
|
||||
if (zstr(r_sdp) || sofia_media_tech_media(tech_pvt, r_sdp, SDP_OFFER) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "CODEC NEGOTIATION ERROR");
|
||||
//switch_mutex_lock(tech_pvt->sofia_mutex);
|
||||
//nua_respond(tech_pvt->nh, SIP_488_NOT_ACCEPTABLE, TAG_END());
|
||||
|
@ -904,7 +904,7 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
|
|||
return status;
|
||||
}
|
||||
|
||||
switch_core_media_gen_local_sdp(session, SDP_TYPE_RESPONSE, NULL, 0, NULL, 0);
|
||||
switch_core_media_gen_local_sdp(session, SDP_ANSWER, NULL, 0, NULL, 0);
|
||||
if (sofia_media_activate_rtp(tech_pvt) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
||||
}
|
||||
|
@ -1598,7 +1598,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
|||
ip = switch_channel_get_variable(channel, SWITCH_REMOTE_MEDIA_IP_VARIABLE);
|
||||
port = switch_channel_get_variable(channel, SWITCH_REMOTE_MEDIA_PORT_VARIABLE);
|
||||
if (ip && port) {
|
||||
switch_core_media_gen_local_sdp(session, SDP_TYPE_REQUEST, ip, (switch_port_t)atoi(port), msg->string_arg, 1);
|
||||
switch_core_media_gen_local_sdp(session, SDP_OFFER, ip, (switch_port_t)atoi(port), msg->string_arg, 1);
|
||||
}
|
||||
|
||||
if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
|
||||
|
@ -1783,7 +1783,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
|||
if (switch_channel_direction(tech_pvt->channel) == SWITCH_CALL_DIRECTION_INBOUND) {
|
||||
|
||||
switch_core_media_prepare_codecs(tech_pvt->session, SWITCH_TRUE);
|
||||
if (sofia_media_tech_media(tech_pvt, r_sdp, SDP_TYPE_REQUEST) != SWITCH_STATUS_SUCCESS) {
|
||||
if (sofia_media_tech_media(tech_pvt, r_sdp, SDP_OFFER) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "CODEC NEGOTIATION ERROR");
|
||||
status = SWITCH_STATUS_FALSE;
|
||||
goto end_lock;
|
||||
|
@ -1793,7 +1793,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
|||
}
|
||||
|
||||
|
||||
switch_core_media_set_sdp_codec_string(tech_pvt->session, r_sdp, SDP_TYPE_RESPONSE);
|
||||
switch_core_media_set_sdp_codec_string(tech_pvt->session, r_sdp, SDP_ANSWER);
|
||||
switch_channel_set_variable(tech_pvt->channel, "absolute_codec_string", switch_channel_get_variable(tech_pvt->channel, "ep_codec_string"));
|
||||
switch_core_media_prepare_codecs(tech_pvt->session, SWITCH_TRUE);
|
||||
|
||||
|
@ -1802,7 +1802,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
|||
goto end_lock;
|
||||
}
|
||||
|
||||
switch_core_media_gen_local_sdp(session, SDP_TYPE_REQUEST, NULL, 0, NULL, 1);
|
||||
switch_core_media_gen_local_sdp(session, SDP_OFFER, NULL, 0, NULL, 1);
|
||||
|
||||
if (!msg->numeric_arg) {
|
||||
if (send_invite) {
|
||||
|
@ -2256,7 +2256,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
|||
switch_channel_clear_flag(tech_pvt->channel, CF_AWAITING_STREAM_CHANGE);
|
||||
|
||||
switch_core_session_local_crypto_key(tech_pvt->session, SWITCH_MEDIA_TYPE_AUDIO);
|
||||
switch_core_media_gen_local_sdp(session, SDP_TYPE_RESPONSE, NULL, 0, NULL, 0);
|
||||
switch_core_media_gen_local_sdp(session, SDP_ANSWER, NULL, 0, NULL, 0);
|
||||
|
||||
if (sofia_use_soa(tech_pvt)) {
|
||||
nua_respond(tech_pvt->nh, SIP_200_OK,
|
||||
|
@ -2584,7 +2584,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
|||
|
||||
|
||||
switch_core_media_prepare_codecs(tech_pvt->session, SWITCH_TRUE);
|
||||
if (zstr(r_sdp) || sofia_media_tech_media(tech_pvt, r_sdp, SDP_TYPE_REQUEST) != SWITCH_STATUS_SUCCESS) {
|
||||
if (zstr(r_sdp) || sofia_media_tech_media(tech_pvt, r_sdp, SDP_OFFER) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING,
|
||||
"CODEC NEGOTIATION ERROR. SDP:\n%s\n", r_sdp ? r_sdp : "NO SDP!");
|
||||
switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "CODEC NEGOTIATION ERROR");
|
||||
|
@ -2599,7 +2599,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
|||
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
||||
goto end_lock;
|
||||
}
|
||||
switch_core_media_gen_local_sdp(session, SDP_TYPE_RESPONSE, NULL, 0, NULL, 0);
|
||||
switch_core_media_gen_local_sdp(session, SDP_ANSWER, NULL, 0, NULL, 0);
|
||||
if (sofia_media_activate_rtp(tech_pvt) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
||||
}
|
||||
|
|
|
@ -6683,7 +6683,7 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
|
|||
tech_pvt->mparams.last_sdp_response = NULL;
|
||||
|
||||
if (sip->sip_payload && sip->sip_payload->pl_data) {
|
||||
switch_core_media_set_sdp_codec_string(session, sip->sip_payload->pl_data, SDP_TYPE_RESPONSE);
|
||||
switch_core_media_set_sdp_codec_string(session, sip->sip_payload->pl_data, SDP_ANSWER);
|
||||
|
||||
if (!zstr(tech_pvt->mparams.prev_sdp_response) && !strcmp(tech_pvt->mparams.prev_sdp_response, sip->sip_payload->pl_data)) {
|
||||
tech_pvt->mparams.last_sdp_response = tech_pvt->mparams.prev_sdp_response;
|
||||
|
@ -7506,9 +7506,9 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
|||
switch_channel_mark_pre_answered(channel);
|
||||
}
|
||||
//if ((sofia_test_flag(tech_pvt, TFLAG_LATE_NEGOTIATION) || switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND)) {
|
||||
// switch_core_media_set_sdp_codec_string(session, r_sdp, status < 200 ? SDP_TYPE_REQUEST : SDP_TYPE_RESPONSE);
|
||||
// switch_core_media_set_sdp_codec_string(session, r_sdp, status < 200 ? SDP_OFFER : SDP_ANSWER);
|
||||
//}
|
||||
switch_core_media_set_sdp_codec_string(session, r_sdp, SDP_TYPE_REQUEST);
|
||||
switch_core_media_set_sdp_codec_string(session, r_sdp, SDP_OFFER);
|
||||
sofia_glue_pass_sdp(tech_pvt, (char *) r_sdp);
|
||||
sofia_set_flag(tech_pvt, TFLAG_NEW_SDP);
|
||||
|
||||
|
@ -7680,7 +7680,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
|||
}
|
||||
|
||||
} else {
|
||||
if (sofia_media_tech_media(tech_pvt, (char *) r_sdp, SDP_TYPE_REQUEST) != SWITCH_STATUS_SUCCESS) {
|
||||
if (sofia_media_tech_media(tech_pvt, (char *) r_sdp, SDP_OFFER) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "CODEC NEGOTIATION ERROR");
|
||||
nua_respond(nh, SIP_488_NOT_ACCEPTABLE,
|
||||
TAG_IF(!zstr(session_id_header), SIPTAG_HEADER_STR(session_id_header)),TAG_END());
|
||||
|
@ -7776,7 +7776,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
|||
switch_core_media_prepare_codecs(tech_pvt->session, SWITCH_FALSE);
|
||||
|
||||
if (tech_pvt->mparams.num_codecs) {
|
||||
match = sofia_media_negotiate_sdp(session, r_sdp, SDP_TYPE_REQUEST);
|
||||
match = sofia_media_negotiate_sdp(session, r_sdp, SDP_OFFER);
|
||||
}
|
||||
|
||||
if (!match) {
|
||||
|
@ -7785,7 +7785,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
|||
TAG_IF(!zstr(session_id_header), SIPTAG_HEADER_STR(session_id_header)),TAG_END());
|
||||
}
|
||||
} else {
|
||||
switch_core_media_gen_local_sdp(session, SDP_TYPE_RESPONSE, NULL, 0, NULL, 0);
|
||||
switch_core_media_gen_local_sdp(session, SDP_ANSWER, NULL, 0, NULL, 0);
|
||||
switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "RECEIVED");
|
||||
sofia_set_flag_locked(tech_pvt, TFLAG_READY);
|
||||
|
||||
|
@ -7909,7 +7909,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
|||
uint8_t match = 0;
|
||||
|
||||
if (tech_pvt->mparams.num_codecs) {
|
||||
match = sofia_media_negotiate_sdp(session, r_sdp, SDP_TYPE_REQUEST);
|
||||
match = sofia_media_negotiate_sdp(session, r_sdp, SDP_OFFER);
|
||||
}
|
||||
|
||||
if (!match) {
|
||||
|
@ -7995,7 +7995,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
|||
switch_core_media_choose_port(tech_pvt->session, SWITCH_MEDIA_TYPE_AUDIO, 0);
|
||||
switch_core_media_prepare_codecs(session, 1);
|
||||
switch_channel_set_state(channel, CS_HIBERNATE);
|
||||
switch_core_media_gen_local_sdp(session, SDP_TYPE_REQUEST, NULL, 0, NULL, 0);
|
||||
switch_core_media_gen_local_sdp(session, SDP_OFFER, NULL, 0, NULL, 0);
|
||||
sofia_set_flag_locked(tech_pvt, TFLAG_3PCC);
|
||||
|
||||
if (sofia_use_soa(tech_pvt)) {
|
||||
|
@ -8067,10 +8067,10 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
|||
switch_channel_set_flag(channel, CF_NOSDP_REINVITE);
|
||||
|
||||
if (switch_channel_var_true(channel, "sip_unhold_nosdp")) {
|
||||
switch_core_media_gen_local_sdp(session, SDP_TYPE_RESPONSE, NULL, 0, "sendrecv",
|
||||
switch_core_media_gen_local_sdp(session, SDP_ANSWER, NULL, 0, "sendrecv",
|
||||
zstr(tech_pvt->mparams.local_sdp_str) || !switch_channel_test_flag(channel, CF_PROXY_MODE));
|
||||
} else {
|
||||
switch_core_media_gen_local_sdp(session, SDP_TYPE_RESPONSE, NULL, 0, NULL,
|
||||
switch_core_media_gen_local_sdp(session, SDP_ANSWER, NULL, 0, NULL,
|
||||
zstr(tech_pvt->mparams.local_sdp_str) || !switch_channel_test_flag(channel, CF_PROXY_MODE));
|
||||
}
|
||||
|
||||
|
@ -8116,13 +8116,13 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
|||
sofia_set_flag(tech_pvt, TFLAG_SDP);
|
||||
|
||||
|
||||
match = sofia_media_negotiate_sdp(session, r_sdp, SDP_TYPE_RESPONSE);
|
||||
match = sofia_media_negotiate_sdp(session, r_sdp, SDP_ANSWER);
|
||||
if (match) {
|
||||
if (switch_core_media_choose_port(tech_pvt->session, SWITCH_MEDIA_TYPE_AUDIO, 0) != SWITCH_STATUS_SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
switch_core_media_gen_local_sdp(session, SDP_TYPE_RESPONSE, NULL, 0, NULL, 0);
|
||||
switch_core_media_gen_local_sdp(session, SDP_ANSWER, NULL, 0, NULL, 0);
|
||||
|
||||
if (sofia_media_activate_rtp(tech_pvt) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Early Media RTP Error!\n");
|
||||
|
@ -8191,7 +8191,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
|||
|
||||
|
||||
switch_core_media_prepare_codecs(tech_pvt->session, SWITCH_TRUE);
|
||||
if (sofia_media_tech_media(tech_pvt, r_sdp, SDP_TYPE_REQUEST) != SWITCH_STATUS_SUCCESS) {
|
||||
if (sofia_media_tech_media(tech_pvt, r_sdp, SDP_OFFER) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "CODEC NEGOTIATION ERROR");
|
||||
switch_core_session_rwunlock(other_session);
|
||||
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
||||
|
@ -8210,7 +8210,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
|||
}
|
||||
}
|
||||
|
||||
switch_core_media_gen_local_sdp(session, SDP_TYPE_RESPONSE, NULL, 0, NULL, 1);
|
||||
switch_core_media_gen_local_sdp(session, SDP_ANSWER, NULL, 0, NULL, 1);
|
||||
|
||||
if (sofia_use_soa(tech_pvt)) {
|
||||
nua_respond(tech_pvt->nh, SIP_200_OK,
|
||||
|
@ -8320,7 +8320,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
|||
switch_channel_set_flag(tech_pvt->channel, CF_REINVITE);
|
||||
|
||||
if (tech_pvt->mparams.num_codecs){
|
||||
match = sofia_media_negotiate_sdp(session, r_sdp, SDP_TYPE_REQUEST);
|
||||
match = sofia_media_negotiate_sdp(session, r_sdp, SDP_OFFER);
|
||||
}
|
||||
|
||||
if (!match) {
|
||||
|
@ -8369,7 +8369,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
|||
|
||||
|
||||
|
||||
switch_core_media_gen_local_sdp(session, SDP_TYPE_RESPONSE, NULL, 0, NULL, 0);
|
||||
switch_core_media_gen_local_sdp(session, SDP_ANSWER, NULL, 0, NULL, 0);
|
||||
if (sofia_use_soa(tech_pvt)){
|
||||
nua_respond(tech_pvt->nh, SIP_200_OK,
|
||||
SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
|
||||
|
@ -8419,7 +8419,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
|||
switch_channel_set_flag(tech_pvt->channel, CF_REINVITE);
|
||||
|
||||
if (tech_pvt->mparams.num_codecs) {
|
||||
match = sofia_media_negotiate_sdp(session, r_sdp, SDP_TYPE_REQUEST);
|
||||
match = sofia_media_negotiate_sdp(session, r_sdp, SDP_OFFER);
|
||||
}
|
||||
|
||||
|
||||
|
@ -8438,7 +8438,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
|||
goto done;
|
||||
}
|
||||
|
||||
switch_core_media_gen_local_sdp(session, SDP_TYPE_RESPONSE, NULL, 0, NULL, 0);
|
||||
switch_core_media_gen_local_sdp(session, SDP_ANSWER, NULL, 0, NULL, 0);
|
||||
|
||||
if (sofia_media_activate_rtp(tech_pvt) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Reinvite RTP Error!\n");
|
||||
|
@ -8462,7 +8462,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
|||
if (is_ok) {
|
||||
|
||||
if (switch_core_session_local_crypto_key(tech_pvt->session, SWITCH_MEDIA_TYPE_AUDIO)) {
|
||||
switch_core_media_gen_local_sdp(session, SDP_TYPE_RESPONSE, NULL, 0, NULL, 0);
|
||||
switch_core_media_gen_local_sdp(session, SDP_ANSWER, NULL, 0, NULL, 0);
|
||||
}
|
||||
|
||||
if (!switch_channel_test_flag(tech_pvt->channel, CF_AWAITING_STREAM_CHANGE)) {
|
||||
|
@ -8507,13 +8507,13 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
|||
|
||||
|
||||
if (tech_pvt->mparams.num_codecs) {
|
||||
match = sofia_media_negotiate_sdp(session, r_sdp, SDP_TYPE_RESPONSE);
|
||||
match = sofia_media_negotiate_sdp(session, r_sdp, SDP_ANSWER);
|
||||
}
|
||||
if (match) {
|
||||
if (switch_core_media_choose_port(tech_pvt->session, SWITCH_MEDIA_TYPE_AUDIO, 0) != SWITCH_STATUS_SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
switch_core_media_gen_local_sdp(session, SDP_TYPE_RESPONSE, NULL, 0, NULL, 0);
|
||||
switch_core_media_gen_local_sdp(session, SDP_ANSWER, NULL, 0, NULL, 0);
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Processing updated SDP\n");
|
||||
switch_channel_set_flag(tech_pvt->channel, CF_REINVITE);
|
||||
|
@ -8571,9 +8571,9 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
|||
|
||||
if (tech_pvt->mparams.num_codecs) {
|
||||
if (sofia_test_flag(tech_pvt, TFLAG_GOT_ACK)) {
|
||||
match = sofia_media_negotiate_sdp(session, r_sdp, SDP_TYPE_REQUEST);
|
||||
match = sofia_media_negotiate_sdp(session, r_sdp, SDP_OFFER);
|
||||
} else {
|
||||
match = sofia_media_negotiate_sdp(session, r_sdp, SDP_TYPE_RESPONSE);
|
||||
match = sofia_media_negotiate_sdp(session, r_sdp, SDP_ANSWER);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8668,7 +8668,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
|||
uint8_t match = 0;
|
||||
|
||||
|
||||
match = sofia_media_negotiate_sdp(session, r_sdp, SDP_TYPE_RESPONSE);
|
||||
match = sofia_media_negotiate_sdp(session, r_sdp, SDP_ANSWER);
|
||||
|
||||
|
||||
sofia_set_flag_locked(tech_pvt, TFLAG_ANS);
|
||||
|
@ -10466,7 +10466,7 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
|
|||
|
||||
|
||||
if (r_sdp) {
|
||||
switch_core_media_set_sdp_codec_string(session, r_sdp, SDP_TYPE_REQUEST);
|
||||
switch_core_media_set_sdp_codec_string(session, r_sdp, SDP_OFFER);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1158,7 +1158,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
|
|||
}
|
||||
|
||||
if (!switch_channel_get_private(tech_pvt->channel, "t38_options") || zstr(tech_pvt->mparams.local_sdp_str)) {
|
||||
switch_core_media_gen_local_sdp(session, SDP_TYPE_REQUEST, NULL, 0, NULL, 0);
|
||||
switch_core_media_gen_local_sdp(session, SDP_OFFER, NULL, 0, NULL, 0);
|
||||
}
|
||||
|
||||
sofia_set_flag_locked(tech_pvt, TFLAG_READY);
|
||||
|
|
|
@ -1320,7 +1320,7 @@ static void tech_reattach(verto_pvt_t *tech_pvt, jsock_t *jsock)
|
|||
switch_channel_set_flag(tech_pvt->channel, CF_REATTACHED);
|
||||
switch_channel_set_flag(tech_pvt->channel, CF_REINVITE);
|
||||
switch_channel_set_flag(tech_pvt->channel, CF_RECOVERING);
|
||||
switch_core_media_gen_local_sdp(tech_pvt->session, SDP_TYPE_REQUEST, NULL, 0, NULL, 0);
|
||||
switch_core_media_gen_local_sdp(tech_pvt->session, SDP_OFFER, NULL, 0, NULL, 0);
|
||||
switch_channel_clear_flag(tech_pvt->channel, CF_REINVITE);
|
||||
switch_channel_clear_flag(tech_pvt->channel, CF_RECOVERING);
|
||||
switch_core_session_request_video_refresh(tech_pvt->session);
|
||||
|
@ -2405,7 +2405,7 @@ static switch_status_t verto_connect(switch_core_session_t *session, const char
|
|||
}
|
||||
}
|
||||
|
||||
switch_core_media_gen_local_sdp(session, SDP_TYPE_REQUEST, NULL, 0, NULL, 0);
|
||||
switch_core_media_gen_local_sdp(session, SDP_OFFER, NULL, 0, NULL, 0);
|
||||
}
|
||||
|
||||
msg = jrpc_new_req(method, tech_pvt->call_id, ¶ms);
|
||||
|
@ -2641,7 +2641,7 @@ static switch_status_t verto_media(switch_core_session_t *session)
|
|||
switch_core_media_prepare_codecs(tech_pvt->session, SWITCH_TRUE);
|
||||
|
||||
if (tech_pvt->r_sdp) {
|
||||
if (verto_tech_media(tech_pvt, tech_pvt->r_sdp, SDP_TYPE_REQUEST) != SWITCH_STATUS_SUCCESS) {
|
||||
if (verto_tech_media(tech_pvt, tech_pvt->r_sdp, SDP_OFFER) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_set_variable(tech_pvt->channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "CODEC NEGOTIATION ERROR");
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
@ -2653,7 +2653,7 @@ static switch_status_t verto_media(switch_core_session_t *session)
|
|||
return status;
|
||||
}
|
||||
|
||||
switch_core_media_gen_local_sdp(session, SDP_TYPE_RESPONSE, NULL, 0, NULL, 0);
|
||||
switch_core_media_gen_local_sdp(session, SDP_ANSWER, NULL, 0, NULL, 0);
|
||||
|
||||
if (switch_core_media_activate_rtp(tech_pvt->session) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
||||
|
@ -2963,7 +2963,7 @@ static switch_bool_t verto__answer_func(const char *method, cJSON *params, jsock
|
|||
switch_channel_set_variable(tech_pvt->channel, SWITCH_R_SDP_VARIABLE, sdp);
|
||||
switch_channel_set_variable(tech_pvt->channel, "verto_client_address", jsock->name);
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Remote SDP %s:\n%s\n", switch_channel_get_name(tech_pvt->channel), sdp);
|
||||
switch_core_media_set_sdp_codec_string(session, sdp, SDP_TYPE_RESPONSE);
|
||||
switch_core_media_set_sdp_codec_string(session, sdp, SDP_ANSWER);
|
||||
|
||||
if (!switch_channel_var_true(switch_core_session_get_channel(session),"verto_skip_set_user")) {
|
||||
switch_ivr_set_user(session, jsock->uid);
|
||||
|
@ -2978,7 +2978,7 @@ static switch_bool_t verto__answer_func(const char *method, cJSON *params, jsock
|
|||
if (switch_channel_test_flag(tech_pvt->channel, CF_PROXY_MODE)) {
|
||||
pass_sdp(tech_pvt);
|
||||
} else {
|
||||
if (verto_tech_media(tech_pvt, tech_pvt->r_sdp, SDP_TYPE_RESPONSE) != SWITCH_STATUS_SUCCESS) {
|
||||
if (verto_tech_media(tech_pvt, tech_pvt->r_sdp, SDP_ANSWER) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_set_variable(tech_pvt->channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "CODEC NEGOTIATION ERROR");
|
||||
cJSON_AddItemToObject(obj, "message", cJSON_CreateString("CODEC ERROR"));
|
||||
err = 1;
|
||||
|
@ -3448,8 +3448,8 @@ static switch_bool_t verto__modify_func(const char *method, cJSON *params, jsock
|
|||
//switch_channel_set_flag(tech_pvt->channel, CF_VIDEO_BREAK);
|
||||
//switch_core_session_kill_channel(tech_pvt->session, SWITCH_SIG_BREAK);
|
||||
|
||||
if (switch_core_media_negotiate_sdp(tech_pvt->session, tech_pvt->r_sdp, &p, SDP_TYPE_REQUEST)) {
|
||||
switch_core_media_gen_local_sdp(session, SDP_TYPE_RESPONSE, NULL, 0, NULL, 0);
|
||||
if (switch_core_media_negotiate_sdp(tech_pvt->session, tech_pvt->r_sdp, &p, SDP_OFFER)) {
|
||||
switch_core_media_gen_local_sdp(session, SDP_ANSWER, NULL, 0, NULL, 0);
|
||||
|
||||
if (switch_core_media_activate_rtp(tech_pvt->session) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_set_variable(tech_pvt->channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "MEDIA ERROR");
|
||||
|
@ -3606,8 +3606,8 @@ static switch_bool_t verto__attach_func(const char *method, cJSON *params, jsock
|
|||
//switch_channel_set_flag(tech_pvt->channel, CF_VIDEO_BREAK);
|
||||
//switch_core_session_kill_channel(tech_pvt->session, SWITCH_SIG_BREAK);
|
||||
|
||||
if (switch_core_media_negotiate_sdp(tech_pvt->session, tech_pvt->r_sdp, &p, SDP_TYPE_RESPONSE)) {
|
||||
//switch_core_media_gen_local_sdp(session, SDP_TYPE_RESPONSE, NULL, 0, NULL, 0);
|
||||
if (switch_core_media_negotiate_sdp(tech_pvt->session, tech_pvt->r_sdp, &p, SDP_ANSWER)) {
|
||||
//switch_core_media_gen_local_sdp(session, SDP_ANSWER, NULL, 0, NULL, 0);
|
||||
|
||||
if (switch_core_media_activate_rtp(tech_pvt->session) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_set_variable(tech_pvt->channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "MEDIA ERROR");
|
||||
|
@ -4020,7 +4020,7 @@ static switch_bool_t verto__invite_func(const char *method, cJSON *params, jsock
|
|||
tech_pvt->channel = channel;
|
||||
tech_pvt->jsock_uuid = switch_core_session_strdup(session, jsock->uuid_str);
|
||||
tech_pvt->r_sdp = switch_core_session_strdup(session, sdp);
|
||||
switch_core_media_set_sdp_codec_string(session, sdp, SDP_TYPE_REQUEST);
|
||||
switch_core_media_set_sdp_codec_string(session, sdp, SDP_OFFER);
|
||||
switch_core_session_set_private_class(session, tech_pvt, SWITCH_PVT_SECONDARY);
|
||||
|
||||
tech_pvt->call_id = switch_core_session_strdup(session, call_id);
|
||||
|
|
|
@ -45055,8 +45055,8 @@ public class switch_scheduler_task : global::System.IDisposable {
|
|||
namespace FreeSWITCH.Native {
|
||||
|
||||
public enum switch_sdp_type_t {
|
||||
SDP_TYPE_REQUEST,
|
||||
SDP_TYPE_RESPONSE
|
||||
SDP_OFFER,
|
||||
SDP_ANSWER
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -713,7 +713,7 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se
|
|||
|
||||
for (pmap = engine->payload_map; pmap && pmap->allocated; pmap = pmap->next) {
|
||||
|
||||
if (sdp_type == SDP_TYPE_RESPONSE) {
|
||||
if (sdp_type == SDP_ANSWER) {
|
||||
switch(type) {
|
||||
case SWITCH_MEDIA_TYPE_TEXT:
|
||||
exists = (type == pmap->type && !strcasecmp(name, pmap->iananame));
|
||||
|
@ -722,11 +722,11 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se
|
|||
exists = (type == pmap->type && !strcasecmp(name, pmap->iananame) && pmap->pt == pt && (!pmap->rate || rate == pmap->rate) && (!pmap->ptime || pmap->ptime == ptime));
|
||||
break;
|
||||
case SWITCH_MEDIA_TYPE_VIDEO:
|
||||
exists = (pmap->sdp_type == SDP_TYPE_REQUEST && type == pmap->type && !strcasecmp(name, pmap->iananame));
|
||||
exists = (pmap->sdp_type == SDP_OFFER && type == pmap->type && !strcasecmp(name, pmap->iananame));
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "CHECK PMAP %s:%s %d %s:%s %d ... %d\n",
|
||||
name, "RES", pt,
|
||||
pmap->iananame, pmap->sdp_type == SDP_TYPE_REQUEST ? "REQ" : "RES", pmap->pt, exists);
|
||||
pmap->iananame, pmap->sdp_type == SDP_OFFER ? "REQ" : "RES", pmap->pt, exists);
|
||||
|
||||
|
||||
break;
|
||||
|
@ -797,7 +797,7 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se
|
|||
}
|
||||
|
||||
if (!zstr(fmtp)) {
|
||||
if (sdp_type == SDP_TYPE_REQUEST || !exists) {
|
||||
if (sdp_type == SDP_OFFER || !exists) {
|
||||
pmap->rm_fmtp = switch_core_strdup(session->pool, fmtp);
|
||||
}
|
||||
}
|
||||
|
@ -807,7 +807,7 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se
|
|||
pmap->recv_pt = (switch_payload_t) pt;
|
||||
|
||||
|
||||
if (sdp_type == SDP_TYPE_REQUEST || !exists) {
|
||||
if (sdp_type == SDP_OFFER || !exists) {
|
||||
pmap->pt = (switch_payload_t) pt;
|
||||
}
|
||||
|
||||
|
@ -818,7 +818,7 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se
|
|||
if (!exists) {
|
||||
pmap->sdp_type = sdp_type;
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "ADD PMAP %s %s %d\n", sdp_type == SDP_TYPE_REQUEST ? "REQ" : "RES", name, pt);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "ADD PMAP %s %s %d\n", sdp_type == SDP_OFFER ? "REQ" : "RES", name, pt);
|
||||
|
||||
if (pmap == engine->payload_map) {
|
||||
engine->pmap_tail = pmap;
|
||||
|
@ -1724,7 +1724,7 @@ SWITCH_DECLARE(int) switch_core_session_check_incoming_crypto(switch_core_sessio
|
|||
const char *a = switch_stristr("AE", engine->ssec[engine->crypto_type].remote_crypto_key);
|
||||
const char *b = switch_stristr("AE", crypto);
|
||||
|
||||
if (sdp_type == SDP_TYPE_REQUEST) {
|
||||
if (sdp_type == SDP_OFFER) {
|
||||
if (!vval) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Unsupported Crypto [%s]\n", crypto);
|
||||
goto end;
|
||||
|
@ -4633,7 +4633,7 @@ static void check_stream_changes(switch_core_session_t *session, const char *r_s
|
|||
switch_channel_set_flag(other_session->channel, CF_PROCESSING_STREAM_CHANGE);
|
||||
switch_channel_set_flag(session->channel, CF_AWAITING_STREAM_CHANGE);
|
||||
|
||||
if (sdp_type == SDP_TYPE_REQUEST && r_sdp) {
|
||||
if (sdp_type == SDP_OFFER && r_sdp) {
|
||||
const char *filter_codec_string = switch_channel_get_variable(session->channel, "filter_codec_string");
|
||||
|
||||
switch_channel_set_variable(session->channel, "codec_string", NULL);
|
||||
|
@ -4654,7 +4654,7 @@ static void check_stream_changes(switch_core_session_t *session, const char *r_s
|
|||
}
|
||||
|
||||
if (other_session) {
|
||||
if (sdp_type == SDP_TYPE_RESPONSE && switch_channel_test_flag(session->channel, CF_PROCESSING_STREAM_CHANGE)) {
|
||||
if (sdp_type == SDP_ANSWER && switch_channel_test_flag(session->channel, CF_PROCESSING_STREAM_CHANGE)) {
|
||||
switch_channel_clear_flag(session->channel, CF_PROCESSING_STREAM_CHANGE);
|
||||
|
||||
if (switch_channel_test_flag(other_session->channel, CF_AWAITING_STREAM_CHANGE)) {
|
||||
|
@ -4667,7 +4667,7 @@ static void check_stream_changes(switch_core_session_t *session, const char *r_s
|
|||
}
|
||||
|
||||
sdp_in = switch_channel_get_variable(other_session->channel, SWITCH_R_SDP_VARIABLE);
|
||||
res = switch_core_media_negotiate_sdp(other_session, sdp_in, &proceed, SDP_TYPE_REQUEST);
|
||||
res = switch_core_media_negotiate_sdp(other_session, sdp_in, &proceed, SDP_OFFER);
|
||||
(void)res;
|
||||
switch_core_media_activate_rtp(other_session);
|
||||
msg = switch_core_session_alloc(other_session, sizeof(*msg));
|
||||
|
@ -4715,11 +4715,11 @@ SWITCH_DECLARE(void) switch_core_media_set_smode(switch_core_session_t *session,
|
|||
engine->pass_codecs = 0;
|
||||
|
||||
if (switch_channel_var_true(session->channel, "rtp_pass_codecs_on_stream_change")) {
|
||||
if (sdp_type == SDP_TYPE_REQUEST && switch_channel_test_flag(session->channel, CF_REINVITE) &&
|
||||
if (sdp_type == SDP_OFFER && switch_channel_test_flag(session->channel, CF_REINVITE) &&
|
||||
switch_channel_media_up(session->channel) && (pass_codecs || old_smode != smode)) {
|
||||
|
||||
if (switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_core_media_set_smode(other_session, type, opp_smode, SDP_TYPE_REQUEST);
|
||||
switch_core_media_set_smode(other_session, type, opp_smode, SDP_OFFER);
|
||||
switch_channel_set_flag(session->channel, CF_STREAM_CHANGED);
|
||||
switch_core_session_rwunlock(other_session);
|
||||
}
|
||||
|
@ -4752,7 +4752,7 @@ static void switch_core_media_set_rmode(switch_core_session_t *session, switch_m
|
|||
|
||||
if (switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS) {
|
||||
|
||||
if (sdp_type == SDP_TYPE_RESPONSE && (switch_channel_test_flag(other_session->channel, CF_REINVITE) || switch_channel_direction(session->channel) == SWITCH_CALL_DIRECTION_OUTBOUND)) {
|
||||
if (sdp_type == SDP_ANSWER && (switch_channel_test_flag(other_session->channel, CF_REINVITE) || switch_channel_direction(session->channel) == SWITCH_CALL_DIRECTION_OUTBOUND)) {
|
||||
switch_core_media_set_smode(other_session, type, rmode, sdp_type);
|
||||
}
|
||||
|
||||
|
@ -5099,7 +5099,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
|
|||
switch_channel_clear_app_flag_key("T38", session->channel, CF_APP_T38);
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s T38 REFUSE on %s\n",
|
||||
switch_channel_get_name(channel),
|
||||
sdp_type == SDP_TYPE_RESPONSE ? "response" : "request");
|
||||
sdp_type == SDP_ANSWER ? "response" : "request");
|
||||
|
||||
restore_pmaps(a_engine);
|
||||
fmatch = 0;
|
||||
|
@ -5112,7 +5112,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
|
|||
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s T38 ACCEPT on %s\n",
|
||||
switch_channel_get_name(channel),
|
||||
sdp_type == SDP_TYPE_RESPONSE ? "response" : "request");
|
||||
sdp_type == SDP_ANSWER ? "response" : "request");
|
||||
|
||||
if (switch_channel_test_app_flag_key("T38", session->channel, CF_APP_T38)) {
|
||||
if (proceed) *proceed = 0;
|
||||
|
@ -5217,7 +5217,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
|
|||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s T38 %s POSSIBLE on %s\n",
|
||||
switch_channel_get_name(channel),
|
||||
fmatch ? "IS" : "IS NOT",
|
||||
sdp_type == SDP_TYPE_RESPONSE ? "response" : "request");
|
||||
sdp_type == SDP_ANSWER ? "response" : "request");
|
||||
|
||||
|
||||
goto done;
|
||||
|
@ -5249,7 +5249,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
|
|||
|
||||
switch_core_media_set_rmode(smh->session, SWITCH_MEDIA_TYPE_AUDIO, sdp_media_flow(m->m_mode), sdp_type);
|
||||
|
||||
if (sdp_type == SDP_TYPE_REQUEST) {
|
||||
if (sdp_type == SDP_OFFER) {
|
||||
switch(a_engine->rmode) {
|
||||
case SWITCH_MEDIA_FLOW_RECVONLY:
|
||||
switch_core_media_set_smode(smh->session, SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_FLOW_SENDONLY, sdp_type);
|
||||
|
@ -5315,7 +5315,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
|
|||
switch_channel_set_variable(session->channel, "media_audio_mode", NULL);
|
||||
}
|
||||
|
||||
if (sdp_type == SDP_TYPE_RESPONSE) {
|
||||
if (sdp_type == SDP_ANSWER) {
|
||||
if (inactive) {
|
||||
// When freeswitch had previously sent inactive in sip request. it should remain inactive otherwise smode should be sendrecv
|
||||
if (a_engine->smode==SWITCH_MEDIA_FLOW_INACTIVE) {
|
||||
|
@ -5834,7 +5834,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
|
|||
|
||||
if (smh->mparams->dtmf_type == DTMF_AUTO || smh->mparams->dtmf_type == DTMF_2833 ||
|
||||
switch_channel_test_flag(session->channel, CF_LIBERAL_DTMF)) {
|
||||
if (sdp_type == SDP_TYPE_REQUEST) {
|
||||
if (sdp_type == SDP_OFFER) {
|
||||
smh->mparams->te = smh->mparams->recv_te = (switch_payload_t) best_te;
|
||||
switch_channel_set_variable(session->channel, "dtmf_type", "rfc2833");
|
||||
smh->mparams->dtmf_type = DTMF_2833;
|
||||
|
@ -5902,7 +5902,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
|
|||
map->rm_encoding,
|
||||
NULL,
|
||||
NULL,
|
||||
SDP_TYPE_REQUEST,
|
||||
SDP_OFFER,
|
||||
map->rm_pt,
|
||||
1000,
|
||||
0,
|
||||
|
@ -5980,7 +5980,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
|
|||
|
||||
switch_core_media_set_rmode(smh->session, SWITCH_MEDIA_TYPE_VIDEO, sdp_media_flow(m->m_mode), sdp_type);
|
||||
|
||||
if (sdp_type == SDP_TYPE_REQUEST) {
|
||||
if (sdp_type == SDP_OFFER) {
|
||||
sdp_bandwidth_t *bw;
|
||||
int tias = 0;
|
||||
|
||||
|
@ -6146,7 +6146,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
|
|||
vmatch = strcasecmp(rm_encoding, imp->iananame) ? 0 : 1;
|
||||
}
|
||||
|
||||
if (sdp_type == SDP_TYPE_RESPONSE && consider_video_fmtp && vmatch && !zstr(map->rm_fmtp) && !zstr(smh->fmtps[i])) {
|
||||
if (sdp_type == SDP_ANSWER && consider_video_fmtp && vmatch && !zstr(map->rm_fmtp) && !zstr(smh->fmtps[i])) {
|
||||
almost_vmatch = 1;
|
||||
vmatch = !strcasecmp(smh->fmtps[i], map->rm_fmtp);
|
||||
}
|
||||
|
@ -6321,7 +6321,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
|
|||
"L16",
|
||||
NULL,
|
||||
NULL,
|
||||
SDP_TYPE_REQUEST,
|
||||
SDP_OFFER,
|
||||
97,
|
||||
8000,
|
||||
20,
|
||||
|
@ -6378,7 +6378,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
|
|||
if (switch_channel_test_flag(channel, CF_VIDEO) && !saw_video) {
|
||||
//switch_core_media_set_rmode(smh->session, SWITCH_MEDIA_TYPE_VIDEO, SWITCH_MEDIA_FLOW_INACTIVE, sdp_type);
|
||||
|
||||
if (sdp_type == SDP_TYPE_REQUEST) {
|
||||
if (sdp_type == SDP_OFFER) {
|
||||
switch_core_media_set_smode(smh->session, SWITCH_MEDIA_TYPE_VIDEO, SWITCH_MEDIA_FLOW_INACTIVE, sdp_type);
|
||||
}
|
||||
}
|
||||
|
@ -9708,7 +9708,7 @@ static const char *get_media_profile_name(switch_core_session_t *session, int se
|
|||
static char *get_setup(switch_rtp_engine_t *engine, switch_core_session_t *session, switch_sdp_type_t sdp_type)
|
||||
{
|
||||
|
||||
if (sdp_type == SDP_TYPE_REQUEST) {
|
||||
if (sdp_type == SDP_OFFER) {
|
||||
engine->dtls_controller = 0;
|
||||
engine->new_dtls = 1;
|
||||
engine->new_ice = 1;
|
||||
|
@ -9809,7 +9809,7 @@ static void generate_m(switch_core_session_t *session, char *buf, size_t buflen,
|
|||
}
|
||||
|
||||
if (smh->mparams->dtmf_type == DTMF_2833 && smh->mparams->te > 95) {
|
||||
if (sdp_type == SDP_TYPE_RESPONSE) {
|
||||
if (sdp_type == SDP_ANSWER) {
|
||||
switch_rtp_engine_t *a_engine = &smh->engines[SWITCH_MEDIA_TYPE_AUDIO];
|
||||
if (a_engine) {
|
||||
payload_map_t *pmap;
|
||||
|
@ -9915,7 +9915,7 @@ static void generate_m(switch_core_session_t *session, char *buf, size_t buflen,
|
|||
|
||||
|
||||
if ((smh->mparams->dtmf_type == DTMF_2833 || switch_channel_test_flag(session->channel, CF_LIBERAL_DTMF)) && smh->mparams->te > 95) {
|
||||
if (smh->mparams->dtmf_type == DTMF_2833 && sdp_type == SDP_TYPE_RESPONSE) {
|
||||
if (smh->mparams->dtmf_type == DTMF_2833 && sdp_type == SDP_ANSWER) {
|
||||
switch_rtp_engine_t *a_engine = &smh->engines[SWITCH_MEDIA_TYPE_AUDIO];
|
||||
if (a_engine) {
|
||||
payload_map_t *pmap;
|
||||
|
@ -10264,7 +10264,7 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
|
|||
v_engine->rtcp_mux = -1;
|
||||
}
|
||||
|
||||
if ((a_engine->rtcp_mux != -1 && v_engine->rtcp_mux != -1) && (sdp_type == SDP_TYPE_REQUEST)) {
|
||||
if ((a_engine->rtcp_mux != -1 && v_engine->rtcp_mux != -1) && (sdp_type == SDP_OFFER)) {
|
||||
a_engine->rtcp_mux = 1;
|
||||
v_engine->rtcp_mux = 1;
|
||||
}
|
||||
|
@ -10347,7 +10347,7 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
|
|||
continue;
|
||||
}
|
||||
|
||||
if (sdp_type == SDP_TYPE_REQUEST) {
|
||||
if (sdp_type == SDP_OFFER) {
|
||||
for (j = 0; j < SWITCH_MAX_CODECS; j++) {
|
||||
if (smh->rates[j] == 0) {
|
||||
break;
|
||||
|
@ -10365,7 +10365,7 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
|
|||
continue;
|
||||
}
|
||||
|
||||
if (sdp_type == SDP_TYPE_REQUEST) {
|
||||
if (sdp_type == SDP_OFFER) {
|
||||
switch_core_session_t *orig_session = NULL;
|
||||
|
||||
switch_core_session_get_partner(session, &orig_session);
|
||||
|
@ -11180,7 +11180,7 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
|
|||
}
|
||||
}
|
||||
|
||||
if (sdp_type == SDP_TYPE_REQUEST) {
|
||||
if (sdp_type == SDP_OFFER) {
|
||||
fir++;
|
||||
pli++;
|
||||
nack++;
|
||||
|
@ -11441,7 +11441,7 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
|
|||
|
||||
// RTP TEXT
|
||||
|
||||
if (sdp_type == SDP_TYPE_RESPONSE && !switch_channel_test_flag(session->channel, CF_RTT)) {
|
||||
if (sdp_type == SDP_ANSWER && !switch_channel_test_flag(session->channel, CF_RTT)) {
|
||||
if (switch_channel_test_flag(session->channel, CF_TEXT_SDP_RECVD)) {
|
||||
switch_channel_clear_flag(session->channel, CF_TEXT_SDP_RECVD);
|
||||
switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "m=text 0 %s 19\r\n",
|
||||
|
@ -11456,7 +11456,7 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
|
|||
t_engine->t140_pt = 0;
|
||||
t_engine->red_pt = 0;
|
||||
|
||||
if (sdp_type == SDP_TYPE_REQUEST) {
|
||||
if (sdp_type == SDP_OFFER) {
|
||||
t_engine->t140_pt = 96;
|
||||
t_engine->red_pt = 97;
|
||||
|
||||
|
@ -11465,7 +11465,7 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
|
|||
"red",
|
||||
NULL,
|
||||
NULL,
|
||||
SDP_TYPE_REQUEST,
|
||||
SDP_OFFER,
|
||||
t_engine->red_pt,
|
||||
1000,
|
||||
0,
|
||||
|
@ -11477,7 +11477,7 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
|
|||
"t140",
|
||||
NULL,
|
||||
NULL,
|
||||
SDP_TYPE_REQUEST,
|
||||
SDP_OFFER,
|
||||
t_engine->t140_pt,
|
||||
1000,
|
||||
0,
|
||||
|
@ -11978,7 +11978,7 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
|
|||
"PROXY",
|
||||
NULL,
|
||||
NULL,
|
||||
SDP_TYPE_RESPONSE,
|
||||
SDP_ANSWER,
|
||||
0,
|
||||
8000,
|
||||
20,
|
||||
|
@ -12135,7 +12135,7 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
|
|||
"PROXY-VID",
|
||||
NULL,
|
||||
NULL,
|
||||
SDP_TYPE_RESPONSE,
|
||||
SDP_ANSWER,
|
||||
0,
|
||||
90000,
|
||||
90000,
|
||||
|
@ -12198,7 +12198,7 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
|
|||
"PROXY-TXT",
|
||||
NULL,
|
||||
NULL,
|
||||
SDP_TYPE_RESPONSE,
|
||||
SDP_ANSWER,
|
||||
0,
|
||||
90000,
|
||||
90000,
|
||||
|
@ -13099,7 +13099,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_receive_message(switch_core_se
|
|||
switch_core_media_prepare_codecs(session, 1);
|
||||
clear_pmaps(a_engine);
|
||||
clear_pmaps(v_engine);
|
||||
switch_core_media_gen_local_sdp(session, SDP_TYPE_REQUEST, ip, (switch_port_t)atoi(port), NULL, 1);
|
||||
switch_core_media_gen_local_sdp(session, SDP_OFFER, ip, (switch_port_t)atoi(port), NULL, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13151,7 +13151,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_receive_message(switch_core_se
|
|||
switch_core_media_prepare_codecs(session, SWITCH_TRUE);
|
||||
switch_core_media_check_video_codecs(session);
|
||||
|
||||
switch_core_media_gen_local_sdp(session, SDP_TYPE_REQUEST, NULL, 0, NULL, 1);
|
||||
switch_core_media_gen_local_sdp(session, SDP_OFFER, NULL, 0, NULL, 1);
|
||||
}
|
||||
|
||||
if (msg->numeric_arg && switch_core_session_get_partner(session, &nsession) == SWITCH_STATUS_SUCCESS) {
|
||||
|
@ -13964,7 +13964,7 @@ SWITCH_DECLARE(void) switch_core_media_check_outgoing_proxy(switch_core_session_
|
|||
"PROXY",
|
||||
NULL,
|
||||
NULL,
|
||||
SDP_TYPE_RESPONSE,
|
||||
SDP_ANSWER,
|
||||
0,
|
||||
8000,
|
||||
20,
|
||||
|
@ -13980,7 +13980,7 @@ SWITCH_DECLARE(void) switch_core_media_check_outgoing_proxy(switch_core_session_
|
|||
"PROXY-VID",
|
||||
NULL,
|
||||
NULL,
|
||||
SDP_TYPE_RESPONSE,
|
||||
SDP_ANSWER,
|
||||
0,
|
||||
90000,
|
||||
90000,
|
||||
|
@ -14001,7 +14001,7 @@ SWITCH_DECLARE(void) switch_core_media_check_outgoing_proxy(switch_core_session_
|
|||
"PROXY-TXT",
|
||||
NULL,
|
||||
NULL,
|
||||
SDP_TYPE_RESPONSE,
|
||||
SDP_ANSWER,
|
||||
0,
|
||||
1000,
|
||||
1000,
|
||||
|
@ -14155,7 +14155,7 @@ SWITCH_DECLARE (void) switch_core_media_recover_session(switch_core_session_t *s
|
|||
}
|
||||
}
|
||||
|
||||
switch_core_media_gen_local_sdp(session, SDP_TYPE_REQUEST, NULL, 0, NULL, 1);
|
||||
switch_core_media_gen_local_sdp(session, SDP_OFFER, NULL, 0, NULL, 1);
|
||||
switch_core_media_set_video_codec(session, 1);
|
||||
|
||||
if (switch_core_media_activate_rtp(session) != SWITCH_STATUS_SUCCESS) {
|
||||
|
|
|
@ -2151,7 +2151,7 @@ SWITCH_DECLARE(void) switch_ivr_check_hold(switch_core_session_t *session)
|
|||
msg.message_id = SWITCH_MESSAGE_INDICATE_MEDIA_RENEG;
|
||||
msg.from = __FILE__;
|
||||
|
||||
switch_core_media_set_smode(session, SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_FLOW_SENDRECV, SDP_TYPE_REQUEST);
|
||||
switch_core_media_set_smode(session, SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_FLOW_SENDRECV, SDP_OFFER);
|
||||
switch_core_session_receive_message(session, &msg);
|
||||
}
|
||||
|
||||
|
|
|
@ -187,7 +187,7 @@ FST_TEARDOWN_END()
|
|||
|
||||
switch_core_media_prepare_codecs(session, SWITCH_FALSE);
|
||||
|
||||
match = switch_core_media_negotiate_sdp(session, r_sdp, &p, SDP_TYPE_REQUEST);
|
||||
match = switch_core_media_negotiate_sdp(session, r_sdp, &p, SDP_OFFER);
|
||||
fst_requires(match == 1);
|
||||
|
||||
status = switch_core_media_choose_ports(session, SWITCH_TRUE, SWITCH_FALSE);
|
||||
|
|
|
@ -206,7 +206,7 @@ static switch_status_t rtp_test_start_call(switch_core_session_t **psession)
|
|||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
match = switch_core_media_negotiate_sdp(session, r_sdp, &p, SDP_TYPE_REQUEST);
|
||||
match = switch_core_media_negotiate_sdp(session, r_sdp, &p, SDP_OFFER);
|
||||
if (match != 1) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "switch_core_media_negotiate_sdp() failed\n");
|
||||
return SWITCH_STATUS_FALSE;
|
||||
|
|
Loading…
Reference in New Issue