Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
e5d140d1
提交
e5d140d1
authored
8月 08, 2012
作者:
Kapil Gupta
提交者:
root
8月 08, 2012
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
adding code for reporting DTMF to MGC
上级
99e04bf1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
23 行增加
和
0 行删除
+23
-0
media_gateway.c
src/mod/endpoints/mod_media_gateway/media_gateway.c
+23
-0
没有找到文件。
src/mod/endpoints/mod_media_gateway/media_gateway.c
浏览文件 @
e5d140d1
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
*/
*/
#include "mod_media_gateway.h"
#include "mod_media_gateway.h"
#include "media_gateway_stack.h"
megaco_profile_t
*
megaco_profile_locate
(
const
char
*
name
)
megaco_profile_t
*
megaco_profile_locate
(
const
char
*
name
)
{
{
...
@@ -79,6 +80,24 @@ megaco_profile_t* megaco_get_profile_by_suId(SuId suId)
...
@@ -79,6 +80,24 @@ megaco_profile_t* megaco_get_profile_by_suId(SuId suId)
return
profile
;
return
profile
;
}
}
static
switch_status_t
mg_on_dtmf
(
switch_core_session_t
*
session
,
const
switch_dtmf_t
*
dtmf
,
switch_dtmf_direction_t
direction
)
{
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
mg_termination_t
*
term
=
switch_channel_get_private
(
channel
,
"_mg_term_"
);
char
digit
[
2
]
=
{
dtmf
->
digit
};
if
(
!
term
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Cannot find termination structure for session [%s]
\n
"
,
switch_core_session_get_uuid
(
session
));
return
SWITCH_STATUS_SUCCESS
;
}
//switch_status_t mg_send_dtmf_notify(megaco_profile_t* mg_profile, const char* term_name, char* digits, int num_of_collected_digits);
//mg_send_dtmf_notify(term->profile, term->name, digit, 1);
switch_log_printf
(
"NOT Sending notify to MGC for dtmf: %c
\n
"
,
dtmf
->
digit
);
return
SWITCH_STATUS_SUCCESS
;
}
/*
/*
* Creates a freeswitch channel for the specified termination.
* Creates a freeswitch channel for the specified termination.
* The channel will be parked until future actions are taken
* The channel will be parked until future actions are taken
...
@@ -136,6 +155,7 @@ switch_status_t megaco_activate_termination(mg_termination_t *term)
...
@@ -136,6 +155,7 @@ switch_status_t megaco_activate_termination(mg_termination_t *term)
}
}
if
(
zstr
(
term
->
uuid
))
{
if
(
zstr
(
term
->
uuid
))
{
switch_channel_t
*
channel
;
if
(
switch_ivr_originate
(
NULL
,
&
session
,
&
cause
,
dialstring
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
var_event
,
0
,
NULL
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_ivr_originate
(
NULL
,
&
session
,
&
cause
,
dialstring
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
var_event
,
0
,
NULL
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Failed to instanciate termination [%s]: %s
\n
"
,
term
->
name
,
switch_channel_cause2str
(
cause
));
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Failed to instanciate termination [%s]: %s
\n
"
,
term
->
name
,
switch_channel_cause2str
(
cause
));
status
=
SWITCH_STATUS_FALSE
;
status
=
SWITCH_STATUS_FALSE
;
...
@@ -144,6 +164,9 @@ switch_status_t megaco_activate_termination(mg_termination_t *term)
...
@@ -144,6 +164,9 @@ switch_status_t megaco_activate_termination(mg_termination_t *term)
term
->
uuid
=
switch_core_strdup
(
term
->
pool
,
switch_core_session_get_uuid
(
session
));
term
->
uuid
=
switch_core_strdup
(
term
->
pool
,
switch_core_session_get_uuid
(
session
));
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Termination [%s] successfully instanciated as [%s] [%s]
\n
"
,
term
->
name
,
dialstring
,
switch_core_session_get_uuid
(
session
));
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Termination [%s] successfully instanciated as [%s] [%s]
\n
"
,
term
->
name
,
dialstring
,
switch_core_session_get_uuid
(
session
));
channel
=
switch_core_session_get_channel
(
session
);
switch_channel_set_private
(
channel
,
"_mg_term_"
,
term
);
switch_core_event_hook_add_recv_dtmf
(
session
,
mg_on_dtmf
);
}
}
switch_set_flag
(
term
,
MGT_ACTIVE
);
switch_set_flag
(
term
,
MGT_ACTIVE
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论