Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
8e408e9a
提交
8e408e9a
authored
10月 01, 2014
作者:
Brian West
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-6865 #resolve add XMPP priority to dingaling
上级
a39db868
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
21 行增加
和
2 行删除
+21
-2
libdingaling.c
libs/libdingaling/src/libdingaling.c
+12
-1
libdingaling.h
libs/libdingaling/src/libdingaling.h
+1
-0
mod_dingaling.c
src/mod/endpoints/mod_dingaling/mod_dingaling.c
+8
-1
没有找到文件。
libs/libdingaling/src/libdingaling.c
浏览文件 @
8e408e9a
...
@@ -127,6 +127,7 @@ struct ldl_handle {
...
@@ -127,6 +127,7 @@ struct ldl_handle {
char
*
password
;
char
*
password
;
char
*
server
;
char
*
server
;
char
*
status_msg
;
char
*
status_msg
;
char
*
priority
;
uint16_t
port
;
uint16_t
port
;
int
features
;
int
features
;
int
counter
;
int
counter
;
...
@@ -1470,7 +1471,7 @@ static int on_commands(void *user_data, ikspak *pak)
...
@@ -1470,7 +1471,7 @@ static int on_commands(void *user_data, ikspak *pak)
static
int
on_result
(
void
*
user_data
,
ikspak
*
pak
)
static
int
on_result
(
void
*
user_data
,
ikspak
*
pak
)
{
{
ldl_handle_t
*
handle
=
user_data
;
ldl_handle_t
*
handle
=
user_data
;
iks
*
msg
,
*
ctag
;
iks
*
msg
,
*
ctag
,
*
tag
;
if
((
msg
=
iks_make_pres
(
IKS_SHOW_AVAILABLE
,
handle
->
status_msg
)))
{
if
((
msg
=
iks_make_pres
(
IKS_SHOW_AVAILABLE
,
handle
->
status_msg
)))
{
ctag
=
iks_insert
(
msg
,
"c"
);
ctag
=
iks_insert
(
msg
,
"c"
);
...
@@ -1480,6 +1481,11 @@ static int on_result(void *user_data, ikspak *pak)
...
@@ -1480,6 +1481,11 @@ static int on_result(void *user_data, ikspak *pak)
iks_insert_attrib
(
ctag
,
"client"
,
"libdingaling"
);
iks_insert_attrib
(
ctag
,
"client"
,
"libdingaling"
);
iks_insert_attrib
(
ctag
,
"xmlns"
,
"http://jabber.org/protocol/caps"
);
iks_insert_attrib
(
ctag
,
"xmlns"
,
"http://jabber.org/protocol/caps"
);
if
(
handle
->
priority
&&
strlen
(
handle
->
priority
))
{
tag
=
iks_insert
(
msg
,
"priority"
);
iks_insert_cdata
(
tag
,
handle
->
priority
,
0
);
}
apr_queue_push
(
handle
->
queue
,
msg
);
apr_queue_push
(
handle
->
queue
,
msg
);
msg
=
NULL
;
msg
=
NULL
;
}
}
...
@@ -3117,6 +3123,7 @@ ldl_status ldl_handle_init(ldl_handle_t **handle,
...
@@ -3117,6 +3123,7 @@ ldl_status ldl_handle_init(ldl_handle_t **handle,
char
*
server
,
char
*
server
,
ldl_user_flag_t
flags
,
ldl_user_flag_t
flags
,
char
*
status_msg
,
char
*
status_msg
,
char
*
priority
,
ldl_loop_callback_t
loop_callback
,
ldl_loop_callback_t
loop_callback
,
ldl_session_callback_t
session_callback
,
ldl_session_callback_t
session_callback
,
ldl_response_callback_t
response_callback
,
ldl_response_callback_t
response_callback
,
...
@@ -3162,6 +3169,10 @@ ldl_status ldl_handle_init(ldl_handle_t **handle,
...
@@ -3162,6 +3169,10 @@ ldl_status ldl_handle_init(ldl_handle_t **handle,
new_handle
->
status_msg
=
apr_pstrdup
(
pool
,
status_msg
);
new_handle
->
status_msg
=
apr_pstrdup
(
pool
,
status_msg
);
}
}
if
(
priority
)
{
new_handle
->
priority
=
apr_pstrdup
(
pool
,
priority
);
}
if
(
loop_callback
)
{
if
(
loop_callback
)
{
new_handle
->
loop_callback
=
loop_callback
;
new_handle
->
loop_callback
=
loop_callback
;
}
}
...
...
libs/libdingaling/src/libdingaling.h
浏览文件 @
8e408e9a
...
@@ -666,6 +666,7 @@ ldl_status ldl_handle_init(ldl_handle_t **handle,
...
@@ -666,6 +666,7 @@ ldl_status ldl_handle_init(ldl_handle_t **handle,
char
*
server
,
char
*
server
,
ldl_user_flag_t
flags
,
ldl_user_flag_t
flags
,
char
*
status_msg
,
char
*
status_msg
,
char
*
priority
,
ldl_loop_callback_t
loop_callback
,
ldl_loop_callback_t
loop_callback
,
ldl_session_callback_t
session_callback
,
ldl_session_callback_t
session_callback
,
ldl_response_callback_t
response_callback
,
ldl_response_callback_t
response_callback
,
...
...
src/mod/endpoints/mod_dingaling/mod_dingaling.c
浏览文件 @
8e408e9a
...
@@ -124,6 +124,7 @@ struct mdl_profile {
...
@@ -124,6 +124,7 @@ struct mdl_profile {
char
*
login
;
char
*
login
;
char
*
password
;
char
*
password
;
char
*
message
;
char
*
message
;
char
*
priority
;
#ifdef AUTO_REPLY
#ifdef AUTO_REPLY
char
*
auto_reply
;
char
*
auto_reply
;
#endif
#endif
...
@@ -2844,7 +2845,7 @@ static switch_status_t init_profile(mdl_profile_t *profile, uint8_t login)
...
@@ -2844,7 +2845,7 @@ static switch_status_t init_profile(mdl_profile_t *profile, uint8_t login)
profile
->
login
,
profile
->
login
,
profile
->
password
,
profile
->
password
,
profile
->
server
,
profile
->
server
,
profile
->
user_flags
,
profile
->
message
,
handle_loop
,
handle_signalling
,
handle_response
,
profile
)
==
LDL_STATUS_SUCCESS
)
{
profile
->
user_flags
,
profile
->
message
,
profile
->
priority
,
handle_loop
,
handle_signalling
,
handle_response
,
profile
)
==
LDL_STATUS_SUCCESS
)
{
profile
->
purge
=
SWITCH_FALSE
;
profile
->
purge
=
SWITCH_FALSE
;
switch_thread_rwlock_create
(
&
profile
->
rwlock
,
module_pool
);
switch_thread_rwlock_create
(
&
profile
->
rwlock
,
module_pool
);
...
@@ -2923,6 +2924,8 @@ static void set_profile_val(mdl_profile_t *profile, char *var, char *val)
...
@@ -2923,6 +2924,8 @@ static void set_profile_val(mdl_profile_t *profile, char *var, char *val)
profile
->
name
=
switch_core_strdup
(
module_pool
,
val
);
profile
->
name
=
switch_core_strdup
(
module_pool
,
val
);
}
else
if
(
!
strcasecmp
(
var
,
"message"
)
&&
!
zstr
(
val
))
{
}
else
if
(
!
strcasecmp
(
var
,
"message"
)
&&
!
zstr
(
val
))
{
profile
->
message
=
switch_core_strdup
(
module_pool
,
val
);
profile
->
message
=
switch_core_strdup
(
module_pool
,
val
);
}
else
if
(
!
strcasecmp
(
var
,
"priority"
)
&&
!
zstr
(
val
))
{
profile
->
priority
=
switch_core_strdup
(
module_pool
,
val
);
}
else
if
(
!
strcasecmp
(
var
,
"local-network-acl"
)
&&
!
zstr
(
val
))
{
}
else
if
(
!
strcasecmp
(
var
,
"local-network-acl"
)
&&
!
zstr
(
val
))
{
profile
->
local_network
=
switch_core_strdup
(
module_pool
,
val
);
profile
->
local_network
=
switch_core_strdup
(
module_pool
,
val
);
}
else
if
(
!
strcasecmp
(
var
,
"rtp-ip"
))
{
}
else
if
(
!
strcasecmp
(
var
,
"rtp-ip"
))
{
...
@@ -3189,6 +3192,8 @@ static switch_bool_t match_profile(mdl_profile_t *profile, mdl_profile_t *new_pr
...
@@ -3189,6 +3192,8 @@ static switch_bool_t match_profile(mdl_profile_t *profile, mdl_profile_t *new_pr
(
new_profile
->
password
&&
profile
->
password
&&
!
strcasecmp
(
new_profile
->
password
,
profile
->
password
)))
&&
(
new_profile
->
password
&&
profile
->
password
&&
!
strcasecmp
(
new_profile
->
password
,
profile
->
password
)))
&&
((
!
new_profile
->
message
&&
!
profile
->
message
)
||
((
!
new_profile
->
message
&&
!
profile
->
message
)
||
(
new_profile
->
message
&&
profile
->
message
&&
!
strcasecmp
(
new_profile
->
message
,
profile
->
message
)))
&&
(
new_profile
->
message
&&
profile
->
message
&&
!
strcasecmp
(
new_profile
->
message
,
profile
->
message
)))
&&
((
!
new_profile
->
priority
&&
!
profile
->
priority
)
||
(
new_profile
->
priority
&&
profile
->
priority
&&
!
strcasecmp
(
new_profile
->
priority
,
profile
->
priority
)))
&&
((
!
new_profile
->
avatar
&&
!
profile
->
avatar
)
||
(
new_profile
->
avatar
&&
profile
->
avatar
&&
!
strcasecmp
(
new_profile
->
avatar
,
profile
->
avatar
)))
&&
((
!
new_profile
->
avatar
&&
!
profile
->
avatar
)
||
(
new_profile
->
avatar
&&
profile
->
avatar
&&
!
strcasecmp
(
new_profile
->
avatar
,
profile
->
avatar
)))
&&
#ifdef AUTO_REPLY
#ifdef AUTO_REPLY
((
!
new_profile
->
auto_reply
&&
!
profile
->
auto_reply
)
||
((
!
new_profile
->
auto_reply
&&
!
profile
->
auto_reply
)
||
...
@@ -3310,6 +3315,7 @@ static switch_status_t soft_reload(void)
...
@@ -3310,6 +3315,7 @@ static switch_status_t soft_reload(void)
switch_set_flag
(
profile
,
TFLAG_AUTO
);
switch_set_flag
(
profile
,
TFLAG_AUTO
);
profile
->
message
=
""
;
profile
->
message
=
""
;
profile
->
priority
=
""
;
profile
->
user_flags
|=
LDL_FLAG_COMPONENT
;
profile
->
user_flags
|=
LDL_FLAG_COMPONENT
;
switch_mutex_init
(
&
profile
->
mutex
,
SWITCH_MUTEX_NESTED
,
module_pool
);
switch_mutex_init
(
&
profile
->
mutex
,
SWITCH_MUTEX_NESTED
,
module_pool
);
switch_snprintf
(
dbname
,
sizeof
(
dbname
),
"dingaling_%s"
,
profile
->
name
);
switch_snprintf
(
dbname
,
sizeof
(
dbname
),
"dingaling_%s"
,
profile
->
name
);
...
@@ -3440,6 +3446,7 @@ static switch_status_t load_config(void)
...
@@ -3440,6 +3446,7 @@ static switch_status_t load_config(void)
switch_set_flag
(
profile
,
TFLAG_AUTO
);
switch_set_flag
(
profile
,
TFLAG_AUTO
);
profile
->
message
=
""
;
profile
->
message
=
""
;
profile
->
priority
=
""
;
profile
->
user_flags
|=
LDL_FLAG_COMPONENT
;
profile
->
user_flags
|=
LDL_FLAG_COMPONENT
;
switch_mutex_init
(
&
profile
->
mutex
,
SWITCH_MUTEX_NESTED
,
module_pool
);
switch_mutex_init
(
&
profile
->
mutex
,
SWITCH_MUTEX_NESTED
,
module_pool
);
switch_snprintf
(
dbname
,
sizeof
(
dbname
),
"dingaling_%s"
,
profile
->
name
);
switch_snprintf
(
dbname
,
sizeof
(
dbname
),
"dingaling_%s"
,
profile
->
name
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论