Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
d3141403
提交
d3141403
authored
5月 12, 2006
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cleanup
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@1445
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
1dfa2ce5
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
45 行增加
和
19 行删除
+45
-19
switch_utils.h
src/include/switch_utils.h
+7
-0
mod_exosip.c
src/mod/endpoints/mod_exosip/mod_exosip.c
+13
-14
mod_spidermonkey.c
src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
+17
-2
mod_xml_rpc.c
src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
+4
-2
switch_core.c
src/switch_core.c
+4
-1
没有找到文件。
src/include/switch_utils.h
浏览文件 @
d3141403
...
@@ -127,6 +127,13 @@ SWITCH_DECLARE(unsigned char) switch_char_to_rfc2833(char key);
...
@@ -127,6 +127,13 @@ SWITCH_DECLARE(unsigned char) switch_char_to_rfc2833(char key);
*/
*/
#define switch_copy_flags(dest, src, flags) (dest)->flags &= ~(flags); (dest)->flags |= ((src)->flags & (flags))
#define switch_copy_flags(dest, src, flags) (dest)->flags &= ~(flags); (dest)->flags |= ((src)->flags & (flags))
/*!
\brief Free a pointer and set it to NULL unles it already is NULL
\param it the pointer
*/
#define switch_safe_free(it) if (it) {free(it);it=NULL;}
/*!
/*!
\brief Test for NULL or zero length string
\brief Test for NULL or zero length string
\param s the string to test
\param s the string to test
...
...
src/mod/endpoints/mod_exosip/mod_exosip.c
浏览文件 @
d3141403
...
@@ -30,6 +30,8 @@
...
@@ -30,6 +30,8 @@
*
*
*/
*/
#define MY_EVENT_REGISTER "exosip::register"
#define MY_EVENT_REGISTER "exosip::register"
#define MY_EVENT_EXPIRE "exosip::expire"
#define MY_EVENT_EXPIRE "exosip::expire"
...
@@ -1361,6 +1363,10 @@ static switch_status_t exosip_create_call(eXosip_event_t * event)
...
@@ -1361,6 +1363,10 @@ static switch_status_t exosip_create_call(eXosip_event_t * event)
}
}
}
}
switch_safe_free
(
dname
);
switch_safe_free
(
drate
);
switch_safe_free
(
dpayload
);
if
(
activate_rtp
(
tech_pvt
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
activate_rtp
(
tech_pvt
)
!=
SWITCH_STATUS_SUCCESS
)
{
exosip_on_hangup
(
session
);
exosip_on_hangup
(
session
);
switch_core_session_destroy
(
&
session
);
switch_core_session_destroy
(
&
session
);
...
@@ -1493,10 +1499,8 @@ static void handle_message_new(eXosip_event_t *je)
...
@@ -1493,10 +1499,8 @@ static void handle_message_new(eXosip_event_t *je)
if
(
osip_message_get_contact
(
je
->
request
,
x
++
,
&
contact
)
<
0
)
{
if
(
osip_message_get_contact
(
je
->
request
,
x
++
,
&
contact
)
<
0
)
{
break
;
break
;
}
}
if
(
lame
)
{
free
(
lame
);
switch_safe_free
(
lame
);
lame
=
NULL
;
}
osip_contact_to_str
((
const
osip_contact_t
*
)
contact
,
&
lame
);
osip_contact_to_str
((
const
osip_contact_t
*
)
contact
,
&
lame
);
contact_uri
=
osip_contact_get_url
(
contact
);
contact_uri
=
osip_contact_get_url
(
contact
);
...
@@ -1544,11 +1548,8 @@ static void handle_message_new(eXosip_event_t *je)
...
@@ -1544,11 +1548,8 @@ static void handle_message_new(eXosip_event_t *je)
}
}
}
}
switch_safe_free
(
lame
);
}
else
{
}
/* Unimplemented */
}
}
}
...
@@ -1650,9 +1651,9 @@ static void handle_answer(eXosip_event_t * event)
...
@@ -1650,9 +1651,9 @@ static void handle_answer(eXosip_event_t * event)
eXosip_call_send_ack
(
event
->
did
,
ack
);
eXosip_call_send_ack
(
event
->
did
,
ack
);
eXosip_unlock
();
eXosip_unlock
();
free
(
dname
);
switch_safe_
free
(
dname
);
free
(
drate
);
switch_safe_
free
(
drate
);
free
(
dpayload
);
switch_safe_
free
(
dpayload
);
if
(
activate_rtp
(
tech_pvt
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
activate_rtp
(
tech_pvt
)
!=
SWITCH_STATUS_SUCCESS
)
{
...
@@ -2018,8 +2019,6 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
...
@@ -2018,8 +2019,6 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
break
;
break
;
case
EXOSIP_CALL_INVITE
:
case
EXOSIP_CALL_INVITE
:
if
(
exosip_create_call
(
event
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
exosip_create_call
(
event
)
!=
SWITCH_STATUS_SUCCESS
)
{
destroy_call_by_event
(
event
);
destroy_call_by_event
(
event
);
}
}
break
;
break
;
...
...
src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
浏览文件 @
d3141403
...
@@ -661,11 +661,18 @@ static JSBool session_hangup(JSContext *cx, JSObject *obj, uintN argc, jsval *ar
...
@@ -661,11 +661,18 @@ static JSBool session_hangup(JSContext *cx, JSObject *obj, uintN argc, jsval *ar
{
{
struct
js_session
*
jss
=
JS_GetPrivate
(
cx
,
obj
);
struct
js_session
*
jss
=
JS_GetPrivate
(
cx
,
obj
);
switch_channel_t
*
channel
;
switch_channel_t
*
channel
;
char
*
cause_name
=
NULL
;
switch_call_cause_t
cause
=
SWITCH_CAUSE_NORMAL_CLEARING
;
if
(
argc
>
1
)
{
cause_name
=
JS_GetStringBytes
(
JS_ValueToString
(
cx
,
argv
[
0
]));
cause
=
switch_channel_str2cause
(
cause_name
);
}
channel
=
switch_core_session_get_channel
(
jss
->
session
);
channel
=
switch_core_session_get_channel
(
jss
->
session
);
assert
(
channel
!=
NULL
);
assert
(
channel
!=
NULL
);
switch_channel_hangup
(
channel
,
SWITCH_CAUSE_NORMAL_CLEARING
);
switch_channel_hangup
(
channel
,
cause
);
switch_core_session_kill_channel
(
jss
->
session
,
SWITCH_SIG_KILL
);
switch_core_session_kill_channel
(
jss
->
session
,
SWITCH_SIG_KILL
);
return
JS_TRUE
;
return
JS_TRUE
;
}
}
...
@@ -747,7 +754,7 @@ static JSBool js_fetchurl_hash(JSContext *cx, JSObject *obj, uintN argc, jsval *
...
@@ -747,7 +754,7 @@ static JSBool js_fetchurl_hash(JSContext *cx, JSObject *obj, uintN argc, jsval *
url
=
JS_GetStringBytes
(
JS_ValueToString
(
cx
,
argv
[
0
]));
url
=
JS_GetStringBytes
(
JS_ValueToString
(
cx
,
argv
[
0
]));
name
=
JS_GetStringBytes
(
JS_ValueToString
(
cx
,
argv
[
1
]));
name
=
JS_GetStringBytes
(
JS_ValueToString
(
cx
,
argv
[
1
]));
curl_global_init
(
CURL_GLOBAL_ALL
);
curl_handle
=
curl_easy_init
();
curl_handle
=
curl_easy_init
();
if
(
!
strncasecmp
(
url
,
"https"
,
5
))
{
if
(
!
strncasecmp
(
url
,
"https"
,
5
))
{
curl_easy_setopt
(
curl_handle
,
CURLOPT_SSL_VERIFYPEER
,
0
);
curl_easy_setopt
(
curl_handle
,
CURLOPT_SSL_VERIFYPEER
,
0
);
...
@@ -2206,6 +2213,14 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_mod
...
@@ -2206,6 +2213,14 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_mod
/* connect my internal structure to the blank pointer passed to me */
/* connect my internal structure to the blank pointer passed to me */
*
module_interface
=
&
spidermonkey_module_interface
;
*
module_interface
=
&
spidermonkey_module_interface
;
curl_global_init
(
CURL_GLOBAL_ALL
);
/* indicate that the module should continue to be loaded */
/* indicate that the module should continue to be loaded */
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
SWITCH_MOD_DECLARE
(
switch_status_t
)
switch_module_shutdown
(
void
)
{
curl_global_cleanup
();
return
SWITCH_STATUS_SUCCESS
;
}
src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
浏览文件 @
d3141403
...
@@ -77,13 +77,12 @@ static switch_xml_t xml_url_fetch(char *section,
...
@@ -77,13 +77,12 @@ static switch_xml_t xml_url_fetch(char *section,
char
url
[
1024
]
=
""
,
filename
[
1024
]
=
""
;
char
url
[
1024
]
=
""
,
filename
[
1024
]
=
""
;
CURL
*
curl_handle
=
NULL
;
CURL
*
curl_handle
=
NULL
;
struct
config_data
config_data
;
struct
config_data
config_data
;
switch_xml_t
xml
;
switch_xml_t
xml
=
NULL
;
snprintf
(
url
,
sizeof
(
url
),
"%s?section=%s&tag_name=%s&key_name=%s&key_value=%s%s%s
\n
"
,
snprintf
(
url
,
sizeof
(
url
),
"%s?section=%s&tag_name=%s&key_name=%s&key_value=%s%s%s
\n
"
,
globals
.
url
,
section
,
tag_name
,
key_name
,
key_value
,
params
?
"&"
:
""
,
params
?
params
:
""
);
globals
.
url
,
section
,
tag_name
,
key_name
,
key_value
,
params
?
"&"
:
""
,
params
?
params
:
""
);
srand
((
unsigned
int
)(
time
(
NULL
)
+
strlen
(
url
)));
srand
((
unsigned
int
)(
time
(
NULL
)
+
strlen
(
url
)));
snprintf
(
filename
,
sizeof
(
filename
),
"%s%04x.tmp"
,
SWITCH_GLOBAL_dirs
.
temp_dir
,
(
rand
()
&
0xffff
));
snprintf
(
filename
,
sizeof
(
filename
),
"%s%04x.tmp"
,
SWITCH_GLOBAL_dirs
.
temp_dir
,
(
rand
()
&
0xffff
));
curl_global_init
(
CURL_GLOBAL_ALL
);
curl_handle
=
curl_easy_init
();
curl_handle
=
curl_easy_init
();
if
(
!
strncasecmp
(
url
,
"https"
,
5
))
{
if
(
!
strncasecmp
(
url
,
"https"
,
5
))
{
curl_easy_setopt
(
curl_handle
,
CURLOPT_SSL_VERIFYPEER
,
0
);
curl_easy_setopt
(
curl_handle
,
CURLOPT_SSL_VERIFYPEER
,
0
);
...
@@ -172,6 +171,8 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_mod
...
@@ -172,6 +171,8 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_mod
switch_xml_bind_search_function
(
xml_url_fetch
);
switch_xml_bind_search_function
(
xml_url_fetch
);
}
}
curl_global_init
(
CURL_GLOBAL_ALL
);
/* indicate that the module should continue to be loaded */
/* indicate that the module should continue to be loaded */
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
...
@@ -306,6 +307,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
...
@@ -306,6 +307,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
SWITCH_MOD_DECLARE
(
switch_status_t
)
switch_module_shutdown
(
void
)
SWITCH_MOD_DECLARE
(
switch_status_t
)
switch_module_shutdown
(
void
)
{
{
globals
.
running
=
0
;
globals
.
running
=
0
;
curl_global_cleanup
();
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
src/switch_core.c
浏览文件 @
d3141403
...
@@ -2535,7 +2535,9 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread,
...
@@ -2535,7 +2535,9 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread,
switch_time_t
last_commit
=
switch_time_now
();
switch_time_t
last_commit
=
switch_time_now
();
uint32_t
freq
=
1000
,
target
=
500
,
diff
=
0
;
uint32_t
freq
=
1000
,
target
=
500
,
diff
=
0
;
runtime
.
event_db
=
switch_core_db_handle
();
if
(
!
runtime
.
event_db
)
{
runtime
.
event_db
=
switch_core_db_handle
();
}
switch_queue_create
(
&
runtime
.
sql_queue
,
SWITCH_SQL_QUEUE_LEN
,
runtime
.
memory_pool
);
switch_queue_create
(
&
runtime
.
sql_queue
,
SWITCH_SQL_QUEUE_LEN
,
runtime
.
memory_pool
);
for
(;;)
{
for
(;;)
{
...
@@ -2880,6 +2882,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_destroy(void)
...
@@ -2880,6 +2882,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_destroy(void)
switch_yield
(
1000
);
switch_yield
(
1000
);
}
}
switch_core_db_close
(
runtime
.
db
);
switch_core_db_close
(
runtime
.
db
);
switch_core_db_close
(
runtime
.
event_db
);
switch_xml_destroy
();
switch_xml_destroy
();
if
(
runtime
.
memory_pool
)
{
if
(
runtime
.
memory_pool
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论