Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
30a0a205
提交
30a0a205
authored
7月 27, 2012
作者:
Mathieu Rene
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'nsg-4.3' of git.sangoma.com:smg_freeswitch into nsg/4.3
上级
3519ebc9
3350403d
全部展开
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
535 行增加
和
10 行删除
+535
-10
tdm.c
libs/freetdm/mod_freetdm/tdm.c
+6
-0
media_gateway_cmd_handler.c
...d/endpoints/mod_media_gateway/media_gateway_cmd_handler.c
+18
-8
media_gateway_stack.h
src/mod/endpoints/mod_media_gateway/media_gateway_stack.h
+6
-0
media_gateway_utils.c
src/mod/endpoints/mod_media_gateway/media_gateway_utils.c
+500
-0
media_gateway_xml.c
src/mod/endpoints/mod_media_gateway/media_gateway_xml.c
+4
-2
mod_media_gateway.h
src/mod/endpoints/mod_media_gateway/mod_media_gateway.h
+1
-0
没有找到文件。
libs/freetdm/mod_freetdm/tdm.c
浏览文件 @
30a0a205
...
...
@@ -111,6 +111,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
const
char
*
dname
;
ftdm_codec_t
codec
;
uint32_t
interval
;
ftdm_status_t
fstatus
;
ctdm_private_t
*
tech_pvt
=
NULL
;
...
...
@@ -136,6 +137,11 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
channel
=
switch_core_session_get_channel
(
*
new_session
);
if
((
fstatus
=
ftdm_span_start
(
span
))
!=
FTDM_SUCCESS
&&
fstatus
!=
FTDM_EINVAL
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Couldn't start span %s.
\n
"
,
span_name
);
goto
fail
;
}
if
(
ftdm_channel_open
(
span_id
,
chan_id
,
&
chan
)
!=
FTDM_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Couldn't open span or channel.
\n
"
);
goto
fail
;
...
...
src/mod/endpoints/mod_media_gateway/media_gateway_cmd_handler.c
浏览文件 @
30a0a205
...
...
@@ -500,7 +500,7 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
mg_context_t
*
mg_ctxt
;
int
mediaId
;
MgMgcoLocalDesc
*
local
=
NULL
;
CmSdpInfoSet
*
psdp
=
NULL
;
/*CmSdpInfoSet *psdp = NULL;*/
/* TODO - Kapil dummy line , will need to add with proper code */
...
...
@@ -707,6 +707,11 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
/* only for RTP */
if
(
is_rtp
){
mg_build_sdp
(
&
desc
->
u
.
media
,
inc_med_desc
,
mg_profile
,
term
,
&
rsp
.
u
.
mgCmdRsp
[
0
]
->
memCp
);
}
#if 0
if(is_rtp){
mg_build_sdp(desc, inc_med_desc, mg_profile, term, &rsp.u.mgCmdRsp[0]->memCp);
/* build local descriptors */
/*MgMgcoStreamDesc *stream;*/
char* ipAddress[4];// = "192.168.1.1";
...
...
@@ -762,12 +767,15 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
psdp = &(local->sdp);
if((NOTPRSNT == local->sdp.numComp.pres) || (0 == local->sdp.numComp.val)){
if (mgUtlGrowList((void ***)&psdp->info, sizeof(CmSdpInfo),
&psdp->numComp, &rsp.u.mgCmdRsp[0]->memCp) != ROK)
{
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_ERROR,"Grow List failed\n");
return SWITCH_STATUS_FALSE;
}
}
psdp->info[psdp->numComp.val-1]->pres.pres = PRSNT_NODEF;
...
...
@@ -875,7 +883,7 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
MG_INIT_TOKEN_VALUE(&(media->field.par.pflst[media->field.par.numProtFmts.val-1]->u.rtp.fmts[0]->type), CM_SDP_SPEC);
MG_INIT_TOKEN_VALUE
(
&
(
media
->
field
.
par
.
pflst
[
media
->
field
.
par
.
numProtFmts
.
val
-
1
]
->
u
.
rtp
.
fmts
[
0
]
->
val
),
4
);
MG_INIT_TOKEN_VALUE(&(media->field.par.pflst[media->field.par.numProtFmts.val-1]->u.rtp.fmts[0]->val),
8
);
/* Fill attribute if reqd */
{
...
...
@@ -893,6 +901,7 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
free(dup);
}
#endif
/* We will always send one command at a time..*/
...
...
@@ -1055,10 +1064,11 @@ switch_status_t handle_mg_modify_cmd(megaco_profile_t* mg_profile, MgMgcoCommand
ret
=
mg_prc_descriptors
(
mg_profile
,
inc_cmd
,
term
);
/* SDP updated to termination */
megaco_activate_termination
(
term
);
}
/* TODO - copy inc descriptor...not sure if we need to do this.. */
/********************************************************************/
/* Matt - to provide the response SDP structure which needs to fill in Modify command response */
...
...
src/mod/endpoints/mod_media_gateway/media_gateway_stack.h
浏览文件 @
30a0a205
...
...
@@ -155,6 +155,9 @@ int mg_enable_logging(void);
int
mg_disable_logging
(
void
);
void
mg_util_set_err_string
(
MgStr
*
errTxt
,
char
*
str
);
switch_status_t
mg_build_sdp
(
MgMgcoMediaDesc
*
out
,
MgMgcoMediaDesc
*
inc
,
megaco_profile_t
*
mg_profile
,
mg_termination_t
*
term
,
CmMemListCp
*
memCp
);
switch_status_t
mg_add_local_descriptor
(
MgMgcoMediaDesc
*
media
,
megaco_profile_t
*
mg_profile
,
mg_termination_t
*
term
,
CmMemListCp
*
memCp
);
switch_status_t
sng_mgco_cfg
(
megaco_profile_t
*
profile
);
switch_status_t
sng_mgco_init
(
sng_mg_event_interface_t
*
event
);
...
...
@@ -193,6 +196,9 @@ switch_status_t mg_fill_svc_change(MgMgcoSvcChgPar *srvPar, uint8_t method, c
void
mg_fill_null_context
(
MgMgcoContextId
*
ctxt
);
switch_status_t
mg_send_service_change
(
SuId
suId
,
const
char
*
term_name
,
uint8_t
method
,
MgServiceChangeReason_e
reason
,
uint8_t
wild
);
switch_status_t
mg_create_mgco_command
(
MgMgcoCommand
*
cmd
,
uint8_t
apiType
,
uint8_t
cmdType
);
switch_status_t
mg_add_lcl_media
(
CmSdpMediaDescSet
*
med
,
megaco_profile_t
*
mg_profile
,
mg_termination_t
*
term
,
CmMemListCp
*
memCp
);
switch_status_t
mg_add_supported_media_codec
(
CmSdpMediaDesc
*
media
,
megaco_profile_t
*
mg_profile
,
mg_termination_t
*
term
,
CmMemListCp
*
memCp
);
switch_status_t
mg_rem_unsupported_codecs
(
megaco_profile_t
*
mg_profile
,
mg_termination_t
*
term
,
CmSdpMedFmtRtpList
*
fmtList
,
CmSdpAttrSet
*
attrSet
,
CmMemListCp
*
memCp
);
switch_status_t
mg_send_oos_service_change
(
megaco_profile_t
*
mg_profile
,
const
char
*
term_name
,
int
wild
);
switch_status_t
mg_send_ins_service_change
(
megaco_profile_t
*
mg_profile
,
const
char
*
term_name
,
int
wild
);
...
...
src/mod/endpoints/mod_media_gateway/media_gateway_utils.c
浏览文件 @
30a0a205
差异被折叠。
点击展开。
src/mod/endpoints/mod_media_gateway/media_gateway_xml.c
浏览文件 @
30a0a205
...
...
@@ -74,7 +74,7 @@ switch_status_t config_profile(megaco_profile_t *profile, switch_bool_t reload)
// <map termination-id-prefix="Term1/" termination-id-base="1" tech="freetdm" channel-prefix="wp2" channel-map"1-15,17-31"/>
const
char
*
prefix
=
switch_xml_attr
(
mg_term
,
"termination-id-prefix"
);
//const char *sztermination_id_base = switch_xml_attr(mg_term, "termination-id-base");
//
const char *tech = switch_xml_attr(mg_term, "tech");
const
char
*
tech
=
switch_xml_attr
(
mg_term
,
"tech"
);
const
char
*
channel_prefix
=
switch_xml_attr
(
mg_term
,
"channel-prefix"
);
const
char
*
channel_map
=
switch_xml_attr
(
mg_term
,
"channel-map"
);
...
...
@@ -100,6 +100,7 @@ switch_status_t config_profile(megaco_profile_t *profile, switch_bool_t reload)
term
->
type
=
MG_TERM_TDM
;
term
->
profile
=
profile
;
term
->
mg_ctxt
=
NULL
;
term
->
tech
=
switch_core_strdup
(
pool
,
tech
);
term
->
active_events
=
NULL
;
term
->
name
=
switch_core_sprintf
(
pool
,
"%s%d"
,
prefix
,
j
);
term
->
u
.
tdm
.
channel
=
j
;
...
...
@@ -260,6 +261,7 @@ static switch_xml_config_item_t *get_instructions(megaco_profile_t *profile) {
SWITCH_CONFIG_ITEM
(
"rtp-port-range"
,
SWITCH_CONFIG_STRING
,
CONFIG_REQUIRED
,
&
profile
->
rtp_port_range
,
"1-65535"
,
&
switch_config_string_strdup
,
""
,
"rtp port range"
),
SWITCH_CONFIG_ITEM
(
"rtp-termination-id-prefix"
,
SWITCH_CONFIG_STRING
,
CONFIG_RELOADABLE
,
&
profile
->
rtp_termination_id_prefix
,
""
,
&
switch_config_string_strdup
,
""
,
"rtp termination prefix"
),
SWITCH_CONFIG_ITEM
(
"rtp-termination-id-len"
,
SWITCH_CONFIG_INT
,
CONFIG_RELOADABLE
,
&
profile
->
rtp_termination_id_len
,
""
,
&
opt_termination_id_len
,
""
,
"rtp termination id"
),
SWITCH_CONFIG_ITEM
(
"codec-prefs"
,
SWITCH_CONFIG_STRING
,
0
,
&
profile
->
codec_prefs
,
""
,
&
switch_config_string_strdup
,
""
,
"codec preferences, coma-separated"
),
SWITCH_CONFIG_ITEM_END
()
};
...
...
src/mod/endpoints/mod_media_gateway/mod_media_gateway.h
浏览文件 @
30a0a205
...
...
@@ -113,6 +113,7 @@ struct mg_termination_s {
mg_termination_t
*
next
;
/*!< List for physical terminations */
mg_context_t
*
mg_ctxt
;
uint32_t
flags
;
const
char
*
tech
;
/* Endpoint controlling the TDM interface - only FreeTDM tested so far */
union
{
struct
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论