Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
4ee68141
提交
4ee68141
authored
9月 03, 2010
作者:
Anthony Minessale
提交者:
Brian West
9月 03, 2010
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
make dingaling work with google voice inbound too
上级
5ce37cbe
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
41 行增加
和
4 行删除
+41
-4
libdingaling.c
libs/libdingaling/src/libdingaling.c
+5
-0
libdingaling.h
libs/libdingaling/src/libdingaling.h
+1
-0
mod_dingaling.c
src/mod/endpoints/mod_dingaling/mod_dingaling.c
+35
-4
没有找到文件。
libs/libdingaling/src/libdingaling.c
浏览文件 @
4ee68141
...
@@ -2471,6 +2471,11 @@ int ldl_handle_running(ldl_handle_t *handle)
...
@@ -2471,6 +2471,11 @@ int ldl_handle_running(ldl_handle_t *handle)
}
}
void
ldl_session_set_gateway
(
ldl_session_t
*
session
)
{
ldl_set_flag
(
session
,
LDL_FLAG_GATEWAY
);
}
int
ldl_session_gateway
(
ldl_session_t
*
session
)
int
ldl_session_gateway
(
ldl_session_t
*
session
)
{
{
return
ldl_test_flag
(
session
,
LDL_FLAG_GATEWAY
)
?
1
:
0
;
return
ldl_test_flag
(
session
,
LDL_FLAG_GATEWAY
)
?
1
:
0
;
...
...
libs/libdingaling/src/libdingaling.h
浏览文件 @
4ee68141
...
@@ -593,6 +593,7 @@ ldl_status ldl_handle_init(ldl_handle_t **handle,
...
@@ -593,6 +593,7 @@ ldl_status ldl_handle_init(ldl_handle_t **handle,
void
ldl_handle_run
(
ldl_handle_t
*
handle
);
void
ldl_handle_run
(
ldl_handle_t
*
handle
);
int
ldl_session_gateway
(
ldl_session_t
*
handle
);
int
ldl_session_gateway
(
ldl_session_t
*
handle
);
void
ldl_session_set_gateway
(
ldl_session_t
*
session
);
/*!
/*!
\brief Stop a libDingaLing handle
\brief Stop a libDingaLing handle
...
...
src/mod/endpoints/mod_dingaling/mod_dingaling.c
浏览文件 @
4ee68141
...
@@ -1002,7 +1002,7 @@ static int do_candidates(struct private_object *tech_pvt, int force)
...
@@ -1002,7 +1002,7 @@ static int do_candidates(struct private_object *tech_pvt, int force)
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
tech_pvt
->
session
),
SWITCH_LOG_DEBUG
,
"Send Candidate %s:%d [%s]
\n
"
,
cand
[
0
].
address
,
cand
[
0
].
port
,
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
tech_pvt
->
session
),
SWITCH_LOG_DEBUG
,
"Send Candidate %s:%d [%s]
\n
"
,
cand
[
0
].
address
,
cand
[
0
].
port
,
cand
[
0
].
username
);
cand
[
0
].
username
);
if
(
ldl_session_gateway
(
tech_pvt
->
dlsession
))
{
if
(
ldl_session_gateway
(
tech_pvt
->
dlsession
)
&&
switch_test_flag
(
tech_pvt
,
TFLAG_OUTBOUND
)
)
{
tech_pvt
->
cand_id
=
ldl_session_transport
(
tech_pvt
->
dlsession
,
cand
,
1
);
tech_pvt
->
cand_id
=
ldl_session_transport
(
tech_pvt
->
dlsession
,
cand
,
1
);
}
else
{
}
else
{
tech_pvt
->
cand_id
=
ldl_session_candidates
(
tech_pvt
->
dlsession
,
cand
,
1
);
tech_pvt
->
cand_id
=
ldl_session_candidates
(
tech_pvt
->
dlsession
,
cand
,
1
);
...
@@ -2980,6 +2980,8 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
...
@@ -2980,6 +2980,8 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
tech_pvt
->
flags
|=
profile
->
flags
;
tech_pvt
->
flags
|=
profile
->
flags
;
channel
=
switch_core_session_get_channel
(
session
);
channel
=
switch_core_session_get_channel
(
session
);
switch_core_session_set_private
(
session
,
tech_pvt
);
switch_core_session_set_private
(
session
,
tech_pvt
);
tech_pvt
->
dlsession
=
dlsession
;
tech_pvt
->
session
=
session
;
tech_pvt
->
session
=
session
;
tech_pvt
->
codec_index
=
-
1
;
tech_pvt
->
codec_index
=
-
1
;
tech_pvt
->
profile
=
profile
;
tech_pvt
->
profile
=
profile
;
...
@@ -3025,6 +3027,24 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
...
@@ -3025,6 +3027,24 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
cid_num
=
tech_pvt
->
recip
;
cid_num
=
tech_pvt
->
recip
;
}
}
if
(
switch_stristr
(
"voice.google.com"
,
from
))
{
char
*
id
=
switch_core_session_strdup
(
session
,
from
);
char
*
p
;
if
((
p
=
strchr
(
id
,
'@'
)))
{
*
p
++
=
'\0'
;
cid_name
=
"Google Voice"
;
cid_num
=
id
;
}
ldl_session_set_gateway
(
dlsession
);
do_candidates
(
tech_pvt
,
1
);
}
/* context of "_auto_" means set it to the domain */
/* context of "_auto_" means set it to the domain */
if
(
profile
->
context
&&
!
strcmp
(
profile
->
context
,
"_auto_"
))
{
if
(
profile
->
context
&&
!
strcmp
(
profile
->
context
,
"_auto_"
))
{
context
=
profile
->
name
;
context
=
profile
->
name
;
...
@@ -3047,7 +3067,7 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
...
@@ -3047,7 +3067,7 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
switch_safe_free
(
tmp
);
switch_safe_free
(
tmp
);
}
}
if
(
!
tech_pvt
->
caller_profile
)
{
if
(
!
tech_pvt
->
caller_profile
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"Creating an identity for %s %s <%s> %s
\n
"
,
ldl_session_get_id
(
dlsession
),
cid_name
,
cid_num
,
exten
);
"Creating an identity for %s %s <%s> %s
\n
"
,
ldl_session_get_id
(
dlsession
),
cid_name
,
cid_num
,
exten
);
...
@@ -3079,7 +3099,7 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
...
@@ -3079,7 +3099,7 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
}
}
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"Creating a session for %s
\n
"
,
ldl_session_get_id
(
dlsession
));
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"Creating a session for %s
\n
"
,
ldl_session_get_id
(
dlsession
));
ldl_session_set_private
(
dlsession
,
session
);
ldl_session_set_private
(
dlsession
,
session
);
tech_pvt
->
dlsession
=
dlsession
;
switch_channel_set_name
(
channel
,
"DingaLing/new"
);
switch_channel_set_name
(
channel
,
"DingaLing/new"
);
switch_channel_set_state
(
channel
,
CS_INIT
);
switch_channel_set_state
(
channel
,
CS_INIT
);
if
(
switch_core_session_thread_launch
(
session
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_core_session_thread_launch
(
session
)
!=
SWITCH_STATUS_SUCCESS
)
{
...
@@ -3230,6 +3250,7 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
...
@@ -3230,6 +3250,7 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
}
}
}
}
}
}
}
}
break
;
break
;
...
@@ -3259,7 +3280,15 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
...
@@ -3259,7 +3280,15 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
if
(
profile
->
acl_count
)
{
if
(
profile
->
acl_count
)
{
for
(
x
=
0
;
x
<
len
;
x
++
)
{
for
(
x
=
0
;
x
<
len
;
x
++
)
{
uint32_t
y
=
0
;
uint32_t
y
=
0
;
if
(
strcasecmp
(
candidates
[
x
].
protocol
,
"udp"
))
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"candidate %s:%d has an unsupported protocol!
\n
"
,
candidates
[
x
].
address
,
candidates
[
x
].
port
);
continue
;
}
for
(
y
=
0
;
y
<
profile
->
acl_count
;
y
++
)
{
for
(
y
=
0
;
y
<
profile
->
acl_count
;
y
++
)
{
if
(
switch_check_network_list_ip
(
candidates
[
x
].
address
,
profile
->
acl
[
y
]))
{
if
(
switch_check_network_list_ip
(
candidates
[
x
].
address
,
profile
->
acl
[
y
]))
{
choice
=
x
;
choice
=
x
;
ok
=
1
;
ok
=
1
;
...
@@ -3268,7 +3297,7 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
...
@@ -3268,7 +3297,7 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
if
(
ok
)
{
if
(
ok
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"candidate %s:%d PASS ACL %s
\n
"
,
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"candidate %s:%d PASS ACL %s
\n
"
,
candidates
[
x
].
address
,
candidates
[
x
].
port
,
profile
->
acl
[
y
]);
candidates
[
x
].
address
,
candidates
[
x
].
port
,
profile
->
acl
[
y
]);
break
;
goto
end_candidates
;
}
else
{
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"candidate %s:%d FAIL ACL %s
\n
"
,
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"candidate %s:%d FAIL ACL %s
\n
"
,
candidates
[
x
].
address
,
candidates
[
x
].
port
,
profile
->
acl
[
y
]);
candidates
[
x
].
address
,
candidates
[
x
].
port
,
profile
->
acl
[
y
]);
...
@@ -3311,6 +3340,8 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
...
@@ -3311,6 +3340,8 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
}
}
}
}
end_candidates
:
if
(
ok
)
{
if
(
ok
)
{
ldl_payload_t
payloads
[
5
];
ldl_payload_t
payloads
[
5
];
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论