提交 8f9600e1 authored 作者: Anthony Minessale's avatar Anthony Minessale

MODENDP-202 and MODENDP-204

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12680 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 f89df210
......@@ -321,7 +321,7 @@ core-clean: clean_core
core-install: core_install
clean_core: clean-libLTLIBRARIES
rm -f $(libfreeswitch_la_OBJECTS)
install_core: install-libLTLIBRARIES
core_install: install_core
......
......@@ -1593,6 +1593,7 @@ static void xmpp_connect(ldl_handle_t *handle, char *jabber_id, char *pass)
microsleep(100);
}
ldl_set_flag_locked(handle, LDL_FLAG_STOPPED);
}
......@@ -2324,6 +2325,7 @@ ldl_status ldl_handle_init(ldl_handle_t **handle,
void ldl_handle_run(ldl_handle_t *handle)
{
ldl_clear_flag_locked(handle, LDL_FLAG_STOPPED);
ldl_set_flag_locked(handle, LDL_FLAG_RUNNING);
xmpp_connect(handle, handle->login, handle->password);
ldl_clear_flag_locked(handle, LDL_FLAG_RUNNING);
......@@ -2332,12 +2334,24 @@ void ldl_handle_run(ldl_handle_t *handle)
void ldl_handle_stop(ldl_handle_t *handle)
{
ldl_clear_flag_locked(handle, LDL_FLAG_RUNNING);
if (ldl_test_flag(handle, LDL_FLAG_TLS)) {
int fd;
if ((fd = iks_fd(handle->parser)) > -1) {
shutdown(fd, 0x02);
}
}
while(!ldl_test_flag(handle, LDL_FLAG_STOPPED)) {
microsleep(100);
}
}
ldl_status ldl_handle_destroy(ldl_handle_t **handle)
{
apr_pool_t *pool = (*handle)->pool;
ldl_handle_stop(*handle);
ldl_flush_queue(*handle, 1);
......
......@@ -119,7 +119,8 @@ typedef enum {
LDL_FLAG_AUTHORIZED = (1 << 2),
LDL_FLAG_READY = (1 << 3),
LDL_FLAG_CONNECTED = (1 << 4),
LDL_FLAG_QUEUE_RUNNING = (1 << 5)
LDL_FLAG_QUEUE_RUNNING = (1 << 5),
LDL_FLAG_STOPPED = (1 << 6)
} ldl_flag_t;
typedef enum {
......
......@@ -1805,7 +1805,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dingaling_load)
#define PRES_SYNTAX "dl_pres <profile_name>"
#define LOGOUT_SYNTAX "dl_logout <profile_name>"
#define LOGIN_SYNTAX "dl_login <profile_name>"
#define LOGIN_SYNTAX "Existing Profile:\ndl_login profile=<profile_name>\nDynamic Profile:\ndl_login var1=val1;var2=val2;varN=valN\n"
#define DEBUG_SYNTAX "dl_debug [true|false]"
SWITCH_ADD_API(api_interface, "dl_debug", "DingaLing Debug", dl_debug, DEBUG_SYNTAX);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论