Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
13a595a1
提交
13a595a1
authored
9月 11, 2014
作者:
Dušan Dragić
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mod_gsmopen: get device manufacturer, model and firmware version info.
上级
79d962f3
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
48 行增加
和
1 行删除
+48
-1
gsmopen.h
src/mod/endpoints/mod_gsmopen/gsmopen.h
+6
-0
gsmopen_protocol.cpp
src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp
+33
-1
mod_gsmopen.cpp
src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp
+9
-0
没有找到文件。
src/mod/endpoints/mod_gsmopen/gsmopen.h
浏览文件 @
13a595a1
...
@@ -453,6 +453,12 @@ struct private_object {
...
@@ -453,6 +453,12 @@ struct private_object {
int
requesting_operator_name
;
int
requesting_operator_name
;
char
subscriber_number
[
128
];
char
subscriber_number
[
128
];
int
requesting_subscriber_number
;
int
requesting_subscriber_number
;
char
device_mfg
[
128
];
int
requesting_device_mfg
;
char
device_model
[
128
];
int
requesting_device_model
;
char
device_firmware
[
128
];
int
requesting_device_firmware
;
int
network_creg_not_supported
;
int
network_creg_not_supported
;
char
creg
[
128
];
char
creg
[
128
];
...
...
src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp
浏览文件 @
13a595a1
...
@@ -330,17 +330,29 @@ int gsmopen_serial_config_AT(private_t *tech_pvt)
...
@@ -330,17 +330,29 @@ int gsmopen_serial_config_AT(private_t *tech_pvt)
}
}
/* phone manufacturer */
/* phone manufacturer */
tech_pvt
->
requesting_device_mfg
=
1
;
res
=
gsmopen_serial_write_AT_ack
(
tech_pvt
,
"AT+CGMI"
);
res
=
gsmopen_serial_write_AT_ack
(
tech_pvt
,
"AT+CGMI"
);
tech_pvt
->
requesting_device_mfg
=
0
;
if
(
res
)
{
if
(
res
)
{
DEBUGA_GSMOPEN
(
"AT+CGMI failed
\n
"
,
GSMOPEN_P_LOG
);
DEBUGA_GSMOPEN
(
"AT+CGMI failed
\n
"
,
GSMOPEN_P_LOG
);
}
}
/* phone model */
/* phone model */
tech_pvt
->
requesting_device_model
=
1
;
res
=
gsmopen_serial_write_AT_ack
(
tech_pvt
,
"AT+CGMM"
);
res
=
gsmopen_serial_write_AT_ack
(
tech_pvt
,
"AT+CGMM"
);
tech_pvt
->
requesting_device_model
=
0
;
if
(
res
)
{
if
(
res
)
{
DEBUGA_GSMOPEN
(
"AT+CGMM failed
\n
"
,
GSMOPEN_P_LOG
);
DEBUGA_GSMOPEN
(
"AT+CGMM failed
\n
"
,
GSMOPEN_P_LOG
);
}
}
/* phone firmware */
tech_pvt
->
requesting_device_firmware
=
1
;
res
=
gsmopen_serial_write_AT_ack
(
tech_pvt
,
"AT+CGMR"
);
tech_pvt
->
requesting_device_firmware
=
0
;
if
(
res
)
{
DEBUGA_GSMOPEN
(
"AT+CGMR failed
\n
"
,
GSMOPEN_P_LOG
);
}
/* signal network registration with a +CREG unsolicited msg */
/* signal network registration with a +CREG unsolicited msg */
res
=
gsmopen_serial_write_AT_ack
(
tech_pvt
,
"AT+CREG=1"
);
res
=
gsmopen_serial_write_AT_ack
(
tech_pvt
,
"AT+CREG=1"
);
if
(
res
)
{
if
(
res
)
{
...
@@ -1682,13 +1694,33 @@ int gsmopen_serial_read_AT(private_t *tech_pvt, int look_for_ack, int timeout_us
...
@@ -1682,13 +1694,33 @@ int gsmopen_serial_read_AT(private_t *tech_pvt, int look_for_ack, int timeout_us
}
}
}
}
/* if we are requesting IMSI, put the line into the im
e
i buffer if the line is not "OK" or "ERROR" */
/* if we are requesting IMSI, put the line into the im
s
i buffer if the line is not "OK" or "ERROR" */
if
(
tech_pvt
->
requesting_imsi
&&
at_ack
==
-
1
)
{
if
(
tech_pvt
->
requesting_imsi
&&
at_ack
==
-
1
)
{
if
(
strlen
(
tech_pvt
->
line_array
.
result
[
i
]))
{
/* we are reading the IMSI */
if
(
strlen
(
tech_pvt
->
line_array
.
result
[
i
]))
{
/* we are reading the IMSI */
strncpy
(
tech_pvt
->
imsi
,
tech_pvt
->
line_array
.
result
[
i
],
sizeof
(
tech_pvt
->
imsi
));
strncpy
(
tech_pvt
->
imsi
,
tech_pvt
->
line_array
.
result
[
i
],
sizeof
(
tech_pvt
->
imsi
));
}
}
}
}
/* if we are requesting device manufacturer, model or firmware version,
* put the line into the buffer if the line is not "OK" or "ERROR" */
if
(
tech_pvt
->
requesting_device_mfg
&&
at_ack
==
-
1
)
{
if
(
strlen
(
tech_pvt
->
line_array
.
result
[
i
]))
{
strncpy
(
tech_pvt
->
device_mfg
,
tech_pvt
->
line_array
.
result
[
i
],
sizeof
(
tech_pvt
->
device_mfg
));
}
}
if
(
tech_pvt
->
requesting_device_model
&&
at_ack
==
-
1
)
{
if
(
strlen
(
tech_pvt
->
line_array
.
result
[
i
]))
{
strncpy
(
tech_pvt
->
device_model
,
tech_pvt
->
line_array
.
result
[
i
],
sizeof
(
tech_pvt
->
device_model
));
}
}
if
(
tech_pvt
->
requesting_device_firmware
&&
at_ack
==
-
1
)
{
if
(
strlen
(
tech_pvt
->
line_array
.
result
[
i
]))
{
strncpy
(
tech_pvt
->
device_firmware
,
tech_pvt
->
line_array
.
result
[
i
],
sizeof
(
tech_pvt
->
device_firmware
));
}
}
/* if we are reading an sms message from memory, put the line into the sms buffer if the line is not "OK" or "ERROR" */
/* if we are reading an sms message from memory, put the line into the sms buffer if the line is not "OK" or "ERROR" */
if
(
tech_pvt
->
reading_sms_msg
>
1
&&
at_ack
==
-
1
)
{
if
(
tech_pvt
->
reading_sms_msg
>
1
&&
at_ack
==
-
1
)
{
...
...
src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp
浏览文件 @
13a595a1
...
@@ -2423,6 +2423,9 @@ SWITCH_STANDARD_API(gsmopen_dump_function)
...
@@ -2423,6 +2423,9 @@ SWITCH_STANDARD_API(gsmopen_dump_function)
snprintf
(
value
,
sizeof
(
value
)
-
1
,
"%d"
,
tech_pvt
->
running
);
snprintf
(
value
,
sizeof
(
value
)
-
1
,
"%d"
,
tech_pvt
->
running
);
stream
->
write_function
(
stream
,
"running = %s
\n
"
,
value
);
stream
->
write_function
(
stream
,
"running = %s
\n
"
,
value
);
stream
->
write_function
(
stream
,
"subscriber_number = %s
\n
"
,
tech_pvt
->
subscriber_number
);
stream
->
write_function
(
stream
,
"subscriber_number = %s
\n
"
,
tech_pvt
->
subscriber_number
);
stream
->
write_function
(
stream
,
"device_manufacturer = %s
\n
"
,
tech_pvt
->
device_mfg
);
stream
->
write_function
(
stream
,
"device_model = %s
\n
"
,
tech_pvt
->
device_model
);
stream
->
write_function
(
stream
,
"device_firmware = %s
\n
"
,
tech_pvt
->
device_firmware
);
stream
->
write_function
(
stream
,
"operator = %s
\n
"
,
tech_pvt
->
operator_name
);
stream
->
write_function
(
stream
,
"operator = %s
\n
"
,
tech_pvt
->
operator_name
);
stream
->
write_function
(
stream
,
"imei = %s
\n
"
,
tech_pvt
->
imei
);
stream
->
write_function
(
stream
,
"imei = %s
\n
"
,
tech_pvt
->
imei
);
stream
->
write_function
(
stream
,
"imsi = %s
\n
"
,
tech_pvt
->
imsi
);
stream
->
write_function
(
stream
,
"imsi = %s
\n
"
,
tech_pvt
->
imsi
);
...
@@ -2483,6 +2486,9 @@ SWITCH_STANDARD_API(gsmopen_dump_function)
...
@@ -2483,6 +2486,9 @@ SWITCH_STANDARD_API(gsmopen_dump_function)
snprintf
(
value
,
sizeof
(
value
)
-
1
,
"%d"
,
tech_pvt
->
running
);
snprintf
(
value
,
sizeof
(
value
)
-
1
,
"%d"
,
tech_pvt
->
running
);
stream
->
write_function
(
stream
,
"running = %s
\n
"
,
value
);
stream
->
write_function
(
stream
,
"running = %s
\n
"
,
value
);
stream
->
write_function
(
stream
,
"subscriber_number = %s
\n
"
,
tech_pvt
->
subscriber_number
);
stream
->
write_function
(
stream
,
"subscriber_number = %s
\n
"
,
tech_pvt
->
subscriber_number
);
stream
->
write_function
(
stream
,
"device_manufacturer = %s
\n
"
,
tech_pvt
->
device_mfg
);
stream
->
write_function
(
stream
,
"device_model = %s
\n
"
,
tech_pvt
->
device_model
);
stream
->
write_function
(
stream
,
"device_firmware = %s
\n
"
,
tech_pvt
->
device_firmware
);
stream
->
write_function
(
stream
,
"operator = %s
\n
"
,
tech_pvt
->
operator_name
);
stream
->
write_function
(
stream
,
"operator = %s
\n
"
,
tech_pvt
->
operator_name
);
stream
->
write_function
(
stream
,
"imei = %s
\n
"
,
tech_pvt
->
imei
);
stream
->
write_function
(
stream
,
"imei = %s
\n
"
,
tech_pvt
->
imei
);
stream
->
write_function
(
stream
,
"imsi = %s
\n
"
,
tech_pvt
->
imsi
);
stream
->
write_function
(
stream
,
"imsi = %s
\n
"
,
tech_pvt
->
imsi
);
...
@@ -2814,6 +2820,9 @@ int dump_event_full(private_t *tech_pvt, int is_alarm, int alarm_code, const cha
...
@@ -2814,6 +2820,9 @@ int dump_event_full(private_t *tech_pvt, int is_alarm, int alarm_code, const cha
snprintf
(
value
,
sizeof
(
value
)
-
1
,
"%d"
,
tech_pvt
->
running
);
snprintf
(
value
,
sizeof
(
value
)
-
1
,
"%d"
,
tech_pvt
->
running
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"running"
,
value
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"running"
,
value
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"subscriber_number"
,
tech_pvt
->
subscriber_number
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"subscriber_number"
,
tech_pvt
->
subscriber_number
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"device_manufacturer"
,
tech_pvt
->
device_mfg
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"device_model"
,
tech_pvt
->
device_model
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"device_firmware"
,
tech_pvt
->
device_firmware
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"operator"
,
tech_pvt
->
operator_name
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"operator"
,
tech_pvt
->
operator_name
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"imei"
,
tech_pvt
->
imei
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"imei"
,
tech_pvt
->
imei
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"imsi"
,
tech_pvt
->
imsi
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"imsi"
,
tech_pvt
->
imsi
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论