Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
6013035a
提交
6013035a
authored
11月 15, 2006
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@3380
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
ee4118ab
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
52 行增加
和
26 行删除
+52
-26
libdingaling.c
libs/libdingaling/src/libdingaling.c
+33
-16
libdingaling.h
libs/libdingaling/src/libdingaling.h
+7
-0
switch_am_config.h.in
src/include/switch_am_config.h.in
+1
-1
mod_dingaling.c
src/mod/endpoints/mod_dingaling/mod_dingaling.c
+9
-7
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+2
-2
没有找到文件。
libs/libdingaling/src/libdingaling.c
浏览文件 @
6013035a
...
...
@@ -149,6 +149,17 @@ struct ldl_session {
};
static
void
lowercase
(
char
*
str
)
{
size_t
x
=
0
;
if
(
str
)
{
for
(
x
=
0
;
x
<
strlen
(
str
);
x
++
)
{
str
[
x
]
=
(
char
)
tolower
((
int
)
str
[
x
]);
}
}
}
static
char
*
cut_path
(
char
*
in
)
{
char
*
p
,
*
ret
=
in
;
...
...
@@ -682,7 +693,6 @@ static int on_presence(void *user_data, ikspak *pak)
char
id
[
1024
];
char
*
resource
;
struct
ldl_buffer
*
buffer
;
size_t
x
;
ldl_signal_t
signal
;
...
...
@@ -696,8 +706,6 @@ static int on_presence(void *user_data, ikspak *pak)
status
=
type
;
}
if
(
!
apr_hash_get
(
handle
->
sub_hash
,
from
,
APR_HASH_KEY_STRING
))
{
iks
*
msg
;
apr_hash_set
(
handle
->
sub_hash
,
apr_pstrdup
(
handle
->
pool
,
from
),
APR_HASH_KEY_STRING
,
&
marker
);
...
...
@@ -706,16 +714,12 @@ static int on_presence(void *user_data, ikspak *pak)
}
apr_cpystrn
(
id
,
from
,
sizeof
(
id
));
lowercase
(
id
);
if
((
resource
=
strchr
(
id
,
'/'
)))
{
*
resource
++
=
'\0'
;
}
if
(
resource
)
{
for
(
x
=
0
;
x
<
strlen
(
resource
);
x
++
)
{
resource
[
x
]
=
(
char
)
tolower
((
int
)
resource
[
x
]);
}
}
if
(
resource
&&
strstr
(
resource
,
"talk"
)
&&
(
buffer
=
apr_hash_get
(
handle
->
probe_hash
,
id
,
APR_HASH_KEY_STRING
)))
{
apr_cpystrn
(
buffer
->
buf
,
from
,
buffer
->
len
);
fflush
(
stderr
);
...
...
@@ -861,8 +865,10 @@ static int on_commands(void *user_data, ikspak *pak)
if
(
!
strcasecmp
(
iks_name
(
tag
),
"bind"
))
{
char
*
jid
=
iks_find_cdata
(
tag
,
"jid"
);
char
*
resource
=
strchr
(
jid
,
'/'
);
//iks *iq, *x;
handle
->
acc
->
resource
=
apr_pstrdup
(
handle
->
pool
,
resource
);
if
(
resource
)
{
resource
++
;
handle
->
acc
->
resource
=
apr_pstrdup
(
handle
->
pool
,
resource
);
}
handle
->
login
=
apr_pstrdup
(
handle
->
pool
,
jid
);
#if 0
if ((iq = iks_new("iq"))) {
...
...
@@ -1582,6 +1588,11 @@ void *ldl_handle_get_private(ldl_handle_t *handle)
return
handle
->
private_info
;
}
void
*
ldl_handle_get_login
(
ldl_handle_t
*
handle
)
{
return
handle
->
login
;
}
void
ldl_handle_send_presence
(
ldl_handle_t
*
handle
,
char
*
from
,
char
*
to
,
char
*
type
,
char
*
rpid
,
char
*
message
)
{
do_presence
(
handle
,
from
,
to
,
type
,
rpid
,
message
);
...
...
@@ -1747,7 +1758,7 @@ unsigned int ldl_session_candidates(ldl_session_t *session,
char
*
ldl_handle_probe
(
ldl_handle_t
*
handle
,
char
*
id
,
char
*
from
,
char
*
buf
,
unsigned
int
len
)
{
iks
*
pres
,
*
msg
;
char
*
lid
=
NULL
;
char
*
lid
=
NULL
,
*
low_id
=
NULL
;
struct
ldl_buffer
buffer
;
apr_time_t
started
;
unsigned
int
elapsed
;
...
...
@@ -1762,13 +1773,14 @@ char *ldl_handle_probe(ldl_handle_t *handle, char *id, char *from, char *buf, un
iks_insert_attrib
(
pres
,
"type"
,
"probe"
);
iks_insert_attrib
(
pres
,
"from"
,
from
);
iks_insert_attrib
(
pres
,
"to"
,
id
);
apr_hash_set
(
handle
->
probe_hash
,
id
,
APR_HASH_KEY_STRING
,
&
buffer
);
msg
=
iks_make_s10n
(
IKS_TYPE_SUBSCRIBE
,
id
,
notice
);
iks_insert_attrib
(
pres
,
"from"
,
from
);
iks_insert_attrib
(
msg
,
"from"
,
from
);
apr_queue_push
(
handle
->
queue
,
msg
);
msg
=
iks_make_s10n
(
IKS_TYPE_SUBSCRIBED
,
id
,
notice
);
iks_insert_attrib
(
msg
,
"from"
,
from
);
apr_queue_push
(
handle
->
queue
,
msg
);
apr_queue_push
(
handle
->
queue
,
pres
);
...
...
@@ -1793,7 +1805,12 @@ char *ldl_handle_probe(ldl_handle_t *handle, char *id, char *from, char *buf, un
ldl_yield
(
1000
);
}
apr_hash_set
(
handle
->
probe_hash
,
id
,
APR_HASH_KEY_STRING
,
NULL
);
if
((
low_id
=
strdup
(
id
)))
{
lowercase
(
id
);
apr_hash_set
(
handle
->
probe_hash
,
low_id
,
APR_HASH_KEY_STRING
,
NULL
);
free
(
low_id
);
}
return
lid
;
}
...
...
libs/libdingaling/src/libdingaling.h
浏览文件 @
6013035a
...
...
@@ -355,6 +355,13 @@ unsigned int ldl_session_terminate(ldl_session_t *session);
*/
void
*
ldl_handle_get_private
(
ldl_handle_t
*
handle
);
/*!
\brief Get the full login of a connection handle
\param handle the conection handle
\return the requested data
*/
void
*
ldl_handle_get_login
(
ldl_handle_t
*
handle
);
/*!
\brief Send a message to a session
\param session the session handle
...
...
src/include/switch_am_config.h.in
浏览文件 @
6013035a
...
...
@@ -124,5 +124,5 @@
/* Define to rpl_malloc if the replacement function should be used. */
#undef malloc
/* Define to `unsigned
int
' if <sys/types.h> does not define. */
/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t
src/mod/endpoints/mod_dingaling/mod_dingaling.c
浏览文件 @
6013035a
...
...
@@ -1504,7 +1504,7 @@ static switch_status_t channel_outgoing_channel(switch_core_session_t *session,
snprintf
(
ubuf
,
sizeof
(
ubuf
),
"%s/talk"
,
outbound_profile
->
caller_id_number
);
user
=
ubuf
;
}
else
{
user
=
mdl_profile
->
login
;
user
=
ldl_handle_get_login
(
mdl_profile
->
handle
)
;
}
if
(
!
ldl_handle_ready
(
mdl_profile
->
handle
))
{
...
...
@@ -2174,7 +2174,9 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
char
*
hint
;
if
(
profile
->
auto_reply
)
{
ldl_handle_send_msg
(
handle
,
(
profile
->
user_flags
&
LDL_FLAG_COMPONENT
)
?
to
:
profile
->
login
,
from
,
""
,
profile
->
auto_reply
);
ldl_handle_send_msg
(
handle
,
(
profile
->
user_flags
&
LDL_FLAG_COMPONENT
)
?
to
:
ldl_handle_get_login
(
profile
->
handle
),
from
,
""
,
profile
->
auto_reply
);
}
if
(
strchr
(
to
,
'+'
))
{
...
...
@@ -2207,7 +2209,7 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
break
;
case
LDL_SIGNAL_LOGIN_SUCCESS
:
if
(
switch_event_create_subclass
(
&
event
,
SWITCH_EVENT_CUSTOM
,
DL_EVENT_LOGIN_SUCCESS
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"login"
,
"%s"
,
profile
->
login
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"login"
,
"%s"
,
ldl_handle_get_login
(
profile
->
handle
)
);
switch_event_fire
(
&
event
);
}
if
(
profile
->
user_flags
&
LDL_FLAG_COMPONENT
)
{
...
...
@@ -2217,13 +2219,13 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
break
;
case
LDL_SIGNAL_LOGIN_FAILURE
:
if
(
switch_event_create_subclass
(
&
event
,
SWITCH_EVENT_CUSTOM
,
DL_EVENT_LOGIN_FAILURE
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"login"
,
"%s"
,
profile
->
login
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"login"
,
"%s"
,
ldl_handle_get_login
(
profile
->
handle
)
);
switch_event_fire
(
&
event
);
}
break
;
case
LDL_SIGNAL_CONNECTED
:
if
(
switch_event_create_subclass
(
&
event
,
SWITCH_EVENT_CUSTOM
,
DL_EVENT_CONNECTED
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"login"
,
"%s"
,
profile
->
login
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"login"
,
"%s"
,
ldl_handle_get_login
(
profile
->
handle
)
);
switch_event_fire
(
&
event
);
}
break
;
...
...
@@ -2317,7 +2319,7 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
}
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"proto"
,
MDL_CHAT_PROTO
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"login"
,
"%s"
,
profile
->
login
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"login"
,
"%s"
,
ldl_handle_get_login
(
profile
->
handle
)
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"hint"
,
"%s"
,
hint
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s"
,
from
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"to"
,
"%s"
,
to
);
...
...
@@ -2531,7 +2533,7 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
ldl_session_get_id
(
dlsession
),
cid_name
,
cid_num
,
exten
);
if
((
tech_pvt
->
caller_profile
=
switch_caller_profile_new
(
switch_core_session_get_pool
(
session
),
profile
->
login
,
ldl_handle_get_login
(
profile
->
handle
)
,
profile
->
dialplan
,
cid_name
,
cid_num
,
...
...
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
6013035a
...
...
@@ -4478,8 +4478,8 @@ static void *SWITCH_THREAD_FUNC profile_thread_run(switch_thread_t *thread, void
TAG_IF
((
profile
->
pflags
&
PFLAG_PRESENCE
),
NUTAG_ALLOW
(
"NOTIFY"
)),
TAG_IF
((
profile
->
pflags
&
PFLAG_PRESENCE
),
NUTAG_ALLOW
(
"SUBSCRIBE"
)),
TAG_IF
((
profile
->
pflags
&
PFLAG_PRESENCE
),
NUTAG_ENABLEMESSAGE
(
1
)),
TAG_IF
((
profile
->
pflags
&
PFLAG_PRESENCE
),
NUTAG_ALLOW_EVENTS
(
"presence"
)),
TAG_IF
((
profile
->
pflags
&
PFLAG_PRESENCE
),
NUTAG_ALLOW_EVENTS
(
"presence.winfo"
)),
//
TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ALLOW_EVENTS("presence")),
//
TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ALLOW_EVENTS("presence.winfo")),
SIPTAG_SUPPORTED_STR
(
"100rel, precondition"
),
SIPTAG_USER_AGENT_STR
(
SOFIA_USER_AGENT
),
TAG_END
());
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论