Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
747ab41f
提交
747ab41f
authored
10月 20, 2006
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bs
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@3118
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
458b6012
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
60 行增加
和
5 行删除
+60
-5
libdingaling.c
libs/libdingaling/src/libdingaling.c
+5
-5
mod_dingaling.c
src/mod/endpoints/mod_dingaling/mod_dingaling.c
+55
-0
没有找到文件。
libs/libdingaling/src/libdingaling.c
浏览文件 @
747ab41f
...
@@ -1247,7 +1247,7 @@ static void j_setup_filter(ldl_handle_t *handle)
...
@@ -1247,7 +1247,7 @@ static void j_setup_filter(ldl_handle_t *handle)
}
}
static
void
ldl_flush_queue
(
ldl_handle_t
*
handle
)
static
void
ldl_flush_queue
(
ldl_handle_t
*
handle
,
int
done
)
{
{
iks
*
msg
;
iks
*
msg
;
void
*
pop
;
void
*
pop
;
...
@@ -1280,7 +1280,7 @@ static void ldl_flush_queue(ldl_handle_t *handle)
...
@@ -1280,7 +1280,7 @@ static void ldl_flush_queue(ldl_handle_t *handle)
packet_node
->
next
=
now
+
5000000
;
packet_node
->
next
=
now
+
5000000
;
}
}
}
}
if
(
packet_node
->
retries
==
0
)
{
if
(
packet_node
->
retries
==
0
||
done
)
{
if
(
globals
.
debug
)
{
if
(
globals
.
debug
)
{
globals
.
logger
(
DL_LOG_DEBUG
,
"Discarding packet %s
\n
"
,
packet_node
->
id
);
globals
.
logger
(
DL_LOG_DEBUG
,
"Discarding packet %s
\n
"
,
packet_node
->
id
);
}
}
...
@@ -1302,7 +1302,7 @@ static void *APR_THREAD_FUNC queue_thread(apr_thread_t *thread, void *obj)
...
@@ -1302,7 +1302,7 @@ static void *APR_THREAD_FUNC queue_thread(apr_thread_t *thread, void *obj)
ldl_set_flag_locked
(
handle
,
LDL_FLAG_QUEUE_RUNNING
);
ldl_set_flag_locked
(
handle
,
LDL_FLAG_QUEUE_RUNNING
);
while
(
ldl_test_flag
(
handle
,
LDL_FLAG_RUNNING
))
{
while
(
ldl_test_flag
(
handle
,
LDL_FLAG_RUNNING
))
{
ldl_flush_queue
(
handle
);
ldl_flush_queue
(
handle
,
0
);
if
(
handle
->
loop_callback
(
handle
)
!=
LDL_STATUS_SUCCESS
)
{
if
(
handle
->
loop_callback
(
handle
)
!=
LDL_STATUS_SUCCESS
)
{
int
fd
;
int
fd
;
...
@@ -1414,7 +1414,7 @@ static void xmpp_connect(ldl_handle_t *handle, char *jabber_id, char *pass)
...
@@ -1414,7 +1414,7 @@ static void xmpp_connect(ldl_handle_t *handle, char *jabber_id, char *pass)
if
(
!
ldl_test_flag
(
handle
,
LDL_FLAG_TLS
)
&&
ldl_test_flag
(
handle
,
LDL_FLAG_READY
))
{
if
(
!
ldl_test_flag
(
handle
,
LDL_FLAG_TLS
)
&&
ldl_test_flag
(
handle
,
LDL_FLAG_READY
))
{
ldl_flush_queue
(
handle
);
ldl_flush_queue
(
handle
,
0
);
}
}
if
(
!
ldl_test_flag
(
handle
,
LDL_FLAG_CONNECTED
))
{
if
(
!
ldl_test_flag
(
handle
,
LDL_FLAG_CONNECTED
))
{
...
@@ -2022,7 +2022,7 @@ ldl_status ldl_handle_destroy(ldl_handle_t **handle)
...
@@ -2022,7 +2022,7 @@ ldl_status ldl_handle_destroy(ldl_handle_t **handle)
{
{
apr_pool_t
*
pool
=
(
*
handle
)
->
pool
;
apr_pool_t
*
pool
=
(
*
handle
)
->
pool
;
ldl_flush_queue
(
*
handle
);
ldl_flush_queue
(
*
handle
,
1
);
apr_pool_destroy
(
pool
);
apr_pool_destroy
(
pool
);
...
...
src/mod/endpoints/mod_dingaling/mod_dingaling.c
浏览文件 @
747ab41f
...
@@ -413,6 +413,59 @@ static void roster_event_handler(switch_event_t *event)
...
@@ -413,6 +413,59 @@ static void roster_event_handler(switch_event_t *event)
}
}
static
int
so_callback
(
void
*
pArg
,
int
argc
,
char
**
argv
,
char
**
columnNames
)
{
struct
mdl_profile
*
profile
=
(
struct
mdl_profile
*
)
pArg
;
char
*
sub_from
=
argv
[
0
];
char
*
sub_to
=
argv
[
1
];
ldl_handle_send_presence
(
profile
->
handle
,
sub_to
,
sub_from
,
"unavailable"
,
"dnd"
,
"Bub-Bye"
);
return
0
;
}
static
void
sign_off
(
void
)
{
struct
mdl_profile
*
profile
=
NULL
;
switch_hash_index_t
*
hi
;
void
*
val
;
char
*
sql
;
switch_core_db_t
*
db
;
sql
=
switch_mprintf
(
"select * from subscriptions"
);
for
(
hi
=
switch_hash_first
(
apr_hash_pool_get
(
globals
.
profile_hash
),
globals
.
profile_hash
);
hi
;
hi
=
switch_hash_next
(
hi
))
{
char
*
errmsg
;
switch_hash_this
(
hi
,
NULL
,
NULL
,
&
val
);
profile
=
(
struct
mdl_profile
*
)
val
;
if
(
!
(
profile
->
user_flags
&
LDL_FLAG_COMPONENT
))
{
continue
;
}
if
(
sql
)
{
if
(
!
(
db
=
switch_core_db_open_file
(
profile
->
dbname
)))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Error Opening DB %s
\n
"
,
profile
->
dbname
);
continue
;
}
switch_mutex_lock
(
profile
->
mutex
);
switch_core_db_exec
(
db
,
sql
,
so_callback
,
profile
,
&
errmsg
);
switch_mutex_unlock
(
profile
->
mutex
);
switch_core_db_close
(
db
);
}
}
switch_yield
(
1000000
);
switch_safe_free
(
sql
);
}
static
void
terminate_session
(
switch_core_session_t
**
session
,
int
line
,
switch_call_cause_t
cause
)
static
void
terminate_session
(
switch_core_session_t
**
session
,
int
line
,
switch_call_cause_t
cause
)
{
{
if
(
*
session
)
{
if
(
*
session
)
{
...
@@ -1549,6 +1602,8 @@ static switch_status_t init_profile(struct mdl_profile *profile, uint8_t login)
...
@@ -1549,6 +1602,8 @@ static switch_status_t init_profile(struct mdl_profile *profile, uint8_t login)
SWITCH_MOD_DECLARE
(
switch_status_t
)
switch_module_shutdown
(
void
)
SWITCH_MOD_DECLARE
(
switch_status_t
)
switch_module_shutdown
(
void
)
{
{
sign_off
();
if
(
globals
.
running
)
{
if
(
globals
.
running
)
{
int
x
=
0
;
int
x
=
0
;
globals
.
running
=
0
;
globals
.
running
=
0
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论