From 1ab88581d795b02300e141da7f694887fb5e0d97 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 19 Dec 2012 14:51:28 -0600 Subject: [PATCH] rename --- src/mod/endpoints/mod_sofia/mod_sofia.c | 70 ++++++++++---------- src/mod/endpoints/mod_sofia/mod_sofia.h | 36 +++++------ src/mod/endpoints/mod_sofia/sofia.c | 44 ++++++------- src/mod/endpoints/mod_sofia/sofia_glue.c | 18 +++--- src/mod/endpoints/mod_sofia/sofia_media.c | 78 +++++++++++------------ 5 files changed, 123 insertions(+), 123 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index da88a181cd..b5355612be 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -85,7 +85,7 @@ static switch_status_t sofia_on_init(switch_core_session_t *session) switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s SOFIA INIT\n", switch_channel_get_name(channel)); if (switch_channel_test_flag(channel, CF_PROXY_MODE) || switch_channel_test_flag(channel, CF_PROXY_MEDIA)) { - sofia_glue_tech_absorb_sdp(tech_pvt); + sofia_media_tech_absorb_sdp(tech_pvt); } if (switch_channel_test_flag(tech_pvt->channel, CF_RECOVERING) || switch_channel_test_flag(tech_pvt->channel, CF_RECOVERING_BRIDGE)) { @@ -701,7 +701,7 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session) // This code handles the pass_indication sent after the 3pcc ack is received by the other leg in the is_3pcc && is_proxy case below. // Is there a better place to hang this...? b_sdp = switch_channel_get_variable(channel, SWITCH_B_SDP_VARIABLE); - sofia_glue_tech_set_local_sdp(tech_pvt, b_sdp, SWITCH_TRUE); + sofia_media_tech_set_local_sdp(tech_pvt, b_sdp, SWITCH_TRUE); switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "3PCC-PROXY nomedia - sending ack\n"); nua_ack(tech_pvt->nh, @@ -729,10 +729,10 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session) is_3pcc = (sofia_test_pflag(tech_pvt->profile, PFLAG_3PCC_PROXY) && sofia_test_flag(tech_pvt, TFLAG_3PCC)); if (b_sdp && is_proxy && !is_3pcc) { - sofia_glue_tech_set_local_sdp(tech_pvt, b_sdp, SWITCH_TRUE); + sofia_media_tech_set_local_sdp(tech_pvt, b_sdp, SWITCH_TRUE); if (switch_channel_test_flag(channel, CF_PROXY_MEDIA)) { - sofia_glue_tech_patch_sdp(tech_pvt); + sofia_media_tech_patch_sdp(tech_pvt); if (sofia_media_activate_rtp(tech_pvt) != SWITCH_STATUS_SUCCESS) { return SWITCH_STATUS_FALSE; } @@ -743,15 +743,15 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session) if(!is_proxy) { tech_pvt->num_codecs = 0; - sofia_glue_tech_prepare_codecs(tech_pvt); + sofia_media_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); + sofia_media_set_local_sdp(tech_pvt, NULL, 0, NULL, 0); } else { - sofia_glue_tech_set_local_sdp(tech_pvt, b_sdp, SWITCH_TRUE); + sofia_media_tech_set_local_sdp(tech_pvt, b_sdp, SWITCH_TRUE); if (switch_channel_test_flag(channel, CF_PROXY_MEDIA)) { - sofia_glue_tech_patch_sdp(tech_pvt); + sofia_media_tech_patch_sdp(tech_pvt); if (sofia_media_activate_rtp(tech_pvt) != SWITCH_STATUS_SUCCESS) { return SWITCH_STATUS_FALSE; } @@ -823,9 +823,9 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session) 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_glue_tech_prepare_codecs(tech_pvt); + sofia_media_tech_prepare_codecs(tech_pvt); - if (sofia_glue_tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) { + if (sofia_media_tech_media(tech_pvt, r_sdp) != 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()); @@ -840,7 +840,7 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session) return status; } - sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 0); + sofia_media_set_local_sdp(tech_pvt, NULL, 0, NULL, 0); if (sofia_media_activate_rtp(tech_pvt) != SWITCH_STATUS_SUCCESS) { switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); } @@ -983,7 +983,7 @@ static switch_status_t sofia_read_video_frame(switch_core_session_t *session, sw if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_BREAK) { if (status == SWITCH_STATUS_TIMEOUT) { if (sofia_test_flag(tech_pvt, TFLAG_SIP_HOLD)) { - sofia_glue_toggle_hold(tech_pvt, 0); + sofia_media_toggle_hold(tech_pvt, 0); sofia_clear_flag_locked(tech_pvt, TFLAG_SIP_HOLD); switch_channel_clear_flag(channel, CF_LEG_HOLDING); } @@ -1105,7 +1105,7 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f if (status == SWITCH_STATUS_TIMEOUT) { if (sofia_test_flag(tech_pvt, TFLAG_SIP_HOLD)) { - sofia_glue_toggle_hold(tech_pvt, 0); + sofia_media_toggle_hold(tech_pvt, 0); sofia_clear_flag_locked(tech_pvt, TFLAG_SIP_HOLD); switch_channel_clear_flag(channel, CF_LEG_HOLDING); } @@ -1274,7 +1274,7 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f tech_pvt->codec_ms = codec_ms; } - if (sofia_glue_tech_set_codec(tech_pvt, 2) != SWITCH_STATUS_SUCCESS) { + if (sofia_media_tech_set_codec(tech_pvt, 2) != SWITCH_STATUS_SUCCESS) { *frame = NULL; return SWITCH_STATUS_GENERR; } @@ -1905,9 +1905,9 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi tech_pvt->rm_encoding = NULL; tech_pvt->video_rm_encoding = NULL; sofia_clear_flag_locked(tech_pvt, TFLAG_VIDEO); - sofia_glue_tech_prepare_codecs(tech_pvt); - sofia_glue_check_video_codecs(tech_pvt); - sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 1); + sofia_media_tech_prepare_codecs(tech_pvt); + sofia_media_check_video_codecs(tech_pvt); + sofia_media_set_local_sdp(tech_pvt, NULL, 0, NULL, 1); sofia_set_pflag(tech_pvt->profile, PFLAG_RENEG_ON_REINVITE); sofia_clear_flag(tech_pvt, TFLAG_ENABLE_SOA); } @@ -1940,7 +1940,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) { - sofia_glue_set_local_sdp(tech_pvt, ip, (switch_port_t)atoi(port), msg->string_arg, 1); + sofia_media_set_local_sdp(tech_pvt, ip, (switch_port_t)atoi(port), msg->string_arg, 1); } if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) { @@ -1971,7 +1971,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi if (tech_pvt->rm_encoding) { tech_pvt->rm_encoding = NULL; } - sofia_glue_tech_set_local_sdp(tech_pvt, NULL, SWITCH_FALSE); + sofia_media_tech_set_local_sdp(tech_pvt, NULL, SWITCH_FALSE); if ((uuid = switch_channel_get_partner_uuid(channel)) && (other_session = switch_core_session_locate(uuid))) { @@ -1980,13 +1980,13 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi port = switch_channel_get_variable(other_channel, SWITCH_REMOTE_MEDIA_PORT_VARIABLE); switch_core_session_rwunlock(other_session); if (ip && port) { - sofia_glue_set_local_sdp(tech_pvt, ip, (switch_port_t)atoi(port), NULL, 1); + sofia_media_set_local_sdp(tech_pvt, ip, (switch_port_t)atoi(port), NULL, 1); } } if (!tech_pvt->local_sdp_str) { - sofia_glue_tech_absorb_sdp(tech_pvt); + sofia_media_tech_absorb_sdp(tech_pvt); } sofia_glue_do_invite(session); @@ -2019,7 +2019,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s Sending media re-direct:\n%s\n", switch_channel_get_name(channel), msg->string_arg); - sofia_glue_tech_set_local_sdp(tech_pvt, msg->string_arg, SWITCH_TRUE); + sofia_media_tech_set_local_sdp(tech_pvt, msg->string_arg, SWITCH_TRUE); if(zstr(tech_pvt->local_sdp_str)) { sofia_set_flag(tech_pvt, TFLAG_3PCC_INVITE); @@ -2109,15 +2109,15 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi uint32_t send_invite = 1; switch_channel_clear_flag(channel, CF_PROXY_MODE); - sofia_glue_tech_set_local_sdp(tech_pvt, NULL, SWITCH_FALSE); + sofia_media_tech_set_local_sdp(tech_pvt, NULL, SWITCH_FALSE); if (!(switch_channel_test_flag(channel, CF_ANSWERED) || switch_channel_test_flag(channel, CF_EARLY_MEDIA))) { 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_glue_tech_prepare_codecs(tech_pvt); - if (sofia_glue_tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) { + sofia_media_tech_prepare_codecs(tech_pvt); + 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; goto end_lock; @@ -2127,13 +2127,13 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi } if (!switch_rtp_ready(tech_pvt->rtp_session)) { - sofia_glue_tech_prepare_codecs(tech_pvt); + sofia_media_tech_prepare_codecs(tech_pvt); if ((status = sofia_glue_tech_choose_port(tech_pvt, 0)) != SWITCH_STATUS_SUCCESS) { switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); goto end_lock; } } - sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 1); + sofia_media_set_local_sdp(tech_pvt, NULL, 0, NULL, 1); if (send_invite) { if (!switch_channel_test_flag(channel, CF_PROXY_MEDIA)) { @@ -2446,7 +2446,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi { if (msg->numeric_arg) { - sofia_glue_toggle_hold(tech_pvt, 1); + sofia_media_toggle_hold(tech_pvt, 1); } else { sofia_set_flag_locked(tech_pvt, TFLAG_SIP_HOLD); @@ -2636,11 +2636,11 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi } } } else { - sofia_glue_tech_set_local_sdp(tech_pvt, sdp, SWITCH_TRUE); + sofia_media_tech_set_local_sdp(tech_pvt, sdp, SWITCH_TRUE); } if (switch_channel_test_flag(channel, CF_PROXY_MEDIA)) { - sofia_glue_tech_patch_sdp(tech_pvt); + sofia_media_tech_patch_sdp(tech_pvt); sofia_glue_tech_proxy_remote_addr(tech_pvt, NULL); } if (sofia_use_soa(tech_pvt)) { @@ -2760,11 +2760,11 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi if (switch_channel_test_flag(channel, CF_PROXY_MODE) || switch_channel_test_flag(channel, CF_PROXY_MEDIA)) { const char *sdp = NULL; if ((sdp = switch_channel_get_variable(channel, SWITCH_B_SDP_VARIABLE))) { - sofia_glue_tech_set_local_sdp(tech_pvt, sdp, SWITCH_TRUE); + sofia_media_tech_set_local_sdp(tech_pvt, sdp, SWITCH_TRUE); } if (switch_channel_test_flag(channel, CF_PROXY_MEDIA)) { - sofia_glue_tech_patch_sdp(tech_pvt); + sofia_media_tech_patch_sdp(tech_pvt); if (sofia_media_activate_rtp(tech_pvt) != SWITCH_STATUS_SUCCESS) { status = SWITCH_STATUS_FALSE; @@ -2778,8 +2778,8 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi const char *r_sdp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE); tech_pvt->num_codecs = 0; - sofia_glue_tech_prepare_codecs(tech_pvt); - if (zstr(r_sdp) || sofia_glue_tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) { + sofia_media_tech_prepare_codecs(tech_pvt); + if (zstr(r_sdp) || sofia_media_tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "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"); @@ -2796,7 +2796,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; } - sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 0); + sofia_media_set_local_sdp(tech_pvt, NULL, 0, NULL, 0); if (sofia_media_activate_rtp(tech_pvt) != SWITCH_STATUS_SUCCESS) { switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); } diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.h b/src/mod/endpoints/mod_sofia/mod_sofia.h index 6be5927507..d4879ebf41 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.h +++ b/src/mod/endpoints/mod_sofia/mod_sofia.h @@ -917,11 +917,11 @@ switch_status_t sofia_media_activate_rtp(private_object_t *tech_pvt); void sofia_glue_deactivate_rtp(private_object_t *tech_pvt); -void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, switch_port_t port, const char *sr, int force); +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_glue_tech_prepare_codecs(private_object_t *tech_pvt); +void sofia_media_tech_prepare_codecs(private_object_t *tech_pvt); -const char *sofia_glue_get_codec_string(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); @@ -929,7 +929,7 @@ switch_status_t sofia_glue_tech_choose_port(private_object_t *tech_pvt, int forc switch_status_t sofia_glue_do_invite(switch_core_session_t *session); -uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_sdp); +uint8_t sofia_media_negotiate_sdp(switch_core_session_t *session, const char *r_sdp); void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, switch_core_session_t *session, sip_t const *sip, sofia_dispatch_event_t *de, tagi_t tags[]); @@ -956,7 +956,7 @@ void launch_sofia_profile_thread(sofia_profile_t *profile); switch_status_t sofia_presence_chat_send(switch_event_t *message_event); -void sofia_glue_tech_absorb_sdp(private_object_t *tech_pvt); +void sofia_media_tech_absorb_sdp(private_object_t *tech_pvt); void sofia_glue_pass_zrtp_hash2(switch_core_session_t *aleg_session, switch_core_session_t *bleg_session); void sofia_glue_pass_zrtp_hash(switch_core_session_t *session); @@ -966,8 +966,8 @@ void sofia_glue_pass_zrtp_hash(switch_core_session_t *session); * \param codec_string The profile's codec string or NULL if inexistant * \param sdp The parsed SDP content */ -void sofia_glue_set_r_sdp_codec_string(switch_core_session_t *session, const char *codec_string, sdp_session_t *sdp); -switch_status_t sofia_glue_tech_media(private_object_t *tech_pvt, const char *r_sdp); +void sofia_media_set_r_sdp_codec_string(switch_core_session_t *session, const char *codec_string, sdp_session_t *sdp); +switch_status_t sofia_media_tech_media(private_object_t *tech_pvt, const char *r_sdp); char *sofia_reg_find_reg_url(sofia_profile_t *profile, const char *user, const char *host, char *val, switch_size_t len); void event_handler(switch_event_t *event); void sofia_presence_event_handler(switch_event_t *event); @@ -1040,7 +1040,7 @@ char *sofia_overcome_sip_uri_weakness(switch_core_session_t *session, const char switch_bool_t sofia_glue_execute_sql_callback(sofia_profile_t *profile, switch_mutex_t *mutex, char *sql, switch_core_db_callback_func_t callback, void *pdata); char *sofia_glue_execute_sql2str(sofia_profile_t *profile, switch_mutex_t *mutex, char *sql, char *resbuf, size_t len); -void sofia_glue_check_video_codecs(private_object_t *tech_pvt); +void sofia_media_check_video_codecs(private_object_t *tech_pvt); void sofia_glue_del_profile(sofia_profile_t *profile); switch_status_t sofia_glue_add_profile(char *key, sofia_profile_t *profile); @@ -1117,14 +1117,14 @@ int sofia_glue_check_nat(sofia_profile_t *profile, const char *network_ip); 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_glue_tech_patch_sdp(private_object_t *tech_pvt); +void sofia_media_tech_patch_sdp(private_object_t *tech_pvt); switch_status_t sofia_glue_tech_proxy_remote_addr(private_object_t *tech_pvt, const char *sdp_str); 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); void sofia_reg_check_sync(sofia_profile_t *profile); switch_status_t sofia_glue_tech_choose_video_port(private_object_t *tech_pvt, int force); -switch_status_t sofia_glue_tech_set_video_codec(private_object_t *tech_pvt, int force); +switch_status_t sofia_media_tech_set_video_codec(private_object_t *tech_pvt, int force); char *sofia_glue_get_register_host(const char *uri); const char *sofia_glue_strip_proto(const char *uri); void sofia_glue_del_gateway(sofia_gateway_t *gp); @@ -1133,9 +1133,9 @@ void sofia_glue_del_every_gateway(sofia_profile_t *profile); void sofia_reg_send_reboot(sofia_profile_t *profile, const char *callid, const char *user, const char *host, const char *contact, const char *user_agent, const char *network_ip); void sofia_glue_restart_all_profiles(void); -int sofia_glue_toggle_hold(private_object_t *tech_pvt, int sendonly); +int sofia_media_toggle_hold(private_object_t *tech_pvt, int sendonly); const char *sofia_state_string(int state); -switch_status_t sofia_glue_tech_set_codec(private_object_t *tech_pvt, int force); +switch_status_t sofia_media_tech_set_codec(private_object_t *tech_pvt, int force); 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); @@ -1162,7 +1162,7 @@ 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_glue_tech_set_local_sdp(private_object_t *tech_pvt, const char *sdp_str, switch_bool_t dup); +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); @@ -1182,9 +1182,9 @@ switch_status_t sip_dig_function(_In_opt_z_ const char *cmd, _In_opt_ switch_cor const char *sofia_gateway_status_name(sofia_gateway_status_t status); void sofia_reg_fire_custom_gateway_state_event(sofia_gateway_t *gateway, int status, const char *phrase); uint32_t sofia_reg_reg_count(sofia_profile_t *profile, const char *user, const char *host); -void sofia_glue_copy_t38_options(switch_t38_options_t *t38_options, switch_core_session_t *session); -switch_t38_options_t *sofia_glue_extract_t38_options(switch_core_session_t *session, const char *r_sdp); -char *sofia_glue_get_multipart(switch_core_session_t *session, const char *prefix, const char *sdp, char **mp_type); +void sofia_media_copy_t38_options(switch_t38_options_t *t38_options, switch_core_session_t *session); +switch_t38_options_t *sofia_media_extract_t38_options(switch_core_session_t *session, const char *r_sdp); +char *sofia_media_get_multipart(switch_core_session_t *session, const char *prefix, const char *sdp, char **mp_type); int sofia_glue_tech_simplify(private_object_t *tech_pvt); switch_console_callback_match_t *sofia_reg_find_reg_url_multi(sofia_profile_t *profile, const char *user, const char *host); switch_console_callback_match_t *sofia_reg_find_reg_url_with_positive_expires_multi(sofia_profile_t *profile, const char *user, const char *host, time_t reg_time, const char *contact_str, long exptime); @@ -1192,8 +1192,8 @@ switch_bool_t sofia_glue_profile_exists(const char *key); void sofia_glue_global_siptrace(switch_bool_t on); void sofia_glue_global_capture(switch_bool_t on); void sofia_glue_global_watchdog(switch_bool_t on); -void sofia_glue_proxy_codec(switch_core_session_t *session, const char *r_sdp); -switch_status_t sofia_glue_sdp_map(const char *r_sdp, switch_event_t **fmtp, switch_event_t **pt); +void sofia_media_proxy_codec(switch_core_session_t *session, const char *r_sdp); +switch_status_t sofia_media_sdp_map(const char *r_sdp, switch_event_t **fmtp, switch_event_t **pt); void sofia_glue_build_vid_refresh_message(switch_core_session_t *session, const char *pl); void sofia_glue_check_dtmf_type(private_object_t *tech_pvt); void sofia_glue_parse_rtp_bugs(switch_rtp_bug_flag_t *flag_pole, const char *str); diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 3b1fb25c8f..8c762cc9cf 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -4948,11 +4948,11 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status sip->sip_payload && sip->sip_payload->pl_data && !strcasecmp(tech_pvt->iananame, "PROXY")) { switch_core_session_t *other_session; - sofia_glue_proxy_codec(session, sip->sip_payload->pl_data); + sofia_media_proxy_codec(session, sip->sip_payload->pl_data); if (switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS) { if (switch_core_session_compare(session, other_session)) { - sofia_glue_proxy_codec(other_session, sip->sip_payload->pl_data); + sofia_media_proxy_codec(other_session, sip->sip_payload->pl_data); } switch_core_session_rwunlock(other_session); } @@ -5234,7 +5234,7 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status switch_channel_clear_app_flag_key("T38", tech_pvt->channel, CF_APP_T38_REQ); switch_channel_set_app_flag_key("T38", tech_pvt->channel, CF_APP_T38_FAIL); } else if (status == 200 && sofia_test_flag(tech_pvt, TFLAG_T38_PASSTHRU) && has_t38 && sip->sip_payload && sip->sip_payload->pl_data) { - switch_t38_options_t *t38_options = sofia_glue_extract_t38_options(session, sip->sip_payload->pl_data); + switch_t38_options_t *t38_options = sofia_media_extract_t38_options(session, sip->sip_payload->pl_data); if (!t38_options) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Could not parse T.38 options from sdp.\n"); @@ -5273,7 +5273,7 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status } } - sofia_glue_copy_t38_options(t38_options, other_session); + sofia_media_copy_t38_options(t38_options, other_session); } } @@ -5449,7 +5449,7 @@ void *SWITCH_THREAD_FUNC media_on_hold_thread_run(switch_thread_t *thread, void switch_rtp_clear_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_AUTOADJ); } - sofia_glue_toggle_hold(tech_pvt, 1); + sofia_media_toggle_hold(tech_pvt, 1); } switch_core_session_rwunlock(other_session); } @@ -5762,7 +5762,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, if (sofia_test_flag(tech_pvt, TFLAG_LATE_NEGOTIATION) && switch_channel_direction(tech_pvt->channel) == SWITCH_CALL_DIRECTION_INBOUND) { switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "DELAYED NEGOTIATION"); } else { - if (sofia_glue_tech_media(tech_pvt, (char *) r_sdp) != SWITCH_STATUS_SUCCESS) { + if (sofia_media_tech_media(tech_pvt, (char *) r_sdp) != SWITCH_STATUS_SUCCESS) { switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "CODEC NEGOTIATION ERROR"); nua_respond(nh, SIP_488_NOT_ACCEPTABLE, TAG_END()); switch_channel_hangup(channel, SWITCH_CAUSE_INCOMPATIBLE_DESTINATION); @@ -5864,7 +5864,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, uint8_t match = 0; if (tech_pvt->num_codecs) { - match = sofia_glue_negotiate_sdp(session, r_sdp); + match = sofia_media_negotiate_sdp(session, r_sdp); } if (!match) { @@ -5947,7 +5947,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, } else { switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "RECEIVED_NOSDP"); sofia_glue_tech_choose_port(tech_pvt, 0); - sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 0); + sofia_media_set_local_sdp(tech_pvt, 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)) { @@ -5970,7 +5970,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, 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_media_set_local_sdp(tech_pvt, 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); @@ -6038,15 +6038,15 @@ 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_glue_tech_set_local_sdp(tech_pvt, NULL, SWITCH_FALSE); + sofia_media_tech_set_local_sdp(tech_pvt, 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_glue_tech_prepare_codecs(tech_pvt); - if (sofia_glue_tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) { + sofia_media_tech_prepare_codecs(tech_pvt); + 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; switch_core_session_rwunlock(other_session); @@ -6057,14 +6057,14 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, if (!switch_rtp_ready(tech_pvt->rtp_session)) { - sofia_glue_tech_prepare_codecs(tech_pvt); + sofia_media_tech_prepare_codecs(tech_pvt); if ((status = sofia_glue_tech_choose_port(tech_pvt, 0)) != SWITCH_STATUS_SUCCESS) { switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); switch_core_session_rwunlock(other_session); goto done; } } - sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 1); + sofia_media_set_local_sdp(tech_pvt, NULL, 0, NULL, 1); if (sofia_use_soa(tech_pvt)) { nua_respond(tech_pvt->nh, SIP_200_OK, @@ -6157,7 +6157,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, sofia_set_flag_locked(tech_pvt, TFLAG_REINVITE); if (tech_pvt->num_codecs) { - match = sofia_glue_negotiate_sdp(session, r_sdp); + match = sofia_media_negotiate_sdp(session, r_sdp); } if (match && sofia_test_flag(tech_pvt, TFLAG_NOREPLY)) { @@ -6170,7 +6170,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, goto done; } - sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 0); + sofia_media_set_local_sdp(tech_pvt, 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"); @@ -6189,7 +6189,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_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 0); + sofia_media_set_local_sdp(tech_pvt, NULL, 0, NULL, 0); } if (sofia_use_soa(tech_pvt)) { nua_respond(tech_pvt->nh, SIP_200_OK, @@ -6221,13 +6221,13 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, sofia_set_flag_locked(tech_pvt, TFLAG_REINVITE); if (tech_pvt->num_codecs) { - match = sofia_glue_negotiate_sdp(session, r_sdp); + match = sofia_media_negotiate_sdp(session, r_sdp); } if (match) { if (sofia_glue_tech_choose_port(tech_pvt, 0) != SWITCH_STATUS_SUCCESS) { goto done; } - sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 0); + sofia_media_set_local_sdp(tech_pvt, NULL, 0, NULL, 0); switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Processing updated SDP\n"); sofia_set_flag_locked(tech_pvt, TFLAG_REINVITE); @@ -6281,7 +6281,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, int is_ok = 1; if (tech_pvt->num_codecs) { - match = sofia_glue_negotiate_sdp(session, r_sdp); + match = sofia_media_negotiate_sdp(session, r_sdp); } if (match) { @@ -6377,7 +6377,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, uint8_t match = 0; if (tech_pvt->num_codecs) { - match = sofia_glue_negotiate_sdp(session, r_sdp); + match = sofia_media_negotiate_sdp(session, r_sdp); } sofia_set_flag_locked(tech_pvt, TFLAG_ANS); @@ -8177,7 +8177,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_glue_tech_prepare_codecs(tech_pvt); + sofia_media_tech_prepare_codecs(tech_pvt); switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "INBOUND CALL"); diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index c3707f5ae3..b6f45778eb 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -169,7 +169,7 @@ void sofia_glue_set_udptl_image_sdp(private_object_t *tech_pvt, switch_t38_optio switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "m=audio 0 RTP/AVP 19\n"); } - sofia_glue_tech_set_local_sdp(tech_pvt, buf, SWITCH_TRUE); + sofia_media_tech_set_local_sdp(tech_pvt, buf, SWITCH_TRUE); switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, "%s image media sdp:\n%s\n", @@ -1153,8 +1153,8 @@ 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_glue_tech_prepare_codecs(tech_pvt); - sofia_glue_check_video_codecs(tech_pvt); + sofia_media_tech_prepare_codecs(tech_pvt); + sofia_media_check_video_codecs(tech_pvt); check_decode(cid_name, session); check_decode(cid_num, session); @@ -1171,7 +1171,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->local_sdp_str)) { - sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 0); + sofia_media_set_local_sdp(tech_pvt, NULL, 0, NULL, 0); } sofia_set_flag_locked(tech_pvt, TFLAG_READY); @@ -1593,7 +1593,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) if (switch_rtp_ready(tech_pvt->rtp_session)) { sofia_glue_tech_proxy_remote_addr(tech_pvt, NULL); } - sofia_glue_tech_patch_sdp(tech_pvt); + sofia_media_tech_patch_sdp(tech_pvt); } if (!zstr(tech_pvt->dest)) { @@ -1632,7 +1632,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) tech_pvt->nh->nh_has_invite = 1; } - if ((mp = sofia_glue_get_multipart(session, SOFIA_MULTIPART_PREFIX, tech_pvt->local_sdp_str, &mp_type))) { + if ((mp = sofia_media_get_multipart(session, SOFIA_MULTIPART_PREFIX, tech_pvt->local_sdp_str, &mp_type))) { sofia_clear_flag(tech_pvt, TFLAG_ENABLE_SOA); } @@ -2510,7 +2510,7 @@ int sofia_recover_callback(switch_core_session_t *session) tech_pvt->pt = tech_pvt->agreed_pt = (switch_payload_t)atoi(tmp); } - sofia_glue_tech_set_codec(tech_pvt, 1); + sofia_media_tech_set_codec(tech_pvt, 1); tech_pvt->adv_sdp_audio_ip = tech_pvt->extrtpip = (char *) ip; tech_pvt->adv_sdp_audio_port = tech_pvt->local_sdp_audio_port = (switch_port_t)atoi(port); @@ -2559,10 +2559,10 @@ int sofia_recover_callback(switch_core_session_t *session) tech_pvt->remote_sdp_video_ip = (char *) r_ip; tech_pvt->remote_sdp_video_port = (switch_port_t)atoi(r_port); } - //sofia_glue_tech_set_video_codec(tech_pvt, 1); + //sofia_media_tech_set_video_codec(tech_pvt, 1); } - sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 1); + sofia_media_set_local_sdp(tech_pvt, NULL, 0, NULL, 1); if (sofia_media_activate_rtp(tech_pvt) != SWITCH_STATUS_SUCCESS) { goto end; diff --git a/src/mod/endpoints/mod_sofia/sofia_media.c b/src/mod/endpoints/mod_sofia/sofia_media.c index 9d0ff64d0d..c8cabf1d55 100644 --- a/src/mod/endpoints/mod_sofia/sofia_media.c +++ b/src/mod/endpoints/mod_sofia/sofia_media.c @@ -32,7 +32,7 @@ #include "mod_sofia.h" -switch_status_t sofia_glue_get_offered_pt(private_object_t *tech_pvt, const switch_codec_implementation_t *mimp, switch_payload_t *pt) +switch_status_t sofia_media_get_offered_pt(private_object_t *tech_pvt, const switch_codec_implementation_t *mimp, switch_payload_t *pt) { int i = 0; @@ -50,7 +50,7 @@ switch_status_t sofia_glue_get_offered_pt(private_object_t *tech_pvt, const swit } -void sofia_glue_tech_absorb_sdp(private_object_t *tech_pvt) +void sofia_media_tech_absorb_sdp(private_object_t *tech_pvt) { const char *sdp_str; @@ -83,13 +83,13 @@ void sofia_glue_tech_absorb_sdp(private_object_t *tech_pvt) } sdp_parser_free(parser); } - sofia_glue_tech_set_local_sdp(tech_pvt, sdp_str, SWITCH_TRUE); + sofia_media_tech_set_local_sdp(tech_pvt, sdp_str, SWITCH_TRUE); } } -switch_status_t sofia_glue_sdp_map(const char *r_sdp, switch_event_t **fmtp, switch_event_t **pt) +switch_status_t sofia_media_sdp_map(const char *r_sdp, switch_event_t **fmtp, switch_event_t **pt) { sdp_media_t *m; sdp_parser_t *parser = NULL; @@ -148,7 +148,7 @@ switch_status_t sofia_glue_sdp_map(const char *r_sdp, switch_event_t **fmtp, swi } -void sofia_glue_proxy_codec(switch_core_session_t *session, const char *r_sdp) +void sofia_media_proxy_codec(switch_core_session_t *session, const char *r_sdp) { sdp_media_t *m; sdp_parser_t *parser = NULL; @@ -199,7 +199,7 @@ void sofia_glue_proxy_codec(switch_core_session_t *session, const char *r_sdp) tech_pvt->iananame = switch_core_session_strdup(tech_pvt->session, map->rm_encoding); tech_pvt->rm_rate = map->rm_rate; tech_pvt->codec_ms = ptime; - sofia_glue_tech_set_codec(tech_pvt, 0); + sofia_media_tech_set_codec(tech_pvt, 0); break; } @@ -279,7 +279,7 @@ switch_t38_options_t *tech_process_udptl(private_object_t *tech_pvt, sdp_session -switch_t38_options_t *sofia_glue_extract_t38_options(switch_core_session_t *session, const char *r_sdp) +switch_t38_options_t *sofia_media_extract_t38_options(switch_core_session_t *session, const char *r_sdp) { sdp_media_t *m; sdp_parser_t *parser = NULL; @@ -312,7 +312,7 @@ switch_t38_options_t *sofia_glue_extract_t38_options(switch_core_session_t *sess } -uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_sdp) +uint8_t sofia_media_negotiate_sdp(switch_core_session_t *session, const char *r_sdp) { uint8_t match = 0; switch_payload_t best_te = 0, te = 0, cng_pt = 0; @@ -447,7 +447,7 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s if (!tech_pvt->hold_laps) { tech_pvt->hold_laps++; - if (sofia_glue_toggle_hold(tech_pvt, sendonly)) { + if (sofia_media_toggle_hold(tech_pvt, sendonly)) { reneg = sofia_test_pflag(tech_pvt->profile, PFLAG_RENEG_ON_HOLD); if ((val = switch_channel_get_variable(tech_pvt->channel, "sip_renegotiate_codec_on_hold"))) { @@ -471,7 +471,7 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s total_codecs = tech_pvt->num_negotiated_codecs; } else if (reneg) { tech_pvt->num_codecs = 0; - sofia_glue_tech_prepare_codecs(tech_pvt); + sofia_media_tech_prepare_codecs(tech_pvt); codec_array = tech_pvt->codecs; total_codecs = tech_pvt->num_codecs; } @@ -584,7 +584,7 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s - sofia_glue_copy_t38_options(t38_options, other_session); + sofia_media_copy_t38_options(t38_options, other_session); sofia_set_flag(tech_pvt, TFLAG_T38_PASSTHRU); sofia_set_flag(other_tech_pvt, TFLAG_T38_PASSTHRU); @@ -870,7 +870,7 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s if (!switch_true(mirror) && switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND && (!sofia_test_flag(tech_pvt, TFLAG_REINVITE) || sofia_test_pflag(tech_pvt->profile, PFLAG_RENEG_ON_REINVITE))) { - sofia_glue_get_offered_pt(tech_pvt, mimp, &tech_pvt->audio_recv_pt); + sofia_media_get_offered_pt(tech_pvt, mimp, &tech_pvt->audio_recv_pt); } switch_snprintf(tmp, sizeof(tmp), "%d", tech_pvt->audio_recv_pt); @@ -879,7 +879,7 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s } if (match) { - if (sofia_glue_tech_set_codec(tech_pvt, 1) == SWITCH_STATUS_SUCCESS) { + if (sofia_media_tech_set_codec(tech_pvt, 1) == SWITCH_STATUS_SUCCESS) { got_audio = 1; } else { match = 0; @@ -1032,12 +1032,12 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s switch_channel_set_variable(tech_pvt->channel, "sip_video_fmtp", tech_pvt->video_rm_fmtp); switch_snprintf(tmp, sizeof(tmp), "%d", tech_pvt->video_agreed_pt); switch_channel_set_variable(tech_pvt->channel, "sip_video_pt", tmp); - sofia_glue_check_video_codecs(tech_pvt); + sofia_media_check_video_codecs(tech_pvt); tech_pvt->video_recv_pt = (switch_payload_t)map->rm_pt; if (!switch_true(mirror) && switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND) { - sofia_glue_get_offered_pt(tech_pvt, mimp, &tech_pvt->video_recv_pt); + sofia_media_get_offered_pt(tech_pvt, mimp, &tech_pvt->video_recv_pt); } switch_snprintf(tmp, sizeof(tmp), "%d", tech_pvt->video_recv_pt); @@ -1112,7 +1112,7 @@ switch_status_t sofia_media_activate_rtp(private_object_t *tech_pvt) } } - if ((status = sofia_glue_tech_set_codec(tech_pvt, 0)) != SWITCH_STATUS_SUCCESS) { + if ((status = sofia_media_tech_set_codec(tech_pvt, 0)) != SWITCH_STATUS_SUCCESS) { goto end; } @@ -1524,7 +1524,7 @@ switch_status_t sofia_media_activate_rtp(private_object_t *tech_pvt) video: - sofia_glue_check_video_codecs(tech_pvt); + sofia_media_check_video_codecs(tech_pvt); if (sofia_test_flag(tech_pvt, TFLAG_VIDEO) && tech_pvt->video_rm_encoding && tech_pvt->remote_sdp_video_port) { /******************************************************************************************/ @@ -1645,7 +1645,7 @@ switch_status_t sofia_media_activate_rtp(private_object_t *tech_pvt) if (switch_channel_test_flag(tech_pvt->channel, CF_PROXY_MEDIA)) { flags[SWITCH_RTP_FLAG_PROXY_MEDIA]++; } - sofia_glue_tech_set_video_codec(tech_pvt, 0); + sofia_media_tech_set_video_codec(tech_pvt, 0); flags[SWITCH_RTP_FLAG_USE_TIMER] = 0; flags[SWITCH_RTP_FLAG_NOBLOCK] = 0; @@ -1768,7 +1768,7 @@ void sofia_media_set_sdp_codec_string(switch_core_session_t *session, const char if ((parser = sdp_parse(NULL, r_sdp, (int) strlen(r_sdp), 0))) { if ((sdp = sdp_session(parser))) { - sofia_glue_set_r_sdp_codec_string(session, sofia_glue_get_codec_string(tech_pvt), sdp); + sofia_media_set_r_sdp_codec_string(session, sofia_media_get_codec_string(tech_pvt), sdp); } sdp_parser_free(parser); @@ -1776,7 +1776,7 @@ void sofia_media_set_sdp_codec_string(switch_core_session_t *session, const char } -switch_status_t sofia_glue_tech_set_video_codec(private_object_t *tech_pvt, int force) +switch_status_t sofia_media_tech_set_video_codec(private_object_t *tech_pvt, int force) { if (!tech_pvt->video_rm_encoding) { @@ -1870,7 +1870,7 @@ switch_status_t sofia_glue_tech_set_video_codec(private_object_t *tech_pvt, int return SWITCH_STATUS_SUCCESS; } -switch_status_t sofia_glue_tech_set_codec(private_object_t *tech_pvt, int force) +switch_status_t sofia_media_tech_set_codec(private_object_t *tech_pvt, int force) { switch_status_t status = SWITCH_STATUS_SUCCESS; int resetting = 0; @@ -2000,7 +2000,7 @@ switch_status_t sofia_glue_tech_set_codec(private_object_t *tech_pvt, int force) switch_core_session_unlock_codec_read(tech_pvt->session); } - sofia_glue_tech_set_video_codec(tech_pvt, force); + sofia_media_tech_set_video_codec(tech_pvt, force); return status; } @@ -2059,7 +2059,7 @@ static void add_audio_codec(sdp_rtpmap_t *map, int ptime, char *buf, switch_size } -void sofia_glue_set_r_sdp_codec_string(switch_core_session_t *session, const char *codec_string, sdp_session_t *sdp) +void sofia_media_set_r_sdp_codec_string(switch_core_session_t *session, const char *codec_string, sdp_session_t *sdp) { char buf[1024] = { 0 }; sdp_media_t *m; @@ -2239,7 +2239,7 @@ void sofia_glue_set_r_sdp_codec_string(switch_core_session_t *session, const cha } } -switch_status_t sofia_glue_tech_media(private_object_t *tech_pvt, const char *r_sdp) +switch_status_t sofia_media_tech_media(private_object_t *tech_pvt, const char *r_sdp) { uint8_t match = 0; @@ -2250,7 +2250,7 @@ switch_status_t sofia_glue_tech_media(private_object_t *tech_pvt, const char *r_ return SWITCH_STATUS_FALSE; } - if ((match = sofia_glue_negotiate_sdp(tech_pvt->session, r_sdp))) { + if ((match = sofia_media_negotiate_sdp(tech_pvt->session, r_sdp))) { if (sofia_glue_tech_choose_port(tech_pvt, 0) != SWITCH_STATUS_SUCCESS) { return SWITCH_STATUS_FALSE; } @@ -2267,7 +2267,7 @@ switch_status_t sofia_glue_tech_media(private_object_t *tech_pvt, const char *r_ return SWITCH_STATUS_FALSE; } -int sofia_glue_toggle_hold(private_object_t *tech_pvt, int sendonly) +int sofia_media_toggle_hold(private_object_t *tech_pvt, int sendonly) { int changed = 0; @@ -2359,7 +2359,7 @@ int sofia_glue_toggle_hold(private_object_t *tech_pvt, int sendonly) return changed; } -void sofia_glue_copy_t38_options(switch_t38_options_t *t38_options, switch_core_session_t *session) +void sofia_media_copy_t38_options(switch_t38_options_t *t38_options, switch_core_session_t *session) { switch_channel_t *channel = switch_core_session_get_channel(session); switch_t38_options_t *local_t38_options = switch_channel_get_private(channel, "t38_options"); @@ -2570,7 +2570,7 @@ static void generate_m(private_object_t *tech_pvt, char *buf, size_t buflen, #define SDPBUFLEN 65536 -void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, switch_port_t port, const char *sr, int force) +void sofia_media_set_local_sdp(private_object_t *tech_pvt, const char *ip, switch_port_t port, const char *sr, int force) { char *buf; int ptime = 0; @@ -2665,7 +2665,7 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, switch } if (!tech_pvt->rm_encoding && (b_sdp = switch_channel_get_variable(tech_pvt->channel, SWITCH_B_SDP_VARIABLE))) { - sofia_glue_sdp_map(b_sdp, &map, &ptmap); + sofia_media_sdp_map(b_sdp, &map, &ptmap); } if (zstr(sr)) { @@ -2862,7 +2862,7 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, switch /*****************************/ if (tech_pvt->video_rm_encoding) { - sofia_glue_tech_set_video_codec(tech_pvt, 0); + sofia_media_tech_set_video_codec(tech_pvt, 0); switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), " %d", tech_pvt->video_agreed_pt); } else if (tech_pvt->num_codecs) { int i; @@ -2991,12 +2991,12 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, switch switch_event_destroy(&ptmap); } - sofia_glue_tech_set_local_sdp(tech_pvt, buf, SWITCH_TRUE); + sofia_media_tech_set_local_sdp(tech_pvt, buf, SWITCH_TRUE); switch_safe_free(buf); } -const char *sofia_glue_get_codec_string(private_object_t *tech_pvt) +const char *sofia_media_get_codec_string(private_object_t *tech_pvt) { const char *preferred = NULL, *fallback = NULL; @@ -3017,7 +3017,7 @@ const char *sofia_glue_get_codec_string(private_object_t *tech_pvt) return !zstr(preferred) ? preferred : fallback; } -void sofia_glue_tech_prepare_codecs(private_object_t *tech_pvt) +void sofia_media_tech_prepare_codecs(private_object_t *tech_pvt) { const char *abs, *codec_string = NULL; const char *ocodec = NULL; @@ -3045,7 +3045,7 @@ void sofia_glue_tech_prepare_codecs(private_object_t *tech_pvt) } if (!(codec_string = switch_channel_get_variable(tech_pvt->channel, "codec_string"))) { - codec_string = sofia_glue_get_codec_string(tech_pvt); + codec_string = sofia_media_get_codec_string(tech_pvt); } if (codec_string && *codec_string == '=') { @@ -3080,7 +3080,7 @@ void sofia_glue_tech_prepare_codecs(private_object_t *tech_pvt) } -void sofia_glue_check_video_codecs(private_object_t *tech_pvt) +void sofia_media_check_video_codecs(private_object_t *tech_pvt) { if (tech_pvt->num_codecs && !sofia_test_flag(tech_pvt, TFLAG_VIDEO)) { int i; @@ -3098,7 +3098,7 @@ void sofia_glue_check_video_codecs(private_object_t *tech_pvt) } -void sofia_glue_tech_patch_sdp(private_object_t *tech_pvt) +void sofia_media_tech_patch_sdp(private_object_t *tech_pvt) { switch_size_t len; char *p, *q, *pe, *qe; @@ -3370,12 +3370,12 @@ void sofia_glue_tech_patch_sdp(private_object_t *tech_pvt) switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, "%s Patched SDP\n---\n%s\n+++\n%s\n", switch_channel_get_name(tech_pvt->channel), tech_pvt->local_sdp_str, new_sdp); - sofia_glue_tech_set_local_sdp(tech_pvt, new_sdp, SWITCH_FALSE); + sofia_media_tech_set_local_sdp(tech_pvt, new_sdp, SWITCH_FALSE); } -void sofia_glue_tech_set_local_sdp(private_object_t *tech_pvt, const char *sdp_str, switch_bool_t dup) +void sofia_media_tech_set_local_sdp(private_object_t *tech_pvt, const char *sdp_str, switch_bool_t dup) { switch_mutex_lock(tech_pvt->sofia_mutex); tech_pvt->local_sdp_str = dup ? switch_core_session_strdup(tech_pvt->session, sdp_str) : (char *) sdp_str; @@ -3384,7 +3384,7 @@ void sofia_glue_tech_set_local_sdp(private_object_t *tech_pvt, const char *sdp_s } -char *sofia_glue_get_multipart(switch_core_session_t *session, const char *prefix, const char *sdp, char **mp_type) +char *sofia_media_get_multipart(switch_core_session_t *session, const char *prefix, const char *sdp, char **mp_type) { char *extra_headers = NULL; switch_stream_handle_t stream = { 0 };