Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
da8d9bc2
提交
da8d9bc2
authored
12月 15, 2007
作者:
Brian West
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@6802
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
3f581d06
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
172 行增加
和
61 行删除
+172
-61
default.xml
conf/directory/default.xml
+1
-1
nua_stack.c
libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c
+1
-1
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+5
-1
sofia.c
src/mod/endpoints/mod_sofia/sofia.c
+13
-1
sofia_glue.c
src/mod/endpoints/mod_sofia/sofia_glue.c
+2
-0
sofia_presence.c
src/mod/endpoints/mod_sofia/sofia_presence.c
+125
-53
switch_channel.c
src/switch_channel.c
+25
-4
没有找到文件。
conf/directory/default.xml
浏览文件 @
da8d9bc2
...
...
@@ -2,7 +2,7 @@
<!--the domain or ip (the right hand side of the @ in the addr-->
<domain
name=
"$${domain}"
>
<params>
<param
name=
"dial-string"
value=
"sofia/${dialed_domain}/${dialed_user}"
/>
<param
name=
"dial-string"
value=
"
{presence_id=${dialed_user}@${dialed_domain}}
sofia/${dialed_domain}/${dialed_user}"
/>
</params>
<X-PRE-PROCESS
cmd=
"include"
data=
"default/*.xml"
/>
...
...
libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c
浏览文件 @
da8d9bc2
...
...
@@ -2125,7 +2125,7 @@ int nua_client_bind(nua_client_request_t *cr, nua_dialog_usage_t *du)
}
if
(
du
->
du_cr
&&
cr
!=
du
->
du_cr
)
{
assert
(
!
nua_client_is_queued
(
du
->
du_cr
));
if
(
nua_client_is_queued
(
du
->
du_cr
))
return
-
1
;
if
(
nua_client_is_reporting
(
du
->
du_cr
))
{
...
...
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
da8d9bc2
...
...
@@ -998,9 +998,13 @@ static int show_reg_callback(void *pArg, int argc, char **argv, char **columnNam
"Call-ID
\t
%s
\n
"
"User
\t
%s@%s
\n
"
"Contact
\t
%s
\n
"
"Agent
\t
%s
\n
"
"Status
\t
%s(%s) EXP(%s)
\n\n
"
,
switch_str_nil
(
argv
[
0
]),
switch_str_nil
(
argv
[
1
]),
switch_str_nil
(
argv
[
2
]),
switch_str_nil
(
argv
[
3
]),
switch_str_nil
(
argv
[
4
]),
switch_str_nil
(
argv
[
5
]),
exp_buf
);
switch_str_nil
(
argv
[
7
]),
switch_str_nil
(
argv
[
4
]),
switch_str_nil
(
argv
[
5
]),
exp_buf
);
return
0
;
}
...
...
src/mod/endpoints/mod_sofia/sofia.c
浏览文件 @
da8d9bc2
...
...
@@ -58,6 +58,17 @@ void sofia_handle_sip_r_notify(switch_core_session_t *session, int status,
char
const
*
phrase
,
nua_t
*
nua
,
sofia_profile_t
*
profile
,
nua_handle_t
*
nh
,
sofia_private_t
*
sofia_private
,
sip_t
const
*
sip
,
tagi_t
tags
[])
{
if
(
status
==
481
&&
sip
)
{
const
char
*
call_id
=
sip
->
sip_call_id
->
i_id
;
char
*
sql
;
switch_core_hash_delete
(
profile
->
sub_hash
,
call_id
);
sql
=
switch_mprintf
(
"delete from sip_subscriptions where call_id='%q'"
,
call_id
);
switch_assert
(
sql
!=
NULL
);
sofia_glue_execute_sql
(
profile
,
SWITCH_FALSE
,
sql
,
profile
->
ireg_mutex
);
free
(
sql
);
nua_handle_destroy
(
nh
);
}
}
void
sofia_handle_sip_i_notify
(
switch_core_session_t
*
session
,
int
status
,
...
...
@@ -318,7 +329,7 @@ void event_handler(switch_event_t *event)
sofia_glue_execute_sql
(
profile
,
SWITCH_FALSE
,
sql
,
NULL
);
switch_safe_free
(
sql
);
sql
=
switch_mprintf
(
"insert into sip_registrations values ('%q', '%q','%q','%q','Reg
e
stered', '%q', %ld, '%q')"
,
sql
=
switch_mprintf
(
"insert into sip_registrations values ('%q', '%q','%q','%q','Reg
i
stered', '%q', %ld, '%q')"
,
call_id
,
from_user
,
from_host
,
contact_str
,
rpid
,
expires
,
user_agent
);
if
(
sql
)
{
...
...
@@ -398,6 +409,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
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
(
"dialog"
)),
TAG_IF
((
profile
->
pflags
&
PFLAG_PRESENCE
),
NUTAG_ALLOW_EVENTS
(
"call-info"
)),
TAG_IF
((
profile
->
pflags
&
PFLAG_PRESENCE
),
NUTAG_ALLOW_EVENTS
(
"presence.winfo"
)),
TAG_IF
((
profile
->
pflags
&
PFLAG_PRESENCE
),
NUTAG_ALLOW_EVENTS
(
"message-summary"
)),
SIPTAG_SUPPORTED_STR
(
"100rel, precondition, timer"
),
SIPTAG_USER_AGENT_STR
(
profile
->
user_agent
),
TAG_END
());
...
...
src/mod/endpoints/mod_sofia/sofia_glue.c
浏览文件 @
da8d9bc2
...
...
@@ -1233,6 +1233,7 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t *
if
(
!
switch_test_flag
(
tech_pvt
,
TFLAG_SIP_HOLD
))
{
const
char
*
stream
;
switch_set_flag_locked
(
tech_pvt
,
TFLAG_SIP_HOLD
);
switch_channel_presence
(
tech_pvt
->
channel
,
"unknown"
,
"hold"
);
if
(
tech_pvt
->
max_missed_packets
)
{
switch_rtp_set_max_missed_packets
(
tech_pvt
->
rtp_session
,
tech_pvt
->
max_missed_packets
*
10
);
}
...
...
@@ -1251,6 +1252,7 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t *
}
switch_channel_set_flag_partner
(
tech_pvt
->
channel
,
CF_BREAK
);
switch_clear_flag_locked
(
tech_pvt
,
TFLAG_SIP_HOLD
);
switch_channel_presence
(
tech_pvt
->
channel
,
"unknown"
,
"unhold"
);
}
}
...
...
src/mod/endpoints/mod_sofia/sofia_presence.c
浏览文件 @
da8d9bc2
差异被折叠。
点击展开。
src/switch_channel.c
浏览文件 @
da8d9bc2
...
...
@@ -120,6 +120,7 @@ struct switch_channel {
switch_hash_t
*
private_hash
;
switch_call_cause_t
hangup_cause
;
int
vi
;
int
event_count
;
};
...
...
@@ -305,6 +306,7 @@ SWITCH_DECLARE(void) switch_channel_presence(switch_channel_t *channel, const ch
}
if
(
switch_event_create
(
&
event
,
type
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_channel_event_set_data
(
channel
,
event
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"proto"
,
"%s"
,
__FILE__
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"login"
,
"%s"
,
__FILE__
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s"
,
id
);
...
...
@@ -316,6 +318,8 @@ SWITCH_DECLARE(void) switch_channel_presence(switch_channel_t *channel, const ch
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"status"
,
"%s"
,
status
);
}
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"event_type"
,
"presence"
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"alt_event_type"
,
"dialog"
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"event_count"
,
"%d"
,
channel
->
event_count
++
);
switch_event_fire
(
&
event
);
}
...
...
@@ -587,8 +591,11 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_set_running_state(
switch_log_printf
(
SWITCH_CHANNEL_ID_LOG
,
file
,
func
,
line
,
NULL
,
SWITCH_LOG_DEBUG
,
"%s Running State Change %s
\n
"
,
channel
->
name
,
state_names
[
channel
->
state
]);
channel
->
running_state
=
channel
->
state
;
if
(
channel
->
state
>=
CS_RING
)
{
switch_channel_presence
(
channel
,
"unknown"
,
(
char
*
)
state_names
[
channel
->
state
]);
}
if
(
channel
->
state
<
CS_HANGUP
)
{
switch_event_t
*
event
;
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_CHANNEL_STATE
)
==
SWITCH_STATUS_SUCCESS
)
{
...
...
@@ -601,6 +608,14 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_set_running_state(
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"Channel-State-Number"
,
"%s"
,
(
char
*
)
state_num
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"Channel-Name"
,
"%s"
,
channel
->
name
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"Unique-ID"
,
"%s"
,
switch_core_session_get_uuid
(
channel
->
session
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"Call-Direction"
,
"%s"
,
switch_channel_test_flag
(
channel
,
CF_OUTBOUND
)
?
"outbound"
:
"inbound"
);
if
(
switch_channel_test_flag
(
channel
,
CF_ANSWERED
))
{
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"Answer-State"
,
"confirmed"
);
}
else
if
(
switch_channel_test_flag
(
channel
,
CF_EARLY_MEDIA
))
{
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"Answer-State"
,
"early"
);
}
else
{
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"Answer-State"
,
"ringing"
);
}
}
switch_event_fire
(
&
event
);
}
...
...
@@ -799,9 +814,6 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_set_state(switch_c
if
(
ok
)
{
if
(
state
>
CS_RING
)
{
switch_channel_presence
(
channel
,
"unknown"
,
(
char
*
)
state_names
[
state
]);
}
switch_log_printf
(
SWITCH_CHANNEL_ID_LOG
,
file
,
func
,
line
,
NULL
,
SWITCH_LOG_DEBUG
,
"%s State Change %s -> %s
\n
"
,
channel
->
name
,
state_names
[
last_state
],
state_names
[
state
]);
switch_mutex_lock
(
channel
->
flag_mutex
);
...
...
@@ -858,6 +870,15 @@ SWITCH_DECLARE(void) switch_channel_event_set_data(switch_channel_t *channel, sw
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"Channel-Name"
,
"%s"
,
switch_channel_get_name
(
channel
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"Unique-ID"
,
"%s"
,
switch_core_session_get_uuid
(
channel
->
session
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"Call-Direction"
,
"%s"
,
switch_channel_test_flag
(
channel
,
CF_OUTBOUND
)
?
"outbound"
:
"inbound"
);
if
(
switch_channel_test_flag
(
channel
,
CF_ANSWERED
))
{
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"Answer-State"
,
"answered"
);
}
else
if
(
switch_channel_test_flag
(
channel
,
CF_EARLY_MEDIA
))
{
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"Answer-State"
,
"early"
);
}
else
{
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"Answer-State"
,
"ringing"
);
}
if
((
codec
=
switch_core_session_get_read_codec
(
channel
->
session
))
&&
codec
->
implementation
)
{
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"Channel-Read-Codec-Name"
,
"%s"
,
switch_str_nil
(
codec
->
implementation
->
iananame
));
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"Channel-Read-Codec-Rate"
,
"%u"
,
codec
->
implementation
->
actual_samples_per_second
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论