提交 d6af3a1f authored 作者: Anthony Minessale's avatar Anthony Minessale

omfg

上级 10010d47
......@@ -155,8 +155,8 @@ fi
AX_PATH_LIBGNUTLS()
# set defaults for use on all platforms
SWITCH_AM_CFLAGS="-I${switch_srcdir}/src/include -I${switch_builddir}/src/include -I${switch_srcdir}/libs/libteletone/src -I${switch_srcdir}/libs/stfu"
SWITCH_AM_CXXFLAGS="-I${switch_srcdir}/src/include -I${switch_builddir}/src/include -I${switch_srcdir}/libs/libteletone/src -I${switch_srcdir}/libs/stfu"
SWITCH_AM_CFLAGS="-I${switch_srcdir}/src/include -I${switch_builddir}/src/include -I${switch_srcdir}/libs/libteletone/src -I${switch_srcdir}/libs/stfu -I${switch_srcdir}/libs/sofia-sip/libsofia-sip-ua/sdp/sofia-sip -I${switch_srcdir}/libs/sofia-sip/libsofia-sip-ua/su"
SWITCH_AM_CXXFLAGS="-I${switch_srcdir}/src/include -I${switch_builddir}/src/include -I${switch_srcdir}/libs/libteletone/src -I${switch_srcdir}/libs/stfu -I${switch_srcdir}/libs/sofia-sip/libsofia-sip-ua/sdp/sofia-sip -I${switch_srcdir}/libs/sofia-sip/libsofia-sip-ua/su"
SWITCH_AM_LDFLAGS="-lm"
#set SOLINK variable based on compiler and host
......@@ -220,6 +220,8 @@ AC_MSG_RESULT([using libtool library extension... ${LIBTOOL_LIB_EXTEN}])
AC_ARG_ENABLE(64,
[AC_HELP_STRING([--enable-64],[build with 64 bit support])],[enable_64="$enable_64"],[enable_64="no"])
APR_ADDTO(SWITCH_AM_CFLAGS, -Ilibs/sofia-sip/libsofia-sip-ua/sdp/sofia-sip -Ilibs/sofia-sip/libsofia-sip-ua/su)
# tweak compiler specific flags
if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
APR_ADDTO(SWITCH_AM_CFLAGS, -KPIC)
......
......@@ -32,10 +32,20 @@
#ifndef SWITCH_CORE_MEDIA_H
#define SWITCH_CORE_MEDIA_H
#include <sdp.h>
#include <switch.h>
SWITCH_BEGIN_EXTERN_C
typedef enum {
DTMF_2833,
DTMF_INFO,
DTMF_NONE
} switch_core_media_dtmf_t;
typedef enum {
SM_NDLB_ALLOW_BAD_IANANAME = (1 << 0),
SM_NDLB_ALLOW_NONDUP_SDP = (1 << 1),
......@@ -44,7 +54,18 @@ typedef enum {
} switch_core_media_NDLB_t;
typedef enum {
SCMF_DISABLE_TRANSCODING = (1 << 0)
SCMF_RUNNING,
SCMF_DISABLE_TRANSCODING,
SCMF_AUTOFIX_TIMING,
SCMF_CODEC_GREEDY,
SCMF_CODEC_SCROOGE,
SCMF_DISABLE_HOLD,
SCMF_RENEG_ON_HOLD,
SCMF_RENEG_ON_REINVITE,
SCMF_T38_PASSTHRU,
SCMF_LIBERAL_DTMF,
SCMF_SUPPRESS_CNG,
SCMF_MAX
} switch_core_media_flag_t;
struct switch_media_handle_s;
......@@ -58,7 +79,8 @@ typedef enum {
typedef enum {
SCM_INBOUND_CODEC_STRING,
SCM_OUTBOUND_CODEC_STRING,
SCM_TEST,
SCM_AUTO_RTP_BUGS,
SCM_MANUAL_RTP_BUGS,
SCM_MAX
} scm_param_t;
......@@ -79,6 +101,7 @@ SWITCH_DECLARE(int32_t) switch_media_handle_test_ndlb(switch_media_handle_t *smh
SWITCH_DECLARE(void) switch_media_handle_set_media_flag(switch_media_handle_t *smh, switch_core_media_flag_t flag);
SWITCH_DECLARE(void) switch_media_handle_clear_media_flag(switch_media_handle_t *smh, switch_core_media_flag_t flag);
SWITCH_DECLARE(int32_t) switch_media_handle_test_media_flag(switch_media_handle_t *smh, switch_core_media_flag_t flag);
SWITCH_DECLARE(void) switch_media_handle_set_media_flags(switch_media_handle_t *smh, switch_core_media_flag_t flags[]);
SWITCH_DECLARE(void) switch_core_session_check_outgoing_crypto(switch_core_session_t *session, const char *sec_var);
SWITCH_DECLARE(const char *) switch_core_session_local_crypto_key(switch_core_session_t *session, switch_media_type_t type);
SWITCH_DECLARE(int) switch_core_session_check_incoming_crypto(switch_core_session_t *session,
......@@ -93,6 +116,16 @@ SWITCH_DECLARE(void) switch_core_media_set_rtp_session(switch_core_session_t *se
SWITCH_DECLARE(void) switch_media_set_param(switch_media_handle_t *smh, scm_param_t param, ...);
SWITCH_DECLARE(void *) switch_media_get_param(switch_media_handle_t *smh, scm_param_t param);
SWITCH_DECLARE(const char *)switch_core_media_get_codec_string(switch_core_session_t *session);
SWITCH_DECLARE(void) switch_core_media_parse_rtp_bugs(switch_rtp_bug_flag_t *flag_pole, const char *str);
SWITCH_DECLARE(switch_t38_options_t *) switch_core_media_process_udptl(switch_core_session_t *session, sdp_session_t *sdp, sdp_media_t *m);
SWITCH_DECLARE(switch_t38_options_t *) switch_core_media_extract_t38_options(switch_core_session_t *session, const char *r_sdp);
SWITCH_DECLARE(void) switch_core_media_pass_zrtp_hash(switch_core_session_t *session);
SWITCH_DECLARE(void) switch_core_media_find_zrtp_hash(switch_core_session_t *session, sdp_session_t *sdp);
SWITCH_DECLARE(const char *) switch_core_media_get_zrtp_hash(switch_core_session_t *session, switch_media_type_t type, switch_bool_t local);
SWITCH_DECLARE(void) switch_core_media_pass_zrtp_hash2(switch_core_session_t *aleg_session, switch_core_session_t *bleg_session);
SWITCH_DECLARE(int) switch_core_media_toggle_hold(switch_core_session_t *session, int sendonly);
SWITCH_DECLARE(void) switch_core_media_copy_t38_options(switch_t38_options_t *t38_options, switch_core_session_t *session);
SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *session, const char *r_sdp, uint8_t *proceed, int reinvite, int codec_flags, switch_payload_t default_te);
SWITCH_END_EXTERN_C
#endif
......
......@@ -1282,6 +1282,12 @@ typedef enum {
CF_HOLD_ON_BRIDGE,
CF_SECURE,
CF_CRYPTO_RECOVER,
CF_LIBERAL_DTMF,
CF_SLA_BARGE,
CF_SLA_BARGING,
CF_PROTO_HOLD, //TFLAG_SIP_HOLD
CF_HOLD_LOCK,
CF_VIDEO_POSSIBLE,//TFLAG_VIDEO
/* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
/* IF YOU ADD NEW ONES CHECK IF THEY SHOULD PERSIST OR ZERO THEM IN switch_core_session.c switch_core_session_request_xml() */
CF_FLAG_MAX
......
......@@ -1220,7 +1220,7 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f
}
if ((tech_pvt->read_frame.datalen % 10) == 0 &&
sofia_test_pflag(tech_pvt->profile, PFLAG_AUTOFIX_TIMING) && tech_pvt->check_frames < MAX_CODEC_CHECK_FRAMES) {
sofia_test_media_flag(tech_pvt->profile, SCMF_AUTOFIX_TIMING) && tech_pvt->check_frames < MAX_CODEC_CHECK_FRAMES) {
tech_pvt->check_frames++;
if (!tech_pvt->read_impl.encoded_bytes_per_packet) {
......@@ -1503,7 +1503,7 @@ static switch_status_t sofia_send_dtmf(switch_core_session_t *session, const swi
{
private_object_t *tech_pvt;
char message[128] = "";
sofia_dtmf_t dtmf_type;
switch_core_media_dtmf_t dtmf_type;
tech_pvt = (private_object_t *) switch_core_session_get_private(session);
switch_assert(tech_pvt != NULL);
......@@ -1865,7 +1865,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
switch_channel_set_flag(tech_pvt->channel, CF_SECURE);
}
if (sofia_test_pflag(tech_pvt->profile, PFLAG_AUTOFIX_TIMING)) {
if (sofia_test_media_flag(tech_pvt->profile, SCMF_AUTOFIX_TIMING)) {
tech_pvt->check_frames = 0;
tech_pvt->last_ts = 0;
}
......@@ -1904,7 +1904,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
tech_pvt->num_codecs = 0;
tech_pvt->rm_encoding = NULL;
tech_pvt->video_rm_encoding = NULL;
sofia_clear_flag_locked(tech_pvt, TFLAG_VIDEO);
switch_channel_clear_flag(tech_pvt->channel, CF_VIDEO_POSSIBLE);
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);
......@@ -5020,7 +5020,7 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
if (switch_channel_test_flag(o_channel, CF_ZRTP_PASSTHRU_REQ)) {
const char *x = NULL;
sofia_glue_pass_zrtp_hash2(session, nsession);
switch_core_media_pass_zrtp_hash2(session, nsession);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "[zrtp_passthru] Setting a-leg inherit_codec=true\n");
switch_channel_set_variable(o_channel, "inherit_codec", "true");
if ((x = switch_channel_get_variable(o_channel, "ep_codec_string"))) {
......@@ -5047,7 +5047,7 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
tech_pvt->video_rm_rate = 90000;
tech_pvt->video_codec_ms = 0;
switch_channel_set_flag(tech_pvt->channel, CF_VIDEO);
sofia_set_flag(tech_pvt, TFLAG_VIDEO);
switch_channel_set_flag(tech_pvt->channel, CF_VIDEO_POSSIBLE);
}
}
}
......@@ -5649,14 +5649,14 @@ SWITCH_STANDARD_APP(sofia_sla_function)
if (switch_core_session_check_interface(bargee_session, sofia_endpoint_interface)) {
tech_pvt = switch_core_session_get_private(bargee_session);
sofia_clear_flag(tech_pvt, TFLAG_SLA_BARGING);
sofia_set_flag(tech_pvt, TFLAG_SLA_BARGE);
switch_channel_clear_flag(tech_pvt->channel, CF_SLA_BARGING);
switch_channel_set_flag(tech_pvt->channel, CF_SLA_BARGE);
switch_ivr_transfer_variable(bargee_session, session, SWITCH_SIGNAL_BOND_VARIABLE);
}
if (switch_core_session_check_interface(session, sofia_endpoint_interface)) {
tech_pvt = switch_core_session_get_private(session);
sofia_set_flag(tech_pvt, TFLAG_SLA_BARGING);
switch_channel_set_flag(tech_pvt->channel, CF_SLA_BARGING);
}
channel = switch_core_session_get_channel(session);
......
......@@ -115,9 +115,9 @@ typedef struct private_object private_object_t;
#define SOFIA_SECURE_MEDIA_VARIABLE "sip_secure_media"
#define SOFIA_SECURE_MEDIA_CONFIRMED_VARIABLE "sip_secure_media_confirmed"
#define SOFIA_SECURE_VIDEO_CONFIRMED_VARIABLE "sip_secure_video_confirmed"
#define SOFIA_HAS_CRYPTO_VARIABLE "sip_has_crypto"
#define SOFIA_HAS_VIDEO_CRYPTO_VARIABLE "sip_has_video_crypto"
#define SOFIA_CRYPTO_MANDATORY_VARIABLE "sip_crypto_mandatory"
//#define SOFIA_HAS_CRYPTO_VARIABLE "sip_has_crypto"
//#define SOFIA_HAS_VIDEO_CRYPTO_VARIABLE "sip_has_video_crypto"
//#define SOFIA_CRYPTO_MANDATORY_VARIABLE "sip_crypto_mandatory"
#define FREESWITCH_SUPPORT "update_display,send_info"
#include <switch_stun.h>
......@@ -146,12 +146,6 @@ typedef enum {
SOFIA_CONFIG_RESPAWN
} sofia_config_t;
typedef enum {
DTMF_2833,
DTMF_INFO,
DTMF_NONE
} sofia_dtmf_t;
typedef struct sofia_dispatch_event_s {
nua_saved_event_t event[1];
nua_handle_t *nh;
......@@ -210,7 +204,6 @@ typedef enum {
PFLAG_REWRITE_TIMESTAMPS,
PFLAG_RUNNING,
PFLAG_RESPAWN,
PFLAG_GREEDY,
PFLAG_MULTIREG,
PFLAG_SUPPRESS_CNG,
PFLAG_TLS,
......@@ -232,7 +225,6 @@ typedef enum {
PFLAG_3PCC_PROXY,
PFLAG_CALLID_AS_UUID,
PFLAG_UUID_AS_CALLID,
PFLAG_SCROOGE,
PFLAG_MANAGE_SHARED_APPEARANCE,
PFLAG_STANDBY,
PFLAG_DISABLE_SRV,
......@@ -241,15 +233,12 @@ typedef enum {
PFLAG_AUTOFLUSH,
PFLAG_NAT_OPTIONS_PING,
PFLAG_ALL_REG_OPTIONS_PING,
PFLAG_AUTOFIX_TIMING,
PFLAG_MESSAGE_QUERY_ON_REGISTER,
PFLAG_MESSAGE_QUERY_ON_FIRST_REGISTER,
PFLAG_RTP_AUTOFLUSH_DURING_BRIDGE,
PFLAG_MANUAL_REDIRECT,
PFLAG_DISABLE_HOLD,
PFLAG_AUTO_NAT,
PFLAG_SIPCOMPACT,
PFLAG_USE_ME,
PFLAG_PRESENCE_PRIVACY,
PFLAG_PASS_CALLEE_ID,
PFLAG_LOG_AUTH_FAIL,
......@@ -325,7 +314,6 @@ typedef enum {
TFLAG_INB_NOMEDIA,
TFLAG_LATE_NEGOTIATION,
TFLAG_SDP,
TFLAG_VIDEO,
TFLAG_TPORT_LOG,
TFLAG_SENT_UPDATE,
TFLAG_PROXY_MEDIA,
......@@ -342,12 +330,9 @@ typedef enum {
TFLAG_JB_PAUSED,
TFLAG_3PCC_INVITE,
TFLAG_NOREPLY,
TFLAG_LIBERAL_DTMF,
TFLAG_GOT_ACK,
TFLAG_CAPTURE,
TFLAG_REINVITED,
TFLAG_SLA_BARGE,
TFLAG_SLA_BARGING,
TFLAG_PASS_ACK,
TFLAG_DROP_DTMF,
/* No new flags below this line */
......@@ -596,7 +581,7 @@ struct sofia_profile {
char *pnp_prov_url;
char *pnp_notify_profile;
sofia_cid_type_t cid_type;
sofia_dtmf_t dtmf_type;
switch_core_media_dtmf_t dtmf_type;
int auto_restart;
switch_port_t sip_port;
switch_port_t extsipport;
......@@ -609,9 +594,9 @@ struct sofia_profile {
int dtmf_duration;
uint8_t flags[TFLAG_MAX];
uint8_t pflags[PFLAG_MAX];
switch_core_media_flag_t media_flags[SCMF_MAX];
unsigned int mflags;
unsigned int ndlb;
unsigned int media_flags;
uint32_t max_calls;
uint32_t nonce_ttl;
nua_t *nua;
......@@ -816,7 +801,7 @@ struct private_object {
switch_payload_t video_agreed_pt;
char *video_fmtp_out;
uint32_t video_count;
sofia_dtmf_t dtmf_type;
switch_core_media_dtmf_t dtmf_type;
int q850_cause;
char *remote_ip;
int remote_port;
......@@ -840,11 +825,6 @@ struct private_object {
switch_payload_t ianacodes[SWITCH_MAX_CODECS];
uint32_t session_timeout;
enum nua_session_refresher session_refresher;
/** ZRTP **/
char *local_sdp_audio_zrtp_hash;
char *local_sdp_video_zrtp_hash;
char *remote_sdp_audio_zrtp_hash;
char *remote_sdp_video_zrtp_hash;
char *respond_phrase;
int respond_code;
char *respond_dest;
......@@ -891,6 +871,18 @@ typedef struct {
#define NUTAG_WITH_THIS_MSG(msg) nutag_with, tag_ptr_v(msg)
#define sofia_test_media_flag(obj, flag) ((obj)->media_flags[flag] ? 1 : 0)
#define sofia_set_media_flag(obj, flag) (obj)->media_flags[flag] = 1
#define sofia_set_media_flag_locked(obj, flag) assert(obj->flag_mutex != NULL);\
switch_mutex_lock(obj->flag_mutex);\
(obj)->media_flags[flag] = 1;\
switch_mutex_unlock(obj->flag_mutex);
#define sofia_clear_media_flag_locked(obj, flag) switch_mutex_lock(obj->flag_mutex); (obj)->media_flags[flag] = 0; switch_mutex_unlock(obj->flag_mutex);
#define sofia_clear_media_flag(obj, flag) (obj)->media_flags[flag] = 0
#define sofia_test_pflag(obj, flag) ((obj)->pflags[flag] ? 1 : 0)
#define sofia_set_pflag(obj, flag) (obj)->pflags[flag] = 1
#define sofia_set_pflag_locked(obj, flag) assert(obj->flag_mutex != NULL);\
......@@ -900,6 +892,8 @@ switch_mutex_unlock(obj->flag_mutex);
#define sofia_clear_pflag_locked(obj, flag) switch_mutex_lock(obj->flag_mutex); (obj)->pflags[flag] = 0; switch_mutex_unlock(obj->flag_mutex);
#define sofia_clear_pflag(obj, flag) (obj)->pflags[flag] = 0
#define sofia_set_flag_locked(obj, flag) assert(obj->flag_mutex != NULL);\
switch_mutex_lock(obj->flag_mutex);\
(obj)->flags[flag] = 1;\
......@@ -958,8 +952,6 @@ void launch_sofia_profile_thread(sofia_profile_t *profile);
switch_status_t sofia_presence_chat_send(switch_event_t *message_event);
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);
/*
* \brief Sets the "ep_codec_string" channel variable, parsing r_sdp and taing codec_string in consideration
......@@ -1197,7 +1189,6 @@ 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);
char *sofia_glue_gen_contact_str(sofia_profile_t *profile, sip_t const *sip, nua_handle_t *nh, sofia_dispatch_event_t *de, sofia_nat_parse_t *np);
void sofia_glue_pause_jitterbuffer(switch_core_session_t *session, switch_bool_t on);
void sofia_process_dispatch_event(sofia_dispatch_event_t **dep);
......@@ -1213,8 +1204,6 @@ switch_status_t sofia_init(void);
void sofia_glue_fire_events(sofia_profile_t *profile);
void sofia_event_fire(sofia_profile_t *profile, switch_event_t **event);
void sofia_queue_message(sofia_dispatch_event_t *de);
switch_t38_options_t *tech_process_udptl(private_object_t *tech_pvt, sdp_session_t *sdp, sdp_media_t *m);
void find_zrtp_hash(switch_core_session_t *session, sdp_session_t *sdp);
void sofia_media_set_sdp_codec_string(switch_core_session_t *session, const char *r_sdp);
/* For Emacs:
......
......@@ -74,7 +74,7 @@ typedef struct {
switch_port_t local_port;
switch_port_t remote_port;
switch_payload_t agreed_pt; /*XXX*/
sofia_dtmf_t dtmf_type;
switch_core_media_dtmf_t dtmf_type;
enum {
RTP_SENDONLY,
RTP_RECVONLY,
......
......@@ -599,7 +599,7 @@ void sofia_handle_sip_i_bye(switch_core_session_t *session, int status,
status = 200;
phrase = "OK";
if (sofia_test_flag(tech_pvt, TFLAG_SLA_BARGING)) {
if (switch_channel_test_flag(tech_pvt->channel, CF_SLA_BARGING)) {
const char *bargee_uuid = switch_channel_get_variable(channel, "sip_barging_uuid");
switch_core_session_t *bargee_session;
uint32_t ttl = 0;
......@@ -608,15 +608,14 @@ void sofia_handle_sip_i_bye(switch_core_session_t *session, int status,
//switch_channel_t *bargee_channel = switch_core_session_get_channel(bargee_session);
if ((ttl = switch_core_media_bug_count(bargee_session, "eavesdrop")) == 1) {
if (switch_core_session_check_interface(bargee_session, sofia_endpoint_interface)) {
private_object_t *bargee_tech_pvt = switch_core_session_get_private(bargee_session);
sofia_clear_flag(bargee_tech_pvt, TFLAG_SLA_BARGE);
switch_channel_clear_flag(switch_core_session_get_channel(bargee_session), CF_SLA_BARGE);
}
}
switch_core_session_rwunlock(bargee_session);
}
}
if (sofia_test_flag(tech_pvt, TFLAG_SLA_BARGE)) {
if (switch_channel_test_flag(tech_pvt->channel, CF_SLA_BARGE)) {
switch_core_session_t *new_session, *other_session;
const char *other_uuid = switch_channel_get_partner_uuid(tech_pvt->channel);
char *cmd = NULL;
......@@ -3594,7 +3593,7 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
sofia_set_pflag(profile, PFLAG_STUN_ENABLED);
sofia_set_pflag(profile, PFLAG_DISABLE_100REL);
profile->auto_restart = 1;
sofia_set_pflag(profile, PFLAG_AUTOFIX_TIMING);
sofia_set_media_flag(profile, SCMF_AUTOFIX_TIMING);
sofia_set_pflag(profile, PFLAG_RTP_AUTOFLUSH_DURING_BRIDGE);
profile->contact_user = SOFIA_DEFAULT_CONTACT_USER;
sofia_set_pflag(profile, PFLAG_PASS_CALLEE_ID);
......@@ -3799,9 +3798,9 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
} else if (!strcasecmp(var, "disable-hold")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_DISABLE_HOLD);
sofia_set_media_flag(profile, SCMF_DISABLE_HOLD);
} else {
sofia_clear_pflag(profile, PFLAG_DISABLE_HOLD);
sofia_clear_media_flag(profile, SCMF_DISABLE_HOLD);
}
} else if (!strcasecmp(var, "auto-jitterbuffer-msec")) {
int msec = atoi(val);
......@@ -3833,11 +3832,11 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
profile->client_rport_level = 1;
}
} else if (!strcasecmp(var, "auto-rtp-bugs")) {
sofia_glue_parse_rtp_bugs(&profile->auto_rtp_bugs, val);
switch_core_media_parse_rtp_bugs(&profile->auto_rtp_bugs, val);
} else if (!strcasecmp(var, "manual-rtp-bugs")) {
sofia_glue_parse_rtp_bugs(&profile->manual_rtp_bugs, val);
switch_core_media_parse_rtp_bugs(&profile->manual_rtp_bugs, val);
} else if (!strcasecmp(var, "manual-video-rtp-bugs")) {
sofia_glue_parse_rtp_bugs(&profile->manual_video_rtp_bugs, val);
switch_core_media_parse_rtp_bugs(&profile->manual_video_rtp_bugs, val);
} else if (!strcasecmp(var, "dbname")) {
profile->dbname = switch_core_strdup(profile->pool, val);
} else if (!strcasecmp(var, "presence-hosts")) {
......@@ -4221,9 +4220,9 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
}
} else if (!strcasecmp(var, "rtp-autofix-timing")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_AUTOFIX_TIMING);
sofia_set_media_flag(profile, SCMF_AUTOFIX_TIMING);
} else {
sofia_clear_pflag(profile, PFLAG_AUTOFIX_TIMING);
sofia_clear_media_flag(profile, SCMF_AUTOFIX_TIMING);
}
} else if (!strcasecmp(var, "contact-user")) {
profile->contact_user = switch_core_strdup(profile->pool, val);
......@@ -4241,19 +4240,19 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
}
} else if (!strcasecmp(var, "inbound-codec-negotiation")) {
if (!strcasecmp(val, "greedy")) {
sofia_set_pflag(profile, PFLAG_GREEDY);
sofia_set_media_flag(profile, SCMF_CODEC_GREEDY);
} else if (!strcasecmp(val, "scrooge")) {
sofia_set_pflag(profile, PFLAG_GREEDY);
sofia_set_pflag(profile, PFLAG_SCROOGE);
sofia_set_media_flag(profile, SCMF_CODEC_GREEDY);
sofia_set_media_flag(profile, SCMF_CODEC_SCROOGE);
} else {
sofia_clear_pflag(profile, PFLAG_SCROOGE);
sofia_clear_pflag(profile, PFLAG_GREEDY);
sofia_clear_media_flag(profile, SCMF_CODEC_SCROOGE);
sofia_clear_media_flag(profile, SCMF_CODEC_GREEDY);
}
} else if (!strcasecmp(var, "disable-transcoding")) {
if (switch_true(val)) {
profile->media_flags |= SCMF_DISABLE_TRANSCODING;
sofia_set_media_flag(profile, SCMF_DISABLE_TRANSCODING);
} else {
profile->media_flags &= ~SCMF_DISABLE_TRANSCODING;
sofia_clear_media_flag(profile, SCMF_DISABLE_TRANSCODING);
}
} else if (!strcasecmp(var, "rtp-rewrite-timestamps")) {
if (switch_true(val)) {
......@@ -5004,7 +5003,7 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
sofia_update_callee_id(session, profile, sip, SWITCH_FALSE);
if (sofia_test_pflag(tech_pvt->profile, PFLAG_AUTOFIX_TIMING)) {
if (sofia_test_media_flag(tech_pvt->profile, SCMF_AUTOFIX_TIMING)) {
tech_pvt->check_frames = 0;
tech_pvt->last_ts = 0;
}
......@@ -7425,7 +7424,7 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t
if (dtmf.digit) {
if (tech_pvt->dtmf_type == DTMF_INFO ||
sofia_test_pflag(tech_pvt->profile, PFLAG_LIBERAL_DTMF) || sofia_test_flag(tech_pvt, TFLAG_LIBERAL_DTMF)) {
sofia_test_pflag(tech_pvt->profile, PFLAG_LIBERAL_DTMF) || switch_channel_test_flag(tech_pvt->channel, CF_LIBERAL_DTMF)) {
/* queue it up */
switch_channel_queue_dtmf(channel, &dtmf);
......
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论