Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
e0a7c69c
提交
e0a7c69c
authored
8月 08, 2012
作者:
Kapil Gupta
提交者:
root
8月 08, 2012
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixing rfc2833 issue
上级
d04606fb
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
34 行增加
和
14 行删除
+34
-14
media_gateway_cmd_handler.c
...d/endpoints/mod_media_gateway/media_gateway_cmd_handler.c
+12
-10
rtp.c
src/mod/endpoints/mod_sofia/rtp.c
+22
-4
没有找到文件。
src/mod/endpoints/mod_media_gateway/media_gateway_cmd_handler.c
浏览文件 @
e0a7c69c
...
@@ -705,17 +705,8 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
...
@@ -705,17 +705,8 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
err_code
=
MGT_MGCO_RSP_CODE_DUP_TERM_CTXT
;
err_code
=
MGT_MGCO_RSP_CODE_DUP_TERM_CTXT
;
goto
error
;
goto
error
;
}
}
/********************************************************************/
/* associate physical termination to context */
if
(
SWITCH_STATUS_FALSE
==
megaco_context_add_termination
(
mg_ctxt
,
term
)){
/********************************************************************/
switch_log_printf
(
SWITCH_CHANNEL_LOG_CLEAN
,
SWITCH_LOG_ERROR
,
"megaco_context_add_termination failed
\n
"
);
mg_util_set_err_string
(
&
errTxt
,
" Resource Failure "
);
err_code
=
MGT_MGCO_RSP_CODE_RSRC_ERROR
;
goto
error
;
}
/********************************************************************/
ret
=
mg_prc_descriptors
(
mg_profile
,
inc_cmd
,
term
,
&
inc_cmd
->
u
.
mgCmdInd
[
0
]
->
memCp
);
ret
=
mg_prc_descriptors
(
mg_profile
,
inc_cmd
,
term
,
&
inc_cmd
->
u
.
mgCmdInd
[
0
]
->
memCp
);
...
@@ -725,6 +716,17 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
...
@@ -725,6 +716,17 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
err_code
=
MGT_MGCP_RSP_CODE_INCONSISTENT_LCL_OPT
;
err_code
=
MGT_MGCP_RSP_CODE_INCONSISTENT_LCL_OPT
;
goto
error
;
goto
error
;
}
}
/********************************************************************/
/* associate physical termination to context */
if
(
SWITCH_STATUS_FALSE
==
megaco_context_add_termination
(
mg_ctxt
,
term
)){
switch_log_printf
(
SWITCH_CHANNEL_LOG_CLEAN
,
SWITCH_LOG_ERROR
,
"megaco_context_add_termination failed
\n
"
);
mg_util_set_err_string
(
&
errTxt
,
" Resource Failure "
);
err_code
=
MGT_MGCO_RSP_CODE_RSRC_ERROR
;
goto
error
;
}
/* TODO - locally assigned SDP must be the part of termination...which we can use to fill responses*/
/* TODO - locally assigned SDP must be the part of termination...which we can use to fill responses*/
...
...
src/mod/endpoints/mod_sofia/rtp.c
浏览文件 @
e0a7c69c
...
@@ -74,6 +74,8 @@ typedef struct {
...
@@ -74,6 +74,8 @@ typedef struct {
switch_port_t
local_port
;
switch_port_t
local_port
;
switch_port_t
remote_port
;
switch_port_t
remote_port
;
switch_payload_t
agreed_pt
;
/*XXX*/
switch_payload_t
agreed_pt
;
/*XXX*/
switch_payload_t
rfc2833_pt
;
sofia_dtmf_t
dtmf_type
;
sofia_dtmf_t
dtmf_type
;
enum
{
enum
{
RTP_SENDONLY
,
RTP_SENDONLY
,
...
@@ -146,7 +148,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
...
@@ -146,7 +148,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
*
codec
=
switch_event_get_header_nil
(
var_event
,
kCODEC
),
*
codec
=
switch_event_get_header_nil
(
var_event
,
kCODEC
),
*
szptime
=
switch_event_get_header_nil
(
var_event
,
kPTIME
),
*
szptime
=
switch_event_get_header_nil
(
var_event
,
kPTIME
),
//*mode = switch_event_get_header_nil(var_event, kMODE),
//*mode = switch_event_get_header_nil(var_event, kMODE),
//
*szrfc2833_pt = switch_event_get_header_nil(var_event, kRFC2833PT),
*
szrfc2833_pt
=
switch_event_get_header_nil
(
var_event
,
kRFC2833PT
),
*
szrate
=
switch_event_get_header_nil
(
var_event
,
kRATE
),
*
szrate
=
switch_event_get_header_nil
(
var_event
,
kRATE
),
*
szpt
=
switch_event_get_header_nil
(
var_event
,
kPT
);
*
szpt
=
switch_event_get_header_nil
(
var_event
,
kPT
);
...
@@ -155,7 +157,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
...
@@ -155,7 +157,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
remote_port
=
!
zstr
(
szremote_port
)
?
atoi
(
szremote_port
)
:
0
;
remote_port
=
!
zstr
(
szremote_port
)
?
atoi
(
szremote_port
)
:
0
;
int
ptime
=
!
zstr
(
szptime
)
?
atoi
(
szptime
)
:
0
,
int
ptime
=
!
zstr
(
szptime
)
?
atoi
(
szptime
)
:
0
,
//
rfc2833_pt = !zstr(szrfc2833_pt) ? atoi(szrfc2833_pt) : 0,
rfc2833_pt
=
!
zstr
(
szrfc2833_pt
)
?
atoi
(
szrfc2833_pt
)
:
0
,
rate
=
!
zstr
(
szrate
)
?
atoi
(
szrate
)
:
8000
,
rate
=
!
zstr
(
szrate
)
?
atoi
(
szrate
)
:
8000
,
pt
=
!
zstr
(
szpt
)
?
atoi
(
szpt
)
:
0
;
pt
=
!
zstr
(
szpt
)
?
atoi
(
szpt
)
:
0
;
...
@@ -185,7 +187,12 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
...
@@ -185,7 +187,12 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
tech_pvt
->
remote_port
=
remote_port
;
tech_pvt
->
remote_port
=
remote_port
;
tech_pvt
->
ptime
=
ptime
;
tech_pvt
->
ptime
=
ptime
;
tech_pvt
->
agreed_pt
=
pt
;
tech_pvt
->
agreed_pt
=
pt
;
tech_pvt
->
dtmf_type
=
DTMF_2833
;
/* XXX */
tech_pvt
->
rfc2833_pt
=
rfc2833_pt
;
if
(
rfc2833_pt
)
{
tech_pvt
->
dtmf_type
=
DTMF_2833
;
}
else
{
tech_pvt
->
dtmf_type
=
DTMF_NONE
;
}
if
(
zstr
(
local_addr
)
||
local_port
==
0
)
{
if
(
zstr
(
local_addr
)
||
local_port
==
0
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"The local address and port must be set
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"The local address and port must be set
\n
"
);
...
@@ -247,6 +254,10 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
...
@@ -247,6 +254,10 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Couldn't setup RTP session: [%s]
\n
"
,
err
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Couldn't setup RTP session: [%s]
\n
"
,
err
);
goto
fail
;
goto
fail
;
}
}
if
(
tech_pvt
->
dtmf_type
==
DTMF_2833
)
{
switch_rtp_set_telephony_event
(
tech_pvt
->
rtp_session
,
tech_pvt
->
rfc2833_pt
);
}
if
(
switch_core_session_thread_launch
(
*
new_session
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_core_session_thread_launch
(
*
new_session
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Couldn't start session thread.
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Couldn't start session thread.
\n
"
);
...
@@ -500,11 +511,18 @@ static switch_status_t channel_receive_event(switch_core_session_t *session, swi
...
@@ -500,11 +511,18 @@ static switch_status_t channel_receive_event(switch_core_session_t *session, swi
if
(
compare_var
(
event
,
channel
,
kRFC2833PT
))
{
if
(
compare_var
(
event
,
channel
,
kRFC2833PT
))
{
const
char
*
szpt
=
switch_channel_get_variable
(
channel
,
kRFC2833PT
);
const
char
*
szpt
=
switch_channel_get_variable
(
channel
,
kRFC2833PT
);
int
pt
=
!
zstr
(
szpt
)
?
atoi
(
szpt
)
:
0
;
int
pt
=
!
zstr
(
szpt
)
?
atoi
(
szpt
)
:
0
;
tech_pvt
->
rfc2833_pt
=
pt
;
if
(
pt
)
{
tech_pvt
->
dtmf_type
=
DTMF_2833
;
}
else
{
tech_pvt
->
dtmf_type
=
DTMF_NONE
;
}
switch_channel_set_variable
(
channel
,
kRFC2833PT
,
szpt
);
switch_channel_set_variable
(
channel
,
kRFC2833PT
,
szpt
);
switch_rtp_set_telephony_event
(
tech_pvt
->
rtp_session
,
pt
);
switch_rtp_set_telephony_event
(
tech_pvt
->
rtp_session
,
pt
);
}
}
}
else
{
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"Received unknown command [%s] in event.
\n
"
,
!
command
?
"null"
:
command
);
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"Received unknown command [%s] in event.
\n
"
,
!
command
?
"null"
:
command
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论