Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
195d34bc
提交
195d34bc
authored
4月 06, 2010
作者:
Joao Mesquita
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of git@git.freeswitch.org:freeswitch
上级
3ed45189
254dd594
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
21 个修改的文件
包含
1773 行增加
和
1194 行删除
+1773
-1194
.gitignore
.gitignore
+42
-38
.gitignore
libs/.gitignore
+1073
-1066
Makefile.am
libs/freetdm/Makefile.am
+4
-2
mod_freetdm.c
libs/freetdm/mod_freetdm/mod_freetdm.c
+10
-0
ftdm_cpu_monitor.c
libs/freetdm/src/ftdm_cpu_monitor.c
+271
-0
ftdm_io.c
libs/freetdm/src/ftdm_io.c
+210
-8
ftmod_isdn.c
libs/freetdm/src/ftmod/ftmod_isdn/ftmod_isdn.c
+1
-1
ftmod_libpri.c
libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c
+1
-1
ftmod_sangoma_boost.c
...eetdm/src/ftmod/ftmod_sangoma_boost/ftmod_sangoma_boost.c
+7
-5
freetdm.h
libs/freetdm/src/include/freetdm.h
+1
-1
ftdm_cpu_monitor.h
libs/freetdm/src/include/ftdm_cpu_monitor.h
+75
-0
ftdm_types.h
libs/freetdm/src/include/ftdm_types.h
+3
-1
.gitignore
libs/unimrcp/.gitignore
+0
-3
.gitignore
src/.gitignore
+9
-9
.gitignore
src/mod/.gitignore
+59
-59
.gitignore
src/mod/applications/mod_distributor/.gitignore
+1
-0
.gitignore
src/mod/applications/mod_snapshot/.gitignore
+1
-0
.gitignore
src/mod/applications/mod_vmd/.gitignore
+1
-0
.gitignore
src/mod/asr_tts/mod_tts_commandline/.gitignore
+1
-0
.gitignore
src/mod/endpoints/mod_gsmopen/.gitignore
+2
-0
.gitignore
src/mod/event_handlers/mod_event_test/.gitignore
+1
-0
没有找到文件。
.gitignore
浏览文件 @
195d34bc
...
@@ -8,10 +8,10 @@
...
@@ -8,10 +8,10 @@
.deps
.deps
.\#*
.\#*
\#*
\#*
Debug/
/
Debug/
Release/
/
Release/
All/
/
All/
bin/
/
bin/
*.user
*.user
*.suo
*.suo
*.ncb
*.ncb
...
@@ -26,43 +26,47 @@ bin/
...
@@ -26,43 +26,47 @@ bin/
*.manifest
*.manifest
*.dep
*.dep
*.dll
*.dll
BuildLog.htm
/BuildLog.htm
Path
/Path
w32/Library/lastversion
/w32/Library/lastversion
w32/Library/tmpVersion.Bat
/w32/Library/tmpVersion.Bat
.version
!/w32/Console/FreeSwitchConsole.vcproj.user
AUTHORS
!/w32/Setup/inno_setup/vcredist_x64.exe
COPYING
!/w32/Setup/inno_setup/vcredist_x86.exe
ChangeLog
/.version
Makefile
/AUTHORS
Makefile.in
/COPYING
NEWS
/ChangeLog
README
/Makefile
/Makefile.in
/NEWS
/README
aclocal.m4
aclocal.m4
autom4te.cache
autom4te.cache
build/Makefile
/
build/Makefile
build/Makefile.in
/
build/Makefile.in
build/config/compile
/
build/config/compile
build/config/config.guess
/
build/config/config.guess
build/config/depcomp
/
build/config/depcomp
build/config/install-sh
/
build/config/install-sh
build/config/ltmain.sh
/
build/config/ltmain.sh
build/config/missing
/
build/config/missing
build/freeswitch.pc
/
build/freeswitch.pc
build/getlib.sh
/
build/getlib.sh
build/getsounds.sh
/
build/getsounds.sh
build/modmake.rules
/
build/modmake.rules
config.cache
config.cache
config.log
config.log
config.status
config.status
configure
/
configure
configure.lineno
configure.lineno
freeswitch
/freeswitch
fs_cli
/fs_cli
fs_ivrd
/fs_ivrd
libtool
/libtool
modules.conf
/modules.conf
quiet_libtool
/quiet_libtool
scripts/fsxs
/scripts/fsxs
scripts/gentls_cert
/scripts/gentls_cert
a.out.dSYM
/a.out.dSYM
/freeswitch-sounds-*
libs/.gitignore
浏览文件 @
195d34bc
差异被折叠。
点击展开。
libs/freetdm/Makefile.am
浏览文件 @
195d34bc
...
@@ -72,7 +72,8 @@ $(SRC)/libteletone_detect.c \
...
@@ -72,7 +72,8 @@ $(SRC)/libteletone_detect.c \
$(SRC)
/libteletone_generate.c
\
$(SRC)
/libteletone_generate.c
\
$(SRC)
/ftdm_buffer.c
\
$(SRC)
/ftdm_buffer.c
\
$(SRC)
/ftdm_threadmutex.c
\
$(SRC)
/ftdm_threadmutex.c
\
$(SRC)
/ftdm_dso.c
$(SRC)
/ftdm_dso.c
\
$(SRC)
/ftdm_cpu_monitor.c
library_include_HEADERS
=
\
library_include_HEADERS
=
\
$(SRC)
/include/fsk.h
\
$(SRC)
/include/fsk.h
\
...
@@ -90,7 +91,8 @@ $(SRC)/include/ftdm_buffer.h \
...
@@ -90,7 +91,8 @@ $(SRC)/include/ftdm_buffer.h \
$(SRC)
/include/ftdm_config.h
\
$(SRC)
/include/ftdm_config.h
\
$(SRC)
/include/ftdm_threadmutex.h
\
$(SRC)
/include/ftdm_threadmutex.h
\
$(SRC)
/include/ftdm_dso.h
\
$(SRC)
/include/ftdm_dso.h
\
$(SRC)
/include/ftdm_types.h
$(SRC)
/include/ftdm_types.h
\
$(SRC)
/include/ftdm_cpu_monitor.h
lib_LTLIBRARIES
=
libfreetdm.la
lib_LTLIBRARIES
=
libfreetdm.la
libfreetdm_la_CFLAGS
=
$(AM_CFLAGS)
$(MY_CFLAGS)
libfreetdm_la_CFLAGS
=
$(AM_CFLAGS)
$(MY_CFLAGS)
...
...
libs/freetdm/mod_freetdm/mod_freetdm.c
浏览文件 @
195d34bc
...
@@ -2767,6 +2767,8 @@ void dump_chan(ftdm_span_t *span, uint32_t chan_id, switch_stream_handle_t *stre
...
@@ -2767,6 +2767,8 @@ void dump_chan(ftdm_span_t *span, uint32_t chan_id, switch_stream_handle_t *stre
"type: %s
\n
"
"type: %s
\n
"
"state: %s
\n
"
"state: %s
\n
"
"last_state: %s
\n
"
"last_state: %s
\n
"
"txgain: %3.2f
\n
"
"rxgain: %3.2f
\n
"
"cid_date: %s
\n
"
"cid_date: %s
\n
"
"cid_name: %s
\n
"
"cid_name: %s
\n
"
"cid_num: %s
\n
"
"cid_num: %s
\n
"
...
@@ -2782,6 +2784,8 @@ void dump_chan(ftdm_span_t *span, uint32_t chan_id, switch_stream_handle_t *stre
...
@@ -2782,6 +2784,8 @@ void dump_chan(ftdm_span_t *span, uint32_t chan_id, switch_stream_handle_t *stre
ftdm_chan_type2str
(
span
->
channels
[
chan_id
]
->
type
),
ftdm_chan_type2str
(
span
->
channels
[
chan_id
]
->
type
),
ftdm_channel_state2str
(
span
->
channels
[
chan_id
]
->
state
),
ftdm_channel_state2str
(
span
->
channels
[
chan_id
]
->
state
),
ftdm_channel_state2str
(
span
->
channels
[
chan_id
]
->
last_state
),
ftdm_channel_state2str
(
span
->
channels
[
chan_id
]
->
last_state
),
span
->
channels
[
chan_id
]
->
txgain
,
span
->
channels
[
chan_id
]
->
rxgain
,
span
->
channels
[
chan_id
]
->
caller_data
.
cid_date
,
span
->
channels
[
chan_id
]
->
caller_data
.
cid_date
,
span
->
channels
[
chan_id
]
->
caller_data
.
cid_name
,
span
->
channels
[
chan_id
]
->
caller_data
.
cid_name
,
span
->
channels
[
chan_id
]
->
caller_data
.
cid_num
.
digits
,
span
->
channels
[
chan_id
]
->
caller_data
.
cid_num
.
digits
,
...
@@ -2808,6 +2812,8 @@ void dump_chan_xml(ftdm_span_t *span, uint32_t chan_id, switch_stream_handle_t *
...
@@ -2808,6 +2812,8 @@ void dump_chan_xml(ftdm_span_t *span, uint32_t chan_id, switch_stream_handle_t *
" <type>%s</type>
\n
"
" <type>%s</type>
\n
"
" <state>%s</state>
\n
"
" <state>%s</state>
\n
"
" <last-state>%s</last-state>
\n
"
" <last-state>%s</last-state>
\n
"
" <txgain>%3.2f</txgain>
\n
"
" <rxgain>%3.2f</rxgain>
\n
"
" <cid-date>%s</cid-date>
\n
"
" <cid-date>%s</cid-date>
\n
"
" <cid-name>%s</cid-name>
\n
"
" <cid-name>%s</cid-name>
\n
"
" <cid-num>%s</cid-num>
\n
"
" <cid-num>%s</cid-num>
\n
"
...
@@ -2824,6 +2830,8 @@ void dump_chan_xml(ftdm_span_t *span, uint32_t chan_id, switch_stream_handle_t *
...
@@ -2824,6 +2830,8 @@ void dump_chan_xml(ftdm_span_t *span, uint32_t chan_id, switch_stream_handle_t *
ftdm_chan_type2str
(
span
->
channels
[
chan_id
]
->
type
),
ftdm_chan_type2str
(
span
->
channels
[
chan_id
]
->
type
),
ftdm_channel_state2str
(
span
->
channels
[
chan_id
]
->
state
),
ftdm_channel_state2str
(
span
->
channels
[
chan_id
]
->
state
),
ftdm_channel_state2str
(
span
->
channels
[
chan_id
]
->
last_state
),
ftdm_channel_state2str
(
span
->
channels
[
chan_id
]
->
last_state
),
span
->
channels
[
chan_id
]
->
txgain
,
span
->
channels
[
chan_id
]
->
rxgain
,
span
->
channels
[
chan_id
]
->
caller_data
.
cid_date
,
span
->
channels
[
chan_id
]
->
caller_data
.
cid_date
,
span
->
channels
[
chan_id
]
->
caller_data
.
cid_name
,
span
->
channels
[
chan_id
]
->
caller_data
.
cid_name
,
span
->
channels
[
chan_id
]
->
caller_data
.
cid_num
.
digits
,
span
->
channels
[
chan_id
]
->
caller_data
.
cid_num
.
digits
,
...
@@ -3142,6 +3150,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_freetdm_load)
...
@@ -3142,6 +3150,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_freetdm_load)
module_pool
=
pool
;
module_pool
=
pool
;
ftdm_global_set_logger
(
ftdm_logger
);
ftdm_global_set_logger
(
ftdm_logger
);
ftdm_cpu_monitor_disable
();
if
(
ftdm_global_init
()
!=
FTDM_SUCCESS
)
{
if
(
ftdm_global_init
()
!=
FTDM_SUCCESS
)
{
ftdm_log
(
FTDM_LOG_ERROR
,
"Error loading FreeTDM
\n
"
);
ftdm_log
(
FTDM_LOG_ERROR
,
"Error loading FreeTDM
\n
"
);
...
...
libs/freetdm/src/ftdm_cpu_monitor.c
0 → 100644
浏览文件 @
195d34bc
/*
* Copyright (c) 2010, Sangoma Technologies
* Moises Silva <moy@sangoma.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of the original author; nor the names of any contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Contributors:
* David Yat Sin <dyatsin@sangoma.com>
*
*/
#ifdef WIN32
#define _WIN32_WINNT 0x0501 // To make GetSystemTimes visible in windows.h
#include <windows.h>
#else
/* LINUX */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <fcntl.h>
#include <errno.h>
#endif
#include "freetdm.h"
#include "ftdm_cpu_monitor.h"
struct
ftdm_cpu_monitor_stats
{
/* bool, just used to retrieve the values for the first time and not calculate the percentage of idle time */
int
valid_last_times
;
/* last calculated percentage of idle time */
double
last_percentage_of_idle_time
;
#ifdef __linux__
/* all of these are the Linux jiffies last retrieved count */
unsigned
long
long
last_user_time
;
unsigned
long
long
last_system_time
;
unsigned
long
long
last_idle_time
;
unsigned
long
long
last_nice_time
;
unsigned
long
long
last_irq_time
;
unsigned
long
long
last_soft_irq_time
;
unsigned
long
long
last_io_wait_time
;
unsigned
long
long
last_steal_time
;
/* /proc/stat file descriptor used to retrieve the counters */
int
procfd
;
int
initd
;
#elif defined (WIN32) || defined (WIN64)
__int64
i64LastUserTime
;
__int64
i64LastKernelTime
;
__int64
i64LastIdleTime
;
#else
/* Unsupported */
#endif
};
#ifdef __linux__
static
ftdm_status_t
ftdm_cpu_read_stats
(
struct
ftdm_cpu_monitor_stats
*
p
,
unsigned
long
long
*
user
,
unsigned
long
long
*
nice
,
unsigned
long
long
*
system
,
unsigned
long
long
*
idle
,
unsigned
long
long
*
iowait
,
unsigned
long
long
*
irq
,
unsigned
long
long
*
softirq
,
unsigned
long
long
*
steal
)
{
// the output of proc should not change that often from one kernel to other
// see fs/proc/proc_misc.c or fs/proc/stat.c in the Linux kernel for more details
// also man 5 proc is useful
#define CPU_ELEMENTS 8 // change this if you change the format string
#define CPU_INFO_FORMAT "cpu %Lu %Lu %Lu %Lu %Lu %Lu %Lu %Lu"
static
const
char
procfile
[]
=
"/proc/stat"
;
int
rc
=
0
;
int
myerrno
=
0
;
int
elements
=
0
;
const
char
*
cpustr
=
NULL
;
char
statbuff
[
1024
];
if
(
!
p
->
initd
)
{
p
->
procfd
=
open
(
procfile
,
O_RDONLY
,
0
);
if
(
p
->
procfd
==
-
1
)
{
ftdm_log
(
FTDM_LOG_ERROR
,
"Failed to open CPU statistics file %s: %s
\n
"
,
procfile
,
strerror
(
myerrno
));
return
FTDM_FAIL
;
}
p
->
initd
=
1
;
}
else
{
lseek
(
p
->
procfd
,
0L
,
SEEK_SET
);
}
rc
=
read
(
p
->
procfd
,
statbuff
,
sizeof
(
statbuff
)
-
1
);
if
(
rc
<=
0
)
{
myerrno
=
errno
;
ftdm_log
(
FTDM_LOG_ERROR
,
"Failed to read CPU statistics file %s: %s
\n
"
,
procfile
,
strerror
(
myerrno
));
return
FTDM_FAIL
;
}
cpustr
=
strstr
(
statbuff
,
"cpu "
);
if
(
!
cpustr
)
{
ftdm_log
(
FTDM_LOG_ERROR
,
"wrong format for Linux proc cpu statistics: missing cpu string
\n
"
);
return
FTDM_FAIL
;
}
elements
=
sscanf
(
cpustr
,
CPU_INFO_FORMAT
,
user
,
nice
,
system
,
idle
,
iowait
,
irq
,
softirq
,
steal
);
if
(
elements
!=
CPU_ELEMENTS
)
{
ftdm_log
(
FTDM_LOG_ERROR
,
"wrong format for Linux proc cpu statistics: expected %d elements, but just found %d
\n
"
,
CPU_ELEMENTS
,
elements
);
return
FTDM_FAIL
;
}
return
FTDM_SUCCESS
;
}
#endif
#ifdef __linux__
FT_DECLARE
(
ftdm_status_t
)
ftdm_cpu_get_system_idle_time
(
struct
ftdm_cpu_monitor_stats
*
p
,
double
*
idle_percentage
)
{
unsigned
long
long
user
,
nice
,
system
,
idle
,
iowait
,
irq
,
softirq
,
steal
;
unsigned
long
long
usertime
,
kerneltime
,
idletime
,
totaltime
,
halftime
;
if
(
ftdm_cpu_read_stats
(
p
,
&
user
,
&
nice
,
&
system
,
&
idle
,
&
iowait
,
&
irq
,
&
softirq
,
&
steal
))
{
ftdm_log
(
FTDM_LOG_ERROR
,
"Failed to retrieve Linux CPU statistics
\n
"
);
return
FTDM_FAIL
;
}
if
(
!
p
->
valid_last_times
)
{
// we dont strictly need to save all of them but I feel code is more clear if we do
p
->
valid_last_times
=
1
;
p
->
last_user_time
=
user
;
p
->
last_nice_time
=
nice
;
p
->
last_system_time
=
system
;
p
->
last_irq_time
=
irq
;
p
->
last_soft_irq_time
=
softirq
;
p
->
last_io_wait_time
=
iowait
;
p
->
last_steal_time
=
steal
;
p
->
last_idle_time
=
idle
;
p
->
last_percentage_of_idle_time
=
100
.
0
;
*
idle_percentage
=
p
->
last_percentage_of_idle_time
;
return
FTDM_SUCCESS
;
}
usertime
=
(
user
-
p
->
last_user_time
)
+
(
nice
-
p
->
last_nice_time
);
kerneltime
=
(
system
-
p
->
last_system_time
)
+
(
irq
-
p
->
last_irq_time
)
+
(
softirq
-
p
->
last_soft_irq_time
);
kerneltime
+=
(
iowait
-
p
->
last_io_wait_time
);
kerneltime
+=
(
steal
-
p
->
last_steal_time
);
idletime
=
(
idle
-
p
->
last_idle_time
);
totaltime
=
usertime
+
kerneltime
+
idletime
;
if
(
totaltime
<=
0
)
{
// this may happen if not enough time has elapsed and the jiffies counters are the same than the last time we checked
// jiffies depend on timer interrupts which depend on the number of HZ compile time setting of the kernel
// typical configs set HZ to 100 (that means, 100 jiffies updates per second, that is one each 10ms)
// avoid an arithmetic exception and return the same values
*
idle_percentage
=
p
->
last_percentage_of_idle_time
;
return
FTDM_SUCCESS
;
}
halftime
=
totaltime
/
2UL
;
p
->
last_percentage_of_idle_time
=
((
100
*
idletime
+
halftime
)
/
totaltime
);
*
idle_percentage
=
p
->
last_percentage_of_idle_time
;
p
->
last_user_time
=
user
;
p
->
last_nice_time
=
nice
;
p
->
last_system_time
=
system
;
p
->
last_irq_time
=
irq
;
p
->
last_soft_irq_time
=
softirq
;
p
->
last_io_wait_time
=
iowait
;
p
->
last_steal_time
=
steal
;
p
->
last_idle_time
=
idle
;
return
FTDM_SUCCESS
;
}
#elif defined (WIN32) || defined (WIN64)
FT_DECLARE
(
ftdm_status_t
)
ftdm_cpu_get_system_idle_time
(
struct
ftdm_cpu_monitor_stats
*
p
,
double
*
idle_percentage
)
{
FILETIME
idleTime
;
FILETIME
kernelTime
;
FILETIME
userTime
;
if
(
!::
GetSystemTimes
(
&
idleTime
,
&
kernelTime
,
&
userTime
))
{
return
false
;
}
__int64
i64UserTime
=
(
__int64
)
userTime
.
dwLowDateTime
|
((
__int64
)
userTime
.
dwHighDateTime
<<
32
);
__int64
i64KernelTime
=
(
__int64
)
kernelTime
.
dwLowDateTime
|
((
__int64
)
kernelTime
.
dwHighDateTime
<<
32
);
__int64
i64IdleTime
=
(
__int64
)
idleTime
.
dwLowDateTime
|
((
__int64
)
idleTime
.
dwHighDateTime
<<
32
);
if
(
p
->
valid_last_times
)
{
__int64
i64User
=
i64UserTime
-
p
->
i64LastUserTime
;
__int64
i64Kernel
=
i64KernelTime
-
p
->
i64LastKernelTime
;
__int64
i64Idle
=
i64IdleTime
-
p
->
i64LastIdleTime
;
__int64
i64System
=
i64User
+
i64Kernel
;
*
idle_percentage
=
100
.
0
*
i64Idle
/
i64System
;
}
else
{
*
idle_percentage
=
100
.
0
;
p
->
valid_last_times
=
1
;
}
/* Remember current value for the next call */
p
->
i64LastUserTime
=
i64UserTime
;
p
->
i64LastKernelTime
=
i64KernelTime
;
p
->
i64LastIdleTime
=
i64IdleTime
;
/* Success */
return
FTDM_SUCCESS
;
}
#else
/* Unsupported */
FT_DECLARE
(
ftdm_status_t
)
ftdm_cpu_get_system_idle_time
(
struct
ftdm_cpu_monitor_stats
*
p
,
double
*
idle_percentage
)
{
return
FTDM_FAIL
;
}
#endif
FT_DECLARE
(
struct
ftdm_cpu_monitor_stats
*
)
ftdm_new_cpu_monitor
(
void
)
{
return
calloc
(
1
,
sizeof
(
struct
ftdm_cpu_monitor_stats
));
}
FT_DECLARE
(
void
)
ftdm_delete_cpu_monitor
(
struct
ftdm_cpu_monitor_stats
*
p
)
{
#ifdef __linux__
close
(
p
->
procfd
);
#endif
free
(
p
);
}
/* For Emacs:
* Local Variables:
* mode:c
* indent-tabs-mode:t
* tab-width:4
* c-basic-offset:4
* End:
* For VIM:
* vim:set softtabstop=4 shiftwidth=4 tabstop=4:
*/
libs/freetdm/src/ftdm_io.c
浏览文件 @
195d34bc
差异被折叠。
点击展开。
libs/freetdm/src/ftmod/ftmod_isdn/ftmod_isdn.c
浏览文件 @
195d34bc
...
@@ -2385,7 +2385,7 @@ static FIO_SIG_CONFIGURE_FUNCTION(ftdm_isdn_configure_span)
...
@@ -2385,7 +2385,7 @@ static FIO_SIG_CONFIGURE_FUNCTION(ftdm_isdn_configure_span)
if
((
isdn_data
->
opts
&
FTDM_ISDN_OPT_SUGGEST_CHANNEL
))
{
if
((
isdn_data
->
opts
&
FTDM_ISDN_OPT_SUGGEST_CHANNEL
))
{
span
->
channel_request
=
isdn_channel_request
;
span
->
channel_request
=
isdn_channel_request
;
span
->
suggest_chan_id
=
1
;
ftdm_set_flag
(
span
,
FTDM_SPAN_SUGGEST_CHAN_ID
)
;
}
}
span
->
state_map
=
&
isdn_state_map
;
span
->
state_map
=
&
isdn_state_map
;
...
...
libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c
浏览文件 @
195d34bc
...
@@ -1331,7 +1331,7 @@ static FIO_SIG_CONFIGURE_FUNCTION(ftdm_libpri_configure_span)
...
@@ -1331,7 +1331,7 @@ static FIO_SIG_CONFIGURE_FUNCTION(ftdm_libpri_configure_span)
if
((
isdn_data
->
opts
&
FTMOD_LIBPRI_OPT_SUGGEST_CHANNEL
))
{
if
((
isdn_data
->
opts
&
FTMOD_LIBPRI_OPT_SUGGEST_CHANNEL
))
{
span
->
channel_request
=
isdn_channel_request
;
span
->
channel_request
=
isdn_channel_request
;
span
->
suggest_chan_id
=
1
;
ftdm_set_flag
(
span
,
FTDM_SPAN_SUGGEST_CHAN_ID
)
;
}
}
span
->
state_map
=
&
isdn_state_map
;
span
->
state_map
=
&
isdn_state_map
;
...
...
libs/freetdm/src/ftmod/ftmod_sangoma_boost/ftmod_sangoma_boost.c
浏览文件 @
195d34bc
...
@@ -880,8 +880,8 @@ static __inline__ void advance_chan_states(ftdm_channel_t *ftdmchan);
...
@@ -880,8 +880,8 @@ static __inline__ void advance_chan_states(ftdm_channel_t *ftdmchan);
*/
*/
static
void
handle_call_start
(
ftdm_span_t
*
span
,
sangomabc_connection_t
*
mcon
,
sangomabc_event_t
*
event
)
static
void
handle_call_start
(
ftdm_span_t
*
span
,
sangomabc_connection_t
*
mcon
,
sangomabc_event_t
*
event
)
{
{
ftdm_channel_t
*
ftdmchan
;
ftdm_channel_t
*
ftdmchan
=
NULL
;
int
hangup_cause
=
FTDM_CAUSE_CALL_REJECTED
;
if
(
!
(
ftdmchan
=
find_ftdmchan
(
span
,
(
sangomabc_short_event_t
*
)
event
,
0
)))
{
if
(
!
(
ftdmchan
=
find_ftdmchan
(
span
,
(
sangomabc_short_event_t
*
)
event
,
0
)))
{
if
((
ftdmchan
=
find_ftdmchan
(
span
,
(
sangomabc_short_event_t
*
)
event
,
1
)))
{
if
((
ftdmchan
=
find_ftdmchan
(
span
,
(
sangomabc_short_event_t
*
)
event
,
1
)))
{
int
r
;
int
r
;
...
@@ -896,7 +896,7 @@ static void handle_call_start(ftdm_span_t *span, sangomabc_connection_t *mcon, s
...
@@ -896,7 +896,7 @@ static void handle_call_start(ftdm_span_t *span, sangomabc_connection_t *mcon, s
}
}
ftdm_set_sflag
(
ftdmchan
,
SFLAG_SENT_FINAL_MSG
);
ftdm_set_sflag
(
ftdmchan
,
SFLAG_SENT_FINAL_MSG
);
ftdmchan
=
NULL
;
ftdmchan
=
NULL
;
}
}
ftdm_log
(
FTDM_LOG_CRIT
,
"START CANT FIND CHAN %d:%d
\n
"
,
event
->
span
+
1
,
event
->
chan
+
1
);
ftdm_log
(
FTDM_LOG_CRIT
,
"START CANT FIND CHAN %d:%d
\n
"
,
event
->
span
+
1
,
event
->
chan
+
1
);
goto
error
;
goto
error
;
...
@@ -953,12 +953,13 @@ static void handle_call_start(ftdm_span_t *span, sangomabc_connection_t *mcon, s
...
@@ -953,12 +953,13 @@ static void handle_call_start(ftdm_span_t *span, sangomabc_connection_t *mcon, s
return
;
return
;
error:
error:
hangup_cause
=
ftdmchan
?
ftdmchan
->
caller_data
.
hangup_cause
:
FTDM_CAUSE_REQUESTED_CHAN_UNAVAIL
;
sangomabc_exec_command
(
mcon
,
sangomabc_exec_command
(
mcon
,
event
->
span
,
event
->
span
,
event
->
chan
,
event
->
chan
,
0
,
0
,
SIGBOOST_EVENT_CALL_START_NACK
,
SIGBOOST_EVENT_CALL_START_NACK
,
0
,
0
);
hangup_cause
,
0
);
}
}
...
@@ -2239,7 +2240,8 @@ static FIO_CONFIGURE_SPAN_SIGNALING_FUNCTION(ftdm_sangoma_boost_configure_span)
...
@@ -2239,7 +2240,8 @@ static FIO_CONFIGURE_SPAN_SIGNALING_FUNCTION(ftdm_sangoma_boost_configure_span)
span
->
get_span_sig_status
=
sangoma_boost_get_span_sig_status
;
span
->
get_span_sig_status
=
sangoma_boost_get_span_sig_status
;
span
->
set_span_sig_status
=
sangoma_boost_set_span_sig_status
;
span
->
set_span_sig_status
=
sangoma_boost_set_span_sig_status
;
span
->
state_map
=
&
boost_state_map
;
span
->
state_map
=
&
boost_state_map
;
span
->
suggest_chan_id
=
0
;
ftdm_clear_flag
(
span
,
FTDM_SPAN_SUGGEST_CHAN_ID
);
ftdm_set_flag
(
span
,
FTDM_SPAN_USE_CHAN_QUEUE
);
if
(
sigmod_iface
)
{
if
(
sigmod_iface
)
{
/* the core will do the hunting */
/* the core will do the hunting */
span
->
channel_request
=
NULL
;
span
->
channel_request
=
NULL
;
...
...
libs/freetdm/src/include/freetdm.h
浏览文件 @
195d34bc
...
@@ -654,7 +654,6 @@ struct ftdm_span {
...
@@ -654,7 +654,6 @@ struct ftdm_span {
char
*
type
;
char
*
type
;
char
*
dtmf_hangup
;
char
*
dtmf_hangup
;
size_t
dtmf_hangup_len
;
size_t
dtmf_hangup_len
;
int
suggest_chan_id
;
ftdm_state_map_t
*
state_map
;
ftdm_state_map_t
*
state_map
;
ftdm_caller_data_t
default_caller_data
;
ftdm_caller_data_t
default_caller_data
;
ftdm_queue_t
*
pendingchans
;
ftdm_queue_t
*
pendingchans
;
...
@@ -825,6 +824,7 @@ FT_DECLARE(ftdm_status_t) ftdm_span_find_by_name(const char *name, ftdm_span_t *
...
@@ -825,6 +824,7 @@ FT_DECLARE(ftdm_status_t) ftdm_span_find_by_name(const char *name, ftdm_span_t *
FT_DECLARE
(
char
*
)
ftdm_api_execute
(
const
char
*
type
,
const
char
*
cmd
);
FT_DECLARE
(
char
*
)
ftdm_api_execute
(
const
char
*
type
,
const
char
*
cmd
);
FT_DECLARE
(
int
)
ftdm_vasprintf
(
char
**
ret
,
const
char
*
fmt
,
va_list
ap
);
FT_DECLARE
(
int
)
ftdm_vasprintf
(
char
**
ret
,
const
char
*
fmt
,
va_list
ap
);
FT_DECLARE
(
ftdm_status_t
)
ftdm_channel_set_caller_data
(
ftdm_channel_t
*
ftdmchan
,
ftdm_caller_data_t
*
caller_data
);
FT_DECLARE
(
ftdm_status_t
)
ftdm_channel_set_caller_data
(
ftdm_channel_t
*
ftdmchan
,
ftdm_caller_data_t
*
caller_data
);
FT_DECLARE
(
void
)
ftdm_cpu_monitor_disable
(
void
);
FIO_CODEC_FUNCTION
(
fio_slin2ulaw
);
FIO_CODEC_FUNCTION
(
fio_slin2ulaw
);
FIO_CODEC_FUNCTION
(
fio_ulaw2slin
);
FIO_CODEC_FUNCTION
(
fio_ulaw2slin
);
...
...
libs/freetdm/src/include/ftdm_cpu_monitor.h
0 → 100644
浏览文件 @
195d34bc
/*
* Copyright (c) 2010, Sangoma Technologies
* Moises Silva <moy@sangoma.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of the original author; nor the names of any contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
* Contributors:
* David Yat Sin <dyatsin@sangoma.com>
*
*/
/*! \brief opaque cpu stats structure */
struct
ftdm_cpu_monitor_stats
;
/*!
* \brief create a new cpu monitor
* \return profile timer structure previously created with new_profile_timer, NULL on error
*/
FT_DECLARE
(
struct
ftdm_cpu_monitor_stats
*
)
ftdm_new_cpu_monitor
(
void
);
/*!
* \brief Deletes cpu_monitor
*/
FT_DECLARE
(
void
)
ftdm_delete_cpu_monitor
(
struct
ftdm_cpu_monitor_stats
*
p
);
/*!
* \brief provides the percentage of idle system time
* \param p cpu_stats structure previously created with ftdm_new_cpu_monitor
* \param pointer to store the percentage of idle time
* \return -1 on error 0 for success
*/
FT_DECLARE
(
ftdm_status_t
)
ftdm_cpu_get_system_idle_time
(
struct
ftdm_cpu_monitor_stats
*
p
,
double
*
idle_percentage
);
/* For Emacs:
* Local Variables:
* mode:c
* indent-tabs-mode:t
* tab-width:4
* c-basic-offset:4
* End:
* For VIM:
* vim:set softtabstop=4 shiftwidth=4 tabstop=4:
*/
libs/freetdm/src/include/ftdm_types.h
浏览文件 @
195d34bc
...
@@ -325,7 +325,9 @@ typedef enum {
...
@@ -325,7 +325,9 @@ typedef enum {
FTDM_SPAN_STATE_CHANGE
=
(
1
<<
2
),
FTDM_SPAN_STATE_CHANGE
=
(
1
<<
2
),
FTDM_SPAN_SUSPENDED
=
(
1
<<
3
),
FTDM_SPAN_SUSPENDED
=
(
1
<<
3
),
FTDM_SPAN_IN_THREAD
=
(
1
<<
4
),
FTDM_SPAN_IN_THREAD
=
(
1
<<
4
),
FTDM_SPAN_STOP_THREAD
=
(
1
<<
5
)
FTDM_SPAN_STOP_THREAD
=
(
1
<<
5
),
FTDM_SPAN_USE_CHAN_QUEUE
=
(
1
<<
6
),
FTDM_SPAN_SUGGEST_CHAN_ID
=
(
1
<<
7
),
}
ftdm_span_flag_t
;
}
ftdm_span_flag_t
;
typedef
enum
{
typedef
enum
{
...
...
libs/unimrcp/.gitignore
浏览文件 @
195d34bc
.svn
.svn
.gitignore
.update
configure.gnu
src/.gitignore
浏览文件 @
195d34bc
Makefile
/
Makefile
Makefile.in
/
Makefile.in
include/stamp-h1
/
include/stamp-h1
include/switch_am_config.h
/
include/switch_am_config.h
include/switch_private.h
/
include/switch_private.h
include/switch_private.h.in
/
include/switch_private.h.in
include/switch_swigable_cpp.h
/
include/switch_swigable_cpp.h
include/switch_version.h
/
include/switch_version.h
include/switch_version.h.in
/
include/switch_version.h.in
src/mod/.gitignore
浏览文件 @
195d34bc
Makefile
/
Makefile
Makefile.in
/
Makefile.in
applications/mod_commands/Makefile
/
applications/mod_commands/Makefile
applications/mod_conference/Makefile
/
applications/mod_conference/Makefile
applications/mod_dptools/Makefile
/
applications/mod_dptools/Makefile
applications/mod_enum/Makefile
/
applications/mod_enum/Makefile
applications/mod_enum/Makefile.in
/
applications/mod_enum/Makefile.in
applications/mod_enum/mod_enum.log
/
applications/mod_enum/mod_enum.log
applications/mod_expr/Makefile
/
applications/mod_expr/Makefile
applications/mod_expr/Makefile.in
/
applications/mod_expr/Makefile.in
applications/mod_expr/mod_expr.log
/
applications/mod_expr/mod_expr.log
applications/mod_fifo/Makefile
/
applications/mod_fifo/Makefile
applications/mod_fsv/Makefile
/
applications/mod_fsv/Makefile
applications/mod_limit/Makefile
/
applications/mod_limit/Makefile
applications/mod_stress/Makefile
/
applications/mod_stress/Makefile
applications/mod_stress/Makefile.in
/
applications/mod_stress/Makefile.in
applications/mod_t38gateway/Makefile
/
applications/mod_t38gateway/Makefile
applications/mod_t38gateway/Makefile.in
/
applications/mod_t38gateway/Makefile.in
applications/mod_valet_parking/Makefile
/
applications/mod_valet_parking/Makefile
applications/mod_voicemail/Makefile
/
applications/mod_voicemail/Makefile
asr_tts/mod_unimrcp/Makefile
/
asr_tts/mod_unimrcp/Makefile
asr_tts/mod_unimrcp/Makefile.in
/
asr_tts/mod_unimrcp/Makefile.in
dialplans/mod_dialplan_asterisk/Makefile
/
dialplans/mod_dialplan_asterisk/Makefile
dialplans/mod_dialplan_xml/Makefile
/
dialplans/mod_dialplan_xml/Makefile
endpoints/mod_portaudio/Makefile
/
endpoints/mod_portaudio/Makefile
endpoints/mod_portaudio/Makefile.in
/
endpoints/mod_portaudio/Makefile.in
endpoints/mod_skinny/Makefile
/
endpoints/mod_skinny/Makefile
endpoints/mod_skinny/Makefile.in
/
endpoints/mod_skinny/Makefile.in
endpoints/mod_skypopen/Makefile
/
endpoints/mod_skypopen/Makefile
endpoints/mod_skypopen/Makefile.in
/
endpoints/mod_skypopen/Makefile.in
endpoints/mod_sofia/Makefile
/
endpoints/mod_sofia/Makefile
endpoints/mod_sofia/Makefile.in
/
endpoints/mod_sofia/Makefile.in
endpoints/mod_sofia/mod_sofia.log
/
endpoints/mod_sofia/mod_sofia.log
event_handlers/mod_erlang_event/Makefile
/
event_handlers/mod_erlang_event/Makefile
event_handlers/mod_event_socket/Makefile
/
event_handlers/mod_event_socket/Makefile
formats/mod_native_file/Makefile
/
formats/mod_native_file/Makefile
formats/mod_portaudio_stream/Makefile
/
formats/mod_portaudio_stream/Makefile
formats/mod_portaudio_stream/Makefile.in
/
formats/mod_portaudio_stream/Makefile.in
formats/mod_tone_stream/Makefile
/
formats/mod_tone_stream/Makefile
languages/mod_java/Makefile
/
languages/mod_java/Makefile
languages/mod_lua/Makefile
/
languages/mod_lua/Makefile
languages/mod_lua/Makefile.in
/
languages/mod_lua/Makefile.in
languages/mod_lua/mod_lua.log
/
languages/mod_lua/mod_lua.log
languages/mod_python/Makefile
/
languages/mod_python/Makefile
languages/mod_spidermonkey/Makefile
/
languages/mod_spidermonkey/Makefile
languages/mod_spidermonkey/Makefile.in
/
languages/mod_spidermonkey/Makefile.in
languages/mod_spidermonkey/mod_spidermonkey.log
/
languages/mod_spidermonkey/mod_spidermonkey.log
loggers/mod_console/Makefile
/
loggers/mod_console/Makefile
loggers/mod_logfile/Makefile
/
loggers/mod_logfile/Makefile
loggers/mod_syslog/Makefile
/
loggers/mod_syslog/Makefile
say/mod_say_en/Makefile
/
say/mod_say_en/Makefile
say/mod_say_ru/Makefile
/
say/mod_say_ru/Makefile
applications/mod_stress/mod_stress.log
/
applications/mod_stress/mod_stress.log
asr_tts/mod_unimrcp/mod_unimrcp.log
/
asr_tts/mod_unimrcp/mod_unimrcp.log
endpoints/mod_portaudio/mod_portaudio.log
/
endpoints/mod_portaudio/mod_portaudio.log
endpoints/mod_skypopen/mod_skypopen.log
/
endpoints/mod_skypopen/mod_skypopen.log
formats/mod_portaudio_stream/mod_portaudio_stream.log
/
formats/mod_portaudio_stream/mod_portaudio_stream.log
languages/mod_java/freeswitch.jar
/
languages/mod_java/freeswitch.jar
languages/mod_managed/freeswitch_wrap.cpp
/
languages/mod_managed/freeswitch_wrap.cpp
src/mod/applications/mod_distributor/.gitignore
0 → 100644
浏览文件 @
195d34bc
Makefile
src/mod/applications/mod_snapshot/.gitignore
0 → 100644
浏览文件 @
195d34bc
Makefile
src/mod/applications/mod_vmd/.gitignore
0 → 100644
浏览文件 @
195d34bc
Makefile
src/mod/asr_tts/mod_tts_commandline/.gitignore
0 → 100644
浏览文件 @
195d34bc
Makefile
src/mod/endpoints/mod_gsmopen/.gitignore
0 → 100644
浏览文件 @
195d34bc
!/gsmlib/gsmlib-*/aclocal.m4
!/gsmlib/gsmlib-*/configure
src/mod/event_handlers/mod_event_test/.gitignore
0 → 100644
浏览文件 @
195d34bc
Makefile
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论