Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
183b51dd
提交
183b51dd
authored
7月 30, 2015
作者:
Luis Azedo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-7918 small fixes in mod_kazoo
上级
01672dc9
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
17 行增加
和
6 行删除
+17
-6
kazoo_utils.c
src/mod/event_handlers/mod_kazoo/kazoo_utils.c
+8
-3
mod_kazoo.c
src/mod/event_handlers/mod_kazoo/mod_kazoo.c
+5
-1
mod_kazoo.h
src/mod/event_handlers/mod_kazoo/mod_kazoo.h
+4
-2
没有找到文件。
src/mod/event_handlers/mod_kazoo/kazoo_utils.c
浏览文件 @
183b51dd
...
...
@@ -139,11 +139,11 @@ void close_socketfd(int *sockfd) {
}
}
switch_socket_t
*
create_socket
(
switch_memory_pool_t
*
pool
)
{
switch_socket_t
*
create_socket
_with_port
(
switch_memory_pool_t
*
pool
,
switch_port_t
port
)
{
switch_sockaddr_t
*
sa
;
switch_socket_t
*
socket
;
if
(
switch_sockaddr_info_get
(
&
sa
,
globals
.
ip
,
SWITCH_UNSPEC
,
0
,
0
,
pool
))
{
if
(
switch_sockaddr_info_get
(
&
sa
,
globals
.
ip
,
SWITCH_UNSPEC
,
port
,
0
,
pool
))
{
return
NULL
;
}
...
...
@@ -170,6 +170,11 @@ switch_socket_t *create_socket(switch_memory_pool_t *pool) {
return
socket
;
}
switch_socket_t
*
create_socket
(
switch_memory_pool_t
*
pool
)
{
return
create_socket_with_port
(
pool
,
0
);
}
switch_status_t
create_ei_cnode
(
const
char
*
ip_addr
,
const
char
*
name
,
struct
ei_cnode_s
*
ei_cnode
)
{
struct
hostent
*
nodehost
;
char
hostname
[
EI_MAXHOSTNAMELEN
+
1
]
=
""
;
...
...
@@ -503,7 +508,7 @@ switch_hash_t *create_default_filter() {
switch_core_hash_insert
(
filter
,
"Hangup-Cause"
,
"1"
);
switch_core_hash_insert
(
filter
,
"Unique-ID"
,
"1"
);
switch_core_hash_insert
(
filter
,
"variable_switch_r_sdp"
,
"1"
);
switch_core_hash_insert
(
filter
,
"variable_
si
p_local_sdp_str"
,
"1"
);
switch_core_hash_insert
(
filter
,
"variable_
rt
p_local_sdp_str"
,
"1"
);
switch_core_hash_insert
(
filter
,
"variable_sip_to_uri"
,
"1"
);
switch_core_hash_insert
(
filter
,
"variable_sip_from_uri"
,
"1"
);
switch_core_hash_insert
(
filter
,
"variable_sip_user_agent"
,
"1"
);
...
...
src/mod/event_handlers/mod_kazoo/mod_kazoo.c
浏览文件 @
183b51dd
...
...
@@ -347,6 +347,7 @@ static switch_status_t config(void) {
globals
.
event_stream_preallocate
=
4000
;
globals
.
send_msg_batch
=
10
;
globals
.
event_stream_framing
=
2
;
globals
.
port
=
0
;
if
(
!
(
xml
=
switch_xml_open_cfg
(
cf
,
&
cfg
,
NULL
)))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Failed to open configuration file %s
\n
"
,
cf
);
...
...
@@ -360,6 +361,9 @@ static switch_status_t config(void) {
if
(
!
strcmp
(
var
,
"listen-ip"
))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Set bind ip address: %s
\n
"
,
val
);
set_pref_ip
(
val
);
}
else
if
(
!
strcmp
(
var
,
"listen-port"
))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Set bind port: %s
\n
"
,
val
);
globals
.
port
=
atoi
(
val
);
}
else
if
(
!
strcmp
(
var
,
"cookie"
))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Set cookie: %s
\n
"
,
val
);
set_pref_ei_cookie
(
val
);
...
...
@@ -515,7 +519,7 @@ static switch_status_t create_acceptor() {
ei_set_compat_rel
(
globals
.
ei_compat_rel
);
}
if
(
!
(
globals
.
acceptor
=
create_socket
(
globals
.
pool
)))
{
if
(
!
(
globals
.
acceptor
=
create_socket
_with_port
(
globals
.
pool
,
globals
.
port
)))
{
return
SWITCH_STATUS_SOCKERR
;
}
...
...
src/mod/event_handlers/mod_kazoo/mod_kazoo.h
浏览文件 @
183b51dd
...
...
@@ -48,9 +48,9 @@ struct ei_event_stream_s {
switch_socket_t
*
socket
;
switch_mutex_t
*
socket_mutex
;
switch_bool_t
connected
;
char
remote_ip
[
25
];
char
remote_ip
[
48
];
uint16_t
remote_port
;
char
local_ip
[
25
];
char
local_ip
[
48
];
uint16_t
local_port
;
erlang_pid
pid
;
uint32_t
flags
;
...
...
@@ -111,6 +111,7 @@ struct globals_s {
int
event_stream_preallocate
;
int
send_msg_batch
;
short
event_stream_framing
;
switch_port_t
port
;
};
typedef
struct
globals_s
globals_t
;
extern
globals_t
globals
;
...
...
@@ -140,6 +141,7 @@ switch_status_t handle_api_command_streams(ei_node_t *ei_node, switch_stream_han
/* kazoo_utils.c */
void
close_socket
(
switch_socket_t
**
sock
);
void
close_socketfd
(
int
*
sockfd
);
switch_socket_t
*
create_socket_with_port
(
switch_memory_pool_t
*
pool
,
switch_port_t
port
);
switch_socket_t
*
create_socket
(
switch_memory_pool_t
*
pool
);
switch_status_t
create_ei_cnode
(
const
char
*
ip_addr
,
const
char
*
name
,
struct
ei_cnode_s
*
ei_cnode
);
switch_status_t
ei_compare_pids
(
const
erlang_pid
*
pid1
,
const
erlang_pid
*
pid2
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论