Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
98473085
提交
98473085
authored
7月 31, 2011
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add homer capture hooks to mod_sofia
上级
3e029f0d
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
72 行增加
和
2 行删除
+72
-2
sofia.conf.xml
conf/autoload_configs/sofia.conf.xml
+1
-0
external.xml
conf/sip_profiles/external.xml
+1
-0
internal.xml
conf/sip_profiles/internal.xml
+2
-1
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+27
-1
mod_sofia.h
src/mod/endpoints/mod_sofia/mod_sofia.h
+3
-0
sofia.c
src/mod/endpoints/mod_sofia/sofia.c
+17
-0
sofia_glue.c
src/mod/endpoints/mod_sofia/sofia_glue.c
+21
-0
没有找到文件。
conf/autoload_configs/sofia.conf.xml
浏览文件 @
98473085
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
<param
name=
"log-level"
value=
"0"
/>
<param
name=
"log-level"
value=
"0"
/>
<!-- <param name="auto-restart" value="false"/> -->
<!-- <param name="auto-restart" value="false"/> -->
<param
name=
"debug-presence"
value=
"0"
/>
<param
name=
"debug-presence"
value=
"0"
/>
<!-- <param name="capture-server" value="udp:homer.domain.com:5060"/> -->
</global_settings>
</global_settings>
<!--
<!--
...
...
conf/sip_profiles/external.xml
浏览文件 @
98473085
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
<!-- If you want FreeSWITCH to shutdown if this profile fails to load, uncomment the next line. -->
<!-- If you want FreeSWITCH to shutdown if this profile fails to load, uncomment the next line. -->
<!-- <param name="shutdown-on-fail" value="true"/> -->
<!-- <param name="shutdown-on-fail" value="true"/> -->
<param
name=
"sip-trace"
value=
"no"
/>
<param
name=
"sip-trace"
value=
"no"
/>
<param
name=
"sip-capture"
value=
"no"
/>
<param
name=
"rfc2833-pt"
value=
"101"
/>
<param
name=
"rfc2833-pt"
value=
"101"
/>
<param
name=
"sip-port"
value=
"$${external_sip_port}"
/>
<param
name=
"sip-port"
value=
"$${external_sip_port}"
/>
<param
name=
"dialplan"
value=
"XML"
/>
<param
name=
"dialplan"
value=
"XML"
/>
...
...
conf/sip_profiles/internal.xml
浏览文件 @
98473085
...
@@ -42,7 +42,8 @@
...
@@ -42,7 +42,8 @@
<!-- If you want FreeSWITCH to shutdown if this profile fails to load, uncomment the next line. -->
<!-- If you want FreeSWITCH to shutdown if this profile fails to load, uncomment the next line. -->
<!-- <param name="shutdown-on-fail" value="true"/> -->
<!-- <param name="shutdown-on-fail" value="true"/> -->
<param
name=
"sip-trace"
value=
"no"
/>
<param
name=
"sip-trace"
value=
"no"
/>
<param
name=
"sip-capture"
value=
"no"
/>
<!-- Don't be picky about negotiated DTMF just always offer 2833 and accept both 2833 and INFO -->
<!-- Don't be picky about negotiated DTMF just always offer 2833 and accept both 2833 and INFO -->
<!--<param name="liberal-dtmf" value="true"/>-->
<!--<param name="liberal-dtmf" value="true"/>-->
...
...
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
98473085
...
@@ -3434,6 +3434,17 @@ static switch_status_t cmd_profile(char **argv, int argc, switch_stream_handle_t
...
@@ -3434,6 +3434,17 @@ static switch_status_t cmd_profile(char **argv, int argc, switch_stream_handle_t
goto
done
;
goto
done
;
}
}
if
(
!
strcasecmp
(
argv
[
1
],
"capture"
))
{
if
(
argc
>
2
)
{
int
value
=
switch_true
(
argv
[
2
]);
nua_set_params
(
profile
->
nua
,
TPTAG_CAPT
(
value
?
mod_sofia_globals
.
capture_server
:
NULL
),
TAG_END
());
stream
->
write_function
(
stream
,
"%s sip capturing on %s"
,
value
?
"Enabled"
:
"Disabled"
,
profile
->
name
);
}
else
{
stream
->
write_function
(
stream
,
"Usage: sofia profile <name> capture <on/off>
\n
"
);
}
goto
done
;
}
if
(
!
strcasecmp
(
argv
[
1
],
"watchdog"
))
{
if
(
!
strcasecmp
(
argv
[
1
],
"watchdog"
))
{
if
(
argc
>
2
)
{
if
(
argc
>
2
)
{
int
value
=
switch_true
(
argv
[
2
]);
int
value
=
switch_true
(
argv
[
2
]);
...
@@ -3898,6 +3909,7 @@ SWITCH_STANDARD_API(sofia_function)
...
@@ -3898,6 +3909,7 @@ SWITCH_STANDARD_API(sofia_function)
static
const
char
usage_string
[]
=
"USAGE:
\n
"
static
const
char
usage_string
[]
=
"USAGE:
\n
"
"--------------------------------------------------------------------------------
\n
"
"--------------------------------------------------------------------------------
\n
"
"sofia global siptrace <on|off>
\n
"
"sofia global siptrace <on|off>
\n
"
"sofia capture <on|off>
\n
"
" watchdog <on|off>
\n\n
"
" watchdog <on|off>
\n\n
"
"sofia profile <name> [start | stop | restart | rescan]
\n
"
"sofia profile <name> [start | stop | restart | rescan]
\n
"
" flush_inbound_reg [<call_id> | <[user]@domain>] [reboot]
\n
"
" flush_inbound_reg [<call_id> | <[user]@domain>] [reboot]
\n
"
...
@@ -3906,6 +3918,7 @@ SWITCH_STANDARD_API(sofia_function)
...
@@ -3906,6 +3918,7 @@ SWITCH_STANDARD_API(sofia_function)
" killgw <gateway name>
\n
"
" killgw <gateway name>
\n
"
" [stun-auto-disable | stun-enabled] [true | false]]
\n
"
" [stun-auto-disable | stun-enabled] [true | false]]
\n
"
" siptrace <on|off>
\n
"
" siptrace <on|off>
\n
"
" capture <on|off>
\n
"
" watchdog <on|off>
\n\n
"
" watchdog <on|off>
\n\n
"
"sofia <status|xmlstatus> profile <name> [reg <contact str>] | [pres <pres str>] | [user <user@domain>]
\n
"
"sofia <status|xmlstatus> profile <name> [reg <contact str>] | [pres <pres str>] | [user <user@domain>]
\n
"
"sofia <status|xmlstatus> gateway <name>
\n\n
"
"sofia <status|xmlstatus> gateway <name>
\n\n
"
...
@@ -3965,6 +3978,7 @@ SWITCH_STANDARD_API(sofia_function)
...
@@ -3965,6 +3978,7 @@ SWITCH_STANDARD_API(sofia_function)
goto
done
;
goto
done
;
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"global"
))
{
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"global"
))
{
int
ston
=
-
1
;
int
ston
=
-
1
;
int
cton
=
-
1
;
int
wdon
=
-
1
;
int
wdon
=
-
1
;
if
(
argc
>
1
)
{
if
(
argc
>
1
)
{
...
@@ -4001,6 +4015,12 @@ SWITCH_STANDARD_API(sofia_function)
...
@@ -4001,6 +4015,12 @@ SWITCH_STANDARD_API(sofia_function)
}
}
}
}
if
(
!
strcasecmp
(
argv
[
1
],
"capture"
))
{
if
(
argc
>
2
)
{
cton
=
switch_true
(
argv
[
2
]);
}
}
if
(
!
strcasecmp
(
argv
[
1
],
"watchdog"
))
{
if
(
!
strcasecmp
(
argv
[
1
],
"watchdog"
))
{
if
(
argc
>
2
)
{
if
(
argc
>
2
)
{
wdon
=
switch_true
(
argv
[
2
]);
wdon
=
switch_true
(
argv
[
2
]);
...
@@ -4011,11 +4031,14 @@ SWITCH_STANDARD_API(sofia_function)
...
@@ -4011,11 +4031,14 @@ SWITCH_STANDARD_API(sofia_function)
if
(
ston
!=
-
1
)
{
if
(
ston
!=
-
1
)
{
sofia_glue_global_siptrace
(
ston
);
sofia_glue_global_siptrace
(
ston
);
stream
->
write_function
(
stream
,
"+OK Global siptrace %s"
,
ston
?
"on"
:
"off"
);
stream
->
write_function
(
stream
,
"+OK Global siptrace %s"
,
ston
?
"on"
:
"off"
);
}
else
if
(
cton
!=
-
1
)
{
sofia_glue_global_capture
(
cton
);
stream
->
write_function
(
stream
,
"+OK Global capture %s"
,
cton
?
"on"
:
"off"
);
}
else
if
(
wdon
!=
-
1
)
{
}
else
if
(
wdon
!=
-
1
)
{
sofia_glue_global_watchdog
(
wdon
);
sofia_glue_global_watchdog
(
wdon
);
stream
->
write_function
(
stream
,
"+OK Global watchdog %s"
,
wdon
?
"on"
:
"off"
);
stream
->
write_function
(
stream
,
"+OK Global watchdog %s"
,
wdon
?
"on"
:
"off"
);
}
else
{
}
else
{
stream
->
write_function
(
stream
,
"-ERR Usage: siptrace <on|off>|watchdog <on|off>|debug <sla|presence|none"
);
stream
->
write_function
(
stream
,
"-ERR Usage: siptrace <on|off>|
capture <on|off>|
watchdog <on|off>|debug <sla|presence|none"
);
}
}
goto
done
;
goto
done
;
...
@@ -5208,6 +5231,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load)
...
@@ -5208,6 +5231,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load)
switch_console_set_complete
(
"add sofia tracelevel ::[console:alert:crit:err:warning:notice:info:debug"
);
switch_console_set_complete
(
"add sofia tracelevel ::[console:alert:crit:err:warning:notice:info:debug"
);
switch_console_set_complete
(
"add sofia global siptrace ::[on:off"
);
switch_console_set_complete
(
"add sofia global siptrace ::[on:off"
);
switch_console_set_complete
(
"add sofia global capture ::[on:off"
);
switch_console_set_complete
(
"add sofia global watchdog ::[on:off"
);
switch_console_set_complete
(
"add sofia global watchdog ::[on:off"
);
switch_console_set_complete
(
"add sofia global debug ::[presence:sla:none"
);
switch_console_set_complete
(
"add sofia global debug ::[presence:sla:none"
);
...
@@ -5228,6 +5252,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load)
...
@@ -5228,6 +5252,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load)
switch_console_set_complete
(
"add sofia profile ::sofia::list_profiles killgw ::sofia::list_profile_gateway"
);
switch_console_set_complete
(
"add sofia profile ::sofia::list_profiles killgw ::sofia::list_profile_gateway"
);
switch_console_set_complete
(
"add sofia profile ::sofia::list_profiles siptrace on"
);
switch_console_set_complete
(
"add sofia profile ::sofia::list_profiles siptrace on"
);
switch_console_set_complete
(
"add sofia profile ::sofia::list_profiles siptrace off"
);
switch_console_set_complete
(
"add sofia profile ::sofia::list_profiles siptrace off"
);
switch_console_set_complete
(
"add sofia profile ::sofia::list_profiles capture on"
);
switch_console_set_complete
(
"add sofia profile ::sofia::list_profiles capture off"
);
switch_console_set_complete
(
"add sofia profile ::sofia::list_profiles watchdog on"
);
switch_console_set_complete
(
"add sofia profile ::sofia::list_profiles watchdog on"
);
switch_console_set_complete
(
"add sofia profile ::sofia::list_profiles watchdog off"
);
switch_console_set_complete
(
"add sofia profile ::sofia::list_profiles watchdog off"
);
...
...
src/mod/endpoints/mod_sofia/mod_sofia.h
浏览文件 @
98473085
...
@@ -315,6 +315,7 @@ typedef enum {
...
@@ -315,6 +315,7 @@ typedef enum {
TFLAG_NOREPLY
,
TFLAG_NOREPLY
,
TFLAG_LIBERAL_DTMF
,
TFLAG_LIBERAL_DTMF
,
TFLAG_GOT_ACK
,
TFLAG_GOT_ACK
,
TFLAG_CAPTURE
,
/* No new flags below this line */
/* No new flags below this line */
TFLAG_MAX
TFLAG_MAX
}
TFLAGS
;
}
TFLAGS
;
...
@@ -354,6 +355,7 @@ struct mod_sofia_globals {
...
@@ -354,6 +355,7 @@ struct mod_sofia_globals {
int
auto_restart
;
int
auto_restart
;
int
auto_nat
;
int
auto_nat
;
int
tracelevel
;
int
tracelevel
;
char
*
capture_server
;
int
rewrite_multicasted_fs_path
;
int
rewrite_multicasted_fs_path
;
};
};
extern
struct
mod_sofia_globals
mod_sofia_globals
;
extern
struct
mod_sofia_globals
mod_sofia_globals
;
...
@@ -1115,6 +1117,7 @@ void sofia_glue_tech_simplify(private_object_t *tech_pvt);
...
@@ -1115,6 +1117,7 @@ void sofia_glue_tech_simplify(private_object_t *tech_pvt);
switch_console_callback_match_t
*
sofia_reg_find_reg_url_multi
(
sofia_profile_t
*
profile
,
const
char
*
user
,
const
char
*
host
);
switch_console_callback_match_t
*
sofia_reg_find_reg_url_multi
(
sofia_profile_t
*
profile
,
const
char
*
user
,
const
char
*
host
);
switch_bool_t
sofia_glue_profile_exists
(
const
char
*
key
);
switch_bool_t
sofia_glue_profile_exists
(
const
char
*
key
);
void
sofia_glue_global_siptrace
(
switch_bool_t
on
);
void
sofia_glue_global_siptrace
(
switch_bool_t
on
);
void
sofia_glue_global_capture
(
switch_bool_t
on
);
void
sofia_glue_global_watchdog
(
switch_bool_t
on
);
void
sofia_glue_global_watchdog
(
switch_bool_t
on
);
void
sofia_glue_proxy_codec
(
switch_core_session_t
*
session
,
const
char
*
r_sdp
);
void
sofia_glue_proxy_codec
(
switch_core_session_t
*
session
,
const
char
*
r_sdp
);
switch_status_t
sofia_glue_sdp_map
(
const
char
*
r_sdp
,
switch_event_t
**
fmtp
,
switch_event_t
**
pt
);
switch_status_t
sofia_glue_sdp_map
(
const
char
*
r_sdp
,
switch_event_t
**
fmtp
,
switch_event_t
**
pt
);
...
...
src/mod/endpoints/mod_sofia/sofia.c
浏览文件 @
98473085
...
@@ -1793,6 +1793,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
...
@@ -1793,6 +1793,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
NTATAG_SERVER_RPORT
(
profile
->
server_rport_level
),
NTATAG_SERVER_RPORT
(
profile
->
server_rport_level
),
NTATAG_CLIENT_RPORT
(
profile
->
client_rport_level
),
NTATAG_CLIENT_RPORT
(
profile
->
client_rport_level
),
TPTAG_LOG
(
sofia_test_flag
(
profile
,
TFLAG_TPORT_LOG
)),
TPTAG_LOG
(
sofia_test_flag
(
profile
,
TFLAG_TPORT_LOG
)),
TPTAG_CAPT
(
sofia_test_flag
(
profile
,
TFLAG_CAPTURE
)
?
mod_sofia_globals
.
capture_server
:
NULL
),
TAG_IF
(
sofia_test_pflag
(
profile
,
PFLAG_SIPCOMPACT
),
TAG_IF
(
sofia_test_pflag
(
profile
,
PFLAG_SIPCOMPACT
),
NTATAG_SIPFLAGS
(
MSG_DO_COMPACT
)),
NTATAG_SIPFLAGS
(
MSG_DO_COMPACT
)),
TAG_IF
(
profile
->
timer_t1
,
NTATAG_SIP_T1
(
profile
->
timer_t1
)),
TAG_IF
(
profile
->
timer_t1
,
NTATAG_SIP_T1
(
profile
->
timer_t1
)),
...
@@ -2713,6 +2714,9 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
...
@@ -2713,6 +2714,9 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
mod_sofia_globals
.
rewrite_multicasted_fs_path
=
SWITCH_FALSE
;
mod_sofia_globals
.
rewrite_multicasted_fs_path
=
SWITCH_FALSE
;
}
}
}
}
else
if
(
!
strcasecmp
(
var
,
"capture-server"
))
{
mod_sofia_globals
.
capture_server
=
switch_core_strdup
(
mod_sofia_globals
.
pool
,
val
);
}
}
}
}
}
...
@@ -2791,6 +2795,13 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
...
@@ -2791,6 +2795,13 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
sofia_clear_flag
(
profile
,
TFLAG_TPORT_LOG
);
sofia_clear_flag
(
profile
,
TFLAG_TPORT_LOG
);
}
}
nua_set_params
(
profile
->
nua
,
TPTAG_LOG
(
sofia_test_flag
(
profile
,
TFLAG_TPORT_LOG
)),
TAG_END
());
nua_set_params
(
profile
->
nua
,
TPTAG_LOG
(
sofia_test_flag
(
profile
,
TFLAG_TPORT_LOG
)),
TAG_END
());
}
else
if
(
!
strcasecmp
(
var
,
"sip-capture"
))
{
if
(
switch_true
(
val
))
{
sofia_set_flag
(
profile
,
TFLAG_CAPTURE
);
}
else
{
sofia_clear_flag
(
profile
,
TFLAG_CAPTURE
);
}
nua_set_params
(
profile
->
nua
,
TPTAG_CAPT
(
sofia_test_flag
(
profile
,
TFLAG_CAPTURE
)
?
mod_sofia_globals
.
capture_server
:
NULL
),
TAG_END
());
}
else
if
(
!
strcasecmp
(
var
,
"send-message-query-on-register"
))
{
}
else
if
(
!
strcasecmp
(
var
,
"send-message-query-on-register"
))
{
if
(
switch_true
(
val
))
{
if
(
switch_true
(
val
))
{
sofia_set_pflag
(
profile
,
PFLAG_MESSAGE_QUERY_ON_REGISTER
);
sofia_set_pflag
(
profile
,
PFLAG_MESSAGE_QUERY_ON_REGISTER
);
...
@@ -3394,6 +3405,9 @@ switch_status_t config_sofia(int reload, char *profile_name)
...
@@ -3394,6 +3405,9 @@ switch_status_t config_sofia(int reload, char *profile_name)
mod_sofia_globals
.
rewrite_multicasted_fs_path
=
SWITCH_FALSE
;
mod_sofia_globals
.
rewrite_multicasted_fs_path
=
SWITCH_FALSE
;
}
}
}
}
else
if
(
!
strcasecmp
(
var
,
"capture-server"
))
{
mod_sofia_globals
.
capture_server
=
switch_core_strdup
(
mod_sofia_globals
.
pool
,
val
);
}
}
}
}
}
...
@@ -3485,6 +3499,9 @@ switch_status_t config_sofia(int reload, char *profile_name)
...
@@ -3485,6 +3499,9 @@ switch_status_t config_sofia(int reload, char *profile_name)
profile
->
shutdown_type
=
switch_core_strdup
(
profile
->
pool
,
val
);
profile
->
shutdown_type
=
switch_core_strdup
(
profile
->
pool
,
val
);
}
else
if
(
!
strcasecmp
(
var
,
"sip-trace"
)
&&
switch_true
(
val
))
{
}
else
if
(
!
strcasecmp
(
var
,
"sip-trace"
)
&&
switch_true
(
val
))
{
sofia_set_flag
(
profile
,
TFLAG_TPORT_LOG
);
sofia_set_flag
(
profile
,
TFLAG_TPORT_LOG
);
}
else
if
(
!
strcasecmp
(
var
,
"sip-capture"
)
&&
switch_true
(
val
))
{
sofia_set_flag
(
profile
,
TFLAG_CAPTURE
);
nua_set_params
(
profile
->
nua
,
TPTAG_CAPT
(
mod_sofia_globals
.
capture_server
),
TAG_END
());
}
else
if
(
!
strcasecmp
(
var
,
"odbc-dsn"
)
&&
!
zstr
(
val
))
{
}
else
if
(
!
strcasecmp
(
var
,
"odbc-dsn"
)
&&
!
zstr
(
val
))
{
if
(
switch_odbc_available
())
{
if
(
switch_odbc_available
())
{
profile
->
odbc_dsn
=
switch_core_strdup
(
profile
->
pool
,
val
);
profile
->
odbc_dsn
=
switch_core_strdup
(
profile
->
pool
,
val
);
...
...
src/mod/endpoints/mod_sofia/sofia_glue.c
浏览文件 @
98473085
...
@@ -5240,6 +5240,27 @@ void sofia_glue_global_siptrace(switch_bool_t on)
...
@@ -5240,6 +5240,27 @@ void sofia_glue_global_siptrace(switch_bool_t on)
}
}
void
sofia_glue_global_capture
(
switch_bool_t
on
)
{
switch_hash_index_t
*
hi
;
const
void
*
var
;
void
*
val
;
sofia_profile_t
*
pptr
;
switch_mutex_lock
(
mod_sofia_globals
.
hash_mutex
);
if
(
mod_sofia_globals
.
profile_hash
)
{
for
(
hi
=
switch_hash_first
(
NULL
,
mod_sofia_globals
.
profile_hash
);
hi
;
hi
=
switch_hash_next
(
hi
))
{
switch_hash_this
(
hi
,
&
var
,
NULL
,
&
val
);
if
((
pptr
=
(
sofia_profile_t
*
)
val
))
{
nua_set_params
(
pptr
->
nua
,
TPTAG_CAPT
(
on
?
mod_sofia_globals
.
capture_server
:
NULL
),
TAG_END
());
}
}
}
switch_mutex_unlock
(
mod_sofia_globals
.
hash_mutex
);
}
void
sofia_glue_global_watchdog
(
switch_bool_t
on
)
void
sofia_glue_global_watchdog
(
switch_bool_t
on
)
{
{
switch_hash_index_t
*
hi
;
switch_hash_index_t
*
hi
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论