Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
79dcf196
提交
79dcf196
authored
5月 24, 2006
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@1499
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
a4fc74c3
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
107 行增加
和
87 行删除
+107
-87
freeswitch.xml
conf/freeswitch.xml
+2
-0
mod_dingaling.c
src/mod/endpoints/mod_dingaling/mod_dingaling.c
+35
-25
mod_exosip.c
src/mod/endpoints/mod_exosip/mod_exosip.c
+60
-52
switch_rtp.c
src/switch_rtp.c
+10
-10
没有找到文件。
conf/freeswitch.xml
浏览文件 @
79dcf196
...
...
@@ -106,6 +106,7 @@
<param
name=
"dialplan"
value=
"XML"
/>
<param
name=
"dtmf-duration"
value=
"100"
/>
<param
name=
"codec-prefs"
value=
"PCMU,PCMA"
/>
<param
name=
"use-rtp-timer"
value=
"true"
>
<!-- pick one (default if not specified is 'guess'); -->
<param
name=
"rtp-ip"
value=
"guess"
/>
<!-- <param name-"rtp-ip" value="10.0.0.1"/> -->
...
...
@@ -221,6 +222,7 @@
<param
name=
"message"
value=
"Jingle all the way"
/>
<param
name=
"rtp-ip"
value=
"10.0.0.1"
/>
<param
name=
"auto-login"
value=
"true"
/>
<param
name=
"use-rtp-timer"
value=
"true"
>
<!-- or -->
<!-- <param name="rtp-ip" value="my_lan_ip"/> -->
<!-- <param name="ext-rtp-ip" value="stun:stun.server.com"/> -->
...
...
src/mod/endpoints/mod_dingaling/mod_dingaling.c
浏览文件 @
79dcf196
...
...
@@ -63,7 +63,8 @@ typedef enum {
TFLAG_DO_DESC
=
(
1
<<
15
),
TFLAG_LANADDR
=
(
1
<<
16
),
TFLAG_AUTO
=
(
1
<<
17
),
TFLAG_DTMF
=
(
1
<<
18
)
TFLAG_DTMF
=
(
1
<<
18
),
TFLAG_TIMER
=
(
1
<<
19
)
}
TFLAGS
;
typedef
enum
{
...
...
@@ -236,6 +237,7 @@ static int activate_rtp(struct private_object *tech_pvt)
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
tech_pvt
->
session
);
const
char
*
err
;
int
ms
=
20
;
switch_rtp_flag_t
flags
;
if
(
tech_pvt
->
rtp_session
)
{
return
0
;
...
...
@@ -246,12 +248,12 @@ static int activate_rtp(struct private_object *tech_pvt)
}
if
(
switch_core_codec_init
(
&
tech_pvt
->
read_codec
,
tech_pvt
->
codec_name
,
8000
,
ms
,
1
,
SWITCH_CODEC_FLAG_ENCODE
|
SWITCH_CODEC_FLAG_DECODE
,
NULL
,
switch_core_session_get_pool
(
tech_pvt
->
session
))
!=
SWITCH_STATUS_SUCCESS
)
{
tech_pvt
->
codec_name
,
8000
,
ms
,
1
,
SWITCH_CODEC_FLAG_ENCODE
|
SWITCH_CODEC_FLAG_DECODE
,
NULL
,
switch_core_session_get_pool
(
tech_pvt
->
session
))
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Can't load codec?
\n
"
);
switch_channel_hangup
(
channel
,
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
);
return
-
1
;
...
...
@@ -260,14 +262,14 @@ static int activate_rtp(struct private_object *tech_pvt)
tech_pvt
->
read_frame
.
codec
=
&
tech_pvt
->
read_codec
;
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Set Read Codec to %s
\n
"
,
tech_pvt
->
codec_name
);
if
(
switch_core_codec_init
(
&
tech_pvt
->
write_codec
,
tech_pvt
->
codec_name
,
8000
,
ms
,
1
,
SWITCH_CODEC_FLAG_ENCODE
|
SWITCH_CODEC_FLAG_DECODE
,
NULL
,
switch_core_session_get_pool
(
tech_pvt
->
session
))
!=
SWITCH_STATUS_SUCCESS
)
{
tech_pvt
->
codec_name
,
8000
,
ms
,
1
,
SWITCH_CODEC_FLAG_ENCODE
|
SWITCH_CODEC_FLAG_DECODE
,
NULL
,
switch_core_session_get_pool
(
tech_pvt
->
session
))
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Can't load codec?
\n
"
);
switch_channel_hangup
(
channel
,
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
);
return
-
1
;
...
...
@@ -279,17 +281,23 @@ static int activate_rtp(struct private_object *tech_pvt)
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"SETUP RTP %s:%d -> %s:%d
\n
"
,
tech_pvt
->
profile
->
ip
,
tech_pvt
->
local_port
,
tech_pvt
->
remote_ip
,
tech_pvt
->
remote_port
);
flags
=
SWITCH_RTP_FLAG_GOOGLEHACK
|
SWITCH_RTP_FLAG_AUTOADJ
;
if
(
switch_test_flag
(
tech_pvt
->
profile
,
TFLAG_TIMER
))
{
flags
|=
SWITCH_RTP_FLAG_USE_TIMER
;
}
if
(
!
(
tech_pvt
->
rtp_session
=
switch_rtp_new
(
tech_pvt
->
profile
->
ip
,
tech_pvt
->
local_port
,
tech_pvt
->
remote_ip
,
tech_pvt
->
remote_port
,
tech_pvt
->
codec_num
,
tech_pvt
->
read_codec
.
implementation
->
encoded_bytes_per_frame
,
tech_pvt
->
read_codec
.
implementation
->
microseconds_per_frame
,
SWITCH_RTP_FLAG_USE_TIMER
|
SWITCH_RTP_FLAG_AUTOADJ
|
SWITCH_RTP_FLAG_GOOGLEHACK
,
NULL
,
&
err
,
switch_core_session_get_pool
(
tech_pvt
->
session
))))
{
tech_pvt
->
local_port
,
tech_pvt
->
remote_ip
,
tech_pvt
->
remote_port
,
tech_pvt
->
codec_num
,
tech_pvt
->
read_codec
.
implementation
->
encoded_bytes_per_frame
,
tech_pvt
->
read_codec
.
implementation
->
microseconds_per_frame
,
flags
,
NULL
,
&
err
,
switch_core_session_get_pool
(
tech_pvt
->
session
))))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"RTP ERROR %s
\n
"
,
err
);
switch_channel_hangup
(
channel
,
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
);
return
-
1
;
...
...
@@ -881,14 +889,14 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
switch
(
msg
->
message_id
)
{
case
SWITCH_MESSAGE_INDICATE_BRIDGE
:
if
(
tech_pvt
->
rtp_session
)
{
if
(
tech_pvt
->
rtp_session
&&
switch_test_flag
(
tech_pvt
->
profile
,
TFLAG_TIMER
)
)
{
switch_rtp_clear_flag
(
tech_pvt
->
rtp_session
,
SWITCH_RTP_FLAG_USE_TIMER
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"De-activate timed RTP!
\n
"
);
//switch_rtp_set_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_TIMER_RECLOCK);
}
break
;
case
SWITCH_MESSAGE_INDICATE_UNBRIDGE
:
if
(
tech_pvt
->
rtp_session
)
{
if
(
tech_pvt
->
rtp_session
&&
switch_test_flag
(
tech_pvt
->
profile
,
TFLAG_TIMER
)
)
{
switch_rtp_set_flag
(
tech_pvt
->
rtp_session
,
SWITCH_RTP_FLAG_USE_TIMER
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Re-activate timed RTP!
\n
"
);
//switch_rtp_clear_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_TIMER_RECLOCK);
...
...
@@ -1188,6 +1196,8 @@ static void set_profile_val(struct mdl_profile *profile, char *var, char *val)
profile
->
login
=
switch_core_strdup
(
module_pool
,
val
);
}
else
if
(
!
strcasecmp
(
var
,
"password"
))
{
profile
->
password
=
switch_core_strdup
(
module_pool
,
val
);
}
else
if
(
!
strcasecmp
(
var
,
"use-rtp-timer"
)
&&
switch_true
(
val
))
{
switch_set_flag
(
profile
,
TFLAG_TIMER
);
}
else
if
(
!
strcasecmp
(
var
,
"dialplan"
))
{
profile
->
dialplan
=
switch_core_strdup
(
module_pool
,
val
);
}
else
if
(
!
strcasecmp
(
var
,
"name"
))
{
...
...
src/mod/endpoints/mod_exosip/mod_exosip.c
浏览文件 @
79dcf196
...
...
@@ -75,7 +75,8 @@ typedef enum {
TFLAG_SECURE
=
(
1
<<
11
),
TFLAG_VAD_IN
=
(
1
<<
12
),
TFLAG_VAD_OUT
=
(
1
<<
13
),
TFLAG_VAD
=
(
1
<<
14
)
TFLAG_VAD
=
(
1
<<
14
),
TFLAG_TIMER
=
(
1
<<
15
)
}
TFLAGS
;
...
...
@@ -475,6 +476,7 @@ static switch_status_t activate_rtp(struct private_object *tech_pvt)
switch_channel_t
*
channel
;
const
char
*
err
;
char
*
key
=
NULL
;
switch_rtp_flag_t
flags
;
assert
(
tech_pvt
!=
NULL
);
...
...
@@ -511,17 +513,21 @@ static switch_status_t activate_rtp(struct private_object *tech_pvt)
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"using Realm %s
\n
"
,
tech_pvt
->
realm
);
}
}
flags
=
SWITCH_RTP_FLAG_MINI
|
SWITCH_RTP_FLAG_RAW_WRITE
;
if
(
switch_test_flag
(
tech_pvt
,
TFLAG_TIMER
))
{
flags
|=
SWITCH_RTP_FLAG_USE_TIMER
|
SWITCH_RTP_FLAG_TIMER_RECLOCK
;
}
tech_pvt
->
rtp_session
=
switch_rtp_new
(
tech_pvt
->
local_sdp_audio_ip
,
tech_pvt
->
local_sdp_audio_port
,
tech_pvt
->
remote_sdp_audio_ip
,
tech_pvt
->
remote_sdp_audio_port
,
tech_pvt
->
read_codec
.
codec_interface
->
ianacode
,
tech_pvt
->
read_codec
.
implementation
->
encoded_bytes_per_frame
,
ms
,
SWITCH_RTP_FLAG_MINI
|
SWITCH_RTP_FLAG_USE_TIMER
|
SWITCH_RTP_FLAG_TIMER_RECLOCK
|
SWITCH_RTP_FLAG_RAW_WRITE
,
key
,
&
err
,
switch_core_session_get_pool
(
tech_pvt
->
session
));
tech_pvt
->
local_sdp_audio_port
,
tech_pvt
->
remote_sdp_audio_ip
,
tech_pvt
->
remote_sdp_audio_port
,
tech_pvt
->
read_codec
.
codec_interface
->
ianacode
,
tech_pvt
->
read_codec
.
implementation
->
encoded_bytes_per_frame
,
ms
,
flags
,
key
,
&
err
,
switch_core_session_get_pool
(
tech_pvt
->
session
));
if
(
tech_pvt
->
rtp_session
)
{
uint8_t
vad_in
=
switch_test_flag
(
tech_pvt
,
TFLAG_VAD_IN
)
?
1
:
0
;
...
...
@@ -819,51 +825,51 @@ static switch_status_t exosip_receive_message(switch_core_session_t *session, sw
switch
(
msg
->
message_id
)
{
case
SWITCH_MESSAGE_INDICATE_BRIDGE
:
if
(
tech_pvt
->
rtp_session
)
{
switch_rtp_clear_flag
(
tech_pvt
->
rtp_session
,
SWITCH_RTP_FLAG_USE_TIMER
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"De-activate timed RTP!
\n
"
);
}
break
;
if
(
tech_pvt
->
rtp_session
&&
switch_test_flag
(
tech_pvt
,
TFLAG_TIMER
)
)
{
switch_rtp_clear_flag
(
tech_pvt
->
rtp_session
,
SWITCH_RTP_FLAG_USE_TIMER
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"De-activate timed RTP!
\n
"
);
}
break
;
case
SWITCH_MESSAGE_INDICATE_UNBRIDGE
:
if
(
tech_pvt
->
rtp_session
)
{
switch_rtp_set_flag
(
tech_pvt
->
rtp_session
,
SWITCH_RTP_FLAG_USE_TIMER
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Re-activate timed RTP!
\n
"
);
}
break
;
if
(
tech_pvt
->
rtp_session
&&
switch_test_flag
(
tech_pvt
,
TFLAG_TIMER
)
)
{
switch_rtp_set_flag
(
tech_pvt
->
rtp_session
,
SWITCH_RTP_FLAG_USE_TIMER
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Re-activate timed RTP!
\n
"
);
}
break
;
case
SWITCH_MESSAGE_INDICATE_PROGRESS
:
if
(
msg
)
{
struct
private_object
*
tech_pvt
;
switch_channel_t
*
channel
=
NULL
;
channel
=
switch_core_session_get_channel
(
session
);
assert
(
channel
!=
NULL
);
tech_pvt
=
switch_core_session_get_private
(
session
);
assert
(
tech_pvt
!=
NULL
);
if
(
!
switch_test_flag
(
tech_pvt
,
TFLAG_EARLY_MEDIA
))
{
char
*
buf
=
NULL
;
osip_message_t
*
progress
=
NULL
;
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Asked to send early media by %s
\n
"
,
msg
->
from
);
/* Transmit 183 Progress with SDP */
eXosip_lock
();
eXosip_call_build_answer
(
tech_pvt
->
tid
,
183
,
&
progress
);
if
(
progress
)
{
sdp_message_to_str
(
tech_pvt
->
local_sdp
,
&
buf
);
osip_message_set_body
(
progress
,
buf
,
strlen
(
buf
));
osip_message_set_content_type
(
progress
,
"application/sdp"
);
free
(
buf
);
eXosip_call_send_answer
(
tech_pvt
->
tid
,
183
,
progress
);
switch_set_flag
(
tech_pvt
,
TFLAG_EARLY_MEDIA
);
switch_channel_set_flag
(
channel
,
CF_EARLY_MEDIA
);
}
eXosip_unlock
();
}
}
if
(
msg
)
{
struct
private_object
*
tech_pvt
;
switch_channel_t
*
channel
=
NULL
;
channel
=
switch_core_session_get_channel
(
session
);
assert
(
channel
!=
NULL
);
tech_pvt
=
switch_core_session_get_private
(
session
);
assert
(
tech_pvt
!=
NULL
);
if
(
!
switch_test_flag
(
tech_pvt
,
TFLAG_EARLY_MEDIA
))
{
char
*
buf
=
NULL
;
osip_message_t
*
progress
=
NULL
;
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Asked to send early media by %s
\n
"
,
msg
->
from
);
/* Transmit 183 Progress with SDP */
eXosip_lock
();
eXosip_call_build_answer
(
tech_pvt
->
tid
,
183
,
&
progress
);
if
(
progress
)
{
sdp_message_to_str
(
tech_pvt
->
local_sdp
,
&
buf
);
osip_message_set_body
(
progress
,
buf
,
strlen
(
buf
));
osip_message_set_content_type
(
progress
,
"application/sdp"
);
free
(
buf
);
eXosip_call_send_answer
(
tech_pvt
->
tid
,
183
,
progress
);
switch_set_flag
(
tech_pvt
,
TFLAG_EARLY_MEDIA
);
switch_channel_set_flag
(
channel
,
CF_EARLY_MEDIA
);
}
eXosip_unlock
();
}
}
break
;
break
;
default:
break
;
}
...
...
@@ -1885,6 +1891,8 @@ static int config_exosip(int reload)
if
(
!
strcmp
(
var
,
"debug"
))
{
globals
.
debug
=
atoi
(
val
);
}
else
if
(
!
strcmp
(
var
,
"use-rtp-timer"
)
&&
switch_true
(
val
))
{
switch_set_flag
(
&
globals
,
TFLAG_TIMER
);
}
else
if
(
!
strcmp
(
var
,
"port"
))
{
globals
.
port
=
atoi
(
val
);
}
else
if
(
!
strcmp
(
var
,
"vad"
))
{
...
...
src/switch_rtp.c
浏览文件 @
79dcf196
...
...
@@ -473,16 +473,16 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_create(switch_rtp_t **new_rtp_session
}
SWITCH_DECLARE
(
switch_rtp_t
*
)
switch_rtp_new
(
char
*
rx_host
,
switch_port_t
rx_port
,
char
*
tx_host
,
switch_port_t
tx_port
,
switch_payload_t
payload
,
uint32_t
packet_size
,
uint32_t
ms_per_packet
,
switch_rtp_flag_t
flags
,
char
*
crypto_key
,
const
char
**
err
,
switch_memory_pool_t
*
pool
)
switch_port_t
rx_port
,
char
*
tx_host
,
switch_port_t
tx_port
,
switch_payload_t
payload
,
uint32_t
packet_size
,
uint32_t
ms_per_packet
,
switch_rtp_flag_t
flags
,
char
*
crypto_key
,
const
char
**
err
,
switch_memory_pool_t
*
pool
)
{
switch_rtp_t
*
rtp_session
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论