Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
1ad0d0af
提交
1ad0d0af
authored
5月 04, 2012
作者:
Giovanni Maruzzelli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
gsmopen: FS-4155, mod_sms hookup
上级
1b399d3c
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
20 行增加
和
6 行删除
+20
-6
gsmopen_protocol.cpp
src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp
+5
-6
mod_gsmopen.cpp
src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp
+15
-0
没有找到文件。
src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp
浏览文件 @
1ad0d0af
...
...
@@ -571,7 +571,7 @@ int gsmopen_serial_read_AT(private_t *tech_pvt, int look_for_ack, int timeout_us
timeout_in_msec
=
(
timeout_sec
*
1000
)
+
(
timeout_usec
?
(
timeout_usec
/
1000
)
:
0
);
if
(
timeout_in_msec
!=
100
)
ERRORA
(
"TIMEOUT=%d
\n
"
,
GSMOPEN_P_LOG
,
timeout_in_msec
);
DEBUGA_GSMOPEN
(
"TIMEOUT=%d
\n
"
,
GSMOPEN_P_LOG
,
timeout_in_msec
);
if
(
!
running
||
!
tech_pvt
->
running
)
{
return
-
1
;
...
...
@@ -828,11 +828,10 @@ int gsmopen_serial_read_AT(private_t *tech_pvt, int look_for_ack, int timeout_us
tech_pvt
->
line_array
.
result
[
i
],
tech_pvt
->
callid_name
,
tech_pvt
->
callid_number
);
}
if
((
strncmp
(
tech_pvt
->
line_array
.
result
[
i
],
"+CMS ERROR:"
,
11
)
==
0
))
{
ERRORA
(
"Received:
\"
%s
\"
, what was this error about?
\n
"
,
GSMOPEN_P_LOG
);
}
if
((
strcmp
(
tech_pvt
->
line_array
.
result
[
i
],
"+CMS ERROR: 500"
)
==
0
))
{
ERRORA
(
"Received:
\"
%s
\"
, maybe this account ran OUT OF CREDIT?
\n
"
,
GSMOPEN_P_LOG
);
ERRORA
(
"Received:
\"
%s
\"
, generic error, maybe this account ran OUT OF CREDIT?
\n
"
,
GSMOPEN_P_LOG
,
tech_pvt
->
line_array
.
result
[
i
]);
}
else
if
((
strncmp
(
tech_pvt
->
line_array
.
result
[
i
],
"+CMS ERROR:"
,
11
)
==
0
))
{
ERRORA
(
"Received:
\"
%s
\"
, what was this error about?
\n
"
,
GSMOPEN_P_LOG
,
tech_pvt
->
line_array
.
result
[
i
]);
}
if
((
strcmp
(
tech_pvt
->
line_array
.
result
[
i
],
"BUSY"
)
==
0
))
{
tech_pvt
->
phone_callflow
=
CALLFLOW_CALL_LINEBUSY
;
...
...
@@ -2113,7 +2112,7 @@ int gsmopen_serial_write_AT_ack_nocr_longtime(private_t *tech_pvt, const char *d
return
-
1
;
}
at_result
=
gsmopen_serial_read_AT
(
tech_pvt
,
1
,
500000
,
5
,
NULL
,
1
);
// 5
.5 sec timeout
at_result
=
gsmopen_serial_read_AT
(
tech_pvt
,
1
,
500000
,
20
,
NULL
,
1
);
// 20
.5 sec timeout
UNLOCKA
(
tech_pvt
->
controldev_lock
);
POPPA_UNLOCKA
(
tech_pvt
->
controldev_lock
);
...
...
src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp
浏览文件 @
1ad0d0af
...
...
@@ -1795,6 +1795,9 @@ static switch_status_t chat_send(switch_event_t *message_event)
if
(
hint
==
NULL
||
!
strlen
(
hint
))
{
//FIXME FIXME FIXME
hint
=
from
;
}
if
(
subject
==
NULL
||
!
strlen
(
subject
))
{
//FIXME FIXME FIXME
subject
=
"SIMPLE MESSAGE"
;
}
if
(
to
&&
(
user
=
strdup
(
to
)))
{
if
((
host
=
strchr
(
user
,
'@'
)))
{
*
host
++
=
'\0'
;
...
...
@@ -2981,7 +2984,19 @@ int sms_incoming(private_t *tech_pvt)
//switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "chatname", tech_pvt->chatmessages[which].chatname);
//switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "id", tech_pvt->chatmessages[which].id);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"subject"
,
"SIMPLE MESSAGE"
);
/* mod_sms begin */
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"to"
,
tech_pvt
->
name
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"hint"
,
tech_pvt
->
name
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"to_proto"
,
GSMOPEN_CHAT_PROTO
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"from_user"
,
tech_pvt
->
sms_sender
);
//switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from_host", "from_host");
//switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from_full", "from_full");
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"to_user"
,
tech_pvt
->
name
);
//switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to_host", "to_host");
/* mod_sms end */
switch_event_add_body
(
event
,
"%s
\n
"
,
tech_pvt
->
sms_body
);
//switch_core_chat_send(GSMOPEN_CHAT_PROTO, event); /* mod_sms */
switch_core_chat_send
(
"GLOBAL"
,
event
);
/* mod_sms */
if
(
session
)
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"during-call"
,
"true"
);
if
(
switch_core_session_queue_event
(
session
,
&
event
)
!=
SWITCH_STATUS_SUCCESS
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论