Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
5219ab8c
提交
5219ab8c
authored
9月 14, 2010
作者:
Konrad Hammel
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
freetdm: ss7 - fixed bug in cic status, added activate/deactivate functions for mtp2/3
上级
a1eb601b
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
724 行增加
和
139 行删除
+724
-139
ftmod_sangoma_ss7_cli.c
...eetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_cli.c
+370
-65
ftmod_sangoma_ss7_cntrl.c
...tdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_cntrl.c
+253
-0
ftmod_sangoma_ss7_handle.c
...dm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_handle.c
+0
-22
ftmod_sangoma_ss7_main.c
...etdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.c
+3
-25
ftmod_sangoma_ss7_main.h
...etdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.h
+9
-0
ftmod_sangoma_ss7_out.c
...eetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_out.c
+23
-23
ftmod_sangoma_ss7_sta.c
...eetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_sta.c
+1
-1
ftmod_sangoma_ss7_support.c
...m/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_support.c
+59
-0
ftmod_sangoma_ss7_xml.c
...eetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_xml.c
+6
-3
没有找到文件。
libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_cli.c
浏览文件 @
5219ab8c
...
...
@@ -67,6 +67,14 @@ static ftdm_status_t handle_tx_ubl(ftdm_stream_handle_t *stream, int span, int c
static
ftdm_status_t
handle_tx_cgb
(
ftdm_stream_handle_t
*
stream
,
int
span
,
int
chan
,
int
range
,
int
verbose
);
static
ftdm_status_t
handle_tx_cgu
(
ftdm_stream_handle_t
*
stream
,
int
span
,
int
chan
,
int
range
,
int
verbose
);
static
ftdm_status_t
handle_activate_link
(
ftdm_stream_handle_t
*
stream
,
char
*
name
);
static
ftdm_status_t
handle_deactivate_link
(
ftdm_stream_handle_t
*
stream
,
char
*
name
);
static
ftdm_status_t
handle_activate_linkset
(
ftdm_stream_handle_t
*
stream
,
char
*
name
);
static
ftdm_status_t
handle_deactivate_linkset
(
ftdm_stream_handle_t
*
stream
,
char
*
name
);
static
ftdm_status_t
handle_tx_lpo
(
ftdm_stream_handle_t
*
stream
,
char
*
name
);
static
ftdm_status_t
handle_tx_lpr
(
ftdm_stream_handle_t
*
stream
,
char
*
name
);
static
ftdm_status_t
handle_status_link
(
ftdm_stream_handle_t
*
stream
,
char
*
name
);
static
ftdm_status_t
handle_status_linkset
(
ftdm_stream_handle_t
*
stream
,
char
*
name
);
...
...
@@ -490,6 +498,96 @@ ftdm_status_t ftdm_sngss7_handle_cli_cmd(ftdm_stream_handle_t *stream, const cha
/**********************************************************************/
}
/**************************************************************************/
}
else
if
(
!
strcasecmp
(
argv
[
c
],
"lpo"
))
{
/**************************************************************************/
if
(
check_arg_count
(
argc
,
2
))
goto
handle_cli_error_argc
;
c
++
;
if
(
!
strcasecmp
(
argv
[
c
],
"link"
))
{
/**********************************************************************/
if
(
check_arg_count
(
argc
,
3
))
goto
handle_cli_error_argc
;
c
++
;
handle_tx_lpo
(
stream
,
argv
[
c
]);
/**********************************************************************/
}
else
{
/**********************************************************************/
stream
->
write_function
(
stream
,
"Unknown
\"
lpo
\"
command
\n
"
);
goto
handle_cli_error
;
/**********************************************************************/
}
/**************************************************************************/
}
else
if
(
!
strcasecmp
(
argv
[
c
],
"lpr"
))
{
/**************************************************************************/
if
(
check_arg_count
(
argc
,
2
))
goto
handle_cli_error_argc
;
c
++
;
if
(
!
strcasecmp
(
argv
[
c
],
"link"
))
{
/**********************************************************************/
if
(
check_arg_count
(
argc
,
3
))
goto
handle_cli_error_argc
;
c
++
;
handle_tx_lpr
(
stream
,
argv
[
c
]);
/**********************************************************************/
}
else
{
/**********************************************************************/
stream
->
write_function
(
stream
,
"Unknown
\"
lpr
\"
command
\n
"
);
goto
handle_cli_error
;
/**********************************************************************/
}
/**************************************************************************/
}
else
if
(
!
strcasecmp
(
argv
[
c
],
"activate"
))
{
/**************************************************************************/
if
(
check_arg_count
(
argc
,
2
))
goto
handle_cli_error_argc
;
c
++
;
if
(
!
strcasecmp
(
argv
[
c
],
"link"
))
{
/**********************************************************************/
if
(
check_arg_count
(
argc
,
3
))
goto
handle_cli_error_argc
;
c
++
;
handle_activate_link
(
stream
,
argv
[
c
]);
/**********************************************************************/
}
else
if
(
!
strcasecmp
(
argv
[
c
],
"linkset"
))
{
/**********************************************************************/
if
(
check_arg_count
(
argc
,
3
))
goto
handle_cli_error_argc
;
c
++
;
handle_activate_linkset
(
stream
,
argv
[
c
]);
/**********************************************************************/
}
else
{
/**********************************************************************/
stream
->
write_function
(
stream
,
"Unknown
\"
activate
\"
command
\n
"
);
goto
handle_cli_error
;
/**********************************************************************/
}
/**************************************************************************/
}
else
if
(
!
strcasecmp
(
argv
[
c
],
"deactivate"
))
{
/**************************************************************************/
if
(
check_arg_count
(
argc
,
2
))
goto
handle_cli_error_argc
;
c
++
;
if
(
!
strcasecmp
(
argv
[
c
],
"link"
))
{
/**********************************************************************/
if
(
check_arg_count
(
argc
,
3
))
goto
handle_cli_error_argc
;
c
++
;
handle_deactivate_link
(
stream
,
argv
[
c
]);
/**********************************************************************/
}
else
if
(
!
strcasecmp
(
argv
[
c
],
"linkset"
))
{
/**********************************************************************/
if
(
check_arg_count
(
argc
,
3
))
goto
handle_cli_error_argc
;
c
++
;
handle_deactivate_linkset
(
stream
,
argv
[
c
]);
/**********************************************************************/
}
else
{
/**********************************************************************/
stream
->
write_function
(
stream
,
"Unknown
\"
deactivate
\"
command
\n
"
);
goto
handle_cli_error
;
/**********************************************************************/
}
/**************************************************************************/
}
else
{
/**************************************************************************/
goto
handle_cli_error
;
...
...
@@ -536,11 +634,18 @@ static ftdm_status_t handle_print_usuage(ftdm_stream_handle_t *stream)
stream
->
write_function
(
stream
,
"ftdm ss7 ubl span X chan Y
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 rsc span X chan Y
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 grs 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
,
"
\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 uninhibit 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 activate linkset X
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 deactivate linkset X
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 lpo link X
\n
"
);
stream
->
write_function
(
stream
,
"ftdm ss7 lpr link X
\n
"
);
stream
->
write_function
(
stream
,
"
\n
"
);
return
FTDM_SUCCESS
;
...
...
@@ -921,35 +1026,50 @@ static ftdm_status_t handle_show_status(ftdm_stream_handle_t *stream, int span,
int
lspan
;
int
lchan
;
ftdm_signaling_status_t
sigstatus
=
FTDM_SIG_STATE_DOWN
;
sng_isup_ckt_t
*
ckt
;
x
=
1
;
while
(
g_ftdm_sngss7_data
.
cfg
.
isupCkt
[
x
].
id
!=
0
)
{
if
(
g_ftdm_sngss7_data
.
cfg
.
isupCkt
[
x
].
type
==
VOICE
)
{
ss7_info
=
(
sngss7_chan_data_t
*
)
g_ftdm_sngss7_data
.
cfg
.
isupCkt
[
x
].
obj
;
ftdmchan
=
ss7_info
->
ftdmchan
;
/* extract the circuit to make it easier to work with */
ckt
=
&
g_ftdm_sngss7_data
.
cfg
.
isupCkt
[
x
];
/* if span == 0 then all spans should be printed */
if
(
span
==
0
)
{
lspan
=
ftdmchan
->
physical_span_id
;
lspan
=
ckt
->
span
;
}
else
{
lspan
=
span
;
}
/* if chan == 0 then all chans should be printed */
if
(
chan
==
0
)
{
lchan
=
ftdmchan
->
physical_chan_id
;
lchan
=
ckt
->
chan
;
}
else
{
lchan
=
chan
;
}
if
((
ftdmchan
->
physical_span_id
==
lspan
)
&&
(
ftdmchan
->
physical_chan_id
==
lchan
))
{
/* check if this circuit is one of the circuits we're interested in */
if
((
ckt
->
span
==
lspan
)
&&
(
ckt
->
chan
==
lchan
))
{
if
(
ckt
->
type
==
HOLE
)
{
stream
->
write_function
(
stream
,
"span=%2d|chan=%2d|cic=%4d|NOT USED
\n
"
,
ckt
->
span
,
ckt
->
chan
,
ckt
->
cic
);
}
else
if
(
ckt
->
type
==
SIG
)
{
stream
->
write_function
(
stream
,
"span=%2d|chan=%2d|cic=%4d|SIGNALING LINK
\n
"
,
ckt
->
span
,
ckt
->
chan
,
ckt
->
cic
);
}
else
{
ss7_info
=
(
sngss7_chan_data_t
*
)
g_ftdm_sngss7_data
.
cfg
.
isupCkt
[
x
].
obj
;
ftdmchan
=
ss7_info
->
ftdmchan
;
/* grab the signaling_status */
ftdm_channel_get_sig_status
(
ftdmchan
,
&
sigstatus
);
stream
->
write_function
(
stream
,
"span=%2d|chan=%2d|cic=%4d|sig_status=%s|state=%s|"
,
ftdmchan
->
physical_span_id
,
ftdmchan
->
physical_chan_id
,
ss7_info
->
circui
t
->
cic
,
ckt
->
span
,
ckt
->
chan
,
ck
t
->
cic
,
ftdm_signaling_status2str
(
sigstatus
),
ftdm_channel_state2str
(
ftdmchan
->
state
));
...
...
@@ -992,10 +1112,8 @@ static ftdm_status_t handle_show_status(ftdm_stream_handle_t *stream, int span,
stream
->
write_function
(
stream
,
"flags=0x%X"
,
ss7_info
->
flags
);
stream
->
write_function
(
stream
,
"
\n
"
);
}
/* if ( hole, sig, voice) */
}
/* if ( span and chan) */
}
/* if ( cic != 0) */
/* go the next circuit */
x
++
;
}
/* while (g_ftdm_sngss7_data.cfg.isupCkt[x]id != 0) */
...
...
@@ -1516,6 +1634,193 @@ static ftdm_status_t handle_tx_cgu(ftdm_stream_handle_t *stream, int span, int c
return
FTDM_SUCCESS
;
}
/******************************************************************************/
static
ftdm_status_t
handle_activate_link
(
ftdm_stream_handle_t
*
stream
,
char
*
name
)
{
int
x
=
0
;
/* find the link request by it's name */
x
=
1
;
while
(
g_ftdm_sngss7_data
.
cfg
.
mtpLink
[
x
].
id
!=
0
)
{
if
(
!
strcasecmp
(
g_ftdm_sngss7_data
.
cfg
.
mtpLink
[
x
].
name
,
name
))
{
/* send the uninhibit request */
if
(
ftmod_ss7_activate_mtplink
(
x
))
{
stream
->
write_function
(
stream
,
"Failed to activate link=%s
\n
"
,
name
);
return
FTDM_FAIL
;
}
/* print the new status of the link */
handle_status_link
(
stream
,
&
name
[
0
]);
goto
success
;
}
/* move to the next link */
x
++
;
}
/* while (id != 0) */
stream
->
write_function
(
stream
,
"Could not find link=%s
\n
"
,
name
);
success:
return
FTDM_SUCCESS
;
}
/******************************************************************************/
static
ftdm_status_t
handle_deactivate_link
(
ftdm_stream_handle_t
*
stream
,
char
*
name
)
{
int
x
=
0
;
/* find the link request by it's name */
x
=
1
;
while
(
g_ftdm_sngss7_data
.
cfg
.
mtpLink
[
x
].
id
!=
0
)
{
if
(
!
strcasecmp
(
g_ftdm_sngss7_data
.
cfg
.
mtpLink
[
x
].
name
,
name
))
{
/* send the deactivate request */
if
(
ftmod_ss7_deactivate2_mtplink
(
x
))
{
stream
->
write_function
(
stream
,
"Failed to deactivate link=%s
\n
"
,
name
);
return
FTDM_FAIL
;
}
/* print the new status of the link */
handle_status_link
(
stream
,
&
name
[
0
]);
goto
success
;
}
/* move to the next link */
x
++
;
}
/* while (id != 0) */
stream
->
write_function
(
stream
,
"Could not find link=%s
\n
"
,
name
);
success:
return
FTDM_SUCCESS
;
}
/******************************************************************************/
static
ftdm_status_t
handle_activate_linkset
(
ftdm_stream_handle_t
*
stream
,
char
*
name
)
{
int
x
=
0
;
/* find the linkset request by it's name */
x
=
1
;
while
(
g_ftdm_sngss7_data
.
cfg
.
mtpLinkSet
[
x
].
id
!=
0
)
{
if
(
!
strcasecmp
(
g_ftdm_sngss7_data
.
cfg
.
mtpLinkSet
[
x
].
name
,
name
))
{
/* send the activate request */
if
(
ftmod_ss7_activate_mtplinkSet
(
x
))
{
stream
->
write_function
(
stream
,
"Failed to activate linkset=%s
\n
"
,
name
);
return
FTDM_FAIL
;
}
/* print the new status of the linkset */
handle_status_linkset
(
stream
,
&
name
[
0
]);
goto
success
;
}
/* move to the next linkset */
x
++
;
}
/* while (id != 0) */
stream
->
write_function
(
stream
,
"Could not find linkset=%s
\n
"
,
name
);
success:
return
FTDM_SUCCESS
;
}
/******************************************************************************/
static
ftdm_status_t
handle_deactivate_linkset
(
ftdm_stream_handle_t
*
stream
,
char
*
name
)
{
int
x
=
0
;
/* find the linkset request by it's name */
x
=
1
;
while
(
g_ftdm_sngss7_data
.
cfg
.
mtpLinkSet
[
x
].
id
!=
0
)
{
if
(
!
strcasecmp
(
g_ftdm_sngss7_data
.
cfg
.
mtpLinkSet
[
x
].
name
,
name
))
{
/* send the deactivate request */
if
(
ftmod_ss7_deactivate2_mtplinkSet
(
x
))
{
stream
->
write_function
(
stream
,
"Failed to deactivate linkset=%s
\n
"
,
name
);
return
FTDM_FAIL
;
}
/* print the new status of the linkset */
handle_status_linkset
(
stream
,
&
name
[
0
]);
goto
success
;
}
/* move to the next linkset */
x
++
;
}
/* while (id != 0) */
stream
->
write_function
(
stream
,
"Could not find linkset=%s
\n
"
,
name
);
success:
return
FTDM_SUCCESS
;
}
/******************************************************************************/
static
ftdm_status_t
handle_tx_lpo
(
ftdm_stream_handle_t
*
stream
,
char
*
name
)
{
int
x
=
0
;
/* find the link request by it's name */
x
=
1
;
while
(
g_ftdm_sngss7_data
.
cfg
.
mtpLink
[
x
].
id
!=
0
)
{
if
(
!
strcasecmp
(
g_ftdm_sngss7_data
.
cfg
.
mtpLink
[
x
].
name
,
name
))
{
/* send the uninhibit request */
if
(
ftmod_ss7_lpo_mtplink
(
x
))
{
stream
->
write_function
(
stream
,
"Failed set LPO link=%s
\n
"
,
name
);
return
FTDM_FAIL
;
}
/* print the new status of the link */
handle_status_link
(
stream
,
&
name
[
0
]);
goto
success
;
}
/* move to the next link */
x
++
;
}
/* while (id != 0) */
stream
->
write_function
(
stream
,
"Could not find link=%s
\n
"
,
name
);
success:
return
FTDM_SUCCESS
;
}
/******************************************************************************/
static
ftdm_status_t
handle_tx_lpr
(
ftdm_stream_handle_t
*
stream
,
char
*
name
)
{
int
x
=
0
;
/* find the link request by it's name */
x
=
1
;
while
(
g_ftdm_sngss7_data
.
cfg
.
mtpLink
[
x
].
id
!=
0
)
{
if
(
!
strcasecmp
(
g_ftdm_sngss7_data
.
cfg
.
mtpLink
[
x
].
name
,
name
))
{
/* send the uninhibit request */
if
(
ftmod_ss7_lpr_mtplink
(
x
))
{
stream
->
write_function
(
stream
,
"Failed set LPR link=%s
\n
"
,
name
);
return
FTDM_FAIL
;
}
/* print the new status of the link */
handle_status_link
(
stream
,
&
name
[
0
]);
goto
success
;
}
/* move to the next link */
x
++
;
}
/* while (id != 0) */
stream
->
write_function
(
stream
,
"Could not find link=%s
\n
"
,
name
);
success:
return
FTDM_SUCCESS
;
}
/******************************************************************************/
static
ftdm_status_t
extract_span_chan
(
char
*
argv
[
10
],
int
pos
,
int
*
span
,
int
*
chan
)
{
...
...
libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_cntrl.c
浏览文件 @
5219ab8c
...
...
@@ -50,6 +50,17 @@ static int ftmod_ss7_enable_mtpLinkSet(int lnkSetId);
int
ftmod_ss7_inhibit_mtplink
(
uint32_t
id
);
int
ftmod_ss7_uninhibit_mtplink
(
uint32_t
id
);
int
ftmod_ss7_activate_mtplink
(
uint32_t
id
);
int
ftmod_ss7_deactivate_mtplink
(
uint32_t
id
);
int
ftmod_ss7_deactivate2_mtplink
(
uint32_t
id
);
int
ftmod_ss7_activate_mtplinkSet
(
uint32_t
id
);
int
ftmod_ss7_deactivate_mtplinkSet
(
uint32_t
id
);
int
ftmod_ss7_deactivate2_mtplinkSet
(
uint32_t
id
);
int
ftmod_ss7_lpo_mtplink
(
uint32_t
id
);
int
ftmod_ss7_lpr_mtplink
(
uint32_t
id
);
/******************************************************************************/
/* FUNCTIONS ******************************************************************/
...
...
@@ -271,6 +282,248 @@ int ftmod_ss7_uninhibit_mtplink(uint32_t id)
return
(
sng_cntrl_mtp3
(
&
pst
,
&
cntrl
));
}
/******************************************************************************/
int
ftmod_ss7_activate_mtplink
(
uint32_t
id
)
{
SnMngmt
cntrl
;
Pst
pst
;
/* initalize the post structure */
smPstInit
(
&
pst
);
/* insert the destination Entity */
pst
.
dstEnt
=
ENTSN
;
/* initalize the control structure */
memset
(
&
cntrl
,
0x0
,
sizeof
(
SnMngmt
));
/* initalize the control header */
smHdrInit
(
&
cntrl
.
hdr
);
cntrl
.
hdr
.
msgType
=
TCNTRL
;
/* this is a control request */
cntrl
.
hdr
.
entId
.
ent
=
ENTSN
;
cntrl
.
hdr
.
entId
.
inst
=
S_INST
;
cntrl
.
hdr
.
elmId
.
elmnt
=
STDLSAP
;
cntrl
.
hdr
.
elmId
.
elmntInst1
=
g_ftdm_sngss7_data
.
cfg
.
mtpLink
[
id
].
id
;
cntrl
.
t
.
cntrl
.
action
=
AENA
;
/* Activate */
cntrl
.
t
.
cntrl
.
subAction
=
SAELMNT
;
/* specificed element */
return
(
sng_cntrl_mtp3
(
&
pst
,
&
cntrl
));
}
/******************************************************************************/
int
ftmod_ss7_deactivate_mtplink
(
uint32_t
id
)
{
SnMngmt
cntrl
;
Pst
pst
;
/* initalize the post structure */
smPstInit
(
&
pst
);
/* insert the destination Entity */
pst
.
dstEnt
=
ENTSN
;
/* initalize the control structure */
memset
(
&
cntrl
,
0x0
,
sizeof
(
SnMngmt
));
/* initalize the control header */
smHdrInit
(
&
cntrl
.
hdr
);
cntrl
.
hdr
.
msgType
=
TCNTRL
;
/* this is a control request */
cntrl
.
hdr
.
entId
.
ent
=
ENTSN
;
cntrl
.
hdr
.
entId
.
inst
=
S_INST
;
cntrl
.
hdr
.
elmId
.
elmnt
=
STDLSAP
;
cntrl
.
hdr
.
elmId
.
elmntInst1
=
g_ftdm_sngss7_data
.
cfg
.
mtpLink
[
id
].
id
;
cntrl
.
t
.
cntrl
.
action
=
ADISIMM
;
/* Deactivate */
cntrl
.
t
.
cntrl
.
subAction
=
SAELMNT
;
/* specificed element */
return
(
sng_cntrl_mtp3
(
&
pst
,
&
cntrl
));
}
/******************************************************************************/
int
ftmod_ss7_deactivate2_mtplink
(
uint32_t
id
)
{
SnMngmt
cntrl
;
Pst
pst
;
/* initalize the post structure */
smPstInit
(
&
pst
);
/* insert the destination Entity */
pst
.
dstEnt
=
ENTSN
;
/* initalize the control structure */
memset
(
&
cntrl
,
0x0
,
sizeof
(
SnMngmt
));
/* initalize the control header */
smHdrInit
(
&
cntrl
.
hdr
);
cntrl
.
hdr
.
msgType
=
TCNTRL
;
/* this is a control request */
cntrl
.
hdr
.
entId
.
ent
=
ENTSN
;
cntrl
.
hdr
.
entId
.
inst
=
S_INST
;
cntrl
.
hdr
.
elmId
.
elmnt
=
STDLSAP
;
cntrl
.
hdr
.
elmId
.
elmntInst1
=
g_ftdm_sngss7_data
.
cfg
.
mtpLink
[
id
].
id
;
cntrl
.
t
.
cntrl
.
action
=
ADISIMM_L2
;
/* Deactivate...layer 2 only */
cntrl
.
t
.
cntrl
.
subAction
=
SAELMNT
;
/* specificed element */
return
(
sng_cntrl_mtp3
(
&
pst
,
&
cntrl
));
}
/******************************************************************************/
int
ftmod_ss7_activate_mtplinkSet
(
uint32_t
id
)
{
SnMngmt
cntrl
;
Pst
pst
;
/* initalize the post structure */
smPstInit
(
&
pst
);
/* insert the destination Entity */
pst
.
dstEnt
=
ENTSN
;
/* initalize the control structure */
memset
(
&
cntrl
,
0x0
,
sizeof
(
SnMngmt
));
/* initalize the control header */
smHdrInit
(
&
cntrl
.
hdr
);
cntrl
.
hdr
.
msgType
=
TCNTRL
;
/* this is a control request */
cntrl
.
hdr
.
entId
.
ent
=
ENTSN
;
cntrl
.
hdr
.
entId
.
inst
=
S_INST
;
cntrl
.
hdr
.
elmId
.
elmnt
=
STLNKSET
;
cntrl
.
hdr
.
elmId
.
elmntInst1
=
g_ftdm_sngss7_data
.
cfg
.
mtpLinkSet
[
id
].
id
;
cntrl
.
t
.
cntrl
.
action
=
AACTLNKSET
;
/* Activate */
cntrl
.
t
.
cntrl
.
subAction
=
SAELMNT
;
/* specificed element */
return
(
sng_cntrl_mtp3
(
&
pst
,
&
cntrl
));
}
/******************************************************************************/
int
ftmod_ss7_deactivate_mtplinkSet
(
uint32_t
id
)
{
SnMngmt
cntrl
;
Pst
pst
;
/* initalize the post structure */
smPstInit
(
&
pst
);
/* insert the destination Entity */
pst
.
dstEnt
=
ENTSN
;
/* initalize the control structure */
memset
(
&
cntrl
,
0x0
,
sizeof
(
SnMngmt
));
/* initalize the control header */
smHdrInit
(
&
cntrl
.
hdr
);
cntrl
.
hdr
.
msgType
=
TCNTRL
;
/* this is a control request */
cntrl
.
hdr
.
entId
.
ent
=
ENTSN
;
cntrl
.
hdr
.
entId
.
inst
=
S_INST
;
cntrl
.
hdr
.
elmId
.
elmnt
=
STLNKSET
;
cntrl
.
hdr
.
elmId
.
elmntInst1
=
g_ftdm_sngss7_data
.
cfg
.
mtpLinkSet
[
id
].
id
;
cntrl
.
t
.
cntrl
.
action
=
ADEACTLNKSET
;
/* Activate */
cntrl
.
t
.
cntrl
.
subAction
=
SAELMNT
;
/* specificed element */
return
(
sng_cntrl_mtp3
(
&
pst
,
&
cntrl
));
}
/******************************************************************************/
int
ftmod_ss7_deactivate2_mtplinkSet
(
uint32_t
id
)
{
SnMngmt
cntrl
;
Pst
pst
;
/* initalize the post structure */
smPstInit
(
&
pst
);
/* insert the destination Entity */
pst
.
dstEnt
=
ENTSN
;
/* initalize the control structure */
memset
(
&
cntrl
,
0x0
,
sizeof
(
SnMngmt
));
/* initalize the control header */
smHdrInit
(
&
cntrl
.
hdr
);
cntrl
.
hdr
.
msgType
=
TCNTRL
;
/* this is a control request */
cntrl
.
hdr
.
entId
.
ent
=
ENTSN
;
cntrl
.
hdr
.
entId
.
inst
=
S_INST
;
cntrl
.
hdr
.
elmId
.
elmnt
=
STLNKSET
;
cntrl
.
hdr
.
elmId
.
elmntInst1
=
g_ftdm_sngss7_data
.
cfg
.
mtpLinkSet
[
id
].
id
;
cntrl
.
t
.
cntrl
.
action
=
ADEACTLNKSET_L2
;
/* Activate */
cntrl
.
t
.
cntrl
.
subAction
=
SAELMNT
;
/* specificed element */
return
(
sng_cntrl_mtp3
(
&
pst
,
&
cntrl
));
}
/******************************************************************************/
int
ftmod_ss7_lpo_mtplink
(
uint32_t
id
)
{
SnMngmt
cntrl
;
Pst
pst
;
/* initalize the post structure */
smPstInit
(
&
pst
);
/* insert the destination Entity */
pst
.
dstEnt
=
ENTSN
;
/* initalize the control structure */
memset
(
&
cntrl
,
0x0
,
sizeof
(
SnMngmt
));
/* initalize the control header */
smHdrInit
(
&
cntrl
.
hdr
);
cntrl
.
hdr
.
msgType
=
TCNTRL
;
/* this is a control request */
cntrl
.
hdr
.
entId
.
ent
=
ENTSN
;
cntrl
.
hdr
.
entId
.
inst
=
S_INST
;
cntrl
.
hdr
.
elmId
.
elmnt
=
STDLSAP
;
cntrl
.
hdr
.
elmId
.
elmntInst1
=
g_ftdm_sngss7_data
.
cfg
.
mtpLink
[
id
].
id
;
cntrl
.
t
.
cntrl
.
action
=
ACTION_LPO
;
/* Activate */
cntrl
.
t
.
cntrl
.
subAction
=
SAELMNT
;
/* specificed element */
return
(
sng_cntrl_mtp3
(
&
pst
,
&
cntrl
));
}
/******************************************************************************/
int
ftmod_ss7_lpr_mtplink
(
uint32_t
id
)
{
SnMngmt
cntrl
;
Pst
pst
;
/* initalize the post structure */
smPstInit
(
&
pst
);
/* insert the destination Entity */
pst
.
dstEnt
=
ENTSN
;
/* initalize the control structure */
memset
(
&
cntrl
,
0x0
,
sizeof
(
SnMngmt
));
/* initalize the control header */
smHdrInit
(
&
cntrl
.
hdr
);
cntrl
.
hdr
.
msgType
=
TCNTRL
;
/* this is a control request */
cntrl
.
hdr
.
entId
.
ent
=
ENTSN
;
cntrl
.
hdr
.
entId
.
inst
=
S_INST
;
cntrl
.
hdr
.
elmId
.
elmnt
=
STDLSAP
;
cntrl
.
hdr
.
elmId
.
elmntInst1
=
g_ftdm_sngss7_data
.
cfg
.
mtpLink
[
id
].
id
;
cntrl
.
t
.
cntrl
.
action
=
ACTION_LPR
;
/* Activate */
cntrl
.
t
.
cntrl
.
subAction
=
SAELMNT
;
/* specificed element */
return
(
sng_cntrl_mtp3
(
&
pst
,
&
cntrl
));
}
/******************************************************************************/
/******************************************************************************/
/* For Emacs:
* Local Variables:
...
...
libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_handle.c
浏览文件 @
5219ab8c
...
...
@@ -1123,21 +1123,10 @@ ftdm_status_t handle_pause(uint32_t suInstId, uint32_t spInstId, uint32_t circui
/* lock the channel */
ftdm_mutex_lock
(
ftdmchan
->
mutex
);
/* check if there is a pending state change, give it a bit to clear */
if
(
check_for_state_change
(
ftdmchan
))
{
SS7_ERROR
(
"Failed to wait for pending state change on CIC = %d
\n
"
,
sngss7_info
->
circuit
->
cic
);
ftdm_mutex_unlock
(
ftdmchan
->
mutex
);
i
++
;
SS7_ASSERT
;
};
/* check if the circuit is fully started */
if
(
ftdm_test_flag
(
ftdmchan
->
span
,
FTDM_SPAN_IN_THREAD
))
{
/* set the pause flag on the channel */
sngss7_set_flag
(
sngss7_info
,
FLAG_INFID_PAUSED
);
/* set the statet o SUSPENDED to bring the sig status down */
ftdm_set_state_locked
(
ftdmchan
,
FTDM_CHANNEL_STATE_SUSPENDED
);
}
/* unlock the channel again before we exit */
...
...
@@ -1185,14 +1174,6 @@ ftdm_status_t handle_resume(uint32_t suInstId, uint32_t spInstId, uint32_t circu
/* lock the channel */
ftdm_mutex_lock
(
ftdmchan
->
mutex
);
/* check if there is a pending state change, give it a bit to clear */
if
(
check_for_state_change
(
ftdmchan
))
{
SS7_ERROR
(
"Failed to wait for pending state change on CIC = %d
\n
"
,
sngss7_info
->
circuit
->
cic
);
ftdm_mutex_unlock
(
ftdmchan
->
mutex
);
i
++
;
SS7_ASSERT
;
};
/* only resume if we are paused */
if
(
sngss7_test_flag
(
sngss7_info
,
FLAG_INFID_PAUSED
))
{
/* set the resume flag on the channel */
...
...
@@ -1200,9 +1181,6 @@ ftdm_status_t handle_resume(uint32_t suInstId, uint32_t spInstId, uint32_t circu
/* clear the paused flag */
sngss7_clear_flag
(
sngss7_info
,
FLAG_INFID_PAUSED
);
/* set the statet to SUSPENDED to bring the sig status up */
ftdm_set_state_locked
(
ftdmchan
,
FTDM_CHANNEL_STATE_SUSPENDED
);
}
/* unlock the channel again before we exit */
...
...
libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.c
浏览文件 @
5219ab8c
...
...
@@ -347,6 +347,9 @@ static void *ftdm_sangoma_ss7_run(ftdm_thread_t * me, void *obj)
/* check if the rx_grs has cleared */
check_if_rx_grs_processed
(
ftdmspan
);
}
/* if (sngss7_span->rx_grs.range > 0) */
/* check each channel on the span to see if there is an un-procressed SUS/RES flag */
check_for_res_sus_flag
(
ftdmspan
);
}
/* master while loop */
/* clear the IN_THREAD flag so that we know the thread is done */
...
...
@@ -947,31 +950,6 @@ static void ftdm_sangoma_ss7_process_state_change (ftdm_channel_t * ftdmchan)
SS7_DEBUG_CHAN
(
ftdmchan
,
"Current flags: 0x%X
\n
"
,
sngss7_info
->
flags
);
/**********************************************************************/
if
(
sngss7_test_flag
(
sngss7_info
,
FLAG_INFID_PAUSED
))
{
SS7_DEBUG_CHAN
(
ftdmchan
,
"Processing PAUSE flag %s
\n
"
,
""
);
/* bring the channel signaling status to down */
sigev
.
event_id
=
FTDM_SIGEVENT_SIGSTATUS_CHANGED
;
sigev
.
sigstatus
=
FTDM_SIG_STATE_DOWN
;
ftdm_span_send_signal
(
ftdmchan
->
span
,
&
sigev
);
/* check the last state and return to it to allow the call to finish */
goto
suspend_goto_last
;
}
if
(
sngss7_test_flag
(
sngss7_info
,
FLAG_INFID_RESUME
))
{
SS7_DEBUG_CHAN
(
ftdmchan
,
"Processing RESUME flag %s
\n
"
,
""
);
/* the reset flag is set for the first channel in the span at handle_resume */
/* clear the resume flag */
sngss7_clear_flag
(
sngss7_info
,
FLAG_INFID_RESUME
);
/* go to restart state */
goto
suspend_goto_last
;
}
/**********************************************************************/
if
(
sngss7_test_flag
(
sngss7_info
,
FLAG_CKT_MN_BLOCK_RX
))
{
SS7_DEBUG_CHAN
(
ftdmchan
,
"Processing CKT_MN_BLOCK_RX flag %s
\n
"
,
""
);
...
...
libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.h
浏览文件 @
5219ab8c
...
...
@@ -454,6 +454,14 @@ int ftmod_ss7_cc_isap_config(int id);
int
ftmod_ss7_inhibit_mtplink
(
uint32_t
id
);
int
ftmod_ss7_uninhibit_mtplink
(
uint32_t
id
);
int
ftmod_ss7_activate_mtplink
(
uint32_t
id
);
int
ftmod_ss7_deactivate_mtplink
(
uint32_t
id
);
int
ftmod_ss7_deactivate2_mtplink
(
uint32_t
id
);
int
ftmod_ss7_activate_mtplinkSet
(
uint32_t
id
);
int
ftmod_ss7_deactivate_mtplinkSet
(
uint32_t
id
);
int
ftmod_ss7_deactivate2_mtplinkSet
(
uint32_t
id
);
int
ftmod_ss7_lpo_mtplink
(
uint32_t
id
);
int
ftmod_ss7_lpr_mtplink
(
uint32_t
id
);
int
ftmod_ss7_mtplink_sta
(
uint32_t
id
,
SnMngmt
*
cfm
);
int
ftmod_ss7_mtplinkSet_sta
(
uint32_t
id
,
SnMngmt
*
cfm
);
...
...
@@ -539,6 +547,7 @@ void handle_isup_t35(void *userdata);
ftdm_status_t
ftdm_sngss7_handle_cli_cmd
(
ftdm_stream_handle_t
*
stream
,
const
char
*
data
);
ftdm_status_t
check_if_rx_grs_processed
(
ftdm_span_t
*
ftdmspan
);
ftdm_status_t
check_for_res_sus_flag
(
ftdm_span_t
*
ftdmspan
);
/******************************************************************************/
/* MACROS *********************************************************************/
...
...
libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_out.c
浏览文件 @
5219ab8c
...
...
@@ -224,7 +224,7 @@ void ft_to_sngss7_acm (ftdm_channel_t * ftdmchan)
acm
.
bckCallInd
.
isdnAccInd
.
pres
=
PRSNT_NODEF
;
acm
.
bckCallInd
.
isdnAccInd
.
val
=
0x0
;
acm
.
bckCallInd
.
echoCtrlDevInd
.
pres
=
PRSNT_NODEF
;
acm
.
bckCallInd
.
echoCtrlDevInd
.
val
=
0x0
;
acm
.
bckCallInd
.
echoCtrlDevInd
.
val
=
0x1
;
/* ec device present */
acm
.
bckCallInd
.
sccpMethInd
.
pres
=
PRSNT_NODEF
;
acm
.
bckCallInd
.
sccpMethInd
.
val
=
0x00
;
...
...
libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_sta.c
浏览文件 @
5219ab8c
...
...
@@ -68,7 +68,7 @@ int ftmod_ss7_mtplinkSet_sta(uint32_t id, SnMngmt *cfm)
sta
.
hdr
.
elmId
.
elmnt
=
STLNKSET
;
sta
.
hdr
.
elmId
.
elmntInst1
=
g_ftdm_sngss7_data
.
cfg
.
mtpLinkSet
[
id
].
id
;
sta
.
hdr
.
elmId
.
elmntInst2
=
1
;
sta
.
hdr
.
elmId
.
elmntInst2
=
g_ftdm_sngss7_data
.
cfg
.
mtpLinkSet
[
id
].
links
[
0
]
;
return
(
sng_sta_mtp3
(
&
sta
,
cfm
));
}
...
...
libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_support.c
浏览文件 @
5219ab8c
...
...
@@ -58,6 +58,7 @@ unsigned long get_unique_id(void);
ftdm_status_t
extract_chan_data
(
uint32_t
circuit
,
sngss7_chan_data_t
**
sngss7_info
,
ftdm_channel_t
**
ftdmchan
);
ftdm_status_t
check_if_rx_grs_processed
(
ftdm_span_t
*
ftdmspan
);
ftdm_status_t
check_for_res_sus_flag
(
ftdm_span_t
*
ftdmspan
);
/******************************************************************************/
/* FUNCTIONS ******************************************************************/
...
...
@@ -540,6 +541,64 @@ GRS_UNLOCK_ALL:
return
FTDM_SUCCESS
;
}
/******************************************************************************/
ftdm_status_t
check_for_res_sus_flag
(
ftdm_span_t
*
ftdmspan
)
{
ftdm_channel_t
*
ftdmchan
=
NULL
;
sngss7_chan_data_t
*
sngss7_info
=
NULL
;
ftdm_sigmsg_t
sigev
;
int
x
;
for
(
x
=
1
;
x
<
(
ftdmspan
->
chan_count
+
1
);
x
++
)
{
/* extract the channel structure and sngss7 channel data */
ftdmchan
=
ftdmspan
->
channels
[
x
];
/* if the call data is NULL move on */
if
(
ftdmchan
->
call_data
==
NULL
)
continue
;
sngss7_info
=
ftdmchan
->
call_data
;
/* lock the channel */
ftdm_mutex_lock
(
ftdmchan
->
mutex
);
memset
(
&
sigev
,
0
,
sizeof
(
sigev
));
sigev
.
chan_id
=
ftdmchan
->
chan_id
;
sigev
.
span_id
=
ftdmchan
->
span_id
;
sigev
.
channel
=
ftdmchan
;
if
((
sngss7_test_flag
(
sngss7_info
,
FLAG_INFID_PAUSED
))
&&
(
ftdm_test_flag
(
ftdmchan
,
FTDM_CHANNEL_SIG_UP
)))
{
/* bring the sig status down */
sigev
.
event_id
=
FTDM_SIGEVENT_SIGSTATUS_CHANGED
;
sigev
.
sigstatus
=
FTDM_SIG_STATE_DOWN
;
ftdm_span_send_signal
(
ftdmchan
->
span
,
&
sigev
);
}
if
((
sngss7_test_flag
(
sngss7_info
,
FLAG_INFID_RESUME
))
&&
!
(
ftdm_test_flag
(
ftdmchan
,
FTDM_CHANNEL_SIG_UP
)))
{
/* bring the sig status back up */
sigev
.
event_id
=
FTDM_SIGEVENT_SIGSTATUS_CHANGED
;
sigev
.
sigstatus
=
FTDM_SIG_STATE_UP
;
ftdm_span_send_signal
(
ftdmchan
->
span
,
&
sigev
);
sngss7_clear_flag
(
sngss7_info
,
FLAG_INFID_RESUME
);
}
/* unlock the channel */
ftdm_mutex_unlock
(
ftdmchan
->
mutex
);
}
/* for (x = 1; x < (span->chan_count + 1); x++) */
/* signal the core that sig events are queued for processing */
ftdm_span_trigger_signals
(
ftdmspan
);
return
FTDM_SUCCESS
;
}
/******************************************************************************/
...
...
libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_xml.c
浏览文件 @
5219ab8c
...
...
@@ -1600,11 +1600,10 @@ static int ftmod_ss7_fill_in_circuits(char *ch_map, int cicbase, int typeCntrl,
g_ftdm_sngss7_data
.
cfg
.
isupCkt
[
x
].
chan
=
count
;
if
(
timeslot
.
siglink
)
{
g_ftdm_sngss7_data
.
cfg
.
isupCkt
[
x
].
type
=
SIG
;
}
else
if
(
timeslot
.
hole
)
{
g_ftdm_sngss7_data
.
cfg
.
isupCkt
[
x
].
type
=
HOLE
;
}
else
{
g_ftdm_sngss7_data
.
cfg
.
isupCkt
[
x
].
type
=
VOIC
E
;
g_ftdm_sngss7_data
.
cfg
.
isupCkt
[
x
].
type
=
HOL
E
;
}
if
(
timeslot
.
channel
)
{
g_ftdm_sngss7_data
.
cfg
.
isupCkt
[
x
].
cic
=
cicbase
;
cicbase
++
;
...
...
@@ -1625,6 +1624,10 @@ static int ftmod_ss7_fill_in_circuits(char *ch_map, int cicbase, int typeCntrl,
g_ftdm_sngss7_data
.
cfg
.
isupCkt
[
x
].
obj
=
ss7_info
;
}
/* if (g_ftdm_sngss7_data.cfg.isupCkt[x].id == 0) */
/* increment the span channel count */
count
++
;
}
else
{
/* if ((timeslot.siglink) || (timeslot.gap)) */
/* find the ftdm the channel structure for this channel*/
i
=
1
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论