Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
11c738f0
提交
11c738f0
authored
4月 20, 2006
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@1210
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
a680625e
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
33 行增加
和
27 行删除
+33
-27
freeswitch.conf
conf/freeswitch.conf
+6
-4
mod_exosip.c
src/mod/endpoints/mod_exosip/mod_exosip.c
+27
-23
没有找到文件。
conf/freeswitch.conf
浏览文件 @
11c738f0
...
...
@@ -109,12 +109,14 @@ port => 5060
dialplan
=>
pcre
dtmf_duration
=>
100
;
pick
one
(
default
if
not
specified
is
'guess'
);
ip
=>
guess
;
ip
=>
10
.
0
.
0
.
1
rtp
-
ip
=>
guess
;
rtp
-
ip
=>
10
.
0
.
0
.
1
;
leave
commented
or
0
.
0
.
0
.
0
for
all
ip
;
sip
-
ip
=>
127
.
0
.
0
.
1
;
optional
;
;
extip
=>
stun
:
stun
.
server
.
com
;
extip
=>
100
.
101
.
102
.
103
;
ext
-
rtp
-
ip
=>
stun
:
stun
.
server
.
com
;
ext
-
rtp
-
ip
=>
100
.
101
.
102
.
103
;
specify
'myrealm'
with
certian
key
;
use
!
myrealm
!
at
beginning
of
url
to
activate
...
...
src/mod/endpoints/mod_exosip/mod_exosip.c
浏览文件 @
11c738f0
...
...
@@ -79,8 +79,9 @@ static struct {
int
debug
;
int
bytes_per_frame
;
char
*
dialplan
;
char
*
extip
;
char
*
ip
;
char
*
extrtpip
;
char
*
rtpip
;
char
*
sipip
;
int
port
;
char
*
codec_string
;
char
*
codec_order
[
SWITCH_MAX_CODECS
];
...
...
@@ -137,9 +138,10 @@ struct rfc2833_digit {
};
SWITCH_DECLARE_GLOBAL_STRING_FUNC
(
set_global_dialplan
,
globals
.
dialplan
)
SWITCH_DECLARE_GLOBAL_STRING_FUNC
(
set_global_ext
ip
,
globals
.
ext
ip
)
SWITCH_DECLARE_GLOBAL_STRING_FUNC
(
set_global_
ip
,
globals
.
ip
)
SWITCH_DECLARE_GLOBAL_STRING_FUNC
(
set_global_ext
rtpip
,
globals
.
extrtp
ip
)
SWITCH_DECLARE_GLOBAL_STRING_FUNC
(
set_global_
rtpip
,
globals
.
rtp
ip
)
SWITCH_DECLARE_GLOBAL_STRING_FUNC
(
set_global_codec_string
,
globals
.
codec_string
)
SWITCH_DECLARE_GLOBAL_STRING_FUNC
(
set_global_sipip
,
globals
.
sipip
)
static
switch_status
exosip_on_init
(
switch_core_session
*
session
);
static
switch_status
exosip_on_hangup
(
switch_core_session
*
session
);
...
...
@@ -250,17 +252,17 @@ static switch_status exosip_on_init(switch_core_session *session)
/* Generate callerid URI */
if
(
!
strcasecmp
(
globals
.
ip
,
"guess"
))
{
if
(
!
strcasecmp
(
globals
.
rtp
ip
,
"guess"
))
{
eXosip_guess_localip
(
AF_INET
,
tech_pvt
->
local_sdp_audio_ip
,
sizeof
(
tech_pvt
->
local_sdp_audio_ip
));
}
else
{
switch_copy_string
(
tech_pvt
->
local_sdp_audio_ip
,
globals
.
ip
,
sizeof
(
tech_pvt
->
local_sdp_audio_ip
));
switch_copy_string
(
tech_pvt
->
local_sdp_audio_ip
,
globals
.
rtp
ip
,
sizeof
(
tech_pvt
->
local_sdp_audio_ip
));
}
ip
=
tech_pvt
->
local_sdp_audio_ip
;
if
(
globals
.
extip
)
{
if
(
!
strncasecmp
(
globals
.
extip
,
"stun:"
,
5
))
{
char
*
stun_ip
=
globals
.
extip
+
5
;
if
(
globals
.
ext
rtp
ip
)
{
if
(
!
strncasecmp
(
globals
.
ext
rtp
ip
,
"stun:"
,
5
))
{
char
*
stun_ip
=
globals
.
ext
rtp
ip
+
5
;
if
(
!
stun_ip
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Stun Failed! NO STUN SERVER
\n
"
);
...
...
@@ -279,7 +281,7 @@ static switch_status exosip_on_init(switch_core_session *session)
}
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Stun Success [%s]:[%d]
\n
"
,
ip
,
sdp_port
);
}
else
{
ip
=
globals
.
extip
;
ip
=
globals
.
ext
rtp
ip
;
}
}
snprintf
(
from_uri
,
sizeof
(
from_uri
),
"%s <sip:%s@%s>"
,
...
...
@@ -1164,10 +1166,10 @@ static switch_status exosip_create_call(eXosip_event_t * event)
return
SWITCH_STATUS_GENERR
;
}
if
(
!
strcasecmp
(
globals
.
ip
,
"guess"
))
{
if
(
!
strcasecmp
(
globals
.
rtp
ip
,
"guess"
))
{
eXosip_guess_localip
(
AF_INET
,
tech_pvt
->
local_sdp_audio_ip
,
sizeof
(
tech_pvt
->
local_sdp_audio_ip
));
}
else
{
switch_copy_string
(
tech_pvt
->
local_sdp_audio_ip
,
globals
.
ip
,
sizeof
(
tech_pvt
->
local_sdp_audio_ip
));
switch_copy_string
(
tech_pvt
->
local_sdp_audio_ip
,
globals
.
rtp
ip
,
sizeof
(
tech_pvt
->
local_sdp_audio_ip
));
}
ip
=
tech_pvt
->
local_sdp_audio_ip
;
...
...
@@ -1175,9 +1177,9 @@ static switch_status exosip_create_call(eXosip_event_t * event)
sdp_port
=
tech_pvt
->
local_sdp_audio_port
;
if
(
globals
.
extip
)
{
if
(
!
strncasecmp
(
globals
.
extip
,
"stun:"
,
5
))
{
char
*
stun_ip
=
globals
.
extip
+
5
;
if
(
globals
.
ext
rtp
ip
)
{
if
(
!
strncasecmp
(
globals
.
ext
rtp
ip
,
"stun:"
,
5
))
{
char
*
stun_ip
=
globals
.
ext
rtp
ip
+
5
;
if
(
!
stun_ip
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Stun Failed! NO STUN SERVER
\n
"
);
switch_channel_hangup
(
channel
);
...
...
@@ -1195,7 +1197,7 @@ static switch_status exosip_create_call(eXosip_event_t * event)
}
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Stun Success [%s]:[%d]
\n
"
,
ip
,
sdp_port
);
}
else
{
ip
=
globals
.
extip
;
ip
=
globals
.
ext
rtp
ip
;
}
}
osip_rfc3264_init
(
&
tech_pvt
->
sdp_config
);
...
...
@@ -1664,10 +1666,12 @@ static int config_exosip(int reload)
globals
.
debug
=
atoi
(
val
);
}
else
if
(
!
strcmp
(
var
,
"port"
))
{
globals
.
port
=
atoi
(
val
);
}
else
if
(
!
strcmp
(
var
,
"extip"
))
{
set_global_extip
(
val
);
}
else
if
(
!
strcmp
(
var
,
"ip"
))
{
set_global_ip
(
val
);
}
else
if
(
!
strcmp
(
var
,
"ext-rtp-ip"
))
{
set_global_extrtpip
(
val
);
}
else
if
(
!
strcmp
(
var
,
"rtp-ip"
))
{
set_global_rtpip
(
val
);
}
else
if
(
!
strcmp
(
var
,
"sip-ip"
))
{
set_global_sipip
(
val
);
}
else
if
(
!
strcmp
(
var
,
"dialplan"
))
{
set_global_dialplan
(
val
);
}
else
if
(
!
strncasecmp
(
var
,
"srtp:"
,
5
))
{
...
...
@@ -1692,9 +1696,9 @@ static int config_exosip(int reload)
}
}
if
(
!
globals
.
ip
)
{
if
(
!
globals
.
rtp
ip
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Setting ip to 'guess'
\n
"
);
set_global_ip
(
"guess"
);
set_global_
rtp
ip
(
"guess"
);
}
if
(
!
globals
.
codec_ms
)
{
...
...
@@ -1739,7 +1743,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
return
SWITCH_STATUS_TERM
;
}
if
(
eXosip_listen_addr
(
IPPROTO_UDP
,
NULL
,
globals
.
port
,
AF_INET
,
0
))
{
if
(
eXosip_listen_addr
(
IPPROTO_UDP
,
globals
.
sipip
,
globals
.
port
,
AF_INET
,
0
))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"eXosip_listen_addr failed!
\n
"
);
return
SWITCH_STATUS_TERM
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论