Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
10277be8
提交
10277be8
authored
3月 16, 2012
作者:
James Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
freetdm: synchronizing fixes in releases.3.5 version
- glare - cgb/cgu range bug - inhibit/uninhibit
上级
19f01bf5
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
259 行增加
和
143 行删除
+259
-143
ftmod_sangoma_ss7_cli.c
...eetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_cli.c
+14
-3
ftmod_sangoma_ss7_handle.c
...dm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_handle.c
+144
-114
ftmod_sangoma_ss7_main.c
...etdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.c
+40
-12
ftmod_sangoma_ss7_main.h
...etdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.h
+22
-1
ftmod_sangoma_ss7_xml.c
...eetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_xml.c
+39
-13
没有找到文件。
libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_cli.c
浏览文件 @
10277be8
...
@@ -784,16 +784,24 @@ static ftdm_status_t handle_print_usage(ftdm_stream_handle_t *stream)
...
@@ -784,16 +784,24 @@ static ftdm_status_t handle_print_usage(ftdm_stream_handle_t *stream)
stream
->
write_function
(
stream
,
"ftdm ss7 set ftrace X Y
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 set ftrace X Y
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 set mtrace X Y
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 set mtrace X Y
\n
"
);
stream
->
write_function
(
stream
,
"
\n
"
);
stream
->
write_function
(
stream
,
"
\n
"
);
stream
->
write_function
(
stream
,
"ftmod_sangoma_ss7 information:
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 show status mtp3 X
\n
"
);
stream
->
write_function
(
stream
,
"ftmod_sangoma_ss7 signaling information:
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 show
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 show status mtp2 X
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 show status mtp2 X
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 show status mtp3 X
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 show status linkset X
\n
"
);
stream
->
write_function
(
stream
,
"
\n
"
);
stream
->
write_function
(
stream
,
"ftmod_sangoma_ss7 circuit information:
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 show span all
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 show span X
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 show status span X chan Y
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 show status span X chan Y
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 show free span X chan Y
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 show free span X chan Y
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 show blocks span X chan Y
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 show blocks span X chan Y
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 show inuse span X chan Y
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 show inuse span X chan Y
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 show inreset span X chan Y
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 show inreset span X chan Y
\n
"
);
stream
->
write_function
(
stream
,
"
\n
"
);
stream
->
write_function
(
stream
,
"
\n
"
);
stream
->
write_function
(
stream
,
"ftmod_sangoma_ss7 circuit control:
\n
"
);
stream
->
write_function
(
stream
,
"ftmod_sangoma_ss7 circuit control:
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 blo span X chan Y
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 blo span X chan Y
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 ubl span X chan Y
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 ubl span X chan Y
\n
"
);
...
@@ -802,9 +810,12 @@ static ftdm_status_t handle_print_usage(ftdm_stream_handle_t *stream)
...
@@ -802,9 +810,12 @@ static ftdm_status_t handle_print_usage(ftdm_stream_handle_t *stream)
stream
->
write_function
(
stream
,
"ftdm ss7 cgb span X chan Y range Z
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 cgb span X chan Y range Z
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 cgu span X chan Y range Z
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 cgu span X chan Y range Z
\n
"
);
stream
->
write_function
(
stream
,
"
\n
"
);
stream
->
write_function
(
stream
,
"
\n
"
);
stream
->
write_function
(
stream
,
"ftmod_sangoma_ss7 link control:
\n
"
);
stream
->
write_function
(
stream
,
"ftmod_sangoma_ss7 link control:
\n
"
);
/*
stream->write_function(stream, "ftdm ss7 inhibit link X\n");
stream->write_function(stream, "ftdm ss7 inhibit link X\n");
stream->write_function(stream, "ftdm ss7 uninhibit link X\n");
stream->write_function(stream, "ftdm ss7 uninhibit link X\n");
*/
stream
->
write_function
(
stream
,
"ftdm ss7 activate link X
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 activate link X
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 deactivate link X
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 deactivate link X
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 activate linkset X
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 activate linkset X
\n
"
);
...
...
libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_handle.c
浏览文件 @
10277be8
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
* Contributors:
* Contributors:
*
*
* Ricardo Barroetaveña <rbarroetavena@anura.com.ar>
* Ricardo Barroetaveña <rbarroetavena@anura.com.ar>
* James Zhang <jzhang@sangoma.com>
*
*
*/
*/
...
@@ -199,7 +200,6 @@ ftdm_status_t handle_con_ind(uint32_t suInstId, uint32_t spInstId, uint32_t circ
...
@@ -199,7 +200,6 @@ ftdm_status_t handle_con_ind(uint32_t suInstId, uint32_t spInstId, uint32_t circ
}
else
{
}
else
{
SS7_INFO_CHAN
(
ftdmchan
,
"No Called party (DNIS) information in IAM!%s
\n
"
,
" "
);
SS7_INFO_CHAN
(
ftdmchan
,
"No Called party (DNIS) information in IAM!%s
\n
"
,
" "
);
}
}
copy_ocn_from_sngss7
(
ftdmchan
,
&
siConEvnt
->
origCdNum
);
copy_ocn_from_sngss7
(
ftdmchan
,
&
siConEvnt
->
origCdNum
);
copy_redirgNum_from_sngss7
(
ftdmchan
,
&
siConEvnt
->
redirgNum
);
copy_redirgNum_from_sngss7
(
ftdmchan
,
&
siConEvnt
->
redirgNum
);
copy_redirgInfo_from_sngss7
(
ftdmchan
,
&
siConEvnt
->
redirInfo
);
copy_redirgInfo_from_sngss7
(
ftdmchan
,
&
siConEvnt
->
redirInfo
);
...
@@ -317,12 +317,12 @@ handle_glare:
...
@@ -317,12 +317,12 @@ handle_glare:
/* setup the hangup cause */
/* setup the hangup cause */
ftdmchan
->
caller_data
.
hangup_cause
=
34
;
/* Circuit Congrestion */
ftdmchan
->
caller_data
.
hangup_cause
=
34
;
/* Circuit Congrestion */
/*
this is a remote hangup request */
/*
move the state of the channel to Terminating to end the call
sngss7_set_ckt_flag
(
sngss7_info
,
FLAG_REMOTE_REL
);
in TERMINATING state, the release cause is set to REMOTE_REL
in any means. So we don't have to set the release reason here.
/* move the state of the channel to Terminating to end the call
*/
*/
ftdm_set_state
(
ftdmchan
,
FTDM_CHANNEL_STATE_TERMINATING
);
ftdm_set_state
(
ftdmchan
,
FTDM_CHANNEL_STATE_TERMINATING
);
}
/* if (!(sngss7_test_ckt_flag(sngss7_info, FLAG_GLARE))) */
}
break
;
break
;
/**************************************************************************/
/**************************************************************************/
default:
/* should not have gotten an IAM while in this state */
default:
/* should not have gotten an IAM while in this state */
...
@@ -1283,6 +1283,7 @@ ftdm_status_t handle_reattempt(uint32_t suInstId, uint32_t spInstId, uint32_t ci
...
@@ -1283,6 +1283,7 @@ ftdm_status_t handle_reattempt(uint32_t suInstId, uint32_t spInstId, uint32_t ci
/* the glare flag is already up so it was caught ... do nothing */
/* the glare flag is already up so it was caught ... do nothing */
SS7_DEBUG_CHAN
(
ftdmchan
,
"Glare flag is already up...nothing to do!%s
\n
"
,
" "
);
SS7_DEBUG_CHAN
(
ftdmchan
,
"Glare flag is already up...nothing to do!%s
\n
"
,
" "
);
}
else
{
}
else
{
int
bHangup
=
0
;
SS7_DEBUG_CHAN
(
ftdmchan
,
"Glare flag is not up yet...indicating glare from reattempt!%s
\n
"
,
" "
);
SS7_DEBUG_CHAN
(
ftdmchan
,
"Glare flag is not up yet...indicating glare from reattempt!%s
\n
"
,
" "
);
/* glare, throw the flag */
/* glare, throw the flag */
sngss7_set_ckt_flag
(
sngss7_info
,
FLAG_GLARE
);
sngss7_set_ckt_flag
(
sngss7_info
,
FLAG_GLARE
);
...
@@ -1290,15 +1291,46 @@ ftdm_status_t handle_reattempt(uint32_t suInstId, uint32_t spInstId, uint32_t ci
...
@@ -1290,15 +1291,46 @@ ftdm_status_t handle_reattempt(uint32_t suInstId, uint32_t spInstId, uint32_t ci
/* clear any existing glare data from the channel */
/* clear any existing glare data from the channel */
memset
(
&
sngss7_info
->
glare
,
0x0
,
sizeof
(
sngss7_glare_data_t
));
memset
(
&
sngss7_info
->
glare
,
0x0
,
sizeof
(
sngss7_glare_data_t
));
if
(
g_ftdm_sngss7_data
.
cfg
.
glareResolution
==
SNGSS7_GLARE_DOWN
)
{
/* If I'm in DOWN mode, I will always hangup my call. */
bHangup
=
1
;
}
else
if
(
g_ftdm_sngss7_data
.
cfg
.
glareResolution
==
SNGSS7_GLARE_PC
)
{
/* I'm in PointCode mode.
Case 1: My point code is higher than the other side.
If the CIC number is even, I'm trying to control.
If the CIC number is odd, I'll hangup my call and back off.
Case 2: My point code is lower than the other side.
If the CIC number is odd, I'm trying to control.
If the CIC number is even, I'll hangup my call and back off.
*/
if
(
g_ftdm_sngss7_data
.
cfg
.
isupIntf
[
sngss7_info
->
circuit
->
infId
].
spc
>
g_ftdm_sngss7_data
.
cfg
.
isupIntf
[
sngss7_info
->
circuit
->
infId
].
dpc
)
{
if
((
sngss7_info
->
circuit
->
cic
%
2
)
==
1
)
{
bHangup
=
1
;
}
}
else
{
if
(
(
sngss7_info
->
circuit
->
cic
%
2
)
==
0
)
{
bHangup
=
1
;
}
}
}
else
{
/* If I'm in CONTROL mode, I will not hangup my call. */
bHangup
=
0
;
}
if
(
bHangup
)
{
/* setup the hangup cause */
/* setup the hangup cause */
ftdmchan
->
caller_data
.
hangup_cause
=
34
;
/* Circuit Congrestion */
ftdmchan
->
caller_data
.
hangup_cause
=
34
;
/* Circuit Congrestion */
/* this is a remote hangup request */
/* move the state of the channel to Terminating to end the call
sngss7_set_ckt_flag
(
sngss7_info
,
FLAG_REMOTE_REL
);
in TERMINATING state, the release cause is set to REMOTE_REL
in any means. So we don't have to set the release reason here.
/* move the state of the channel to Terminating to end the call
*/
*/
ftdm_set_state
(
ftdmchan
,
FTDM_CHANNEL_STATE_TERMINATING
);
ftdm_set_state
(
ftdmchan
,
FTDM_CHANNEL_STATE_TERMINATING
);
}
}
}
/* unlock the channel again before we exit */
/* unlock the channel again before we exit */
ftdm_mutex_unlock
(
ftdmchan
->
mutex
);
ftdm_mutex_unlock
(
ftdmchan
->
mutex
);
...
@@ -2341,6 +2373,7 @@ ftdm_status_t handle_cgb_req(uint32_t suInstId, uint32_t spInstId, uint32_t circ
...
@@ -2341,6 +2373,7 @@ ftdm_status_t handle_cgb_req(uint32_t suInstId, uint32_t spInstId, uint32_t circ
int
byte
=
0
;
int
byte
=
0
;
int
bit
=
0
;
int
bit
=
0
;
int
x
;
int
x
;
int
loop_range
=
0
;
ftdm_running_return
(
FTDM_FAIL
);
ftdm_running_return
(
FTDM_FAIL
);
...
@@ -2407,27 +2440,17 @@ ftdm_status_t handle_cgb_req(uint32_t suInstId, uint32_t spInstId, uint32_t circ
...
@@ -2407,27 +2440,17 @@ ftdm_status_t handle_cgb_req(uint32_t suInstId, uint32_t spInstId, uint32_t circ
}
}
/* loop over the cics starting from circuit until range+1 */
/* loop over the cics starting from circuit until range+1 */
for
(
x
=
circuit
;
x
<
(
circuit
+
range
+
1
);
x
++
)
{
loop_range
=
circuit
+
range
+
1
;
/* confirm this is a voice channel */
x
=
circuit
;
if
(
g_ftdm_sngss7_data
.
cfg
.
isupCkt
[
x
].
type
!=
SNG_CKT_VOICE
)
continue
;
while
(
x
<
loop_range
)
{
if
(
g_ftdm_sngss7_data
.
cfg
.
isupCkt
[
x
].
type
!=
SNG_CKT_VOICE
)
{
/* grab the circuit in question */
loop_range
++
;
}
else
{
if
(
extract_chan_data
(
x
,
&
sngss7_info
,
&
ftdmchan
))
{
if
(
extract_chan_data
(
x
,
&
sngss7_info
,
&
ftdmchan
))
{
SS7_ERROR
(
"Failed to extract channel data for circuit = %d!
\n
"
,
x
);
SS7_ERROR
(
"Failed to extract channel data for circuit = %d!
\n
"
,
x
);
break
;
}
else
{
}
/* lock the channel */
ftdm_mutex_lock
(
ftdmchan
->
mutex
);
ftdm_mutex_lock
(
ftdmchan
->
mutex
);
#if 0
SS7_ERROR("KONRAD -> circuit=%d, byte=%d, bit=%d, status[byte]=%d, math=%d\n",
x,
byte,
bit,
status[byte],
(status[byte] & (1 << bit)));
#endif
if
(
status
[
byte
]
&
(
1
<<
bit
))
{
if
(
status
[
byte
]
&
(
1
<<
bit
))
{
switch
(
blockType
)
{
switch
(
blockType
)
{
/**********************************************************************/
/**********************************************************************/
...
@@ -2445,7 +2468,7 @@ ftdm_status_t handle_cgb_req(uint32_t suInstId, uint32_t spInstId, uint32_t circ
...
@@ -2445,7 +2468,7 @@ ftdm_status_t handle_cgb_req(uint32_t suInstId, uint32_t spInstId, uint32_t circ
default:
default:
break
;
break
;
/**********************************************************************/
/**********************************************************************/
}
/* switch (blockType) */
}
}
}
/* bring the sig status down */
/* bring the sig status down */
...
@@ -2460,8 +2483,11 @@ ftdm_status_t handle_cgb_req(uint32_t suInstId, uint32_t spInstId, uint32_t circ
...
@@ -2460,8 +2483,11 @@ ftdm_status_t handle_cgb_req(uint32_t suInstId, uint32_t spInstId, uint32_t circ
byte
++
;
byte
++
;
bit
=
0
;
bit
=
0
;
}
}
}
}
x
++
;
}
}
/* for (x = circuit; x < (circuit + range + 1); x++) */
/* get the ftdmchan and ss7_chan_data from the circuit */
/* get the ftdmchan and ss7_chan_data from the circuit */
if
(
extract_chan_data
(
circuit
,
&
sngss7_info
,
&
ftdmchan
))
{
if
(
extract_chan_data
(
circuit
,
&
sngss7_info
,
&
ftdmchan
))
{
...
@@ -2489,6 +2515,7 @@ ftdm_status_t handle_cgu_req(uint32_t suInstId, uint32_t spInstId, uint32_t circ
...
@@ -2489,6 +2515,7 @@ ftdm_status_t handle_cgu_req(uint32_t suInstId, uint32_t spInstId, uint32_t circ
int
byte
=
0
;
int
byte
=
0
;
int
bit
=
0
;
int
bit
=
0
;
int
x
;
int
x
;
int
loop_range
=
0
;
ftdm_sigmsg_t
sigev
;
ftdm_sigmsg_t
sigev
;
ftdm_running_return
(
FTDM_FAIL
);
ftdm_running_return
(
FTDM_FAIL
);
...
@@ -2558,15 +2585,17 @@ ftdm_status_t handle_cgu_req(uint32_t suInstId, uint32_t spInstId, uint32_t circ
...
@@ -2558,15 +2585,17 @@ ftdm_status_t handle_cgu_req(uint32_t suInstId, uint32_t spInstId, uint32_t circ
}
}
/* loop over the cics starting from circuit until range+1 */
/* loop over the cics starting from circuit until range+1 */
for
(
x
=
circuit
;
x
<
(
circuit
+
range
+
1
);
x
++
)
{
loop_range
=
circuit
+
range
+
1
;
if
(
g_ftdm_sngss7_data
.
cfg
.
isupCkt
[
x
].
type
!=
SNG_CKT_VOICE
)
continue
;
x
=
circuit
;
/* grab the circuit in question */
while
(
x
<
loop_range
)
{
if
(
g_ftdm_sngss7_data
.
cfg
.
isupCkt
[
x
].
type
!=
SNG_CKT_VOICE
)
{
loop_range
++
;
}
else
{
if
(
extract_chan_data
(
x
,
&
sngss7_info
,
&
ftdmchan
))
{
if
(
extract_chan_data
(
x
,
&
sngss7_info
,
&
ftdmchan
))
{
SS7_ERROR
(
"Failed to extract channel data for circuit = %d!
\n
"
,
x
);
SS7_ERROR
(
"Failed to extract channel data for circuit = %d!
\n
"
,
x
);
break
;
}
}
else
{
/* lock the channel */
ftdm_mutex_lock
(
ftdmchan
->
mutex
);
ftdm_mutex_lock
(
ftdmchan
->
mutex
);
if
(
status
[
byte
]
&
(
1
<<
bit
))
{
if
(
status
[
byte
]
&
(
1
<<
bit
))
{
...
@@ -2600,7 +2629,6 @@ ftdm_status_t handle_cgu_req(uint32_t suInstId, uint32_t spInstId, uint32_t circ
...
@@ -2600,7 +2629,6 @@ ftdm_status_t handle_cgu_req(uint32_t suInstId, uint32_t spInstId, uint32_t circ
sngss7_set_sig_status
(
sngss7_info
,
FTDM_SIG_STATE_UP
);
sngss7_set_sig_status
(
sngss7_info
,
FTDM_SIG_STATE_UP
);
}
}
/* unlock the channel again before we exit */
ftdm_mutex_unlock
(
ftdmchan
->
mutex
);
ftdm_mutex_unlock
(
ftdmchan
->
mutex
);
/* update the bit and byte counter*/
/* update the bit and byte counter*/
...
@@ -2609,8 +2637,10 @@ ftdm_status_t handle_cgu_req(uint32_t suInstId, uint32_t spInstId, uint32_t circ
...
@@ -2609,8 +2637,10 @@ ftdm_status_t handle_cgu_req(uint32_t suInstId, uint32_t spInstId, uint32_t circ
byte
++
;
byte
++
;
bit
=
0
;
bit
=
0
;
}
}
}
}
/* for (x = circuit; x < (circuit + range + 1); x++) */
}
x
++
;
}
/* get the ftdmchan and ss7_chan_data from the circuit */
/* get the ftdmchan and ss7_chan_data from the circuit */
if
(
extract_chan_data
(
circuit
,
&
sngss7_info
,
&
ftdmchan
))
{
if
(
extract_chan_data
(
circuit
,
&
sngss7_info
,
&
ftdmchan
))
{
...
...
libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.c
浏览文件 @
10277be8
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
*
*
* Moises Silva <moy@sangoma.com>
* Moises Silva <moy@sangoma.com>
* David Yat Sin <dyatsin@sangoma.com>
* David Yat Sin <dyatsin@sangoma.com>
* James Zhang <jzhang@sangoma.com>
*
*
*/
*/
...
@@ -1474,14 +1475,14 @@ ftdm_status_t ftdm_sangoma_ss7_process_state_change (ftdm_channel_t *ftdmchan)
...
@@ -1474,14 +1475,14 @@ ftdm_status_t ftdm_sangoma_ss7_process_state_change (ftdm_channel_t *ftdmchan)
SS7_DEBUG_CHAN
(
ftdmchan
,
"All reset flags cleared %s
\n
"
,
""
);
SS7_DEBUG_CHAN
(
ftdmchan
,
"All reset flags cleared %s
\n
"
,
""
);
/* all flags are down so we can bring up the sig status */
/* all flags are down so we can bring up the sig status */
sngss7_set_sig_status
(
sngss7_info
,
FTDM_SIG_STATE_UP
);
sngss7_set_sig_status
(
sngss7_info
,
FTDM_SIG_STATE_UP
);
}
/* if (!ftdm_test_flag (ftdmchan, FTDM_CHANNEL_SIG_UP)) */
}
}
else
{
}
else
{
state_flag
=
0
;
state_flag
=
0
;
SS7_DEBUG_CHAN
(
ftdmchan
,
"Down detected blocked flags go to SUSPEND %s
\n
"
,
" "
);
SS7_DEBUG_CHAN
(
ftdmchan
,
"Down detected blocked flags go to SUSPEND %s
\n
"
,
" "
);
ftdm_set_state
(
ftdmchan
,
FTDM_CHANNEL_STATE_SUSPENDED
);
ftdm_set_state
(
ftdmchan
,
FTDM_CHANNEL_STATE_SUSPENDED
);
break
;
break
;
}
/* if !blocked */
}
}
else
{
}
else
{
SS7_DEBUG_CHAN
(
ftdmchan
,
"Reset flags present (0x%X)
\n
"
,
sngss7_info
->
ckt_flags
);
SS7_DEBUG_CHAN
(
ftdmchan
,
"Reset flags present (0x%X)
\n
"
,
sngss7_info
->
ckt_flags
);
...
@@ -1489,7 +1490,7 @@ ftdm_status_t ftdm_sangoma_ss7_process_state_change (ftdm_channel_t *ftdmchan)
...
@@ -1489,7 +1490,7 @@ ftdm_status_t ftdm_sangoma_ss7_process_state_change (ftdm_channel_t *ftdmchan)
state_flag
=
0
;
state_flag
=
0
;
ftdm_set_state
(
ftdmchan
,
FTDM_CHANNEL_STATE_RESTART
);
ftdm_set_state
(
ftdmchan
,
FTDM_CHANNEL_STATE_RESTART
);
}
}
}
/* if ((ftdmchan->last_state == FTDM_CHANNEL_STATE_RESTART) */
}
/* check if t35 is active */
/* check if t35 is active */
if
(
sngss7_info
->
t35
.
hb_timer_id
)
{
if
(
sngss7_info
->
t35
.
hb_timer_id
)
{
...
@@ -1532,20 +1533,47 @@ ftdm_status_t ftdm_sangoma_ss7_process_state_change (ftdm_channel_t *ftdmchan)
...
@@ -1532,20 +1533,47 @@ ftdm_status_t ftdm_sangoma_ss7_process_state_change (ftdm_channel_t *ftdmchan)
/* check if there is a glared call that needs to be processed */
/* check if there is a glared call that needs to be processed */
if
(
sngss7_test_ckt_flag
(
sngss7_info
,
FLAG_GLARE
))
{
if
(
sngss7_test_ckt_flag
(
sngss7_info
,
FLAG_GLARE
))
{
/* clear the glare flag */
sngss7_clear_ckt_flag
(
sngss7_info
,
FLAG_GLARE
);
sngss7_clear_ckt_flag
(
sngss7_info
,
FLAG_GLARE
);
/* check if we have an IAM stored...if we don't have one just exit */
if
(
sngss7_info
->
glare
.
circuit
!=
0
)
{
if
(
sngss7_info
->
glare
.
circuit
!=
0
)
{
/* send the saved call back in to us */
int
bHandle
=
0
;
handle_con_ind
(
0
,
switch
(
g_ftdm_sngss7_data
.
cfg
.
glareResolution
)
{
sngss7_info
->
glare
.
spInstId
,
case
SNGSS7_GLARE_DOWN
:
sngss7_info
->
glare
.
circuit
,
SS7_INFO_CHAN
(
ftdmchan
,
"[CIC:%d]Giving control to the other side, handling copied IAM from glare.
\n
"
,
sngss7_info
->
circuit
->
cic
);
&
sngss7_info
->
glare
.
iam
);
bHandle
=
1
;
break
;
case
SNGSS7_GLARE_PC
:
SS7_INFO_CHAN
(
ftdmchan
,
"[CIC:%d]Trying to handle IAM copied from glare.
\n
"
,
sngss7_info
->
circuit
->
cic
);
SS7_INFO_CHAN
(
ftdmchan
,
"[CIC:%d]My PC = %d, incoming PC = %d.
\n
"
,
sngss7_info
->
circuit
->
cic
,
g_ftdm_sngss7_data
.
cfg
.
isupIntf
[
sngss7_info
->
circuit
->
infId
].
spc
,
g_ftdm_sngss7_data
.
cfg
.
isupIntf
[
sngss7_info
->
circuit
->
infId
].
dpc
);
if
(
g_ftdm_sngss7_data
.
cfg
.
isupIntf
[
sngss7_info
->
circuit
->
infId
].
spc
>
g_ftdm_sngss7_data
.
cfg
.
isupIntf
[
sngss7_info
->
circuit
->
infId
].
dpc
)
{
if
((
sngss7_info
->
circuit
->
cic
%
2
)
==
1
)
{
bHandle
=
1
;
}
}
else
{
if
(
(
sngss7_info
->
circuit
->
cic
%
2
)
==
0
)
{
bHandle
=
1
;
}
}
break
;
default:
/* if configured as SNGSS7_GLARE_CONTROL, always abandon incoming glared IAM. */
bHandle
=
0
;
break
;
}
if
(
!
bHandle
)
{
SS7_INFO_CHAN
(
ftdmchan
,
"[CIC:%d]Handling glare IAM.
\n
"
,
sngss7_info
->
circuit
->
cic
);
handle_con_ind
(
0
,
sngss7_info
->
glare
.
spInstId
,
sngss7_info
->
glare
.
circuit
,
&
sngss7_info
->
glare
.
iam
);
}
/* clear the glare info */
/* clear the glare info */
memset
(
&
sngss7_info
->
glare
,
0x0
,
sizeof
(
sngss7_glare_data_t
));
memset
(
&
sngss7_info
->
glare
,
0x0
,
sizeof
(
sngss7_glare_data_t
));
state_flag
=
0
;
}
}
}
}
...
...
libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.h
浏览文件 @
10277be8
...
@@ -29,6 +29,12 @@
...
@@ -29,6 +29,12 @@
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
* Contributors:
*
* James Zhang <jzhang@sangoma.com>
*
*/
*/
/******************************************************************************/
/******************************************************************************/
#ifndef __FTMOD_SNG_SS7_H__
#ifndef __FTMOD_SNG_SS7_H__
...
@@ -195,6 +201,21 @@ typedef struct sng_mtp2_link {
...
@@ -195,6 +201,21 @@ typedef struct sng_mtp2_link {
uint32_t
t7
;
uint32_t
t7
;
}
sng_mtp2_link_t
;
}
sng_mtp2_link_t
;
/* defining glare handling methods:
SNGSS7_GLARE_PC:
higher PointCode controls even number CIC
lower PointCode controls odd number CIC
SNGSS7_GLARE_DOWN:
always give control to the other side
SNGSS7_GLARE_CONTROL:
always trying to control
*/
typedef
enum
{
SNGSS7_GLARE_PC
=
0
,
SNGSS7_GLARE_DOWN
,
SNGSS7_GLARE_CONTROL
}
sng_glare_resolution
;
typedef
struct
sng_mtp3_link
{
typedef
struct
sng_mtp3_link
{
char
name
[
MAX_NAME_LEN
];
char
name
[
MAX_NAME_LEN
];
uint32_t
flags
;
uint32_t
flags
;
...
@@ -444,6 +465,7 @@ typedef struct sng_ss7_cfg {
...
@@ -444,6 +465,7 @@ typedef struct sng_ss7_cfg {
sng_isup_ckt_t
isupCkt
[
10000
];
/* KONRAD - only need 2000 ( and 0-1000 aren't used) since other servers are registerd else where */
sng_isup_ckt_t
isupCkt
[
10000
];
/* KONRAD - only need 2000 ( and 0-1000 aren't used) since other servers are registerd else where */
sng_nsap_t
nsap
[
MAX_NSAPS
+
1
];
sng_nsap_t
nsap
[
MAX_NSAPS
+
1
];
sng_isap_t
isap
[
MAX_ISAPS
+
1
];
sng_isap_t
isap
[
MAX_ISAPS
+
1
];
sng_glare_resolution
glareResolution
;
}
sng_ss7_cfg_t
;
}
sng_ss7_cfg_t
;
typedef
struct
ftdm_sngss7_data
{
typedef
struct
ftdm_sngss7_data
{
...
@@ -871,7 +893,6 @@ ftdm_status_t copy_redirgInfo_to_sngss7(ftdm_channel_t *ftdmchan, SiRedirInfo *r
...
@@ -871,7 +893,6 @@ ftdm_status_t copy_redirgInfo_to_sngss7(ftdm_channel_t *ftdmchan, SiRedirInfo *r
ftdm_status_t
copy_ocn_to_sngss7
(
ftdm_channel_t
*
ftdmchan
,
SiOrigCdNum
*
origCdNum
);
ftdm_status_t
copy_ocn_to_sngss7
(
ftdm_channel_t
*
ftdmchan
,
SiOrigCdNum
*
origCdNum
);
ftdm_status_t
copy_ocn_from_sngss7
(
ftdm_channel_t
*
ftdmchan
,
SiOrigCdNum
*
origCdNum
);
ftdm_status_t
copy_ocn_from_sngss7
(
ftdm_channel_t
*
ftdmchan
,
SiOrigCdNum
*
origCdNum
);
ftdm_status_t
copy_locPtyNum_to_sngss7
(
ftdm_channel_t
*
ftdmchan
,
SiCgPtyNum
*
locPtyNum
);
ftdm_status_t
copy_locPtyNum_to_sngss7
(
ftdm_channel_t
*
ftdmchan
,
SiCgPtyNum
*
locPtyNum
);
ftdm_status_t
copy_locPtyNum_from_sngss7
(
ftdm_channel_t
*
ftdmchan
,
SiCgPtyNum
*
locPtyNum
);
ftdm_status_t
copy_locPtyNum_from_sngss7
(
ftdm_channel_t
*
ftdmchan
,
SiCgPtyNum
*
locPtyNum
);
ftdm_status_t
copy_genNmb_to_sngss7
(
ftdm_channel_t
*
ftdmchan
,
SiGenNum
*
genNmb
);
ftdm_status_t
copy_genNmb_to_sngss7
(
ftdm_channel_t
*
ftdmchan
,
SiGenNum
*
genNmb
);
...
...
libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_xml.c
浏览文件 @
10277be8
...
@@ -29,6 +29,12 @@
...
@@ -29,6 +29,12 @@
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
* Contributors:
*
* James Zhang <jzhang@sangoma.com>
*
*/
*/
/* INCLUDE ********************************************************************/
/* INCLUDE ********************************************************************/
...
@@ -191,6 +197,7 @@ static int ftmod_ss7_fill_in_self_route(int spc, int linkType, int switchType, i
...
@@ -191,6 +197,7 @@ static int ftmod_ss7_fill_in_self_route(int spc, int linkType, int switchType, i
static
int
ftmod_ss7_fill_in_circuits
(
sng_span_t
*
sngSpan
);
static
int
ftmod_ss7_fill_in_circuits
(
sng_span_t
*
sngSpan
);
static
int
ftmod_ss7_next_timeslot
(
char
*
ch_map
,
sng_timeslot_t
*
timeslot
);
static
int
ftmod_ss7_next_timeslot
(
char
*
ch_map
,
sng_timeslot_t
*
timeslot
);
static
void
ftmod_ss7_set_glare_resolution
(
const
char
*
method
);
/******************************************************************************/
/******************************************************************************/
...
@@ -239,11 +246,11 @@ int ftmod_ss7_parse_xml(ftdm_conf_parameter_t *ftdm_parameters, ftdm_span_t *spa
...
@@ -239,11 +246,11 @@ int ftmod_ss7_parse_xml(ftdm_conf_parameter_t *ftdm_parameters, ftdm_span_t *spa
if
(
!
strcasecmp
(
var
,
"dialplan"
))
{
if
(
!
strcasecmp
(
var
,
"dialplan"
))
{
/**********************************************************************/
/**********************************************************************/
/* do
i give a shit about this???
*/
/* do
n't care for now
*/
/**********************************************************************/
/**********************************************************************/
}
else
if
(
!
strcasecmp
(
var
,
"context"
))
{
}
else
if
(
!
strcasecmp
(
var
,
"context"
))
{
/**********************************************************************/
/**********************************************************************/
/* do
i give a shit about this???
*/
/* do
n't care for now
*/
/**********************************************************************/
/**********************************************************************/
}
else
if
(
!
strcasecmp
(
var
,
"ccSpanId"
))
{
}
else
if
(
!
strcasecmp
(
var
,
"ccSpanId"
))
{
/**********************************************************************/
/**********************************************************************/
...
@@ -451,6 +458,26 @@ static int ftmod_ss7_parse_sng_isup(ftdm_conf_node_t *sng_isup)
...
@@ -451,6 +458,26 @@ static int ftmod_ss7_parse_sng_isup(ftdm_conf_node_t *sng_isup)
return
FTDM_SUCCESS
;
return
FTDM_SUCCESS
;
}
}
static
void
ftmod_ss7_set_glare_resolution
(
const
char
*
method
)
{
sng_glare_resolution
iMethod
=
SNGSS7_GLARE_PC
;
if
(
!
method
||
(
strlen
(
method
)
<=
0
)
)
{
SS7_ERROR
(
"Wrong glare resolution parameter, using default.
\n
"
);
}
else
{
if
(
!
strcasecmp
(
method
,
"PointCode"
))
{
iMethod
=
SNGSS7_GLARE_PC
;
}
else
if
(
!
strcasecmp
(
method
,
"Down"
))
{
iMethod
=
SNGSS7_GLARE_DOWN
;
}
else
if
(
!
strcasecmp
(
method
,
"Control"
))
{
iMethod
=
SNGSS7_GLARE_CONTROL
;
}
else
{
SS7_ERROR
(
"Wrong glare resolution parameter, using default.
\n
"
);
iMethod
=
SNGSS7_GLARE_DOWN
;
}
}
g_ftdm_sngss7_data
.
cfg
.
glareResolution
=
iMethod
;
}
/******************************************************************************/
/******************************************************************************/
static
int
ftmod_ss7_parse_sng_gen
(
ftdm_conf_node_t
*
sng_gen
)
static
int
ftmod_ss7_parse_sng_gen
(
ftdm_conf_node_t
*
sng_gen
)
{
{
...
@@ -463,28 +490,27 @@ static int ftmod_ss7_parse_sng_gen(ftdm_conf_node_t *sng_gen)
...
@@ -463,28 +490,27 @@ static int ftmod_ss7_parse_sng_gen(ftdm_conf_node_t *sng_gen)
/* extract all the information from the parameters */
/* extract all the information from the parameters */
for
(
i
=
0
;
i
<
num_parms
;
i
++
)
{
for
(
i
=
0
;
i
<
num_parms
;
i
++
)
{
/**************************************************************************/
if
(
!
strcasecmp
(
parm
->
var
,
"procId"
))
{
if
(
!
strcasecmp
(
parm
->
var
,
"procId"
))
{
/**********************************************************************/
g_ftdm_sngss7_data
.
cfg
.
procId
=
atoi
(
parm
->
val
);
g_ftdm_sngss7_data
.
cfg
.
procId
=
atoi
(
parm
->
val
);
SS7_DEBUG
(
"Found a procId = %d
\n
"
,
g_ftdm_sngss7_data
.
cfg
.
procId
);
SS7_DEBUG
(
"Found a procId = %d
\n
"
,
g_ftdm_sngss7_data
.
cfg
.
procId
);
/**********************************************************************/
}
}
else
if
(
!
strcasecmp
(
parm
->
var
,
"license"
))
{
else
if
(
!
strcasecmp
(
parm
->
var
,
"license"
))
{
/**********************************************************************/
ftdm_set_string
(
g_ftdm_sngss7_data
.
cfg
.
license
,
parm
->
val
);
ftdm_set_string
(
g_ftdm_sngss7_data
.
cfg
.
license
,
parm
->
val
);
snprintf
(
g_ftdm_sngss7_data
.
cfg
.
signature
,
sizeof
(
g_ftdm_sngss7_data
.
cfg
.
signature
),
"%s.sig"
,
parm
->
val
);
snprintf
(
g_ftdm_sngss7_data
.
cfg
.
signature
,
sizeof
(
g_ftdm_sngss7_data
.
cfg
.
signature
),
"%s.sig"
,
parm
->
val
);
SS7_DEBUG
(
"Found license file = %s
\n
"
,
g_ftdm_sngss7_data
.
cfg
.
license
);
SS7_DEBUG
(
"Found license file = %s
\n
"
,
g_ftdm_sngss7_data
.
cfg
.
license
);
SS7_DEBUG
(
"Found signature file = %s
\n
"
,
g_ftdm_sngss7_data
.
cfg
.
signature
);
SS7_DEBUG
(
"Found signature file = %s
\n
"
,
g_ftdm_sngss7_data
.
cfg
.
signature
);
/**********************************************************************/
}
}
else
if
(
!
strcasecmp
(
parm
->
var
,
"transparent_iam_max_size"
))
{
else
if
(
!
strcasecmp
(
parm
->
var
,
"transparent_iam_max_size"
))
{
g_ftdm_sngss7_data
.
cfg
.
transparent_iam_max_size
=
atoi
(
parm
->
val
);
g_ftdm_sngss7_data
.
cfg
.
transparent_iam_max_size
=
atoi
(
parm
->
val
);
SS7_DEBUG
(
"Found a transparent_iam max size = %d
\n
"
,
g_ftdm_sngss7_data
.
cfg
.
transparent_iam_max_size
);
SS7_DEBUG
(
"Found a transparent_iam max size = %d
\n
"
,
g_ftdm_sngss7_data
.
cfg
.
transparent_iam_max_size
);
}
else
{
}
/**********************************************************************/
else
if
(
!
strcasecmp
(
parm
->
var
,
"glare-reso"
))
{
ftmod_ss7_set_glare_resolution
(
parm
->
val
);
SS7_DEBUG
(
"Found glare resolution configuration = %d %s
\n
"
,
g_ftdm_sngss7_data
.
cfg
.
glareResolution
,
parm
->
val
);
}
else
{
SS7_ERROR
(
"Found an invalid parameter
\"
%s
\"
!
\n
"
,
parm
->
val
);
SS7_ERROR
(
"Found an invalid parameter
\"
%s
\"
!
\n
"
,
parm
->
val
);
return
FTDM_FAIL
;
return
FTDM_FAIL
;
/**********************************************************************/
}
}
/* move to the next parmeter */
/* move to the next parmeter */
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论