Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
985a1dbc
提交
985a1dbc
authored
1月 29, 2008
作者:
Michael Jerris
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cleanup
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@7425
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
92f722b5
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
21 行增加
和
39 行删除
+21
-39
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+21
-39
没有找到文件。
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
985a1dbc
...
...
@@ -220,20 +220,18 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session)
switch_core_session_t
*
a_session
;
private_object_t
*
tech_pvt
=
(
private_object_t
*
)
switch_core_session_get_private
(
session
);
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
switch_call_cause_t
cause
;
int
sip_cause
;
switch_call_cause_t
cause
=
switch_channel_get_cause
(
channel
)
;
int
sip_cause
=
hangup_cause_to_sip
(
cause
)
;
if
(
tech_pvt
->
profile
->
rtpip
&&
tech_pvt
->
local_sdp_audio_port
)
{
switch_rtp_release_port
(
tech_pvt
->
profile
->
rtpip
,
tech_pvt
->
local_sdp_audio_port
);
}
cause
=
switch_channel_get_cause
(
channel
);
if
(
switch_test_flag
(
tech_pvt
,
TFLAG_SIP_HOLD
)
&&
cause
!=
SWITCH_CAUSE_ATTENDED_TRANSFER
)
{
const
char
*
buuid
;
switch_core_session_t
*
bsession
;
switch_channel_t
*
bchannel
;
const
char
*
lost_ext
;
switch_core_session_t
*
bsession
;
switch_channel_t
*
bchannel
;
const
char
*
lost_ext
;
if
(
tech_pvt
->
max_missed_packets
)
{
switch_rtp_set_max_missed_packets
(
tech_pvt
->
rtp_session
,
tech_pvt
->
max_missed_packets
);
...
...
@@ -241,39 +239,33 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session)
switch_channel_presence
(
tech_pvt
->
channel
,
"unknown"
,
"unhold"
);
if
((
buuid
=
switch_channel_get_variable
(
channel
,
SWITCH_SIGNAL_BOND_VARIABLE
)))
{
if
((
bsession
=
switch_core_session_locate
(
buuid
)))
{
bchannel
=
switch_core_session_get_channel
(
bsession
);
if
(
switch_channel_test_flag
(
bchannel
,
CF_BROADCAST
))
{
if
((
lost_ext
=
switch_channel_get_variable
(
bchannel
,
"left_hanging_extension"
)))
{
switch_ivr_session_transfer
(
bsession
,
lost_ext
,
NULL
,
NULL
);
}
if
((
bsession
=
switch_core_session_locate
(
buuid
)))
{
bchannel
=
switch_core_session_get_channel
(
bsession
);
if
(
switch_channel_test_flag
(
bchannel
,
CF_BROADCAST
))
{
if
((
lost_ext
=
switch_channel_get_variable
(
bchannel
,
"left_hanging_extension"
)))
{
switch_ivr_session_transfer
(
bsession
,
lost_ext
,
NULL
,
NULL
);
}
switch_channel_stop_broadcast
(
bchannel
);
}
switch_core_session_rwunlock
(
bsession
);
}
}
}
switch_core_session_rwunlock
(
bsession
);
}
}
switch_clear_flag_locked
(
tech_pvt
,
TFLAG_SIP_HOLD
);
}
sip_cause
=
hangup_cause_to_sip
(
cause
);
sofia_glue_deactivate_rtp
(
tech_pvt
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Channel %s hanging up, cause: %s
\n
"
,
switch_channel_get_name
(
channel
),
switch_channel_cause2str
(
cause
));
switch_channel_get_name
(
channel
),
switch_channel_cause2str
(
cause
));
if
(
tech_pvt
->
hash_key
)
{
switch_core_hash_delete
(
tech_pvt
->
profile
->
chat_hash
,
tech_pvt
->
hash_key
);
}
if
(
session
)
{
const
char
*
call_id
=
tech_pvt
->
call_id
;
char
*
sql
;
sql
=
switch_mprintf
(
"delete from sip_dialogs where call_id='%q'"
,
call_id
);
char
*
sql
=
switch_mprintf
(
"delete from sip_dialogs where call_id='%q'"
,
tech_pvt
->
call_id
);
switch_assert
(
sql
);
sofia_glue_execute_sql
(
tech_pvt
->
profile
,
SWITCH_FALSE
,
sql
,
tech_pvt
->
profile
->
ireg_mutex
);
sofia_glue_execute_sql
(
tech_pvt
->
profile
,
SWITCH_FALSE
,
sql
,
tech_pvt
->
profile
->
ireg_mutex
);
free
(
sql
);
}
...
...
@@ -292,10 +284,10 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session)
}
else
{
if
(
switch_test_flag
(
tech_pvt
,
TFLAG_OUTBOUND
))
{
switch_call_cause_t
causecode
=
switch_channel_get_cause
(
channel
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Sending CANCEL to %s
\n
"
,
switch_channel_get_name
(
channel
));
nua_cancel
(
tech_pvt
->
nh
,
TAG_IF
(
causecode
==
SWITCH_CAUSE_PICKED_OFF
,
SIPTAG_REASON_STR
(
"SIP;cause=200;text=
\"
Call completed elsewhere
\"
"
)),
TAG_END
());
SIPTAG_REASON_STR
(
"SIP;cause=200;text=
\"
Call completed elsewhere
\"
"
)),
TAG_END
());
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Responding to INVITE with: %d
\n
"
,
sip_cause
);
nua_respond
(
tech_pvt
->
nh
,
sip_cause
,
sip_status_phrase
(
sip_cause
),
TAG_END
());
...
...
@@ -379,7 +371,6 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
}
}
if
((
val
=
switch_channel_get_variable
(
channel
,
SOFIA_SESSION_TIMEOUT
)))
{
int
v_session_timeout
=
atoi
(
val
);
if
(
v_session_timeout
>=
0
)
{
...
...
@@ -399,8 +390,6 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
return
SWITCH_STATUS_SUCCESS
;
}
static
switch_status_t
sofia_read_video_frame
(
switch_core_session_t
*
session
,
switch_frame_t
**
frame
,
int
timeout
,
switch_io_flag_t
flags
,
int
stream_id
)
{
private_object_t
*
tech_pvt
=
(
private_object_t
*
)
switch_core_session_get_private
(
session
);
...
...
@@ -497,7 +486,6 @@ static switch_status_t sofia_write_video_frame(switch_core_session_t *session, s
return
status
;
}
static
switch_status_t
sofia_read_frame
(
switch_core_session_t
*
session
,
switch_frame_t
**
frame
,
int
timeout
,
switch_io_flag_t
flags
,
int
stream_id
)
{
private_object_t
*
tech_pvt
=
switch_core_session_get_private
(
session
);
...
...
@@ -536,7 +524,6 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f
switch_assert
(
tech_pvt
->
rtp_session
!=
NULL
);
tech_pvt
->
read_frame
.
datalen
=
0
;
while
(
switch_test_flag
(
tech_pvt
,
TFLAG_IO
)
&&
tech_pvt
->
read_frame
.
datalen
==
0
)
{
tech_pvt
->
read_frame
.
flags
=
SFF_NONE
;
...
...
@@ -556,7 +543,6 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f
switch_channel_queue_dtmf
(
channel
,
&
dtmf
);
}
if
(
tech_pvt
->
read_frame
.
datalen
>
0
)
{
size_t
bytes
=
0
;
int
frames
=
1
;
...
...
@@ -636,8 +622,6 @@ static switch_status_t sofia_write_frame(switch_core_session_t *session, switch_
return
status
;
}
static
switch_status_t
sofia_kill_channel
(
switch_core_session_t
*
session
,
int
sig
)
{
private_object_t
*
tech_pvt
=
switch_core_session_get_private
(
session
);
...
...
@@ -694,7 +678,6 @@ static switch_status_t sofia_send_dtmf(switch_core_session_t *session, const swi
case
DTMF_INFO
:
snprintf
(
message
,
sizeof
(
message
),
"Signal=%c
\r\n
Duration=%d
\r\n
"
,
dtmf
->
digit
,
dtmf
->
duration
/
8
);
nua_info
(
tech_pvt
->
nh
,
//NUTAG_WITH_THIS(tech_pvt->profile->nua),
SIPTAG_CONTENT_TYPE_STR
(
"application/dtmf-relay"
),
SIPTAG_PAYLOAD_STR
(
message
),
TAG_END
());
...
...
@@ -1542,7 +1525,6 @@ static switch_status_t sofia_manage(char *relative_oid, switch_management_action
return
SWITCH_STATUS_SUCCESS
;
}
static
switch_call_cause_t
sofia_outgoing_channel
(
switch_core_session_t
*
session
,
switch_caller_profile_t
*
outbound_profile
,
switch_core_session_t
**
new_session
,
switch_memory_pool_t
**
pool
,
switch_originate_flag_t
flags
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论