mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-26 05:04:14 +00:00
omg it can make calls ... long way to go ...
This commit is contained in:
1 parent
48554d1a85
commit
d012c5f392
7 files changed
+97
-135
No files matched your search
@@ -685,7 +685,7 @@ struct private_object {
|
||||
char *codec_order[SWITCH_MAX_CODECS];
|
||||
int codec_order_last;
|
||||
const switch_codec_implementation_t *codecs[SWITCH_MAX_CODECS];
|
||||
int num_codecs;
|
||||
|
||||
const switch_codec_implementation_t *negotiated_codecs[SWITCH_MAX_CODECS];
|
||||
int num_negotiated_codecs;
|
||||
switch_codec_t read_codec;
|
||||
@@ -873,18 +873,10 @@ void sofia_glue_global_standby(switch_bool_t on);
|
||||
|
||||
switch_status_t sofia_media_activate_rtp(private_object_t *tech_pvt);
|
||||
|
||||
void sofia_glue_deactivate_rtp(private_object_t *tech_pvt);
|
||||
|
||||
void sofia_media_set_local_sdp(private_object_t *tech_pvt, const char *ip, switch_port_t port, const char *sr, int force);
|
||||
|
||||
void sofia_media_tech_prepare_codecs(private_object_t *tech_pvt);
|
||||
|
||||
const char *sofia_media_get_codec_string(private_object_t *tech_pvt);
|
||||
|
||||
void sofia_glue_attach_private(switch_core_session_t *session, sofia_profile_t *profile, private_object_t *tech_pvt, const char *channame);
|
||||
|
||||
switch_status_t sofia_glue_tech_choose_port(private_object_t *tech_pvt, int force);
|
||||
|
||||
switch_status_t sofia_glue_do_invite(switch_core_session_t *session);
|
||||
|
||||
uint8_t sofia_media_negotiate_sdp(switch_core_session_t *session, const char *r_sdp);
|
||||
@@ -1069,7 +1061,7 @@ char *sofia_glue_strip_uri(const char *str);
|
||||
int sofia_glue_transport_has_tls(const sofia_transport_t tp);
|
||||
const char *sofia_glue_get_unknown_header(sip_t const *sip, const char *name);
|
||||
switch_status_t sofia_media_build_crypto(private_object_t *tech_pvt, int index, switch_rtp_crypto_key_type_t type, switch_rtp_crypto_direction_t direction);
|
||||
void sofia_media_tech_patch_sdp(private_object_t *tech_pvt);
|
||||
|
||||
void sofia_presence_event_thread_start(void);
|
||||
void sofia_reg_expire_call_id(sofia_profile_t *profile, const char *call_id, int reboot);
|
||||
void sofia_reg_check_call_id(sofia_profile_t *profile, const char *call_id);
|
||||
@@ -1086,7 +1078,6 @@ void sofia_reg_send_reboot(sofia_profile_t *profile, const char *callid, const c
|
||||
void sofia_glue_restart_all_profiles(void);
|
||||
const char *sofia_state_string(int state);
|
||||
void sofia_wait_for_reply(struct private_object *tech_pvt, nua_event_t event, uint32_t timeout);
|
||||
void sofia_glue_set_udptl_image_sdp(private_object_t *tech_pvt, switch_t38_options_t *t38_options, int insist);
|
||||
|
||||
/*
|
||||
* Logging control functions
|
||||
@@ -1111,7 +1102,6 @@ switch_status_t list_profiles_full(const char *line, const char *cursor, switch_
|
||||
switch_status_t list_profiles(const char *line, const char *cursor, switch_console_callback_match_t **matches);
|
||||
|
||||
sofia_cid_type_t sofia_cid_name2type(const char *name);
|
||||
void sofia_media_tech_set_local_sdp(private_object_t *tech_pvt, const char *sdp_str, switch_bool_t dup);
|
||||
void sofia_glue_set_rtp_stats(private_object_t *tech_pvt);
|
||||
void sofia_glue_get_addr(msg_t *msg, char *buf, size_t buflen, int *port);
|
||||
sofia_destination_t *sofia_glue_get_destination(char *data);
|
||||
|
||||
@@ -5805,7 +5805,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
||||
} else {
|
||||
uint8_t match = 0;
|
||||
|
||||
if (tech_pvt->num_codecs) {
|
||||
if (tech_pvt->mparams->num_codecs) {
|
||||
match = sofia_media_negotiate_sdp(session, r_sdp);
|
||||
}
|
||||
|
||||
@@ -5888,8 +5888,8 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
||||
switch_channel_hangup(channel, SWITCH_CAUSE_MANDATORY_IE_MISSING);
|
||||
} else {
|
||||
switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "RECEIVED_NOSDP");
|
||||
sofia_glue_tech_choose_port(tech_pvt, 0);
|
||||
sofia_media_set_local_sdp(tech_pvt, NULL, 0, NULL, 0);
|
||||
switch_core_media_choose_port(tech_pvt->session, SWITCH_MEDIA_TYPE_AUDIO, 0);
|
||||
switch_core_media_gen_local_sdp(session, NULL, 0, NULL, 0);
|
||||
sofia_set_flag_locked(tech_pvt, TFLAG_3PCC);
|
||||
switch_channel_set_state(channel, CS_HIBERNATE);
|
||||
if (sofia_use_soa(tech_pvt)) {
|
||||
@@ -5911,8 +5911,8 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
||||
// so can be made to work with bypass media as we have time to find out what the other end thinks codec offer should be...
|
||||
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_media_set_local_sdp(tech_pvt, NULL, 0, NULL, 0);
|
||||
//switch_core_media_choose_port(tech_pvt->session, SWITCH_MEDIA_TYPE_AUDIO, 0);
|
||||
//switch_core_media_gen_local_sdp(session, NULL, 0, NULL, 0);
|
||||
sofia_set_flag(tech_pvt, TFLAG_LATE_NEGOTIATION);
|
||||
//Moves into CS_INIT so call moves forward into the dialplan
|
||||
switch_channel_set_state(channel, CS_INIT);
|
||||
@@ -5980,14 +5980,14 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
||||
tech_pvt->hold_laps = 1;
|
||||
switch_channel_set_variable(channel, SWITCH_R_SDP_VARIABLE, r_sdp);
|
||||
switch_channel_clear_flag(channel, CF_PROXY_MODE);
|
||||
sofia_media_tech_set_local_sdp(tech_pvt, NULL, SWITCH_FALSE);
|
||||
switch_core_media_set_local_sdp(tech_pvt->session, NULL, SWITCH_FALSE);
|
||||
|
||||
if (!switch_channel_media_ready(channel)) {
|
||||
if (switch_channel_direction(tech_pvt->channel) == SWITCH_CALL_DIRECTION_INBOUND) {
|
||||
//const char *r_sdp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE);
|
||||
|
||||
tech_pvt->num_codecs = 0;
|
||||
sofia_media_tech_prepare_codecs(tech_pvt);
|
||||
|
||||
switch_core_media_prepare_codecs(tech_pvt->session, SWITCH_TRUE);
|
||||
if (sofia_media_tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "CODEC NEGOTIATION ERROR");
|
||||
status = SWITCH_STATUS_FALSE;
|
||||
@@ -5999,14 +5999,14 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
||||
|
||||
|
||||
if (!switch_rtp_ready(tech_pvt->rtp_session)) {
|
||||
sofia_media_tech_prepare_codecs(tech_pvt);
|
||||
if ((status = sofia_glue_tech_choose_port(tech_pvt, 0)) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_core_media_prepare_codecs(tech_pvt->session, SWITCH_FALSE);
|
||||
if ((status = switch_core_media_choose_port(tech_pvt->session, SWITCH_MEDIA_TYPE_AUDIO, 0)) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
||||
switch_core_session_rwunlock(other_session);
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
sofia_media_set_local_sdp(tech_pvt, NULL, 0, NULL, 1);
|
||||
switch_core_media_gen_local_sdp(session, NULL, 0, NULL, 1);
|
||||
|
||||
if (sofia_use_soa(tech_pvt)) {
|
||||
nua_respond(tech_pvt->nh, SIP_200_OK,
|
||||
@@ -6098,7 +6098,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->num_codecs) {
|
||||
if (tech_pvt->mparams->num_codecs) {
|
||||
match = sofia_media_negotiate_sdp(session, r_sdp);
|
||||
}
|
||||
|
||||
@@ -6108,11 +6108,11 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
||||
}
|
||||
|
||||
if (match) {
|
||||
if (sofia_glue_tech_choose_port(tech_pvt, 0) != SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_core_media_choose_port(tech_pvt->session, SWITCH_MEDIA_TYPE_AUDIO, 0) != SWITCH_STATUS_SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
sofia_media_set_local_sdp(tech_pvt, NULL, 0, NULL, 0);
|
||||
switch_core_media_gen_local_sdp(session, 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");
|
||||
@@ -6131,7 +6131,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)) {
|
||||
sofia_media_set_local_sdp(tech_pvt, NULL, 0, NULL, 0);
|
||||
switch_core_media_gen_local_sdp(session, NULL, 0, NULL, 0);
|
||||
}
|
||||
if (sofia_use_soa(tech_pvt)) {
|
||||
nua_respond(tech_pvt->nh, SIP_200_OK,
|
||||
@@ -6162,14 +6162,14 @@ 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->num_codecs) {
|
||||
if (tech_pvt->mparams->num_codecs) {
|
||||
match = sofia_media_negotiate_sdp(session, r_sdp);
|
||||
}
|
||||
if (match) {
|
||||
if (sofia_glue_tech_choose_port(tech_pvt, 0) != SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_core_media_choose_port(tech_pvt->session, SWITCH_MEDIA_TYPE_AUDIO, 0) != SWITCH_STATUS_SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
sofia_media_set_local_sdp(tech_pvt, NULL, 0, NULL, 0);
|
||||
switch_core_media_gen_local_sdp(session, 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);
|
||||
@@ -6222,7 +6222,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
||||
uint8_t match = 0;
|
||||
int is_ok = 1;
|
||||
|
||||
if (tech_pvt->num_codecs) {
|
||||
if (tech_pvt->mparams->num_codecs) {
|
||||
match = sofia_media_negotiate_sdp(session, r_sdp);
|
||||
}
|
||||
|
||||
@@ -6255,7 +6255,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
||||
switch_channel_set_flag(tech_pvt->channel, CF_REINVITE);
|
||||
tech_pvt->nh = tech_pvt->nh2;
|
||||
tech_pvt->nh2 = NULL;
|
||||
if (sofia_glue_tech_choose_port(tech_pvt, 0) == SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_core_media_choose_port(tech_pvt->session, SWITCH_MEDIA_TYPE_AUDIO, 0) == SWITCH_STATUS_SUCCESS) {
|
||||
if (sofia_media_activate_rtp(tech_pvt) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Cheater Reinvite RTP Error!\n");
|
||||
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
||||
@@ -6318,7 +6318,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
||||
} else {
|
||||
uint8_t match = 0;
|
||||
|
||||
if (tech_pvt->num_codecs) {
|
||||
if (tech_pvt->mparams->num_codecs) {
|
||||
match = sofia_media_negotiate_sdp(session, r_sdp);
|
||||
}
|
||||
|
||||
@@ -6327,7 +6327,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
||||
if (match) {
|
||||
switch_channel_check_zrtp(channel);
|
||||
|
||||
if (sofia_glue_tech_choose_port(tech_pvt, 0) == SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_core_media_choose_port(tech_pvt->session, SWITCH_MEDIA_TYPE_AUDIO, 0) == SWITCH_STATUS_SUCCESS) {
|
||||
if (sofia_media_activate_rtp(tech_pvt) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_mark_answered(channel);
|
||||
} else {
|
||||
@@ -8119,7 +8119,7 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
|
||||
}
|
||||
|
||||
//sofia_glue_set_name(tech_pvt, channel_name);
|
||||
sofia_media_tech_prepare_codecs(tech_pvt);
|
||||
switch_core_media_prepare_codecs(tech_pvt->session, SWITCH_FALSE);
|
||||
|
||||
switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "INBOUND CALL");
|
||||
|
||||
|
||||
@@ -83,6 +83,9 @@ void sofia_glue_attach_private(switch_core_session_t *session, sofia_profile_t *
|
||||
switch_mutex_lock(tech_pvt->flag_mutex);
|
||||
switch_mutex_lock(profile->flag_mutex);
|
||||
|
||||
tech_pvt->mparams = switch_core_session_alloc(session, sizeof(*tech_pvt->mparams));
|
||||
|
||||
|
||||
/* copy flags from profile to the sofia private */
|
||||
for (x = 0; x < TFLAG_MAX; x++) {
|
||||
tech_pvt->flags[x] = profile->flags[x];
|
||||
@@ -138,6 +141,8 @@ void sofia_glue_attach_private(switch_core_session_t *session, sofia_profile_t *
|
||||
switch_channel_set_cap(tech_pvt->channel, CC_FS_RTP);
|
||||
switch_channel_set_cap(tech_pvt->channel, CC_QUEUEABLE_DTMF_DELAY);
|
||||
|
||||
|
||||
|
||||
tech_pvt->mparams->ndlb = tech_pvt->profile->mndlb;
|
||||
tech_pvt->mparams->inbound_codec_string = profile->inbound_codec_string;
|
||||
tech_pvt->mparams->outbound_codec_string = profile->outbound_codec_string;
|
||||
@@ -153,6 +158,8 @@ void sofia_glue_attach_private(switch_core_session_t *session, sofia_profile_t *
|
||||
tech_pvt->mparams->jb_msec = profile->jb_msec;
|
||||
tech_pvt->mparams->rtcp_audio_interval_msec = profile->rtcp_audio_interval_msec;
|
||||
tech_pvt->mparams->rtcp_video_interval_msec = profile->rtcp_video_interval_msec;
|
||||
tech_pvt->mparams->sdp_username = profile->sdp_username;
|
||||
|
||||
|
||||
switch_media_handle_create(&tech_pvt->media_handle, session, tech_pvt->mparams);
|
||||
switch_media_handle_set_media_flags(tech_pvt->media_handle, tech_pvt->profile->media_flags);
|
||||
@@ -696,7 +703,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
|
||||
|
||||
cid_name = caller_profile->caller_id_name;
|
||||
cid_num = caller_profile->caller_id_number;
|
||||
sofia_media_tech_prepare_codecs(tech_pvt);
|
||||
switch_core_media_prepare_codecs(tech_pvt->session, SWITCH_FALSE);
|
||||
switch_core_media_check_video_codecs(tech_pvt->session);
|
||||
check_decode(cid_name, session);
|
||||
check_decode(cid_num, session);
|
||||
@@ -708,13 +715,13 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
|
||||
|
||||
max_forwards = switch_channel_get_variable(channel, SWITCH_MAX_FORWARDS_VARIABLE);
|
||||
|
||||
if ((status = sofia_glue_tech_choose_port(tech_pvt, 0)) != SWITCH_STATUS_SUCCESS) {
|
||||
if ((status = switch_core_media_choose_port(tech_pvt->session, SWITCH_MEDIA_TYPE_AUDIO, 0)) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_ERROR, "Port Error!\n");
|
||||
return status;
|
||||
}
|
||||
|
||||
if (!switch_channel_get_private(tech_pvt->channel, "t38_options") || zstr(tech_pvt->mparams->local_sdp_str)) {
|
||||
sofia_media_set_local_sdp(tech_pvt, NULL, 0, NULL, 0);
|
||||
switch_core_media_gen_local_sdp(session, NULL, 0, NULL, 0);
|
||||
}
|
||||
|
||||
sofia_set_flag_locked(tech_pvt, TFLAG_READY);
|
||||
@@ -1136,7 +1143,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
|
||||
if (switch_rtp_ready(tech_pvt->rtp_session)) {
|
||||
switch_core_media_proxy_remote_addr(session, NULL);
|
||||
}
|
||||
sofia_media_tech_patch_sdp(tech_pvt);
|
||||
switch_core_media_patch_sdp(tech_pvt->session);
|
||||
}
|
||||
|
||||
if (!zstr(tech_pvt->dest)) {
|
||||
@@ -1976,7 +1983,7 @@ int sofia_recover_callback(switch_core_session_t *session)
|
||||
//sofia_media_tech_set_video_codec(tech_pvt, 1);
|
||||
}
|
||||
|
||||
sofia_media_set_local_sdp(tech_pvt, NULL, 0, NULL, 1);
|
||||
switch_core_media_gen_local_sdp(session, NULL, 0, NULL, 1);
|
||||
|
||||
if (sofia_media_activate_rtp(tech_pvt) != SWITCH_STATUS_SUCCESS) {
|
||||
goto end;
|
||||
|
||||
@@ -122,6 +122,10 @@ switch_status_t sofia_media_activate_rtp(private_object_t *tech_pvt)
|
||||
status = switch_core_media_activate_rtp(tech_pvt->session);
|
||||
switch_mutex_unlock(tech_pvt->sofia_mutex);
|
||||
|
||||
///HACK REMOVE ME
|
||||
tech_pvt->rtp_session = tech_pvt->mparams->rtp_session;
|
||||
tech_pvt->video_rtp_session = tech_pvt->mparams->video_rtp_session;
|
||||
|
||||
if (status == SWITCH_STATUS_SUCCESS) {
|
||||
sofia_set_flag(tech_pvt, TFLAG_RTP);
|
||||
sofia_set_flag(tech_pvt, TFLAG_IO);
|
||||
@@ -394,7 +398,7 @@ switch_status_t sofia_media_tech_media(private_object_t *tech_pvt, const char *r
|
||||
}
|
||||
|
||||
if ((match = sofia_media_negotiate_sdp(tech_pvt->session, r_sdp))) {
|
||||
if (sofia_glue_tech_choose_port(tech_pvt, 0) != SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_core_media_choose_port(tech_pvt->session, SWITCH_MEDIA_TYPE_AUDIO, 0) != SWITCH_STATUS_SUCCESS) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
if (sofia_media_activate_rtp(tech_pvt) != SWITCH_STATUS_SUCCESS) {
|
||||
@@ -411,69 +415,6 @@ switch_status_t sofia_media_tech_media(private_object_t *tech_pvt, const char *r
|
||||
}
|
||||
|
||||
|
||||
void sofia_media_tech_prepare_codecs(private_object_t *tech_pvt)
|
||||
{
|
||||
const char *abs, *codec_string = NULL;
|
||||
const char *ocodec = NULL;
|
||||
|
||||
if (switch_channel_test_flag(tech_pvt->channel, CF_PROXY_MODE) || switch_channel_test_flag(tech_pvt->channel, CF_PROXY_MEDIA)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (tech_pvt->num_codecs) {
|
||||
return;
|
||||
}
|
||||
|
||||
tech_pvt->payload_space = 0;
|
||||
|
||||
switch_assert(tech_pvt->session != NULL);
|
||||
|
||||
if ((abs = switch_channel_get_variable(tech_pvt->channel, "absolute_codec_string"))) {
|
||||
/* inherit_codec == true will implicitly clear the absolute_codec_string
|
||||
variable if used since it was the reason it was set in the first place and is no longer needed */
|
||||
if (switch_true(switch_channel_get_variable(tech_pvt->channel, "inherit_codec"))) {
|
||||
switch_channel_set_variable(tech_pvt->channel, "absolute_codec_string", NULL);
|
||||
}
|
||||
codec_string = abs;
|
||||
goto ready;
|
||||
}
|
||||
|
||||
if (!(codec_string = switch_channel_get_variable(tech_pvt->channel, "codec_string"))) {
|
||||
codec_string = switch_core_media_get_codec_string(tech_pvt->session);
|
||||
}
|
||||
|
||||
if (codec_string && *codec_string == '=') {
|
||||
codec_string++;
|
||||
goto ready;
|
||||
}
|
||||
|
||||
|
||||
if ((ocodec = switch_channel_get_variable(tech_pvt->channel, SWITCH_ORIGINATOR_CODEC_VARIABLE))) {
|
||||
if (!codec_string || sofia_test_pflag(tech_pvt->profile, PFLAG_DISABLE_TRANSCODING)) {
|
||||
codec_string = ocodec;
|
||||
} else {
|
||||
if (!(codec_string = switch_core_session_sprintf(tech_pvt->session, "%s,%s", ocodec, codec_string))) {
|
||||
codec_string = ocodec;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ready:
|
||||
|
||||
if (codec_string) {
|
||||
char *tmp_codec_string = switch_core_session_strdup(tech_pvt->session, codec_string);
|
||||
tech_pvt->codec_order_last = switch_separate_string(tmp_codec_string, ',', tech_pvt->codec_order, SWITCH_MAX_CODECS);
|
||||
tech_pvt->num_codecs =
|
||||
switch_loadable_module_get_codecs_sorted(tech_pvt->codecs, SWITCH_MAX_CODECS, tech_pvt->codec_order, tech_pvt->codec_order_last);
|
||||
|
||||
} else {
|
||||
tech_pvt->num_codecs = switch_loadable_module_get_codecs(tech_pvt->codecs, sizeof(tech_pvt->codecs) / sizeof(tech_pvt->codecs[0]));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void sofia_media_deactivate_rtp(private_object_t *tech_pvt)
|
||||
{
|
||||
int loops = 0;
|
||||
|
||||
Reference in new issue
Block a user