Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
d6af3a1f
提交
d6af3a1f
authored
12月 21, 2012
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
omfg
上级
10010d47
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
2002 行增加
和
1073 行删除
+2002
-1073
configure.in
configure.in
+4
-2
switch_core_media.h
src/include/switch_core_media.h
+35
-2
switch_types.h
src/include/switch_types.h
+6
-0
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+9
-9
mod_sofia.h
src/mod/endpoints/mod_sofia/mod_sofia.h
+20
-31
rtp.c
src/mod/endpoints/mod_sofia/rtp.c
+1
-1
sofia.c
src/mod/endpoints/mod_sofia/sofia.c
+20
-21
sofia_glue.c
src/mod/endpoints/mod_sofia/sofia_glue.c
+5
-200
sofia_media.c
src/mod/endpoints/mod_sofia/sofia_media.c
+45
-508
switch_core_media.c
src/switch_core_media.c
+1857
-299
没有找到文件。
configure.in
浏览文件 @
d6af3a1f
...
...
@@ -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)
...
...
src/include/switch_core_media.h
浏览文件 @
d6af3a1f
...
...
@@ -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
...
...
src/include/switch_types.h
浏览文件 @
d6af3a1f
...
...
@@ -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
...
...
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
d6af3a1f
...
...
@@ -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
]
=
""
;
s
of
ia_dtmf_t
dtmf_type
;
s
witch_core_med
ia_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
;
s
ofia_clear_flag_locked
(
tech_pvt
,
TFLAG_VIDEO
);
s
witch_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
;
s
ofia_glue
_pass_zrtp_hash2
(
session
,
nsession
);
s
witch_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
);
s
ofia_set_flag
(
tech_pvt
,
TFLAG_VIDEO
);
s
witch_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
);
s
ofia_clear_flag
(
tech_pvt
,
TFLAG
_SLA_BARGING
);
s
ofia_set_flag
(
tech_pvt
,
TFLAG
_SLA_BARGE
);
s
witch_channel_clear_flag
(
tech_pvt
->
channel
,
CF
_SLA_BARGING
);
s
witch_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
);
s
ofia_set_flag
(
tech_pvt
,
TFLAG
_SLA_BARGING
);
s
witch_channel_set_flag
(
tech_pvt
->
channel
,
CF
_SLA_BARGING
);
}
channel
=
switch_core_session_get_channel
(
session
);
...
...
src/mod/endpoints/mod_sofia/mod_sofia.h
浏览文件 @
d6af3a1f
...
...
@@ -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
;
s
of
ia_dtmf_t
dtmf_type
;
s
witch_core_med
ia_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
;
s
of
ia_dtmf_t
dtmf_type
;
s
witch_core_med
ia_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:
...
...
src/mod/endpoints/mod_sofia/rtp.c
浏览文件 @
d6af3a1f
...
...
@@ -74,7 +74,7 @@ typedef struct {
switch_port_t
local_port
;
switch_port_t
remote_port
;
switch_payload_t
agreed_pt
;
/*XXX*/
s
of
ia_dtmf_t
dtmf_type
;
s
witch_core_med
ia_dtmf_t
dtmf_type
;
enum
{
RTP_SENDONLY
,
RTP_RECVONLY
,
...
...
src/mod/endpoints/mod_sofia/sofia.c
浏览文件 @
d6af3a1f
...
...
@@ -599,7 +599,7 @@ void sofia_handle_sip_i_bye(switch_core_session_t *session, int status,
status
=
200
;
phrase
=
"OK"
;
if
(
s
ofia_test_flag
(
tech_pvt
,
TFLAG
_SLA_BARGING
))
{
if
(
s
witch_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
(
s
ofia_test_flag
(
tech_pvt
,
TFLAG
_SLA_BARGE
))
{
if
(
s
witch_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"
))
{
s
ofia_glue
_parse_rtp_bugs
(
&
profile
->
auto_rtp_bugs
,
val
);
s
witch_core_media
_parse_rtp_bugs
(
&
profile
->
auto_rtp_bugs
,
val
);
}
else
if
(
!
strcasecmp
(
var
,
"manual-rtp-bugs"
))
{
s
ofia_glue
_parse_rtp_bugs
(
&
profile
->
manual_rtp_bugs
,
val
);
s
witch_core_media
_parse_rtp_bugs
(
&
profile
->
manual_rtp_bugs
,
val
);
}
else
if
(
!
strcasecmp
(
var
,
"manual-video-rtp-bugs"
))
{
s
ofia_glue
_parse_rtp_bugs
(
&
profile
->
manual_video_rtp_bugs
,
val
);
s
witch_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
)
||
s
ofia_test_flag
(
tech_pvt
,
TFLAG
_LIBERAL_DTMF
))
{
sofia_test_pflag
(
tech_pvt
->
profile
,
PFLAG_LIBERAL_DTMF
)
||
s
witch_channel_test_flag
(
tech_pvt
->
channel
,
CF
_LIBERAL_DTMF
))
{
/* queue it up */
switch_channel_queue_dtmf
(
channel
,
&
dtmf
);
...
...
src/mod/endpoints/mod_sofia/sofia_glue.c
浏览文件 @
d6af3a1f
差异被折叠。
点击展开。
src/mod/endpoints/mod_sofia/sofia_media.c
浏览文件 @
d6af3a1f
差异被折叠。
点击展开。
src/switch_core_media.c
浏览文件 @
d6af3a1f
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论