Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
92ddf472
提交
92ddf472
authored
12月 22, 2012
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
expose some rtp func via media handle
上级
faaf642d
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
670 行增加
和
18 行删除
+670
-18
switch_core_media.h
src/include/switch_core_media.h
+16
-1
switch_types.h
src/include/switch_types.h
+2
-0
mod_sofia.h
src/mod/endpoints/mod_sofia/mod_sofia.h
+128
-5
sofia.c
src/mod/endpoints/mod_sofia/sofia.c
+3
-3
sofia_glue.c
src/mod/endpoints/mod_sofia/sofia_glue.c
+5
-0
switch_core_media.c
src/switch_core_media.c
+507
-7
switch_core_session.c
src/switch_core_session.c
+9
-2
没有找到文件。
src/include/switch_core_media.h
浏览文件 @
92ddf472
...
@@ -68,6 +68,7 @@ typedef enum {
...
@@ -68,6 +68,7 @@ typedef enum {
SCMF_PASS_RFC2833
,
SCMF_PASS_RFC2833
,
SCMF_AUTOFLUSH
,
SCMF_AUTOFLUSH
,
SCMF_REWRITE_TIMESTAMPS
,
SCMF_REWRITE_TIMESTAMPS
,
SCMF_RTP_AUTOFLUSH_DURING_BRIDGE
,
SCMF_MAX
SCMF_MAX
}
switch_core_media_flag_t
;
}
switch_core_media_flag_t
;
...
@@ -139,6 +140,8 @@ typedef struct switch_core_media_params_s {
...
@@ -139,6 +140,8 @@ typedef struct switch_core_media_params_s {
char
*
adv_sdp_audio_ip
;
char
*
adv_sdp_audio_ip
;
int
num_codecs
;
//x:tp
int
num_codecs
;
//x:tp
int
hold_laps
;
//x:tp
// HACK REMOVE ME
// HACK REMOVE ME
switch_rtp_t
*
rtp_session
;
switch_rtp_t
*
rtp_session
;
...
@@ -214,10 +217,21 @@ SWITCH_DECLARE(void)switch_core_media_set_local_sdp(switch_core_session_t *sessi
...
@@ -214,10 +217,21 @@ SWITCH_DECLARE(void)switch_core_media_set_local_sdp(switch_core_session_t *sessi
SWITCH_DECLARE
(
void
)
switch_core_media_patch_sdp
(
switch_core_session_t
*
session
);
SWITCH_DECLARE
(
void
)
switch_core_media_patch_sdp
(
switch_core_session_t
*
session
);
SWITCH_DECLARE
(
void
)
switch_core_media_set_image_sdp
(
switch_core_session_t
*
session
,
switch_t38_options_t
*
t38_options
,
int
insist
);
SWITCH_DECLARE
(
void
)
switch_core_media_set_image_sdp
(
switch_core_session_t
*
session
,
switch_t38_options_t
*
t38_options
,
int
insist
);
SWITCH_DECLARE
(
void
)
switch_core_media_prepare_codecs
(
switch_core_session_t
*
session
,
switch_bool_t
force
);
SWITCH_DECLARE
(
void
)
switch_core_media_prepare_codecs
(
switch_core_session_t
*
session
,
switch_bool_t
force
);
SWITCH_DECLARE
(
void
)
switch_core_media_start_udptl
(
switch_core_session_t
*
session
,
switch_t38_options_t
*
t38_options
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_media_receive_message
(
switch_core_session_t
*
session
,
switch_core_session_message_t
*
msg
);
SWITCH_DECLARE
(
void
)
switch_core_media_break
(
switch_media_handle_t
*
smh
,
switch_media_type_t
type
);
SWITCH_DECLARE
(
void
)
switch_core_media_kill_socket
(
switch_media_handle_t
*
smh
,
switch_media_type_t
type
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_media_queue_rfc2833
(
switch_media_handle_t
*
smh
,
switch_media_type_t
type
,
const
switch_dtmf_t
*
dtmf
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_media_queue_rfc2833_in
(
switch_media_handle_t
*
smh
,
switch_media_type_t
type
,
const
switch_dtmf_t
*
dtmf
);
SWITCH_DECLARE
(
uint8_t
)
switch_core_media_ready
(
switch_media_handle_t
*
smh
,
switch_media_type_t
type
);
SWITCH_DECLARE
(
void
)
switch_core_media_set_recv_pt
(
switch_media_handle_t
*
smh
,
switch_media_type_t
type
,
switch_payload_t
pt
);
SWITCH_DECLARE
(
void
)
switch_core_media_set_telephony_event
(
switch_media_handle_t
*
smh
,
switch_media_type_t
type
,
switch_payload_t
te
);
SWITCH_DECLARE
(
void
)
switch_core_media_set_telephony_recv_event
(
switch_media_handle_t
*
smh
,
switch_media_type_t
type
,
switch_payload_t
te
);
SWITCH_DECLARE
(
switch_rtp_stats_t
*
)
switch_core_media_stats
(
switch_media_handle_t
*
smh
,
switch_media_type_t
type
,
switch_memory_pool_t
*
pool
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_media_udptl_mode
(
switch_media_handle_t
*
smh
,
switch_media_type_t
type
);
SWITCH_END_EXTERN_C
SWITCH_END_EXTERN_C
#endif
#endif
...
@@ -231,3 +245,4 @@ SWITCH_END_EXTERN_C
...
@@ -231,3 +245,4 @@ SWITCH_END_EXTERN_C
* For VIM:
* For VIM:
* vim:set softtabstop=4 shiftwidth=4 tabstop=4:
* vim:set softtabstop=4 shiftwidth=4 tabstop=4:
*/
*/
src/include/switch_types.h
浏览文件 @
92ddf472
...
@@ -1293,6 +1293,8 @@ typedef enum {
...
@@ -1293,6 +1293,8 @@ typedef enum {
CF_T38_PASSTHRU
,
CF_T38_PASSTHRU
,
CF_DROP_DTMF
,
CF_DROP_DTMF
,
CF_REINVITE
,
CF_REINVITE
,
CF_AUTOFLUSH_DURING_BRIDGE
,
CF_RTP_NOTIMER_DURING_BRIDGE
,
/* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
/* 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() */
/* 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
CF_FLAG_MAX
...
...
src/mod/endpoints/mod_sofia/mod_sofia.h
浏览文件 @
92ddf472
...
@@ -228,7 +228,6 @@ typedef enum {
...
@@ -228,7 +228,6 @@ typedef enum {
PFLAG_ALL_REG_OPTIONS_PING
,
PFLAG_ALL_REG_OPTIONS_PING
,
PFLAG_MESSAGE_QUERY_ON_REGISTER
,
PFLAG_MESSAGE_QUERY_ON_REGISTER
,
PFLAG_MESSAGE_QUERY_ON_FIRST_REGISTER
,
PFLAG_MESSAGE_QUERY_ON_FIRST_REGISTER
,
PFLAG_RTP_AUTOFLUSH_DURING_BRIDGE
,
PFLAG_MANUAL_REDIRECT
,
PFLAG_MANUAL_REDIRECT
,
PFLAG_AUTO_NAT
,
PFLAG_AUTO_NAT
,
PFLAG_SIPCOMPACT
,
PFLAG_SIPCOMPACT
,
...
@@ -302,13 +301,11 @@ typedef enum {
...
@@ -302,13 +301,11 @@ typedef enum {
TFLAG_ZRTP_PASSTHRU
,
TFLAG_ZRTP_PASSTHRU
,
TFLAG_HOLD_LOCK
,
TFLAG_HOLD_LOCK
,
TFLAG_3PCC_HAS_ACK
,
TFLAG_3PCC_HAS_ACK
,
TFLAG_PASS_RFC2833
,
TFLAG_UPDATING_DISPLAY
,
TFLAG_UPDATING_DISPLAY
,
TFLAG_ENABLE_SOA
,
TFLAG_ENABLE_SOA
,
TFLAG_T38_PASSTHRU
,
TFLAG_T38_PASSTHRU
,
TFLAG_RECOVERED
,
TFLAG_RECOVERED
,
TFLAG_AUTOFLUSH_DURING_BRIDGE
,
TFLAG_AUTOFLUSH_DURING_BRIDGE
,
TFLAG_JB_PAUSED
,
TFLAG_3PCC_INVITE
,
TFLAG_3PCC_INVITE
,
TFLAG_NOREPLY
,
TFLAG_NOREPLY
,
TFLAG_GOT_ACK
,
TFLAG_GOT_ACK
,
...
@@ -524,8 +521,8 @@ struct sofia_profile {
...
@@ -524,8 +521,8 @@ struct sofia_profile {
char
*
extrtpip
;
char
*
extrtpip
;
char
*
rtpip
[
MAX_RTPIP
];
char
*
rtpip
[
MAX_RTPIP
];
char
*
jb_msec
;
char
*
jb_msec
;
switch_payload_t
te
;
//x:tp
switch_payload_t
te
;
switch_payload_t
recv_te
;
//x:tp
switch_payload_t
recv_te
;
uint32_t
rtpip_index
;
uint32_t
rtpip_index
;
uint32_t
rtpip_next
;
uint32_t
rtpip_next
;
char
*
rtcp_audio_interval_msec
;
char
*
rtcp_audio_interval_msec
;
...
@@ -670,6 +667,131 @@ struct sofia_profile {
...
@@ -670,6 +667,131 @@ struct sofia_profile {
switch_core_media_vflag_t
vflags
;
switch_core_media_vflag_t
vflags
;
};
};
#if 0
struct private_object {
sofia_private_t *sofia_private;
uint8_t flags[TFLAG_MAX];
// switch_payload_t agreed_pt;
// switch_payload_t audio_recv_pt;
// switch_payload_t video_recv_pt;
switch_core_session_t *session;
switch_channel_t *channel;
switch_media_handle_t *media_handle;
switch_core_media_params_t mparams;
//switch_frame_t read_frame;
char *codec_order[SWITCH_MAX_CODECS];
//int codec_order_last;
const switch_codec_implementation_t *codecs[SWITCH_MAX_CODECS];
const switch_codec_implementation_t *negotiated_codecs[SWITCH_MAX_CODECS];
//int num_negotiated_codecs;
//switch_codec_t read_codec;
//switch_codec_t write_codec;
//uint32_t codec_ms;
// uint32_t bitrate;
switch_caller_profile_t *caller_profile;
//uint32_t timestamp_send;
switch_rtp_t *rtp_session;
// uint32_t video_ssrc;
sofia_profile_t *profile;
char *reply_contact;
char *from_uri;
char *to_uri;
char *from_address;
char *to_address;
char *callid;
char *contact_url;
char *from_str;
char *rpid;
char *asserted_id;
char *preferred_id;
char *privacy;
char *gateway_from_str;
char *rm_encoding;
char *iananame;
char *rm_fmtp;
char *fmtp_out;
char *dest;
char *dest_to;
char *key;
char *xferto;
char *kick;
char *origin;
char *hash_key;
char *chat_from;
char *chat_to;
char *e_dest;
char *call_id;
char *invite_contact;
char *local_url;
char *gateway_name;
char *record_route;
char *route_uri;
char *x_freeswitch_support_remote;
char *x_freeswitch_support_local;
char *last_sent_callee_id_name;
char *last_sent_callee_id_number;
//unsigned long rm_rate;
//switch_payload_t pt;
switch_mutex_t *flag_mutex;
switch_mutex_t *sofia_mutex;
////switch_payload_t te;
////switch_payload_t recv_te;
//switch_payload_t bte;
//switch_payload_t cng_pt;
//switch_payload_t bcng_pt;
sofia_transport_t transport;
nua_handle_t *nh;
nua_handle_t *nh2;
sip_contact_t *contact;
//uint32_t max_missed_packets;
//uint32_t max_missed_hold_packets;
/** VIDEO **/
// switch_frame_t video_read_frame;
// switch_codec_t video_read_codec;
// switch_codec_t video_write_codec;
switch_rtp_t *video_rtp_session;
// switch_port_t adv_sdp_video_port;
// switch_port_t local_sdp_video_port;
// char *video_rm_encoding;
// switch_payload_t video_pt;
// unsigned long video_rm_rate;
// uint32_t video_codec_ms;
// char *video_rm_fmtp;
// switch_payload_t video_agreed_pt;
// char *video_fmtp_out;
// uint32_t video_count;
//switch_core_media_dtmf_t dtmf_type;
int q850_cause;
int got_bye;
//int hold_laps;
switch_thread_id_t locker;
//switch_size_t last_ts;
//uint32_t check_frames;
//uint32_t mismatch_count;
//uint32_t last_codec_ms;
//uint8_t codec_reinvites;
nua_event_t want_event;
switch_rtp_bug_flag_t rtp_bugs;
// switch_rtp_bug_flag_t video_rtp_bugs;
//switch_codec_implementation_t read_impl;
//switch_codec_implementation_t write_impl;
char *user_via;
char *redirected;
sofia_cid_type_t cid_type;
switch_payload_t payload_space;
switch_payload_t ianacodes[SWITCH_MAX_CODECS];
uint32_t session_timeout;
enum nua_session_refresher session_refresher;
char *respond_phrase;
int respond_code;
char *respond_dest;
};
#else
struct
private_object
{
struct
private_object
{
sofia_private_t
*
sofia_private
;
sofia_private_t
*
sofia_private
;
uint8_t
flags
[
TFLAG_MAX
];
uint8_t
flags
[
TFLAG_MAX
];
...
@@ -792,6 +914,7 @@ struct private_object {
...
@@ -792,6 +914,7 @@ struct private_object {
int
respond_code
;
int
respond_code
;
char
*
respond_dest
;
char
*
respond_dest
;
};
};
#endif
struct
callback_t
{
struct
callback_t
{
char
*
val
;
char
*
val
;
...
...
src/mod/endpoints/mod_sofia/sofia.c
浏览文件 @
92ddf472
...
@@ -3593,7 +3593,7 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
...
@@ -3593,7 +3593,7 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
sofia_set_pflag
(
profile
,
PFLAG_DISABLE_100REL
);
sofia_set_pflag
(
profile
,
PFLAG_DISABLE_100REL
);
profile
->
auto_restart
=
1
;
profile
->
auto_restart
=
1
;
sofia_set_media_flag
(
profile
,
SCMF_AUTOFIX_TIMING
);
sofia_set_media_flag
(
profile
,
SCMF_AUTOFIX_TIMING
);
sofia_set_
pflag
(
profile
,
PFLAG
_RTP_AUTOFLUSH_DURING_BRIDGE
);
sofia_set_
media_flag
(
profile
,
SCMF
_RTP_AUTOFLUSH_DURING_BRIDGE
);
profile
->
contact_user
=
SOFIA_DEFAULT_CONTACT_USER
;
profile
->
contact_user
=
SOFIA_DEFAULT_CONTACT_USER
;
sofia_set_pflag
(
profile
,
PFLAG_PASS_CALLEE_ID
);
sofia_set_pflag
(
profile
,
PFLAG_PASS_CALLEE_ID
);
sofia_set_pflag
(
profile
,
PFLAG_SEND_DISPLAY_UPDATE
);
sofia_set_pflag
(
profile
,
PFLAG_SEND_DISPLAY_UPDATE
);
...
@@ -5958,7 +5958,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
...
@@ -5958,7 +5958,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
if
(
r_sdp
)
{
if
(
r_sdp
)
{
const
char
*
var
;
const
char
*
var
;
uint8_t
match
=
0
,
is_ok
=
1
,
is_t38
=
0
;
uint8_t
match
=
0
,
is_ok
=
1
,
is_t38
=
0
;
tech_pvt
->
hold_laps
=
0
;
tech_pvt
->
mparams
.
hold_laps
=
0
;
if
((
var
=
switch_channel_get_variable
(
channel
,
"sip_ignore_reinvites"
))
&&
switch_true
(
var
))
{
if
((
var
=
switch_channel_get_variable
(
channel
,
"sip_ignore_reinvites"
))
&&
switch_true
(
var
))
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"Ignoring Re-invite
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"Ignoring Re-invite
\n
"
);
...
@@ -5977,7 +5977,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
...
@@ -5977,7 +5977,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
if
(
switch_channel_test_flag
(
channel
,
CF_PROXY_MODE
)
&&
!
is_t38
&&
(
profile
->
media_options
&
MEDIA_OPT_MEDIA_ON_HOLD
))
{
if
(
switch_channel_test_flag
(
channel
,
CF_PROXY_MODE
)
&&
!
is_t38
&&
(
profile
->
media_options
&
MEDIA_OPT_MEDIA_ON_HOLD
))
{
if
(
switch_stristr
(
"sendonly"
,
r_sdp
)
||
switch_stristr
(
"0.0.0.0"
,
r_sdp
))
{
if
(
switch_stristr
(
"sendonly"
,
r_sdp
)
||
switch_stristr
(
"0.0.0.0"
,
r_sdp
))
{
tech_pvt
->
hold_laps
=
1
;
tech_pvt
->
mparams
.
hold_laps
=
1
;
switch_channel_set_variable
(
channel
,
SWITCH_R_SDP_VARIABLE
,
r_sdp
);
switch_channel_set_variable
(
channel
,
SWITCH_R_SDP_VARIABLE
,
r_sdp
);
switch_channel_clear_flag
(
channel
,
CF_PROXY_MODE
);
switch_channel_clear_flag
(
channel
,
CF_PROXY_MODE
);
switch_core_media_set_local_sdp
(
tech_pvt
->
session
,
NULL
,
SWITCH_FALSE
);
switch_core_media_set_local_sdp
(
tech_pvt
->
session
,
NULL
,
SWITCH_FALSE
);
...
...
src/mod/endpoints/mod_sofia/sofia_glue.c
浏览文件 @
92ddf472
...
@@ -129,6 +129,11 @@ void sofia_glue_attach_private(switch_core_session_t *session, sofia_profile_t *
...
@@ -129,6 +129,11 @@ void sofia_glue_attach_private(switch_core_session_t *session, sofia_profile_t *
switch_channel_set_flag
(
tech_pvt
->
channel
,
CF_PASS_RFC2833
);
switch_channel_set_flag
(
tech_pvt
->
channel
,
CF_PASS_RFC2833
);
}
}
if
(
sofia_test_pflag
(
tech_pvt
->
profile
,
PFLAG_RTP_NOTIMER_DURING_BRIDGE
))
{
switch_channel_set_flag
(
tech_pvt
->
channel
,
CF_RTP_NOTIMER_DURING_BRIDGE
);
}
switch_core_media_check_dtmf_type
(
session
);
switch_core_media_check_dtmf_type
(
session
);
switch_channel_set_cap
(
tech_pvt
->
channel
,
CC_MEDIA_ACK
);
switch_channel_set_cap
(
tech_pvt
->
channel
,
CC_MEDIA_ACK
);
...
...
src/switch_core_media.c
浏览文件 @
92ddf472
差异被折叠。
点击展开。
src/switch_core_session.c
浏览文件 @
92ddf472
...
@@ -792,8 +792,15 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_perform_receive_message(swit
...
@@ -792,8 +792,15 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_perform_receive_message(swit
switch_core_session_get_uuid
(
session
),
SWITCH_LOG_DEBUG
,
"%s skip receive message [%s] (channel is hungup already)
\n
"
,
switch_core_session_get_uuid
(
session
),
SWITCH_LOG_DEBUG
,
"%s skip receive message [%s] (channel is hungup already)
\n
"
,
switch_channel_get_name
(
session
->
channel
),
message_names
[
message
->
message_id
]);
switch_channel_get_name
(
session
->
channel
),
message_names
[
message
->
message_id
]);
}
else
if
(
session
->
endpoint_interface
->
io_routines
->
receive_message
)
{
}
else
{
status
=
session
->
endpoint_interface
->
io_routines
->
receive_message
(
session
,
message
);
if
(
session
->
media_handle
)
{
status
=
switch_core_media_receive_message
(
session
,
message
);
}
if
(
status
==
SWITCH_STATUS_SUCCESS
)
{
if
(
session
->
endpoint_interface
->
io_routines
->
receive_message
)
{
status
=
session
->
endpoint_interface
->
io_routines
->
receive_message
(
session
,
message
);
}
}
}
}
if
(
status
==
SWITCH_STATUS_SUCCESS
)
{
if
(
status
==
SWITCH_STATUS_SUCCESS
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论