Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
b837c1f4
提交
b837c1f4
authored
4月 27, 2010
作者:
David Yat Sin
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of git@git.freeswitch.org:freeswitch
上级
b135ef37
19dca2e3
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
119 行增加
和
29 行删除
+119
-29
.gitignore
.gitignore
+5
-0
switch.conf.xml
conf/autoload_configs/switch.conf.xml
+2
-0
freeswitch.spec
freeswitch.spec
+1
-1
switch_types.h
src/include/switch_types.h
+4
-2
mod_commands.c
src/mod/applications/mod_commands/mod_commands.c
+10
-0
sofia.c
src/mod/endpoints/mod_sofia/sofia.c
+21
-1
sofia_presence.c
src/mod/endpoints/mod_sofia/sofia_presence.c
+5
-0
sofia_reg.c
src/mod/endpoints/mod_sofia/sofia_reg.c
+5
-0
switch_caller.c
src/switch_caller.c
+8
-0
switch_channel.c
src/switch_channel.c
+4
-2
switch_core.c
src/switch_core.c
+54
-23
没有找到文件。
.gitignore
浏览文件 @
b837c1f4
...
...
@@ -87,3 +87,8 @@ src/mod/say/mod_say_nl/Makefile
src/mod/say/mod_say_th/Makefile
src/mod/say/mod_say_zh/Makefile
libs/curl/lib/ca-bundle.h
libs/g729/
src/mod/codecs/mod_com_g729/
src/mod/languages/mod_lua/mod_lua_wrap.cpp.orig
src/mod/languages/mod_perl/mod_perl_wrap.cpp.orig
src/mod/languages/mod_python/mod_python_wrap.cpp.orig
conf/autoload_configs/switch.conf.xml
浏览文件 @
b837c1f4
...
...
@@ -72,6 +72,8 @@
<param
name=
"mailer-app"
value=
"sendmail"
/>
<param
name=
"mailer-app-args"
value=
"-t"
/>
<param
name=
"dump-cores"
value=
"yes"
/>
<!-- enable verbose-channel-events to dump every detail about a channel on every event -->
<!--<param name="verbose-channel-events" value="no"/>-->
<!--RTP port range -->
<!--<param name="rtp-start-port" value="16384"/>-->
<!--<param name="rtp-end-port" value="32768"/>-->
...
...
freeswitch.spec
浏览文件 @
b837c1f4
...
...
@@ -616,7 +616,7 @@ fi
%config(noreplace) %attr(0640, freeswitch, daemon) %{prefix}/conf/lang/ru/dir/*.xml
%changelog
* Fr Apr 23 2010 - michal.bielicki@seventhsignal.de
* Fr
i
Apr 23 2010 - michal.bielicki@seventhsignal.de
- bumped spec file vrersion up to 1.0.7-trunk for trunk
- added skinny dialplan stuff to specfile
* Sun Mar 28 2010 - michal.bielicki@seventhsignal.de
...
...
src/include/switch_types.h
浏览文件 @
b837c1f4
...
...
@@ -248,7 +248,8 @@ typedef enum {
SCF_EARLY_HANGUP
=
(
1
<<
7
),
SCF_CALIBRATE_CLOCK
=
(
1
<<
8
),
SCF_USE_HEAVY_TIMING
=
(
1
<<
9
),
SCF_USE_CLOCK_RT
=
(
1
<<
10
)
SCF_USE_CLOCK_RT
=
(
1
<<
10
),
SCF_VERBOSE_EVENTS
=
(
1
<<
11
)
}
switch_core_flag_enum_t
;
typedef
uint32_t
switch_core_flag_t
;
...
...
@@ -1494,7 +1495,8 @@ typedef enum {
SCSC_CALIBRATE_CLOCK
,
SCSC_SAVE_HISTORY
,
SCSC_CRASH
,
SCSC_MIN_IDLE_CPU
SCSC_MIN_IDLE_CPU
,
SCSC_VERBOSE_EVENTS
}
switch_session_ctl_t
;
typedef
enum
{
...
...
src/mod/applications/mod_commands/mod_commands.c
浏览文件 @
b837c1f4
...
...
@@ -1500,6 +1500,16 @@ SWITCH_STANDARD_API(ctl_function)
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"crash"
))
{
switch_core_session_ctl
(
SCSC_CRASH
,
NULL
);
stream
->
write_function
(
stream
,
"+OK
\n
"
);
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"verbose_events"
))
{
arg
=
-
1
;
if
(
argv
[
1
])
{
arg
=
switch_true
(
argv
[
1
]);
}
switch_core_session_ctl
(
SCSC_VERBOSE_EVENTS
,
&
arg
);
stream
->
write_function
(
stream
,
"+OK verbose_events is %s
\n
"
,
arg
?
"on"
:
"off"
);
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"save_history"
))
{
switch_core_session_ctl
(
SCSC_SAVE_HISTORY
,
NULL
);
stream
->
write_function
(
stream
,
"+OK
\n
"
);
...
...
src/mod/endpoints/mod_sofia/sofia.c
浏览文件 @
b837c1f4
...
...
@@ -6433,12 +6433,18 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
if
(
uuid
)
{
switch_core_session_t
*
c_session
=
NULL
;
int
do_conf
=
0
;
const
char
*
c_app
=
NULL
;
const
char
*
c_data
=
NULL
;
uuid
=
switch_core_session_strdup
(
b_session
,
uuid
);
if
((
c_session
=
switch_core_session_locate
(
uuid
)))
{
switch_channel_t
*
c_channel
=
switch_core_session_get_channel
(
c_session
);
private_object_t
*
c_tech_pvt
=
NULL
;
c_app
=
switch_channel_get_variable
(
c_channel
,
SWITCH_CURRENT_APPLICATION_VARIABLE
);
c_data
=
switch_channel_get_variable
(
c_channel
,
SWITCH_CURRENT_APPLICATION_DATA_VARIABLE
);
if
(
switch_core_session_check_interface
(
c_session
,
sofia_endpoint_interface
))
{
c_tech_pvt
=
switch_core_session_get_private
(
c_session
);
}
...
...
@@ -6461,7 +6467,21 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
if
(
do_conf
)
{
destination_number
=
switch_core_session_sprintf
(
b_session
,
"answer,conference:%s@sla+flags{mintwo}"
,
uuid
);
}
else
{
destination_number
=
switch_core_session_sprintf
(
b_session
,
"answer,intercept:%s"
,
uuid
);
if
(
one_leg
&&
c_app
)
{
if
(
c_data
)
{
destination_number
=
switch_core_session_sprintf
(
b_session
,
"answer,%s:%s"
,
c_app
,
c_data
);
}
else
{
destination_number
=
switch_core_session_sprintf
(
b_session
,
"answer,%s"
,
c_app
);
}
}
else
{
destination_number
=
switch_core_session_sprintf
(
b_session
,
"answer,intercept:%s"
,
uuid
);
if
((
c_session
=
switch_core_session_locate
(
uuid
)))
{
switch_channel_t
*
c_channel
=
switch_core_session_get_channel
(
c_session
);
switch_channel_hangup
(
c_channel
,
SWITCH_CAUSE_ATTENDED_TRANSFER
);
switch_core_session_rwunlock
(
c_session
);
}
}
}
dialplan
=
"inline"
;
...
...
src/mod/endpoints/mod_sofia/sofia_presence.c
浏览文件 @
b837c1f4
...
...
@@ -1751,6 +1751,11 @@ void sofia_presence_handle_sip_i_subscribe(int status,
}
}
if
(
!
is_nat
&&
sip
&&
sip
->
sip_via
&&
sip
->
sip_via
->
v_port
&&
atoi
(
sip
->
sip_via
->
v_port
)
==
5060
&&
network_port
!=
5060
)
{
is_nat
=
"via port"
;
}
if
(
!
is_nat
&&
profile
->
nat_acl_count
)
{
uint32_t
x
=
0
;
int
ok
=
1
;
...
...
src/mod/endpoints/mod_sofia/sofia_reg.c
浏览文件 @
b837c1f4
...
...
@@ -1364,6 +1364,11 @@ void sofia_reg_handle_sip_i_register(nua_t *nua, sofia_profile_t *profile, nua_h
}
}
if
(
!
is_nat
&&
sip
&&
sip
->
sip_via
&&
sip
->
sip_via
->
v_port
&&
atoi
(
sip
->
sip_via
->
v_port
)
==
5060
&&
network_port
!=
5060
)
{
is_nat
=
"via port"
;
}
if
(
!
is_nat
&&
profile
->
nat_acl_count
)
{
uint32_t
x
=
0
;
int
ok
=
1
;
...
...
src/switch_caller.c
浏览文件 @
b837c1f4
...
...
@@ -271,6 +271,14 @@ SWITCH_DECLARE(void) switch_caller_profile_event_set_data(switch_caller_profile_
switch_snprintf
(
header_name
,
sizeof
(
header_name
),
"%s-Caller-ID-Number"
,
prefix
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
header_name
,
caller_profile
->
caller_id_number
);
}
if
(
!
zstr
(
caller_profile
->
callee_id_name
))
{
switch_snprintf
(
header_name
,
sizeof
(
header_name
),
"%s-Callee-ID-Name"
,
prefix
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
header_name
,
caller_profile
->
callee_id_name
);
}
if
(
!
zstr
(
caller_profile
->
callee_id_number
))
{
switch_snprintf
(
header_name
,
sizeof
(
header_name
),
"%s-Callee-ID-Number"
,
prefix
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
header_name
,
caller_profile
->
callee_id_number
);
}
if
(
!
zstr
(
caller_profile
->
network_addr
))
{
switch_snprintf
(
header_name
,
sizeof
(
header_name
),
"%s-Network-Addr"
,
prefix
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
header_name
,
caller_profile
->
network_addr
);
...
...
src/switch_channel.c
浏览文件 @
b837c1f4
...
...
@@ -1677,11 +1677,13 @@ SWITCH_DECLARE(void) switch_channel_event_set_basic_data(switch_channel_t *chann
SWITCH_DECLARE
(
void
)
switch_channel_event_set_extended_data
(
switch_channel_t
*
channel
,
switch_event_t
*
event
)
{
switch_event_header_t
*
hi
;
int
x
;
int
x
,
global_verbos_events
=
0
;
switch_mutex_lock
(
channel
->
profile_mutex
);
if
(
switch_channel_test_flag
(
channel
,
CF_VERBOSE_EVENTS
)
||
switch_core_session_ctl
(
SCSC_VERBOSE_EVENTS
,
&
global_verbos_events
);
if
(
global_verbos_events
||
switch_channel_test_flag
(
channel
,
CF_VERBOSE_EVENTS
)
||
event
->
event_id
==
SWITCH_EVENT_CHANNEL_CREATE
||
event
->
event_id
==
SWITCH_EVENT_CHANNEL_ORIGINATE
||
event
->
event_id
==
SWITCH_EVENT_CHANNEL_UUID
||
...
...
src/switch_core.c
浏览文件 @
b837c1f4
...
...
@@ -1448,6 +1448,13 @@ static void switch_load_core_config(const char *file)
switch_time_set_matrix
(
switch_true
(
var
));
}
else
if
(
!
strcasecmp
(
var
,
"max-sessions"
)
&&
!
zstr
(
val
))
{
switch_core_session_limit
(
atoi
(
val
));
}
else
if
(
!
strcasecmp
(
var
,
"verbose-channel-events"
)
&&
!
zstr
(
val
))
{
int
v
=
switch_true
(
val
);
if
(
v
)
{
switch_set_flag
((
&
runtime
),
SCF_VERBOSE_EVENTS
);
}
else
{
switch_clear_flag
((
&
runtime
),
SCF_VERBOSE_EVENTS
);
}
}
else
if
(
!
strcasecmp
(
var
,
"min-idle-cpu"
)
&&
!
zstr
(
val
))
{
switch_core_min_idle_cpu
(
atof
(
val
));
}
else
if
(
!
strcasecmp
(
var
,
"tipping-point"
)
&&
!
zstr
(
val
))
{
...
...
@@ -1639,12 +1646,29 @@ SWITCH_DECLARE(uint32_t) switch_core_debug_level(void)
SWITCH_DECLARE
(
int32_t
)
switch_core_session_ctl
(
switch_session_ctl_t
cmd
,
void
*
val
)
{
int
*
intval
=
(
int
*
)
val
;
int
oldintval
=
0
,
newintval
=
0
;
if
(
intval
)
{
oldintval
=
*
intval
;
}
if
(
switch_test_flag
((
&
runtime
),
SCF_SHUTTING_DOWN
))
{
return
-
1
;
}
switch
(
cmd
)
{
case
SCSC_VERBOSE_EVENTS
:
if
(
intval
)
{
if
(
oldintval
>
-
1
)
{
if
(
oldintval
)
{
switch_set_flag
((
&
runtime
),
SCF_VERBOSE_EVENTS
);
}
else
{
switch_clear_flag
((
&
runtime
),
SCF_VERBOSE_EVENTS
);
}
}
newintval
=
switch_test_flag
((
&
runtime
),
SCF_VERBOSE_EVENTS
);
}
break
;
case
SCSC_CALIBRATE_CLOCK
:
switch_time_calibrate_clock
();
break
;
...
...
@@ -1656,10 +1680,10 @@ SWITCH_DECLARE(int32_t) switch_core_session_ctl(switch_session_ctl_t cmd, void *
break
;
case
SCSC_SYNC_CLOCK
:
switch_time_sync
();
*
intval
=
0
;
new
intval
=
0
;
break
;
case
SCSC_PAUSE_INBOUND
:
if
(
*
intval
)
{
if
(
old
intval
)
{
switch_set_flag
((
&
runtime
),
SCF_NO_NEW_SESSIONS
);
}
else
{
switch_clear_flag
((
&
runtime
),
SCF_NO_NEW_SESSIONS
);
...
...
@@ -1710,7 +1734,7 @@ SWITCH_DECLARE(int32_t) switch_core_session_ctl(switch_session_ctl_t cmd, void *
win_shutdown
();
#endif
if
(
*
intval
)
{
if
(
old
intval
)
{
switch_set_flag
((
&
runtime
),
SCF_RESTART
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Restarting
\n
"
);
}
else
{
...
...
@@ -1732,7 +1756,7 @@ SWITCH_DECLARE(int32_t) switch_core_session_ctl(switch_session_ctl_t cmd, void *
win_shutdown
();
#endif
if
(
*
intval
)
{
if
(
old
intval
)
{
switch_set_flag
((
&
runtime
),
SCF_RESTART
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Restarting
\n
"
);
}
else
{
...
...
@@ -1744,62 +1768,69 @@ SWITCH_DECLARE(int32_t) switch_core_session_ctl(switch_session_ctl_t cmd, void *
runtime
.
running
=
0
;
break
;
case
SCSC_CHECK_RUNNING
:
*
intval
=
runtime
.
running
;
new
intval
=
runtime
.
running
;
break
;
case
SCSC_LOGLEVEL
:
if
(
*
intval
>
-
1
)
{
runtime
.
hard_log_level
=
*
intval
;
if
(
old
intval
>
-
1
)
{
runtime
.
hard_log_level
=
old
intval
;
}
if
(
runtime
.
hard_log_level
>
SWITCH_LOG_DEBUG
)
{
runtime
.
hard_log_level
=
SWITCH_LOG_DEBUG
;
}
*
intval
=
runtime
.
hard_log_level
;
new
intval
=
runtime
.
hard_log_level
;
break
;
case
SCSC_DEBUG_LEVEL
:
if
(
*
intval
>
-
1
)
{
if
(
*
intval
>
10
)
*
intval
=
10
;
runtime
.
debug_level
=
*
intval
;
if
(
old
intval
>
-
1
)
{
if
(
old
intval
>
10
)
new
intval
=
10
;
runtime
.
debug_level
=
old
intval
;
}
*
intval
=
runtime
.
debug_level
;
new
intval
=
runtime
.
debug_level
;
break
;
case
SCSC_MIN_IDLE_CPU
:
{
double
*
dval
=
(
double
*
)
val
;
*
dval
=
switch_core_min_idle_cpu
(
*
dval
);
if
(
dval
)
{
*
dval
=
switch_core_min_idle_cpu
(
*
dval
);
}
intval
=
NULL
;
}
break
;
case
SCSC_MAX_SESSIONS
:
*
intval
=
switch_core_session_limit
(
*
intval
);
newintval
=
switch_core_session_limit
(
old
intval
);
break
;
case
SCSC_LAST_SPS
:
*
intval
=
runtime
.
sps_last
;
new
intval
=
runtime
.
sps_last
;
break
;
case
SCSC_MAX_DTMF_DURATION
:
*
intval
=
switch_core_max_dtmf_duration
(
*
intval
);
newintval
=
switch_core_max_dtmf_duration
(
old
intval
);
break
;
case
SCSC_MIN_DTMF_DURATION
:
*
intval
=
switch_core_min_dtmf_duration
(
*
intval
);
newintval
=
switch_core_min_dtmf_duration
(
old
intval
);
break
;
case
SCSC_DEFAULT_DTMF_DURATION
:
*
intval
=
switch_core_default_dtmf_duration
(
*
intval
);
newintval
=
switch_core_default_dtmf_duration
(
old
intval
);
break
;
case
SCSC_SPS
:
switch_mutex_lock
(
runtime
.
throttle_mutex
);
if
(
*
intval
>
0
)
{
runtime
.
sps_total
=
*
intval
;
if
(
old
intval
>
0
)
{
runtime
.
sps_total
=
old
intval
;
}
*
intval
=
runtime
.
sps_total
;
new
intval
=
runtime
.
sps_total
;
switch_mutex_unlock
(
runtime
.
throttle_mutex
);
break
;
case
SCSC_RECLAIM
:
switch_core_memory_reclaim_all
();
*
intval
=
0
;
new
intval
=
0
;
break
;
}
if
(
intval
)
{
*
intval
=
newintval
;
}
return
0
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论