Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
f08b9676
提交
f08b9676
authored
10月 27, 2011
作者:
Michael S Collins
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
ssh://git.freeswitch.org:222/freeswitch
上级
739561f6
26cd927c
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
66 行增加
和
27 行删除
+66
-27
fs_cli.c
libs/esl/fs_cli.c
+22
-8
Makefile.am
libs/freetdm/Makefile.am
+3
-3
configure.ac
libs/freetdm/configure.ac
+35
-10
mod_valet_parking.c
src/mod/applications/mod_valet_parking/mod_valet_parking.c
+5
-5
switch_ivr_play_say.c
src/switch_ivr_play_say.c
+1
-1
没有找到文件。
libs/esl/fs_cli.c
浏览文件 @
f08b9676
...
...
@@ -71,6 +71,7 @@ static char prompt_str[512] = "";
static
char
prompt_color
[
12
]
=
{
ESL_SEQ_DEFAULT_COLOR
};
static
char
input_text_color
[
12
]
=
{
ESL_SEQ_DEFAULT_COLOR
};
static
char
output_text_color
[
12
]
=
{
ESL_SEQ_DEFAULT_COLOR
};
static
int
feature_level
=
0
;
static
cli_profile_t
profiles
[
128
]
=
{{{
0
}}};
static
cli_profile_t
internal_profile
=
{{
0
}};
static
int
pcount
=
0
;
...
...
@@ -679,9 +680,10 @@ static void *msg_thread_run(esl_thread_t *me, void *obj)
}
#ifndef WIN32
if
(
aok
)
{
clear_line
();
if
(
feature_level
)
clear_line
();
printf
(
"%s%s"
,
colors
[
level
],
handle
->
last_event
->
body
);
redisplay
();
if
(
!
feature_level
)
printf
(
"%s"
,
ESL_SEQ_DEFAULT_COLOR
);
if
(
feature_level
)
redisplay
();
}
#else
if
(
aok
)
{
...
...
@@ -1122,6 +1124,7 @@ int main(int argc, char *argv[])
char
dft_cfile
[
512
]
=
"fs_cli.conf"
;
#endif
char
*
home
=
getenv
(
"HOME"
);
char
*
term
=
getenv
(
"TERM"
);
/* Vars for optargs */
int
opt
;
static
struct
option
options
[]
=
{
...
...
@@ -1156,6 +1159,17 @@ int main(int argc, char *argv[])
int
argv_quiet
=
0
;
int
loops
=
2
,
reconnect
=
0
,
timeout
=
0
;
if
(
!
strncasecmp
(
"screen"
,
term
,
6
)
||
!
strncasecmp
(
"vt100"
,
term
,
5
))
{
feature_level
=
1
;
}
else
{
feature_level
=
0
;
}
#ifdef WIN32
feature_level
=
0
;
#endif
strncpy
(
internal_profile
.
host
,
"127.0.0.1"
,
sizeof
(
internal_profile
.
host
));
strncpy
(
internal_profile
.
pass
,
"ClueCon"
,
sizeof
(
internal_profile
.
pass
));
strncpy
(
internal_profile
.
name
,
"internal"
,
sizeof
(
internal_profile
.
name
));
...
...
@@ -1289,11 +1303,11 @@ int main(int argc, char *argv[])
snprintf
(
bare_prompt_str
,
sizeof
(
bare_prompt_str
),
"freeswitch@%s> "
,
profile
->
name
);
}
bare_prompt_str_len
=
(
int
)
strlen
(
bare_prompt_str
);
#ifdef WIN32
snprintf
(
prompt_str
,
sizeof
(
prompt_str
),
"%s"
,
bare_prompt_str
);
/* Not supporting this for now */
#else
snprintf
(
prompt_str
,
sizeof
(
prompt_str
),
"%s%s%s"
,
prompt_color
,
bare_prompt_str
,
input_text_colo
r
);
#endif
if
(
feature_level
)
{
snprintf
(
prompt_str
,
sizeof
(
prompt_str
),
"%s%s%s"
,
prompt_color
,
bare_prompt_str
,
input_text_color
);
}
else
{
snprintf
(
prompt_str
,
sizeof
(
prompt_str
),
"%s"
,
bare_prompt_st
r
);
}
connect:
connected
=
0
;
while
(
--
loops
>
0
)
{
...
...
@@ -1320,7 +1334,7 @@ int main(int argc, char *argv[])
}
if
(
argv_exec
)
{
const
char
*
err
=
NULL
;
snprintf
(
cmd_str
,
sizeof
(
cmd_str
),
"api %s
\n\n
"
,
argv_command
);
snprintf
(
cmd_str
,
sizeof
(
cmd_str
),
"api %s
\n
console_execute: true
\n
\n
"
,
argv_command
);
if
(
timeout
)
{
esl_status_t
status
=
esl_send_recv_timed
(
&
handle
,
cmd_str
,
timeout
);
if
(
status
!=
ESL_SUCCESS
)
{
...
...
libs/freetdm/Makefile.am
浏览文件 @
f08b9676
...
...
@@ -184,9 +184,9 @@ endif
if
HAVE_LIBPRI
mod_LTLIBRARIES
+=
ftmod_libpri.la
ftmod_libpri_la_SOURCES
=
$(SRC)
/ftmod/ftmod_libpri/ftmod_libpri.c
$(SRC)
/ftmod/ftmod_libpri/lpwrap_pri.c
ftmod_libpri_la_CFLAGS
=
$(FTDM_CFLAGS)
$(AM_CFLAGS)
ftmod_libpri_la_LDFLAGS
=
-shared
-module
-avoid-version
-lpri
ftmod_libpri_la_LIBADD
=
libfreetdm.la
ftmod_libpri_la_CFLAGS
=
$(FTDM_CFLAGS)
$(AM_CFLAGS)
$(LIBPRI_CPPFLAGS)
ftmod_libpri_la_LDFLAGS
=
-shared
-module
-avoid-version
$(LIBPRI_LDFLAGS)
ftmod_libpri_la_LIBADD
=
libfreetdm.la
$(LIBPRI_LIBS)
endif
if
HAVE_PRITAP
...
...
libs/freetdm/configure.ac
浏览文件 @
f08b9676
...
...
@@ -194,28 +194,46 @@ AM_CONDITIONAL([HAVE_OPENR2], [test "${HAVE_OPENR2}" = "yes"])
#
HAVE_LIBPRI="no"
AC_ARG_WITH([libpri],
[AS_HELP_STRING([--with-libpri], [Install ftmod_libpri])],
[AS_HELP_STRING([--with-libpri
@<:@=PREFIX@:>@
], [Install ftmod_libpri])],
[case "${withval}" in
no) enable_libpri="no" ;;
*) enable_libpri="yes" ;;
no|yes) with_libpri="${withval}" ;;
*) AS_IF([test -d "${withval}"],
[with_libpri="${withval}"],
[AC_MSG_ERROR([Invalid argument for --with-libpri, \"${withval}\" is not a directory])]
) ;;
esac],
[
enable
_libpri="no"]
[
with
_libpri="no"]
)
if test "
${enable_libpri}" != "
no"
if test "
x${with_libpri}" != "x
no"
then
save_LIBS="${LIBS}"
save_CPPFLAGS="${CPPFLAGS}"
save_LDFLAGS="${LDFLAGS}"
LIBPRI_CPPFLAGS=""
LIBPRI_LDFLAGS=""
AC_MSG_RESULT([${as_nl}<<>> Digium libpri])
save_LIBS="${LIBS}"
AS_IF([test "x${with_libpri}" != "xyes"],
[LIBPRI_CPPFLAGS="-I${with_libpri}/include"
LIBPRI_LDFLAGS="-L${with_libpri}/lib"],
)
LDFLAGS="${save_LDFLAGS} ${LIBPRI_LDFLAGS}"
CPPFLAGS="${save_CPPFLAGS} ${LIBPRI_CPPFLAGS}"
LIBS="${LIBS} -lpri"
AC_MSG_CHECKING([whether libpri is usable])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[#include <libpri.h>],
[const char *version = pri_get_version();]
)],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([yes])
HAVE_LIBPRI="yes"],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([libpri
is not installe
d or unusable (see config.log for details)])]
AC_MSG_ERROR([libpri
not foun
d or unusable (see config.log for details)])]
)
AC_MSG_CHECKING([whether libpri has BRI support])
...
...
@@ -241,10 +259,17 @@ then
[AC_MSG_RESULT([no])
AC_MSG_NOTICE([You will need libpri-1.4.12_beta1 or newer for AOC event support])]
)
# libpri is available, set variables for Makefile(.am)
AC_SUBST([LIBPRI_LIBS], [-lpri])
AC_SUBST([LIBPRI_LDFLAGS])
AC_SUBST([LIBPRI_CPPFLAGS])
LIBS="${save_LIBS}"
LDFLAGS="${save_LDFLAGS}"
CPPFLAGS="${save_CPPFLAGS}"
fi
HAVE_LIBPRI="${enable_libpri}"
AM_CONDITIONAL([HAVE_LIBPRI],[test "${enable_libpri}" = "yes"])
AM_CONDITIONAL([HAVE_LIBPRI],[test "x${HAVE_LIBPRI}" = "xyes"])
##
# Sangoma Wanpipe
...
...
src/mod/applications/mod_valet_parking/mod_valet_parking.c
浏览文件 @
f08b9676
...
...
@@ -31,7 +31,7 @@
#include <switch.h>
#define VALET_EVENT "valet_parking::info"
#define VALET_PROTO "park"
#define TOKEN_FREQ 5
/* Prototypes */
SWITCH_MODULE_LOAD_FUNCTION
(
mod_valet_parking_load
);
...
...
@@ -112,7 +112,7 @@ static void check_timeouts(void)
now
=
switch_epoch_time_now
(
NULL
);
switch_mutex_lock
(
globals
.
mutex
);
if
(
now
-
globals
.
last_timeout_check
<
30
)
{
if
(
now
-
globals
.
last_timeout_check
<
TOKEN_FREQ
)
{
switch_mutex_unlock
(
globals
.
mutex
);
return
;
}
...
...
@@ -137,6 +137,7 @@ static void check_timeouts(void)
switch_hash_this
(
i_hi
,
&
i_var
,
NULL
,
&
i_val
);
i_ext
=
(
char
*
)
i_var
;
token
=
(
valet_token_t
*
)
i_val
;
if
(
token
->
timeout
>
0
&&
(
token
->
timeout
<
now
||
token
->
timeout
==
1
))
{
switch_core_hash_delete
(
lot
->
hash
,
i_ext
);
switch_safe_free
(
token
);
...
...
@@ -393,6 +394,7 @@ SWITCH_STANDARD_APP(valet_parking_function)
if
(
!
(
token
=
next_id
(
session
,
lot
,
min_i
,
max_i
,
in
)))
{
switch_ivr_phrase_macro
(
session
,
in
?
"valet_lot_full"
:
"valet_lot_empty"
,
""
,
NULL
,
NULL
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"%s lot is %s.
\n
"
,
switch_channel_get_name
(
channel
),
in
?
"full"
:
"empty"
);
return
;
}
...
...
@@ -520,7 +522,7 @@ SWITCH_STANDARD_APP(valet_parking_function)
switch_core_session_t
*
b_session
;
if
((
b_session
=
switch_core_session_locate
(
uuid
)))
{
token
->
timeout
=
switch_epoch_time_now
(
NULL
)
+
10
;
token
->
timeout
=
switch_epoch_time_now
(
NULL
)
+
TOKEN_FREQ
;
if
(
play_announce
)
{
switch_ivr_sleep
(
session
,
1500
,
SWITCH_TRUE
,
NULL
);
switch_ivr_phrase_macro
(
session
,
"valet_announce_ext"
,
tmp
,
NULL
,
NULL
);
...
...
@@ -554,8 +556,6 @@ SWITCH_STANDARD_APP(valet_parking_function)
args
.
buf
=
dbuf
;
args
.
buflen
=
sizeof
(
dbuf
);
while
(
switch_channel_ready
(
channel
))
{
switch_status_t
pstatus
=
switch_ivr_play_file
(
session
,
NULL
,
music
,
&
args
);
if
(
pstatus
==
SWITCH_STATUS_BREAK
||
pstatus
==
SWITCH_STATUS_TIMEOUT
)
{
...
...
src/switch_ivr_play_say.c
浏览文件 @
f08b9676
...
...
@@ -1669,7 +1669,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
}
}
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"done playing file
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"done playing file
%s
\n
"
,
file
);
if
(
read_impl
.
samples_per_second
)
{
switch_channel_set_variable_printf
(
channel
,
"playback_seconds"
,
"%d"
,
fh
->
samples_in
/
read_impl
.
samples_per_second
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论