Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
90ba9930
提交
90ba9930
authored
4月 16, 2007
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
...
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@4951
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
b15aff2c
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
57 行增加
和
41 行删除
+57
-41
mod_wanpipe.c
src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
+57
-41
没有找到文件。
src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
浏览文件 @
90ba9930
...
@@ -78,6 +78,7 @@ typedef enum {
...
@@ -78,6 +78,7 @@ typedef enum {
struct
channel_map
{
struct
channel_map
{
char
map
[
SANGOMA_MAX_CHAN_PER_SPAN
][
SWITCH_UUID_FORMATTED_LENGTH
+
1
];
char
map
[
SANGOMA_MAX_CHAN_PER_SPAN
][
SWITCH_UUID_FORMATTED_LENGTH
+
1
];
switch_mutex_t
*
mutex
;
};
};
unsigned
int
txseq
=
0
;
unsigned
int
txseq
=
0
;
...
@@ -635,10 +636,10 @@ static switch_status_t wanpipe_on_hangup(switch_core_session_t *session)
...
@@ -635,10 +636,10 @@ static switch_status_t wanpipe_on_hangup(switch_core_session_t *session)
}
else
if
(
tech_pvt
->
spri
)
{
}
else
if
(
tech_pvt
->
spri
)
{
chanmap
=
tech_pvt
->
spri
->
private_info
;
chanmap
=
tech_pvt
->
spri
->
private_info
;
//if (!switch_test_flag(tech_pvt, TFLAG_BYE)) {
switch_mutex_lock
(
chanmap
->
mutex
);
pri_hangup
(
tech_pvt
->
spri
->
pri
,
tech_pvt
->
call
,
switch_channel_get_cause
(
channel
));
pri_hangup
(
tech_pvt
->
spri
->
pri
,
tech_pvt
->
call
,
switch_channel_get_cause
(
channel
));
pri_destroycall
(
tech_pvt
->
spri
->
pri
,
tech_pvt
->
call
);
pri_destroycall
(
tech_pvt
->
spri
->
pri
,
tech_pvt
->
call
);
//}
switch_mutex_unlock
(
chanmap
->
mutex
);
switch_mutex_lock
(
globals
.
channel_mutex
);
switch_mutex_lock
(
globals
.
channel_mutex
);
*
chanmap
->
map
[
tech_pvt
->
callno
]
=
'\0'
;
*
chanmap
->
map
[
tech_pvt
->
callno
]
=
'\0'
;
...
@@ -691,8 +692,12 @@ static switch_status_t wanpipe_answer_channel(switch_core_session_t *session)
...
@@ -691,8 +692,12 @@ static switch_status_t wanpipe_answer_channel(switch_core_session_t *session)
assert
(
tech_pvt
!=
NULL
);
assert
(
tech_pvt
!=
NULL
);
if
(
tech_pvt
->
spri
)
{
if
(
tech_pvt
->
spri
)
{
struct
channel_map
*
chanmap
=
tech_pvt
->
spri
->
private_info
;
if
(
switch_test_flag
(
tech_pvt
,
TFLAG_INBOUND
))
{
if
(
switch_test_flag
(
tech_pvt
,
TFLAG_INBOUND
))
{
switch_mutex_lock
(
chanmap
->
mutex
);
pri_answer
(
tech_pvt
->
spri
->
pri
,
tech_pvt
->
call
,
0
,
1
);
pri_answer
(
tech_pvt
->
spri
->
pri
,
tech_pvt
->
call
,
0
,
1
);
switch_mutex_unlock
(
chanmap
->
mutex
);
}
}
}
else
if
(
tech_pvt
->
ss7boost_handle
)
{
}
else
if
(
tech_pvt
->
ss7boost_handle
)
{
isup_exec_command
(
tech_pvt
->
ss7boost_handle
,
isup_exec_command
(
tech_pvt
->
ss7boost_handle
,
...
@@ -1178,46 +1183,53 @@ static switch_call_cause_t wanpipe_outgoing_channel(switch_core_session_t *sessi
...
@@ -1178,46 +1183,53 @@ static switch_call_cause_t wanpipe_outgoing_channel(switch_core_session_t *sessi
tech_pvt
->
callno
=
callno
;
tech_pvt
->
callno
=
callno
;
if
(
spri
&&
(
tech_pvt
->
call
=
pri_new_call
(
spri
->
pri
)))
{
if
(
spri
)
{
struct
pri_sr
*
sr
;
struct
channel_map
*
chanmap
=
spri
->
private_info
;
switch_mutex_lock
(
chanmap
->
mutex
);
if
(
tech_pvt
->
call
=
pri_new_call
(
spri
->
pri
))
{
struct
pri_sr
*
sr
;
snprintf
(
name
,
sizeof
(
name
),
"wanpipe/pri/s%dc%d/%s"
,
spri
->
span
,
callno
,
caller_profile
->
destination_number
);
snprintf
(
name
,
sizeof
(
name
),
"wanpipe/pri/s%dc%d/%s"
,
spri
->
span
,
callno
,
caller_profile
->
destination_number
);
switch_channel_set_name
(
channel
,
name
);
switch_channel_set_name
(
channel
,
name
);
switch_channel_set_caller_profile
(
channel
,
caller_profile
);
switch_channel_set_caller_profile
(
channel
,
caller_profile
);
sr
=
pri_sr_new
();
sr
=
pri_sr_new
();
pri_sr_set_channel
(
sr
,
callno
,
0
,
0
);
pri_sr_set_channel
(
sr
,
callno
,
0
,
0
);
pri_sr_set_bearer
(
sr
,
0
,
SPANS
[
span
]
->
l1
);
pri_sr_set_bearer
(
sr
,
0
,
SPANS
[
span
]
->
l1
);
pri_sr_set_called
(
sr
,
caller_profile
->
destination_number
,
SPANS
[
span
]
->
dp
,
1
);
pri_sr_set_called
(
sr
,
caller_profile
->
destination_number
,
SPANS
[
span
]
->
dp
,
1
);
pri_sr_set_caller
(
sr
,
pri_sr_set_caller
(
sr
,
caller_profile
->
caller_id_number
,
caller_profile
->
caller_id_number
,
caller_profile
->
caller_id_name
,
caller_profile
->
caller_id_name
,
SPANS
[
span
]
->
dp
,
SPANS
[
span
]
->
dp
,
PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN
);
PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN
);
pri_sr_set_redirecting
(
sr
,
pri_sr_set_redirecting
(
sr
,
caller_profile
->
caller_id_number
,
caller_profile
->
caller_id_number
,
SPANS
[
span
]
->
dp
,
SPANS
[
span
]
->
dp
,
PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN
,
PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN
,
PRI_REDIR_UNCONDITIONAL
);
PRI_REDIR_UNCONDITIONAL
);
if
(
pri_setup
(
spri
->
pri
,
tech_pvt
->
call
,
sr
))
{
if
(
pri_setup
(
spri
->
pri
,
tech_pvt
->
call
,
sr
))
{
switch_core_session_destroy
(
new_session
);
switch_core_session_destroy
(
new_session
);
pri_sr_free
(
sr
);
pri_sr_free
(
sr
);
cause
=
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
;
cause
=
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
;
goto
error
;
switch_mutex_unlock
(
chanmap
->
mutex
);
}
goto
error
;
}
if
(
!
(
tech_pvt
->
wpsock
=
wp_open
(
spri
->
span
,
callno
)))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Can't open fd!
\n
"
);
if
(
!
(
tech_pvt
->
wpsock
=
wp_open
(
spri
->
span
,
callno
)))
{
switch_core_session_destroy
(
new_session
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Can't open fd!
\n
"
);
switch_core_session_destroy
(
new_session
);
pri_sr_free
(
sr
);
cause
=
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
;
switch_mutex_unlock
(
chanmap
->
mutex
);
goto
error
;
}
pri_sr_free
(
sr
);
pri_sr_free
(
sr
);
cause
=
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
;
switch_copy_string
(
chanmap
->
map
[
callno
],
goto
error
;
switch_core_session_get_uuid
(
*
new_session
),
sizeof
(
chanmap
->
map
[
callno
]));
tech_pvt
->
spri
=
spri
;
}
}
pri_sr_free
(
sr
);
switch_mutex_unlock
(
chanmap
->
mutex
);
switch_copy_string
(
chanmap
->
map
[
callno
],
switch_core_session_get_uuid
(
*
new_session
),
sizeof
(
chanmap
->
map
[
callno
]));
tech_pvt
->
spri
=
spri
;
}
}
}
else
if
(
is_boost
)
{
}
else
if
(
is_boost
)
{
char
*
p
;
char
*
p
;
...
@@ -1452,9 +1464,10 @@ static int on_ring(struct sangoma_pri *spri, sangoma_pri_event_t event_type, pri
...
@@ -1452,9 +1464,10 @@ static int on_ring(struct sangoma_pri *spri, sangoma_pri_event_t event_type, pri
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_NOTICE
,
"-- Ring on channel s%dc%d (from %s to %s)
\n
"
,
spri
->
span
,
pevent
->
ring
.
channel
,
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_NOTICE
,
"-- Ring on channel s%dc%d (from %s to %s)
\n
"
,
spri
->
span
,
pevent
->
ring
.
channel
,
pevent
->
ring
.
callingnum
,
pevent
->
ring
.
callednum
);
pevent
->
ring
.
callingnum
,
pevent
->
ring
.
callednum
);
switch_mutex_unlock
(
chanmap
->
mutex
);
pri_proceeding
(
spri
->
pri
,
pevent
->
ring
.
call
,
pevent
->
ring
.
channel
,
0
);
pri_proceeding
(
spri
->
pri
,
pevent
->
ring
.
call
,
pevent
->
ring
.
channel
,
0
);
pri_acknowledge
(
spri
->
pri
,
pevent
->
ring
.
call
,
pevent
->
ring
.
channel
,
0
);
pri_acknowledge
(
spri
->
pri
,
pevent
->
ring
.
call
,
pevent
->
ring
.
channel
,
0
);
switch_mutex_unlock
(
chanmap
->
mutex
);
if
((
session
=
switch_core_session_request
(
&
wanpipe_endpoint_interface
,
NULL
)))
{
if
((
session
=
switch_core_session_request
(
&
wanpipe_endpoint_interface
,
NULL
)))
{
private_object_t
*
tech_pvt
;
private_object_t
*
tech_pvt
;
...
@@ -1602,6 +1615,9 @@ static void *SWITCH_THREAD_FUNC pri_thread_run(switch_thread_t *thread, void *ob
...
@@ -1602,6 +1615,9 @@ static void *SWITCH_THREAD_FUNC pri_thread_run(switch_thread_t *thread, void *ob
memset
(
&
chanmap
,
0
,
sizeof
(
chanmap
));
memset
(
&
chanmap
,
0
,
sizeof
(
chanmap
));
switch_event_t
*
s_event
;
switch_event_t
*
s_event
;
switch_mutex_init
(
&
chanmap
.
mutex
,
SWITCH_MUTEX_NESTED
,
module_pool
);
SANGOMA_MAP_PRI_EVENT
((
*
spri
),
SANGOMA_PRI_EVENT_ANY
,
on_anything
);
SANGOMA_MAP_PRI_EVENT
((
*
spri
),
SANGOMA_PRI_EVENT_ANY
,
on_anything
);
SANGOMA_MAP_PRI_EVENT
((
*
spri
),
SANGOMA_PRI_EVENT_RING
,
on_ring
);
SANGOMA_MAP_PRI_EVENT
((
*
spri
),
SANGOMA_PRI_EVENT_RING
,
on_ring
);
SANGOMA_MAP_PRI_EVENT
((
*
spri
),
SANGOMA_PRI_EVENT_RINGING
,
on_ringing
);
SANGOMA_MAP_PRI_EVENT
((
*
spri
),
SANGOMA_PRI_EVENT_RINGING
,
on_ringing
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论