Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
46215605
提交
46215605
authored
2月 10, 2011
作者:
Moises Silva
浏览文件
操作
浏览文件
下载
差异文件
Merge remote branch 'fsorig/master'
上级
36117808
6f9da9a0
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
94 行增加
和
37 行删除
+94
-37
switch.conf.xml
conf/autoload_configs/switch.conf.xml
+1
-1
ftdm_io.c
libs/freetdm/src/ftdm_io.c
+39
-9
mod_conference.c
src/mod/applications/mod_conference/mod_conference.c
+29
-16
mod_dptools.c
src/mod/applications/mod_dptools/mod_dptools.c
+2
-0
mod_voicemail.c
src/mod/applications/mod_voicemail/mod_voicemail.c
+18
-8
mod_unimrcp.c
src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c
+1
-1
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+4
-2
没有找到文件。
conf/autoload_configs/switch.conf.xml
浏览文件 @
46215605
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
<param
name=
"colorize-console"
value=
"true"
/>
<param
name=
"colorize-console"
value=
"true"
/>
<!-- minimum idle CPU before refusing calls -->
<!-- minimum idle CPU before refusing calls -->
<
param
name=
"min-idle-cpu"
value=
"25"
/
>
<
!--<param name="min-idle-cpu" value="25"/>--
>
<!--
<!--
Max number of sessions to allow at any given time.
Max number of sessions to allow at any given time.
...
...
libs/freetdm/src/ftdm_io.c
浏览文件 @
46215605
...
@@ -2743,10 +2743,9 @@ static ftdm_status_t ftdmchan_activate_dtmf_buffer(ftdm_channel_t *ftdmchan)
...
@@ -2743,10 +2743,9 @@ static ftdm_status_t ftdmchan_activate_dtmf_buffer(ftdm_channel_t *ftdmchan)
if
(
!
ftdmchan
->
dtmf_buffer
)
{
if
(
!
ftdmchan
->
dtmf_buffer
)
{
if
(
ftdm_buffer_create
(
&
ftdmchan
->
dtmf_buffer
,
1024
,
3192
,
0
)
!=
FTDM_SUCCESS
)
{
if
(
ftdm_buffer_create
(
&
ftdmchan
->
dtmf_buffer
,
1024
,
3192
,
0
)
!=
FTDM_SUCCESS
)
{
ftdm_log
(
FTDM_LOG_ERROR
,
"Failed to allocate DTMF Buffer!
\n
"
);
ftdm_log
(
FTDM_LOG_ERROR
,
"Failed to allocate DTMF Buffer!
\n
"
);
snprintf
(
ftdmchan
->
last_error
,
sizeof
(
ftdmchan
->
last_error
),
"buffer error"
);
return
FTDM_FAIL
;
return
FTDM_FAIL
;
}
else
{
}
else
{
ftdm_log
(
FTDM_LOG_DEBUG
,
"Created DTMF Buffer!
\n
"
);
ftdm_log
_chan_msg
(
ftdmchan
,
FTDM_LOG_DEBUG
,
"Created DTMF buffer
\n
"
);
}
}
}
}
...
@@ -3588,8 +3587,17 @@ static FIO_READ_FUNCTION(ftdm_raw_read)
...
@@ -3588,8 +3587,17 @@ static FIO_READ_FUNCTION(ftdm_raw_read)
return
status
;
return
status
;
}
}
static
ftdm_status_t
handle_dtmf
(
ftdm_channel_t
*
ftdmchan
,
ftdm_size_t
datalen
)
/* This function takes care of automatically generating DTMF or FSK tones when needed */
static
ftdm_status_t
handle_tone_generation
(
ftdm_channel_t
*
ftdmchan
,
ftdm_size_t
datalen
)
{
{
/*
* datalen: size in bytes of the chunk of data the user requested to read (this function
* is called from the ftdm_channel_read function)
* dblen: size currently in use in any of the tone generation buffers (data available in the buffer)
* gen_dtmf_buffer: buffer holding the raw ASCII digits that the user requested to generate
* dtmf_buffer: raw linear tone data generated by teletone to be written to the devices
* fsk_buffer: raw linear FSK modulated data for caller id
*/
ftdm_buffer_t
*
buffer
=
NULL
;
ftdm_buffer_t
*
buffer
=
NULL
;
ftdm_size_t
dblen
=
0
;
ftdm_size_t
dblen
=
0
;
int
wrote
=
0
;
int
wrote
=
0
;
...
@@ -3604,7 +3612,7 @@ static ftdm_status_t handle_dtmf(ftdm_channel_t *ftdmchan, ftdm_size_t datalen)
...
@@ -3604,7 +3612,7 @@ static ftdm_status_t handle_dtmf(ftdm_channel_t *ftdmchan, ftdm_size_t datalen)
}
}
if
(
ftdm_buffer_read
(
ftdmchan
->
gen_dtmf_buffer
,
digits
,
dblen
)
&&
!
ftdm_strlen_zero_buf
(
digits
))
{
if
(
ftdm_buffer_read
(
ftdmchan
->
gen_dtmf_buffer
,
digits
,
dblen
)
&&
!
ftdm_strlen_zero_buf
(
digits
))
{
ftdm_log_chan
(
ftdmchan
,
FTDM_LOG_DEBUG
,
"Generating DTMF [%s]
\n
"
,
digits
);
ftdm_log_chan
(
ftdmchan
,
FTDM_LOG_DEBUG
,
"Generating DTMF [%s]
\n
"
,
digits
);
cur
=
digits
;
cur
=
digits
;
...
@@ -3618,7 +3626,7 @@ static ftdm_status_t handle_dtmf(ftdm_channel_t *ftdmchan, ftdm_size_t datalen)
...
@@ -3618,7 +3626,7 @@ static ftdm_status_t handle_dtmf(ftdm_channel_t *ftdmchan, ftdm_size_t datalen)
ftdm_buffer_write
(
ftdmchan
->
dtmf_buffer
,
ftdmchan
->
tone_session
.
buffer
,
wrote
*
2
);
ftdm_buffer_write
(
ftdmchan
->
dtmf_buffer
,
ftdmchan
->
tone_session
.
buffer
,
wrote
*
2
);
x
++
;
x
++
;
}
else
{
}
else
{
ftdm_log
(
FTDM_LOG_ERROR
,
"%d:%d Problem Adding DTMF SEQ [%s]
\n
"
,
ftdmchan
->
span_id
,
ftdmchan
->
chan_id
,
digits
);
ftdm_log
_chan
(
ftdmchan
,
FTDM_LOG_ERROR
,
"Problem adding DTMF sequence [%s]
\n
"
,
digits
);
return
FTDM_FAIL
;
return
FTDM_FAIL
;
}
}
}
}
...
@@ -3631,6 +3639,7 @@ static ftdm_status_t handle_dtmf(ftdm_channel_t *ftdmchan, ftdm_size_t datalen)
...
@@ -3631,6 +3639,7 @@ static ftdm_status_t handle_dtmf(ftdm_channel_t *ftdmchan, ftdm_size_t datalen)
if
(
!
ftdmchan
->
buffer_delay
||
--
ftdmchan
->
buffer_delay
==
0
)
{
if
(
!
ftdmchan
->
buffer_delay
||
--
ftdmchan
->
buffer_delay
==
0
)
{
/* time to pick a buffer, either the dtmf or fsk buffer */
if
(
ftdmchan
->
dtmf_buffer
&&
(
dblen
=
ftdm_buffer_inuse
(
ftdmchan
->
dtmf_buffer
)))
{
if
(
ftdmchan
->
dtmf_buffer
&&
(
dblen
=
ftdm_buffer_inuse
(
ftdmchan
->
dtmf_buffer
)))
{
buffer
=
ftdmchan
->
dtmf_buffer
;
buffer
=
ftdmchan
->
dtmf_buffer
;
}
else
if
(
ftdmchan
->
fsk_buffer
&&
(
dblen
=
ftdm_buffer_inuse
(
ftdmchan
->
fsk_buffer
)))
{
}
else
if
(
ftdmchan
->
fsk_buffer
&&
(
dblen
=
ftdm_buffer_inuse
(
ftdmchan
->
fsk_buffer
)))
{
...
@@ -3638,22 +3647,41 @@ static ftdm_status_t handle_dtmf(ftdm_channel_t *ftdmchan, ftdm_size_t datalen)
...
@@ -3638,22 +3647,41 @@ static ftdm_status_t handle_dtmf(ftdm_channel_t *ftdmchan, ftdm_size_t datalen)
}
}
}
}
/* if we picked a buffer, time to read from it and write the linear data to the device */
if
(
buffer
)
{
if
(
buffer
)
{
ftdm_size_t
dlen
=
datalen
;
uint8_t
auxbuf
[
1024
];
uint8_t
auxbuf
[
1024
];
/* we initialize dlen to datalen, which is the size in bytes the
* user wants to read (typically chunks of 160 bytes, 20ms G.711) */
ftdm_size_t
dlen
=
datalen
;
ftdm_size_t
len
,
br
,
max
=
sizeof
(
auxbuf
);
ftdm_size_t
len
,
br
,
max
=
sizeof
(
auxbuf
);
/* if the codec is not linear, then data is really twice as much cuz
tone generation is done in linear (we assume anything different than linear is G.711) */
if
(
ftdmchan
->
native_codec
!=
FTDM_CODEC_SLIN
)
{
if
(
ftdmchan
->
native_codec
!=
FTDM_CODEC_SLIN
)
{
dlen
*=
2
;
dlen
*=
2
;
}
}
/* we do not expect the user chunks to be bigger than auxbuf */
ftdm_assert
(
dlen
<=
sizeof
(
auxbuf
),
"Unexpected size for user data chunk size
\n
"
);
/* dblen is the size in use for dtmf_buffer or fsk_buffer, and dlen is the size
* of the read chunks of the user, we pick the smaller one */
len
=
dblen
>
dlen
?
dlen
:
dblen
;
len
=
dblen
>
dlen
?
dlen
:
dblen
;
/* we can't read more than the size of our auxiliary buffer */
ftdm_assert
((
len
<=
sizeof
(
auxbuf
)),
"Unexpected size to read into auxbuf
\n
"
);
br
=
ftdm_buffer_read
(
buffer
,
auxbuf
,
len
);
br
=
ftdm_buffer_read
(
buffer
,
auxbuf
,
len
);
/* the amount read can't possibly be bigger than what we requested */
ftdm_assert
((
br
<=
len
),
"Unexpected size read from tone generation buffer
\n
"
);
/* if we read less than the chunk size, we must fill in with silence the rest */
if
(
br
<
dlen
)
{
if
(
br
<
dlen
)
{
memset
(
auxbuf
+
br
,
0
,
dlen
-
br
);
memset
(
auxbuf
+
br
,
0
,
dlen
-
br
);
}
}
/* finally we convert to the native format for the channel if necessary */
if
(
ftdmchan
->
native_codec
!=
FTDM_CODEC_SLIN
)
{
if
(
ftdmchan
->
native_codec
!=
FTDM_CODEC_SLIN
)
{
if
(
ftdmchan
->
native_codec
==
FTDM_CODEC_ULAW
)
{
if
(
ftdmchan
->
native_codec
==
FTDM_CODEC_ULAW
)
{
fio_slin2ulaw
(
auxbuf
,
max
,
&
dlen
);
fio_slin2ulaw
(
auxbuf
,
max
,
&
dlen
);
...
@@ -3662,6 +3690,7 @@ static ftdm_status_t handle_dtmf(ftdm_channel_t *ftdmchan, ftdm_size_t datalen)
...
@@ -3662,6 +3690,7 @@ static ftdm_status_t handle_dtmf(ftdm_channel_t *ftdmchan, ftdm_size_t datalen)
}
}
}
}
/* write the tone to the channel */
return
ftdm_raw_write
(
ftdmchan
,
auxbuf
,
&
dlen
);
return
ftdm_raw_write
(
ftdmchan
,
auxbuf
,
&
dlen
);
}
}
...
@@ -3741,7 +3770,7 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_read(ftdm_channel_t *ftdmchan, void *data
...
@@ -3741,7 +3770,7 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_read(ftdm_channel_t *ftdmchan, void *data
rdata
[
i
]
=
ftdmchan
->
rxgain_table
[
rdata
[
i
]];
rdata
[
i
]
=
ftdmchan
->
rxgain_table
[
rdata
[
i
]];
}
}
}
}
handle_
dtmf
(
ftdmchan
,
*
datalen
);
handle_
tone_generation
(
ftdmchan
,
*
datalen
);
if
(
ftdm_test_flag
(
ftdmchan
,
FTDM_CHANNEL_TRANSCODE
)
&&
ftdmchan
->
effective_codec
!=
ftdmchan
->
native_codec
)
{
if
(
ftdm_test_flag
(
ftdmchan
,
FTDM_CHANNEL_TRANSCODE
)
&&
ftdmchan
->
effective_codec
!=
ftdmchan
->
native_codec
)
{
if
(
ftdmchan
->
native_codec
==
FTDM_CODEC_ULAW
&&
ftdmchan
->
effective_codec
==
FTDM_CODEC_SLIN
)
{
if
(
ftdmchan
->
native_codec
==
FTDM_CODEC_ULAW
&&
ftdmchan
->
effective_codec
==
FTDM_CODEC_SLIN
)
{
...
@@ -3938,7 +3967,8 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_write(ftdm_channel_t *ftdmchan, void *dat
...
@@ -3938,7 +3967,8 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_write(ftdm_channel_t *ftdmchan, void *dat
if
(
!
ftdmchan
->
buffer_delay
&&
if
(
!
ftdmchan
->
buffer_delay
&&
((
ftdmchan
->
dtmf_buffer
&&
ftdm_buffer_inuse
(
ftdmchan
->
dtmf_buffer
))
||
((
ftdmchan
->
dtmf_buffer
&&
ftdm_buffer_inuse
(
ftdmchan
->
dtmf_buffer
))
||
(
ftdmchan
->
fsk_buffer
&&
ftdm_buffer_inuse
(
ftdmchan
->
fsk_buffer
))))
{
(
ftdmchan
->
fsk_buffer
&&
ftdm_buffer_inuse
(
ftdmchan
->
fsk_buffer
))))
{
/* read size writing DTMF ATM */
/* generating some kind of tone at the moment (see handle_tone_generation),
* we ignore user data ... */
goto
done
;
goto
done
;
}
}
...
...
src/mod/applications/mod_conference/mod_conference.c
浏览文件 @
46215605
...
@@ -401,13 +401,14 @@ static switch_status_t conference_outcall(conference_obj_t *conference,
...
@@ -401,13 +401,14 @@ static switch_status_t conference_outcall(conference_obj_t *conference,
char
*
bridgeto
,
uint32_t
timeout
,
char
*
bridgeto
,
uint32_t
timeout
,
char
*
flags
,
char
*
flags
,
char
*
cid_name
,
char
*
cid_name
,
char
*
cid_num
,
char
*
cid_num
,
char
*
profile
,
switch_call_cause_t
*
cause
,
switch_call_cause_t
*
cause
,
switch_call_cause_t
*
cancel_cause
);
switch_call_cause_t
*
cancel_cause
);
static
switch_status_t
conference_outcall_bg
(
conference_obj_t
*
conference
,
static
switch_status_t
conference_outcall_bg
(
conference_obj_t
*
conference
,
char
*
conference_name
,
char
*
conference_name
,
switch_core_session_t
*
session
,
char
*
bridgeto
,
uint32_t
timeout
,
const
char
*
flags
,
const
char
*
cid_name
,
switch_core_session_t
*
session
,
char
*
bridgeto
,
uint32_t
timeout
,
const
char
*
flags
,
const
char
*
cid_name
,
const
char
*
cid_num
,
const
char
*
call_uuid
,
switch_call_cause_t
*
cancel_cause
);
const
char
*
cid_num
,
const
char
*
call_uuid
,
const
char
*
profile
,
switch_call_cause_t
*
cancel_cause
);
SWITCH_STANDARD_APP
(
conference_function
);
SWITCH_STANDARD_APP
(
conference_function
);
static
void
launch_conference_thread
(
conference_obj_t
*
conference
);
static
void
launch_conference_thread
(
conference_obj_t
*
conference
);
static
void
launch_conference_video_thread
(
conference_obj_t
*
conference
);
static
void
launch_conference_video_thread
(
conference_obj_t
*
conference
);
...
@@ -2410,6 +2411,7 @@ static void conference_loop_output(conference_member_t *member)
...
@@ -2410,6 +2411,7 @@ static void conference_loop_output(conference_member_t *member)
const
char
*
cid_num
=
switch_channel_get_variable
(
channel
,
"conference_auto_outcall_caller_id_number"
);
const
char
*
cid_num
=
switch_channel_get_variable
(
channel
,
"conference_auto_outcall_caller_id_number"
);
const
char
*
toval
=
switch_channel_get_variable
(
channel
,
"conference_auto_outcall_timeout"
);
const
char
*
toval
=
switch_channel_get_variable
(
channel
,
"conference_auto_outcall_timeout"
);
const
char
*
flags
=
switch_channel_get_variable
(
channel
,
"conference_auto_outcall_flags"
);
const
char
*
flags
=
switch_channel_get_variable
(
channel
,
"conference_auto_outcall_flags"
);
const
char
*
profile
=
switch_channel_get_variable
(
channel
,
"conference_auto_outcall_profile"
);
const
char
*
ann
=
switch_channel_get_variable
(
channel
,
"conference_auto_outcall_announce"
);
const
char
*
ann
=
switch_channel_get_variable
(
channel
,
"conference_auto_outcall_announce"
);
const
char
*
prefix
=
switch_channel_get_variable
(
channel
,
"conference_auto_outcall_prefix"
);
const
char
*
prefix
=
switch_channel_get_variable
(
channel
,
"conference_auto_outcall_prefix"
);
int
to
=
60
;
int
to
=
60
;
...
@@ -2441,7 +2443,7 @@ static void conference_loop_output(conference_member_t *member)
...
@@ -2441,7 +2443,7 @@ static void conference_loop_output(conference_member_t *member)
char
*
dial_str
=
switch_mprintf
(
"%s%s"
,
switch_str_nil
(
prefix
),
argv
[
x
]);
char
*
dial_str
=
switch_mprintf
(
"%s%s"
,
switch_str_nil
(
prefix
),
argv
[
x
]);
switch_assert
(
dial_str
);
switch_assert
(
dial_str
);
conference_outcall_bg
(
member
->
conference
,
NULL
,
NULL
,
dial_str
,
to
,
switch_str_nil
(
flags
),
cid_name
,
cid_num
,
NULL
,
conference_outcall_bg
(
member
->
conference
,
NULL
,
NULL
,
dial_str
,
to
,
switch_str_nil
(
flags
),
cid_name
,
cid_num
,
NULL
,
&
member
->
conference
->
cancel_cause
);
profile
,
&
member
->
conference
->
cancel_cause
);
switch_safe_free
(
dial_str
);
switch_safe_free
(
dial_str
);
}
}
switch_safe_free
(
cpstr
);
switch_safe_free
(
cpstr
);
...
@@ -4264,9 +4266,9 @@ static switch_status_t conf_api_sub_dial(conference_obj_t *conference, switch_st
...
@@ -4264,9 +4266,9 @@ static switch_status_t conf_api_sub_dial(conference_obj_t *conference, switch_st
}
}
if
(
conference
)
{
if
(
conference
)
{
conference_outcall
(
conference
,
NULL
,
NULL
,
argv
[
2
],
60
,
NULL
,
argv
[
4
],
argv
[
3
],
&
cause
,
NULL
);
conference_outcall
(
conference
,
NULL
,
NULL
,
argv
[
2
],
60
,
NULL
,
argv
[
4
],
argv
[
3
],
NULL
,
&
cause
,
NULL
);
}
else
{
}
else
{
conference_outcall
(
NULL
,
argv
[
0
],
NULL
,
argv
[
2
],
60
,
NULL
,
argv
[
4
],
argv
[
3
],
&
cause
,
NULL
);
conference_outcall
(
NULL
,
argv
[
0
],
NULL
,
argv
[
2
],
60
,
NULL
,
argv
[
4
],
argv
[
3
],
NULL
,
&
cause
,
NULL
);
}
}
stream
->
write_function
(
stream
,
"Call Requested: result: [%s]
\n
"
,
switch_channel_cause2str
(
cause
));
stream
->
write_function
(
stream
,
"Call Requested: result: [%s]
\n
"
,
switch_channel_cause2str
(
cause
));
...
@@ -4289,9 +4291,9 @@ static switch_status_t conf_api_sub_bgdial(conference_obj_t *conference, switch_
...
@@ -4289,9 +4291,9 @@ static switch_status_t conf_api_sub_bgdial(conference_obj_t *conference, switch_
switch_uuid_format
(
uuid_str
,
&
uuid
);
switch_uuid_format
(
uuid_str
,
&
uuid
);
if
(
conference
)
{
if
(
conference
)
{
conference_outcall_bg
(
conference
,
NULL
,
NULL
,
argv
[
2
],
60
,
NULL
,
argv
[
4
],
argv
[
3
],
uuid_str
,
NULL
);
conference_outcall_bg
(
conference
,
NULL
,
NULL
,
argv
[
2
],
60
,
NULL
,
argv
[
4
],
argv
[
3
],
uuid_str
,
NULL
,
NULL
);
}
else
{
}
else
{
conference_outcall_bg
(
NULL
,
argv
[
0
],
NULL
,
argv
[
2
],
60
,
NULL
,
argv
[
4
],
argv
[
3
],
uuid_str
,
NULL
);
conference_outcall_bg
(
NULL
,
argv
[
0
],
NULL
,
argv
[
2
],
60
,
NULL
,
argv
[
4
],
argv
[
3
],
uuid_str
,
NULL
,
NULL
);
}
}
stream
->
write_function
(
stream
,
"OK Job-UUID: %s
\n
"
,
uuid_str
);
stream
->
write_function
(
stream
,
"OK Job-UUID: %s
\n
"
,
uuid_str
);
...
@@ -4807,7 +4809,8 @@ static switch_status_t conference_outcall(conference_obj_t *conference,
...
@@ -4807,7 +4809,8 @@ static switch_status_t conference_outcall(conference_obj_t *conference,
switch_core_session_t
*
session
,
switch_core_session_t
*
session
,
char
*
bridgeto
,
uint32_t
timeout
,
char
*
bridgeto
,
uint32_t
timeout
,
char
*
flags
,
char
*
cid_name
,
char
*
flags
,
char
*
cid_name
,
char
*
cid_num
,
char
*
cid_num
,
char
*
profile
,
switch_call_cause_t
*
cause
,
switch_call_cause_t
*
cause
,
switch_call_cause_t
*
cancel_cause
)
switch_call_cause_t
*
cancel_cause
)
{
{
...
@@ -4817,6 +4820,7 @@ static switch_status_t conference_outcall(conference_obj_t *conference,
...
@@ -4817,6 +4820,7 @@ static switch_status_t conference_outcall(conference_obj_t *conference,
switch_channel_t
*
caller_channel
=
NULL
;
switch_channel_t
*
caller_channel
=
NULL
;
char
appdata
[
512
];
char
appdata
[
512
];
int
rdlock
=
0
;
int
rdlock
=
0
;
switch_bool_t
have_flags
=
SWITCH_FALSE
;
*
cause
=
SWITCH_CAUSE_NORMAL_CLEARING
;
*
cause
=
SWITCH_CAUSE_NORMAL_CLEARING
;
...
@@ -4902,13 +4906,16 @@ static switch_status_t conference_outcall(conference_obj_t *conference,
...
@@ -4902,13 +4906,16 @@ static switch_status_t conference_outcall(conference_obj_t *conference,
status
=
SWITCH_STATUS_MEMERR
;
status
=
SWITCH_STATUS_MEMERR
;
goto
done
;
goto
done
;
}
}
/* add them to the conference */
if
(
flags
&&
strcasecmp
(
flags
,
"none"
))
{
if
(
flags
&&
strcasecmp
(
flags
,
"none"
))
{
switch_snprintf
(
appdata
,
sizeof
(
appdata
),
"%s+flags{%s}"
,
conference_name
,
flags
);
have_flags
=
SWITCH_TRUE
;
switch_caller_extension_add_application
(
peer_session
,
extension
,
(
char
*
)
global_app_name
,
appdata
);
}
else
{
switch_caller_extension_add_application
(
peer_session
,
extension
,
(
char
*
)
global_app_name
,
conference_name
);
}
}
/* add them to the conference */
switch_snprintf
(
appdata
,
sizeof
(
appdata
),
"%s%s%s%s%s%s"
,
conference_name
,
profile
?
"@"
:
""
,
profile
?
profile
:
""
,
have_flags
?
"+flags{"
:
""
,
have_flags
?
flags
:
""
,
have_flags
?
"}"
:
""
);
switch_caller_extension_add_application
(
peer_session
,
extension
,
(
char
*
)
global_app_name
,
appdata
);
switch_channel_set_caller_extension
(
peer_channel
,
extension
);
switch_channel_set_caller_extension
(
peer_channel
,
extension
);
switch_channel_set_state
(
peer_channel
,
CS_EXECUTE
);
switch_channel_set_state
(
peer_channel
,
CS_EXECUTE
);
...
@@ -4940,6 +4947,7 @@ struct bg_call {
...
@@ -4940,6 +4947,7 @@ struct bg_call {
char
*
cid_num
;
char
*
cid_num
;
char
*
conference_name
;
char
*
conference_name
;
char
*
uuid
;
char
*
uuid
;
char
*
profile
;
switch_call_cause_t
*
cancel_cause
;
switch_call_cause_t
*
cancel_cause
;
switch_memory_pool_t
*
pool
;
switch_memory_pool_t
*
pool
;
};
};
...
@@ -4953,7 +4961,7 @@ static void *SWITCH_THREAD_FUNC conference_outcall_run(switch_thread_t *thread,
...
@@ -4953,7 +4961,7 @@ static void *SWITCH_THREAD_FUNC conference_outcall_run(switch_thread_t *thread,
switch_event_t
*
event
;
switch_event_t
*
event
;
conference_outcall
(
call
->
conference
,
call
->
conference_name
,
conference_outcall
(
call
->
conference
,
call
->
conference_name
,
call
->
session
,
call
->
bridgeto
,
call
->
timeout
,
call
->
flags
,
call
->
cid_name
,
call
->
cid_num
,
&
cause
,
call
->
cancel_cause
);
call
->
session
,
call
->
bridgeto
,
call
->
timeout
,
call
->
flags
,
call
->
cid_name
,
call
->
cid_num
,
call
->
profile
,
&
cause
,
call
->
cancel_cause
);
if
(
call
->
conference
&&
test_eflag
(
call
->
conference
,
EFLAG_BGDIAL_RESULT
)
&&
if
(
call
->
conference
&&
test_eflag
(
call
->
conference
,
EFLAG_BGDIAL_RESULT
)
&&
switch_event_create_subclass
(
&
event
,
SWITCH_EVENT_CUSTOM
,
CONF_EVENT_MAINT
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_event_create_subclass
(
&
event
,
SWITCH_EVENT_CUSTOM
,
CONF_EVENT_MAINT
)
==
SWITCH_STATUS_SUCCESS
)
{
...
@@ -4969,6 +4977,7 @@ static void *SWITCH_THREAD_FUNC conference_outcall_run(switch_thread_t *thread,
...
@@ -4969,6 +4977,7 @@ static void *SWITCH_THREAD_FUNC conference_outcall_run(switch_thread_t *thread,
switch_safe_free
(
call
->
cid_num
);
switch_safe_free
(
call
->
cid_num
);
switch_safe_free
(
call
->
conference_name
);
switch_safe_free
(
call
->
conference_name
);
switch_safe_free
(
call
->
uuid
);
switch_safe_free
(
call
->
uuid
);
switch_safe_free
(
call
->
profile
);
if
(
call
->
pool
)
{
if
(
call
->
pool
)
{
switch_core_destroy_memory_pool
(
&
call
->
pool
);
switch_core_destroy_memory_pool
(
&
call
->
pool
);
}
}
...
@@ -4981,7 +4990,7 @@ static void *SWITCH_THREAD_FUNC conference_outcall_run(switch_thread_t *thread,
...
@@ -4981,7 +4990,7 @@ static void *SWITCH_THREAD_FUNC conference_outcall_run(switch_thread_t *thread,
static
switch_status_t
conference_outcall_bg
(
conference_obj_t
*
conference
,
static
switch_status_t
conference_outcall_bg
(
conference_obj_t
*
conference
,
char
*
conference_name
,
char
*
conference_name
,
switch_core_session_t
*
session
,
char
*
bridgeto
,
uint32_t
timeout
,
const
char
*
flags
,
const
char
*
cid_name
,
switch_core_session_t
*
session
,
char
*
bridgeto
,
uint32_t
timeout
,
const
char
*
flags
,
const
char
*
cid_name
,
const
char
*
cid_num
,
const
char
*
call_uuid
,
switch_call_cause_t
*
cancel_cause
)
const
char
*
cid_num
,
const
char
*
call_uuid
,
const
char
*
profile
,
switch_call_cause_t
*
cancel_cause
)
{
{
struct
bg_call
*
call
=
NULL
;
struct
bg_call
*
call
=
NULL
;
switch_thread_t
*
thread
;
switch_thread_t
*
thread
;
...
@@ -5025,6 +5034,10 @@ static switch_status_t conference_outcall_bg(conference_obj_t *conference,
...
@@ -5025,6 +5034,10 @@ static switch_status_t conference_outcall_bg(conference_obj_t *conference,
call
->
uuid
=
strdup
(
call_uuid
);
call
->
uuid
=
strdup
(
call_uuid
);
}
}
if
(
profile
)
{
call
->
profile
=
strdup
(
profile
);
}
switch_threadattr_create
(
&
thd_attr
,
pool
);
switch_threadattr_create
(
&
thd_attr
,
pool
);
switch_threadattr_detach_set
(
thd_attr
,
1
);
switch_threadattr_detach_set
(
thd_attr
,
1
);
switch_threadattr_stacksize_set
(
thd_attr
,
SWITCH_THREAD_STACKSIZE
);
switch_threadattr_stacksize_set
(
thd_attr
,
SWITCH_THREAD_STACKSIZE
);
...
@@ -5750,7 +5763,7 @@ SWITCH_STANDARD_APP(conference_function)
...
@@ -5750,7 +5763,7 @@ SWITCH_STANDARD_APP(conference_function)
/* if we're using "bridge:" make an outbound call and bridge it in */
/* if we're using "bridge:" make an outbound call and bridge it in */
if
(
!
zstr
(
bridgeto
)
&&
strcasecmp
(
bridgeto
,
"none"
))
{
if
(
!
zstr
(
bridgeto
)
&&
strcasecmp
(
bridgeto
,
"none"
))
{
switch_call_cause_t
cause
;
switch_call_cause_t
cause
;
if
(
conference_outcall
(
conference
,
NULL
,
session
,
bridgeto
,
60
,
NULL
,
NULL
,
NULL
,
&
cause
,
NULL
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
conference_outcall
(
conference
,
NULL
,
session
,
bridgeto
,
60
,
NULL
,
NULL
,
NULL
,
NULL
,
&
cause
,
NULL
)
!=
SWITCH_STATUS_SUCCESS
)
{
goto
done
;
goto
done
;
}
}
}
else
{
}
else
{
...
...
src/mod/applications/mod_dptools/mod_dptools.c
浏览文件 @
46215605
...
@@ -1864,6 +1864,7 @@ SWITCH_STANDARD_APP(att_xfer_function)
...
@@ -1864,6 +1864,7 @@ SWITCH_STANDARD_APP(att_xfer_function)
if
(
switch_ivr_originate
(
session
,
&
peer_session
,
&
cause
,
data
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
SOF_NONE
,
NULL
)
if
(
switch_ivr_originate
(
session
,
&
peer_session
,
&
cause
,
data
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
SOF_NONE
,
NULL
)
!=
SWITCH_STATUS_SUCCESS
||
!
peer_session
)
{
!=
SWITCH_STATUS_SUCCESS
||
!
peer_session
)
{
switch_channel_set_variable
(
channel
,
SWITCH_SIGNAL_BOND_VARIABLE
,
bond
);
goto
end
;
goto
end
;
}
}
...
@@ -1878,6 +1879,7 @@ SWITCH_STANDARD_APP(att_xfer_function)
...
@@ -1878,6 +1879,7 @@ SWITCH_STANDARD_APP(att_xfer_function)
if
(
zstr
(
bond
)
&&
switch_channel_down
(
peer_channel
))
{
if
(
zstr
(
bond
)
&&
switch_channel_down
(
peer_channel
))
{
switch_core_session_rwunlock
(
peer_session
);
switch_core_session_rwunlock
(
peer_session
);
switch_channel_set_variable
(
channel
,
SWITCH_SIGNAL_BOND_VARIABLE
,
bond
);
goto
end
;
goto
end
;
}
}
...
...
src/mod/applications/mod_voicemail/mod_voicemail.c
浏览文件 @
46215605
...
@@ -1011,6 +1011,11 @@ typedef struct msg_cnt_callback msg_cnt_callback_t;
...
@@ -1011,6 +1011,11 @@ typedef struct msg_cnt_callback msg_cnt_callback_t;
static
int
message_count_callback
(
void
*
pArg
,
int
argc
,
char
**
argv
,
char
**
columnNames
)
static
int
message_count_callback
(
void
*
pArg
,
int
argc
,
char
**
argv
,
char
**
columnNames
)
{
{
msg_cnt_callback_t
*
cbt
=
(
msg_cnt_callback_t
*
)
pArg
;
msg_cnt_callback_t
*
cbt
=
(
msg_cnt_callback_t
*
)
pArg
;
if
(
argc
<
3
||
zstr
(
argv
[
0
])
||
zstr
(
argv
[
1
])
||
zstr
(
argv
[
2
]))
{
return
-
1
;
}
if
(
atoi
(
argv
[
0
])
==
1
)
{
/* UnRead */
if
(
atoi
(
argv
[
0
])
==
1
)
{
/* UnRead */
if
(
!
strcasecmp
(
argv
[
1
],
"A_URGENT"
))
{
/* Urgent */
if
(
!
strcasecmp
(
argv
[
1
],
"A_URGENT"
))
{
/* Urgent */
cbt
->
total_new_urgent_messages
=
atoi
(
argv
[
2
]);
cbt
->
total_new_urgent_messages
=
atoi
(
argv
[
2
]);
...
@@ -1263,7 +1268,7 @@ static void message_count(vm_profile_t *profile, const char *id_in, const char *
...
@@ -1263,7 +1268,7 @@ static void message_count(vm_profile_t *profile, const char *id_in, const char *
{
{
char
msg_count
[
80
]
=
""
;
char
msg_count
[
80
]
=
""
;
msg_cnt_callback_t
cbt
=
{
0
};
msg_cnt_callback_t
cbt
=
{
0
};
char
sql
[
256
]
;
char
*
sql
;
char
*
myid
=
NULL
;
char
*
myid
=
NULL
;
...
@@ -1277,15 +1282,20 @@ static void message_count(vm_profile_t *profile, const char *id_in, const char *
...
@@ -1277,15 +1282,20 @@ static void message_count(vm_profile_t *profile, const char *id_in, const char *
myid
=
resolve_id
(
id_in
,
domain_name
,
"message-count"
);
myid
=
resolve_id
(
id_in
,
domain_name
,
"message-count"
);
switch_snprintf
(
sql
,
sizeof
(
sql
),
"select 1, read_flags, count(read_epoch) from voicemail_msgs where "
sql
=
switch_mprintf
(
"username='%s' and domain='%s' and in_folder='%s' "
"select 1, read_flags, count(read_epoch) from voicemail_msgs where "
"and read_epoch=0 group by read_flags union select 0, read_flags, count(read_epoch) from voicemail_msgs where username='%s' "
"username='%q' and domain='%q' and in_folder='%q' and read_epoch=0 "
"and domain='%s' and in_folder='%s' and read_epoch<>0 group by read_flags;"
,
"group by read_flags "
myid
,
domain_name
,
myfolder
,
myid
,
domain_name
,
myfolder
);
"union "
"select 0, read_flags, count(read_epoch) from voicemail_msgs where "
"username='%q' and domain='%q' and in_folder='%q' and read_epoch<>0 "
"group by read_flags;"
,
myid
,
domain_name
,
myfolder
,
myid
,
domain_name
,
myfolder
);
vm_execute_sql_callback
(
profile
,
profile
->
mutex
,
sql
,
message_count_callback
,
&
cbt
);
vm_execute_sql_callback
(
profile
,
profile
->
mutex
,
sql
,
message_count_callback
,
&
cbt
);
free
(
sql
);
*
total_new_messages
=
cbt
.
total_new_messages
+
cbt
.
total_new_urgent_messages
;
*
total_new_messages
=
cbt
.
total_new_messages
+
cbt
.
total_new_urgent_messages
;
*
total_new_urgent_messages
=
cbt
.
total_new_urgent_messages
;
*
total_new_urgent_messages
=
cbt
.
total_new_urgent_messages
;
...
...
src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c
浏览文件 @
46215605
...
@@ -1363,7 +1363,7 @@ static switch_status_t speech_channel_stop(speech_channel_t *schannel)
...
@@ -1363,7 +1363,7 @@ static switch_status_t speech_channel_stop(speech_channel_t *schannel)
}
}
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"(%s) %s stopped
\n
"
,
schannel
->
name
,
speech_channel_type_to_string
(
schannel
->
type
));
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"(%s) %s stopped
\n
"
,
schannel
->
name
,
speech_channel_type_to_string
(
schannel
->
type
));
}
else
if
(
schannel
->
state
==
SPEECH_CHANNEL_DONE
)
{
}
else
if
(
schannel
->
state
==
SPEECH_CHANNEL_DONE
)
{
speech_channel_set_state
(
schannel
,
SPEECH_CHANNEL_READY
);
speech_channel_set_state
_unlocked
(
schannel
,
SPEECH_CHANNEL_READY
);
}
}
done:
done:
...
...
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
46215605
...
@@ -3458,7 +3458,7 @@ SWITCH_STANDARD_API(sofia_contact_function)
...
@@ -3458,7 +3458,7 @@ SWITCH_STANDARD_API(sofia_contact_function)
{
{
char
*
data
;
char
*
data
;
char
*
user
=
NULL
;
char
*
user
=
NULL
;
char
*
domain
=
NULL
;
char
*
domain
=
NULL
,
*
dup_domain
=
NULL
;
char
*
concat
=
NULL
;
char
*
concat
=
NULL
;
char
*
profile_name
=
NULL
;
char
*
profile_name
=
NULL
;
char
*
p
;
char
*
p
;
...
@@ -3501,7 +3501,8 @@ SWITCH_STANDARD_API(sofia_contact_function)
...
@@ -3501,7 +3501,8 @@ SWITCH_STANDARD_API(sofia_contact_function)
}
}
if
(
zstr
(
domain
))
{
if
(
zstr
(
domain
))
{
domain
=
switch_core_get_variable_pdup
(
"domain"
,
switch_core_session_get_pool
(
session
));
dup_domain
=
switch_core_get_variable_dup
(
"domain"
);
domain
=
dup_domain
;
}
}
if
(
!
user
)
goto
end
;
if
(
!
user
)
goto
end
;
...
@@ -3567,6 +3568,7 @@ SWITCH_STANDARD_API(sofia_contact_function)
...
@@ -3567,6 +3568,7 @@ SWITCH_STANDARD_API(sofia_contact_function)
switch_safe_free
(
mystream
.
data
);
switch_safe_free
(
mystream
.
data
);
switch_safe_free
(
data
);
switch_safe_free
(
data
);
switch_safe_free
(
dup_domain
);
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论