Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
5b92970f
提交
5b92970f
authored
9月 26, 2013
作者:
Nathan Neulinger
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
ssh://git.freeswitch.org:222/freeswitch
上级
ea51b869
6078451b
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
120 行增加
和
34 行删除
+120
-34
switch_types.h
src/include/switch_types.h
+3
-1
mod_commands.c
src/mod/applications/mod_commands/mod_commands.c
+10
-2
switch.c
src/switch.c
+1
-1
switch_apr.c
src/switch_apr.c
+6
-6
switch_core_io.c
src/switch_core_io.c
+1
-1
switch_core_session.c
src/switch_core_session.c
+1
-1
switch_event.c
src/switch_event.c
+14
-20
switch_ivr_originate.c
src/switch_ivr_originate.c
+2
-2
gl
support-d/gl
+82
-0
没有找到文件。
src/include/switch_types.h
浏览文件 @
5b92970f
...
@@ -1041,7 +1041,9 @@ typedef enum {
...
@@ -1041,7 +1041,9 @@ typedef enum {
SWITCH_STATUS_FOUND
,
SWITCH_STATUS_FOUND
,
SWITCH_STATUS_CONTINUE
,
SWITCH_STATUS_CONTINUE
,
SWITCH_STATUS_TERM
,
SWITCH_STATUS_TERM
,
SWITCH_STATUS_NOT_INITALIZED
SWITCH_STATUS_NOT_INITALIZED
,
SWITCH_STATUS_XBREAK
=
35
,
SWITCH_STATUS_WINBREAK
=
730035
}
switch_status_t
;
}
switch_status_t
;
...
...
src/mod/applications/mod_commands/mod_commands.c
浏览文件 @
5b92970f
...
@@ -1329,6 +1329,8 @@ SWITCH_STANDARD_API(stun_function)
...
@@ -1329,6 +1329,8 @@ SWITCH_STANDARD_API(stun_function)
switch_port_t
port
=
0
;
switch_port_t
port
=
0
;
switch_memory_pool_t
*
pool
=
NULL
;
switch_memory_pool_t
*
pool
=
NULL
;
char
*
error
=
""
;
char
*
error
=
""
;
char
*
argv
[
3
]
=
{
0
};
char
*
mycmd
=
NULL
;
ip
=
ip_buf
;
ip
=
ip_buf
;
...
@@ -1337,9 +1339,15 @@ SWITCH_STANDARD_API(stun_function)
...
@@ -1337,9 +1339,15 @@ SWITCH_STANDARD_API(stun_function)
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
stun_ip
=
strdup
(
cmd
);
mycmd
=
strdup
(
cmd
);
switch_split
(
mycmd
,
' '
,
argv
);
stun_ip
=
argv
[
0
];
switch_assert
(
stun_ip
);
switch_assert
(
stun_ip
);
port
=
argv
[
1
]
?
atoi
(
argv
[
1
])
:
0
;
if
((
p
=
strchr
(
stun_ip
,
':'
)))
{
if
((
p
=
strchr
(
stun_ip
,
':'
)))
{
int
iport
;
int
iport
;
*
p
++
=
'\0'
;
*
p
++
=
'\0'
;
...
@@ -1374,7 +1382,7 @@ SWITCH_STANDARD_API(stun_function)
...
@@ -1374,7 +1382,7 @@ SWITCH_STANDARD_API(stun_function)
}
}
switch_core_destroy_memory_pool
(
&
pool
);
switch_core_destroy_memory_pool
(
&
pool
);
free
(
stun_ip
);
switch_safe_free
(
mycmd
);
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
...
...
src/switch.c
浏览文件 @
5b92970f
...
@@ -435,7 +435,7 @@ static const char usage[] =
...
@@ -435,7 +435,7 @@ static const char usage[] =
"
\t
-version -- print the version and exit
\n
"
"
\t
-version -- print the version and exit
\n
"
"
\t
-rp -- enable high(realtime) priority settings
\n
"
"
\t
-rp -- enable high(realtime) priority settings
\n
"
"
\t
-lp -- enable low priority settings
\n
"
"
\t
-lp -- enable low priority settings
\n
"
"
\t
-np -- enable normal priority settings
(system defaults)
\n
"
"
\t
-np -- enable normal priority settings
\n
"
"
\t
-vg -- run under valgrind
\n
"
"
\t
-vg -- run under valgrind
\n
"
"
\t
-nosql -- disable internal sql scoreboard
\n
"
"
\t
-nosql -- disable internal sql scoreboard
\n
"
"
\t
-heavy-timer -- Heavy Timer, possibly more accurate but at a cost
\n
"
"
\t
-heavy-timer -- Heavy Timer, possibly more accurate but at a cost
\n
"
...
...
src/switch_apr.c
浏览文件 @
5b92970f
...
@@ -717,7 +717,7 @@ SWITCH_DECLARE(switch_status_t) switch_socket_connect(switch_socket_t *sock, swi
...
@@ -717,7 +717,7 @@ SWITCH_DECLARE(switch_status_t) switch_socket_connect(switch_socket_t *sock, swi
SWITCH_DECLARE
(
switch_status_t
)
switch_socket_send
(
switch_socket_t
*
sock
,
const
char
*
buf
,
switch_size_t
*
len
)
SWITCH_DECLARE
(
switch_status_t
)
switch_socket_send
(
switch_socket_t
*
sock
,
const
char
*
buf
,
switch_size_t
*
len
)
{
{
switch_status_
t
status
=
SWITCH_STATUS_SUCCESS
;
in
t
status
=
SWITCH_STATUS_SUCCESS
;
switch_size_t
req
=
*
len
,
wrote
=
0
,
need
=
*
len
;
switch_size_t
req
=
*
len
,
wrote
=
0
,
need
=
*
len
;
int
to_count
=
0
;
int
to_count
=
0
;
...
@@ -737,7 +737,7 @@ SWITCH_DECLARE(switch_status_t) switch_socket_send(switch_socket_t *sock, const
...
@@ -737,7 +737,7 @@ SWITCH_DECLARE(switch_status_t) switch_socket_send(switch_socket_t *sock, const
}
}
*
len
=
wrote
;
*
len
=
wrote
;
return
status
;
return
(
switch_status_t
)
status
;
}
}
SWITCH_DECLARE
(
switch_status_t
)
switch_socket_send_nonblock
(
switch_socket_t
*
sock
,
const
char
*
buf
,
switch_size_t
*
len
)
SWITCH_DECLARE
(
switch_status_t
)
switch_socket_send_nonblock
(
switch_socket_t
*
sock
,
const
char
*
buf
,
switch_size_t
*
len
)
...
@@ -760,7 +760,7 @@ SWITCH_DECLARE(switch_status_t) switch_socket_sendto(switch_socket_t *sock, swit
...
@@ -760,7 +760,7 @@ SWITCH_DECLARE(switch_status_t) switch_socket_sendto(switch_socket_t *sock, swit
SWITCH_DECLARE
(
switch_status_t
)
switch_socket_recv
(
switch_socket_t
*
sock
,
char
*
buf
,
switch_size_t
*
len
)
SWITCH_DECLARE
(
switch_status_t
)
switch_socket_recv
(
switch_socket_t
*
sock
,
char
*
buf
,
switch_size_t
*
len
)
{
{
switch_status_
t
r
;
in
t
r
;
r
=
apr_socket_recv
(
sock
,
buf
,
len
);
r
=
apr_socket_recv
(
sock
,
buf
,
len
);
...
@@ -768,7 +768,7 @@ SWITCH_DECLARE(switch_status_t) switch_socket_recv(switch_socket_t *sock, char *
...
@@ -768,7 +768,7 @@ SWITCH_DECLARE(switch_status_t) switch_socket_recv(switch_socket_t *sock, char *
r
=
SWITCH_STATUS_BREAK
;
r
=
SWITCH_STATUS_BREAK
;
}
}
return
r
;
return
(
switch_status_t
)
r
;
}
}
SWITCH_DECLARE
(
switch_status_t
)
switch_sockaddr_create
(
switch_sockaddr_t
**
sa
,
switch_memory_pool_t
*
pool
)
SWITCH_DECLARE
(
switch_status_t
)
switch_sockaddr_create
(
switch_sockaddr_t
**
sa
,
switch_memory_pool_t
*
pool
)
...
@@ -866,7 +866,7 @@ SWITCH_DECLARE(switch_status_t) switch_socket_atmark(switch_socket_t *sock, int
...
@@ -866,7 +866,7 @@ SWITCH_DECLARE(switch_status_t) switch_socket_atmark(switch_socket_t *sock, int
SWITCH_DECLARE
(
switch_status_t
)
switch_socket_recvfrom
(
switch_sockaddr_t
*
from
,
switch_socket_t
*
sock
,
int32_t
flags
,
char
*
buf
,
size_t
*
len
)
SWITCH_DECLARE
(
switch_status_t
)
switch_socket_recvfrom
(
switch_sockaddr_t
*
from
,
switch_socket_t
*
sock
,
int32_t
flags
,
char
*
buf
,
size_t
*
len
)
{
{
apr_status_
t
r
=
SWITCH_STATUS_GENERR
;
in
t
r
=
SWITCH_STATUS_GENERR
;
if
(
from
&&
sock
&&
(
r
=
apr_socket_recvfrom
(
from
,
sock
,
flags
,
buf
,
len
))
==
APR_SUCCESS
)
{
if
(
from
&&
sock
&&
(
r
=
apr_socket_recvfrom
(
from
,
sock
,
flags
,
buf
,
len
))
==
APR_SUCCESS
)
{
from
->
port
=
ntohs
(
from
->
sa
.
sin
.
sin_port
);
from
->
port
=
ntohs
(
from
->
sa
.
sin
.
sin_port
);
...
@@ -879,7 +879,7 @@ SWITCH_DECLARE(switch_status_t) switch_socket_recvfrom(switch_sockaddr_t *from,
...
@@ -879,7 +879,7 @@ SWITCH_DECLARE(switch_status_t) switch_socket_recvfrom(switch_sockaddr_t *from,
r
=
SWITCH_STATUS_BREAK
;
r
=
SWITCH_STATUS_BREAK
;
}
}
return
r
;
return
(
switch_status_t
)
r
;
}
}
/* poll stubs */
/* poll stubs */
...
...
src/switch_core_io.c
浏览文件 @
5b92970f
...
@@ -773,7 +773,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
...
@@ -773,7 +773,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
switch_buffer_create_dynamic
(
&
session
->
raw_read_buffer
,
bytes
*
SWITCH_BUFFER_BLOCK_FRAMES
,
bytes
*
SWITCH_BUFFER_START_FRAMES
,
0
);
switch_buffer_create_dynamic
(
&
session
->
raw_read_buffer
,
bytes
*
SWITCH_BUFFER_BLOCK_FRAMES
,
bytes
*
SWITCH_BUFFER_START_FRAMES
,
0
);
}
}
if
(
!
switch_buffer_write
(
session
->
raw_read_buffer
,
read_frame
->
data
,
read_frame
->
datalen
))
{
if
(
read_frame
->
datalen
&&
(
!
switch_buffer_write
(
session
->
raw_read_buffer
,
read_frame
->
data
,
read_frame
->
datalen
)
))
{
status
=
SWITCH_STATUS_MEMERR
;
status
=
SWITCH_STATUS_MEMERR
;
goto
done
;
goto
done
;
}
}
...
...
src/switch_core_session.c
浏览文件 @
5b92970f
...
@@ -1394,7 +1394,7 @@ SWITCH_DECLARE(void) switch_core_session_perform_destroy(switch_core_session_t *
...
@@ -1394,7 +1394,7 @@ SWITCH_DECLARE(void) switch_core_session_perform_destroy(switch_core_session_t *
switch_channel_get_name
((
*
session
)
->
channel
),
switch_channel_state_name
(
switch_channel_get_state
((
*
session
)
->
channel
)));
switch_channel_get_name
((
*
session
)
->
channel
),
switch_channel_state_name
(
switch_channel_get_state
((
*
session
)
->
channel
)));
switch_core_session_reset
(
*
session
,
TRUE
,
SWITCH_TRUE
);
switch_core_session_reset
(
*
session
,
SWITCH_
TRUE
,
SWITCH_TRUE
);
switch_core_media_bug_remove_all
(
*
session
);
switch_core_media_bug_remove_all
(
*
session
);
switch_ivr_deactivate_unicast
(
*
session
);
switch_ivr_deactivate_unicast
(
*
session
);
...
...
src/switch_event.c
浏览文件 @
5b92970f
...
@@ -644,31 +644,11 @@ SWITCH_DECLARE(switch_status_t) switch_event_init(switch_memory_pool_t *pool)
...
@@ -644,31 +644,11 @@ SWITCH_DECLARE(switch_status_t) switch_event_init(switch_memory_pool_t *pool)
switch_find_local_ip
(
guess_ip_v6
,
sizeof
(
guess_ip_v6
),
NULL
,
AF_INET6
);
switch_find_local_ip
(
guess_ip_v6
,
sizeof
(
guess_ip_v6
),
NULL
,
AF_INET6
);
//switch_queue_create(&EVENT_QUEUE[0], POOL_COUNT_MAX + 10, THRUNTIME_POOL);
//switch_queue_create(&EVENT_QUEUE[1], POOL_COUNT_MAX + 10, THRUNTIME_POOL);
//switch_queue_create(&EVENT_QUEUE[2], POOL_COUNT_MAX + 10, THRUNTIME_POOL);
#ifdef SWITCH_EVENT_RECYCLE
#ifdef SWITCH_EVENT_RECYCLE
switch_queue_create
(
&
EVENT_RECYCLE_QUEUE
,
250000
,
THRUNTIME_POOL
);
switch_queue_create
(
&
EVENT_RECYCLE_QUEUE
,
250000
,
THRUNTIME_POOL
);
switch_queue_create
(
&
EVENT_HEADER_RECYCLE_QUEUE
,
250000
,
THRUNTIME_POOL
);
switch_queue_create
(
&
EVENT_HEADER_RECYCLE_QUEUE
,
250000
,
THRUNTIME_POOL
);
#endif
#endif
//switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
if
(
runtime
.
events_use_dispatch
)
{
switch_queue_create
(
&
EVENT_DISPATCH_QUEUE
,
DISPATCH_QUEUE_LEN
*
MAX_DISPATCH
,
pool
);
switch_event_launch_dispatch_threads
(
1
);
}
//switch_thread_create(&EVENT_QUEUE_THREADS[0], thd_attr, switch_event_thread, EVENT_QUEUE[0], RUNTIME_POOL);
//switch_thread_create(&EVENT_QUEUE_THREADS[1], thd_attr, switch_event_thread, EVENT_QUEUE[1], RUNTIME_POOL);
//switch_thread_create(&EVENT_QUEUE_THREADS[2], thd_attr, switch_event_thread, EVENT_QUEUE[2], RUNTIME_POOL);
if
(
runtime
.
events_use_dispatch
)
{
while
(
!
THREAD_COUNT
)
{
switch_cond_next
();
}
}
switch_mutex_lock
(
EVENT_QUEUE_MUTEX
);
switch_mutex_lock
(
EVENT_QUEUE_MUTEX
);
SYSTEM_RUNNING
=
1
;
SYSTEM_RUNNING
=
1
;
switch_mutex_unlock
(
EVENT_QUEUE_MUTEX
);
switch_mutex_unlock
(
EVENT_QUEUE_MUTEX
);
...
@@ -1921,6 +1901,20 @@ SWITCH_DECLARE(switch_status_t) switch_event_fire_detailed(const char *file, con
...
@@ -1921,6 +1901,20 @@ SWITCH_DECLARE(switch_status_t) switch_event_fire_detailed(const char *file, con
if
(
runtime
.
events_use_dispatch
)
{
if
(
runtime
.
events_use_dispatch
)
{
if
(
!
EVENT_DISPATCH_QUEUE
)
{
switch_mutex_lock
(
BLOCK
);
if
(
!
EVENT_DISPATCH_QUEUE
)
{
switch_queue_create
(
&
EVENT_DISPATCH_QUEUE
,
DISPATCH_QUEUE_LEN
*
MAX_DISPATCH
,
THRUNTIME_POOL
);
switch_event_launch_dispatch_threads
(
1
);
while
(
!
THREAD_COUNT
)
{
switch_cond_next
();
}
}
switch_mutex_unlock
(
BLOCK
);
}
if
(
switch_event_queue_dispatch_event
(
event
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_event_queue_dispatch_event
(
event
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_event_destroy
(
event
);
switch_event_destroy
(
event
);
return
SWITCH_STATUS_FALSE
;
return
SWITCH_STATUS_FALSE
;
...
...
src/switch_ivr_originate.c
浏览文件 @
5b92970f
...
@@ -927,7 +927,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_wait_for_answer(switch_core_session_t
...
@@ -927,7 +927,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_wait_for_answer(switch_core_session_t
switch_core_session_get_pool
(
session
))
!=
SWITCH_STATUS_SUCCESS
)
{
switch_core_session_get_pool
(
session
))
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"Codec Error!
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"Codec Error!
\n
"
);
if
(
caller_channel
)
{
if
(
caller_channel
)
{
switch_channel_hangup
(
caller_channel
,
SWITCH_CAUSE_
NORMAL_TEMPORARY_FAILURE
);
switch_channel_hangup
(
caller_channel
,
SWITCH_CAUSE_
BEARERCAPABILITY_NOTIMPL
);
}
}
read_codec
=
NULL
;
read_codec
=
NULL
;
goto
done
;
goto
done
;
...
@@ -1254,7 +1254,7 @@ static switch_status_t setup_ringback(originate_global_t *oglobals, originate_st
...
@@ -1254,7 +1254,7 @@ static switch_status_t setup_ringback(originate_global_t *oglobals, originate_st
switch_core_session_set_read_codec
(
oglobals
->
session
,
write_codec
);
switch_core_session_set_read_codec
(
oglobals
->
session
,
write_codec
);
}
else
{
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_CHANNEL_LOG
(
caller_channel
),
SWITCH_LOG_ERROR
,
"Codec Error!
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_CHANNEL_LOG
(
caller_channel
),
SWITCH_LOG_ERROR
,
"Codec Error!
\n
"
);
switch_channel_hangup
(
caller_channel
,
SWITCH_CAUSE_
NORMAL_TEMPORARY_FAILURE
);
switch_channel_hangup
(
caller_channel
,
SWITCH_CAUSE_
BEARERCAPABILITY_NOTIMPL
);
read_codec
=
NULL
;
read_codec
=
NULL
;
switch_goto_status
(
SWITCH_STATUS_BREAK
,
end
);
switch_goto_status
(
SWITCH_STATUS_BREAK
,
end
);
}
}
...
...
support-d/gl
0 → 100755
浏览文件 @
5b92970f
#!/usr/bin/perl
my
$pager
=
`which less`
||
`which more`
;
my
$tmpdir
=
"/tmp/FSJIRA"
;
system
(
"mkdir -p $tmpdir"
);
my
$cmd
=
"git log "
.
join
(
" "
,
@ARGV
);
open
(
CMD
,
"$cmd |"
);
open
(
PAGER
,
"|$pager"
);
select
PAGER
;
while
(
my
$line
=
<
CMD
>
)
{
print
$line
;
if
(
$line
=~
/([A-Z]+\-[0-9]+)/
)
{
my
$bug
=
$1
;
my
$txt
=
bugtxt
(
$bug
);
if
(
$txt
)
{
print
"="
x
80
.
"\n"
;
print
$txt
;
print
"="
x
80
.
"\n"
;
}
}
}
close
(
CMD
);
close
(
PAGER
);
sub
catfile
($)
{
my
$file
=
shift
;
open
(
I
,
$file
)
or
return
;
$/
=
undef
;
my
$txt
=
<
I
>
;
$/
=
"\n"
;
close
(
I
);
return
$txt
;
}
sub
bugtxt
($)
{
my
$bug
=
shift
or
return
""
;
my
$now
=
time
;
my
$tmp
;
$bug
=~
s/\.\.//g
;
$bug
=~
s/^\///g
;
$bug
=~
s/~//g
;
$bug
=~
s/[^a-zA-Z0-9\-]//g
;
$tmp
=
"$tmpdir/$bug.txt"
;
if
(
-
f
$tmp
)
{
return
catfile
(
$tmp
);
}
my
$cmd
=
"wget -q http://jira.freeswitch.org/si/jira.issueviews:issue-xml/$bug/$bug.xml -O $tmp"
;
system
(
$cmd
);
my
$txt
=
catfile
(
$tmp
);
my
(
$a
,
$title
)
=
$txt
=~
/\<title\>(.*?)\<\/title\>/smg
;
my
(
$status
)
=
$txt
=~
/\<status.*?\>(.*?)\<\/status\>/smg
;
my
(
$a
,
$des
)
=
$txt
=~
/\<description\>(.*?)\<\/description\>/smg
;
my
(
$alogin
,
$aname
)
=
$txt
=~
/\<assignee username=\"([^\"]+)\"\>(.*?)\<\/assignee\>/smg
;
my
(
$rlogin
,
$rname
)
=
$txt
=~
/\<reporter username=\"([^\"]+)\"\>(.*?)\<\/reporter\>/smg
;
if
(
$rname
&&
$aname
)
{
my
$data
=
"$title\nReporter: $rname [$rlogin]\nAssignee: $aname [$alogin]\nStatus: $status\nhttp://jira.freeswitch.org/browse/$bug\n"
;
open
(
O
,
">$tmp"
);
print
O
$data
;
close
(
O
);
return
$data
;
}
else
{
unlink
(
$tmp
);
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论