Move SDP templates to its own SDP_Templates.ttcn file
SDP is used in other protocols than MGCP, eg. SIP. Change-Id: I0610b4cf5533e46a3401c65e60c7cce975c85412
This commit is contained in:
parent
a16a6b667b
commit
1158cc629c
|
@ -24,6 +24,7 @@ import from L3_Templates all;
|
||||||
import from MGCP_Types all;
|
import from MGCP_Types all;
|
||||||
import from MGCP_Templates all;
|
import from MGCP_Templates all;
|
||||||
import from SDP_Types all;
|
import from SDP_Types all;
|
||||||
|
import from SDP_Templates all;
|
||||||
|
|
||||||
type function void_fn_bsc_ms(charstring id) runs on BSC_MS_ConnHdlr;
|
type function void_fn_bsc_ms(charstring id) runs on BSC_MS_ConnHdlr;
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ FILES="RTP_EncDec.cc RTP_Types.ttcn"
|
||||||
gen_links $DIR $FILES
|
gen_links $DIR $FILES
|
||||||
|
|
||||||
DIR=../library
|
DIR=../library
|
||||||
FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn RLCMAC_CSN1_Templates.ttcn RLCMAC_CSN1_Types.ttcn BSSMAP_Templates.ttcn RAN_Emulation.ttcnpp MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc Osmocom_CTRL_Types.ttcn Osmocom_VTY_Functions.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn BSSAP_CodecPort.ttcn Native_Functions.ttcn Native_FunctionDefs.cc"
|
FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn RLCMAC_CSN1_Templates.ttcn RLCMAC_CSN1_Types.ttcn BSSMAP_Templates.ttcn RAN_Emulation.ttcnpp SDP_Templates.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc Osmocom_CTRL_Types.ttcn Osmocom_VTY_Functions.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn BSSAP_CodecPort.ttcn Native_Functions.ttcn Native_FunctionDefs.cc"
|
||||||
gen_links $DIR $FILES
|
gen_links $DIR $FILES
|
||||||
|
|
||||||
ignore_pp_results
|
ignore_pp_results
|
||||||
|
|
|
@ -38,6 +38,7 @@ import from MGCP_Types all;
|
||||||
import from MGCP_Emulation all;
|
import from MGCP_Emulation all;
|
||||||
import from MGCP_Templates all;
|
import from MGCP_Templates all;
|
||||||
import from SDP_Types all;
|
import from SDP_Types all;
|
||||||
|
import from SDP_Templates all;
|
||||||
import from Native_Functions all;
|
import from Native_Functions all;
|
||||||
|
|
||||||
import from Osmocom_CTRL_Functions all;
|
import from Osmocom_CTRL_Functions all;
|
||||||
|
|
|
@ -32,6 +32,7 @@ import from MGCP_Types all;
|
||||||
import from MGCP_Templates all;
|
import from MGCP_Templates all;
|
||||||
import from MGCP_Emulation all;
|
import from MGCP_Emulation all;
|
||||||
import from SDP_Types all;
|
import from SDP_Types all;
|
||||||
|
import from SDP_Templates all;
|
||||||
|
|
||||||
import from StatsD_Checker all;
|
import from StatsD_Checker all;
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ FILES="TELNETasp_PT.cc TELNETasp_PT.hh TELNETasp_PortType.ttcn"
|
||||||
gen_links $DIR $FILES
|
gen_links $DIR $FILES
|
||||||
|
|
||||||
DIR=../library
|
DIR=../library
|
||||||
FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn RAN_Emulation.ttcnpp RLCMAC_CSN1_Templates.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn RAN_Adapter.ttcnpp Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn SCCP_Templates.ttcn IPA_Testing.ttcn GSM_SystemInformation.ttcn GSM_RestOctets.ttcn "
|
FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn RAN_Emulation.ttcnpp RLCMAC_CSN1_Templates.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Emulation.ttcn SDP_Templates.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn RAN_Adapter.ttcnpp Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn SCCP_Templates.ttcn IPA_Testing.ttcn GSM_SystemInformation.ttcn GSM_RestOctets.ttcn "
|
||||||
FILES+="CBSP_Types.ttcn CBSP_Templates.ttcn "
|
FILES+="CBSP_Types.ttcn CBSP_Templates.ttcn "
|
||||||
FILES+="CBSP_CodecPort.ttcn CBSP_CodecPort_CtrlFunct.ttcn CBSP_CodecPort_CtrlFunctdef.cc CBSP_Adapter.ttcn "
|
FILES+="CBSP_CodecPort.ttcn CBSP_CodecPort_CtrlFunct.ttcn CBSP_CodecPort_CtrlFunctdef.cc CBSP_Adapter.ttcn "
|
||||||
FILES+="StatsD_Types.ttcn StatsD_CodecPort.ttcn StatsD_CodecPort_CtrlFunct.ttcn StatsD_CodecPort_CtrlFunctdef.cc StatsD_Checker.ttcn "
|
FILES+="StatsD_Types.ttcn StatsD_CodecPort.ttcn StatsD_CodecPort_CtrlFunct.ttcn StatsD_CodecPort_CtrlFunctdef.cc StatsD_Checker.ttcn "
|
||||||
|
|
|
@ -56,6 +56,7 @@ import from MGCP_Types all;
|
||||||
import from MGCP_Templates all;
|
import from MGCP_Templates all;
|
||||||
import from MGCP_CodecPort all;
|
import from MGCP_CodecPort all;
|
||||||
import from SDP_Types all;
|
import from SDP_Types all;
|
||||||
|
import from SDP_Templates all;
|
||||||
|
|
||||||
import from PFCP_Types all;
|
import from PFCP_Types all;
|
||||||
import from PFCP_Emulation all;
|
import from PFCP_Emulation all;
|
||||||
|
|
|
@ -98,7 +98,7 @@ gen_links $DIR $FILES
|
||||||
|
|
||||||
DIR=../library
|
DIR=../library
|
||||||
FILES="Iuh_Types.ttcn Iuh_CodecPort.ttcn Iuh_CodecPort_CtrlFunctDef.cc Iuh_CodecPort_CtrlFunct.ttcn Iuh_Emulation.ttcn DNS_Helpers.ttcn "
|
FILES="Iuh_Types.ttcn Iuh_CodecPort.ttcn Iuh_CodecPort_CtrlFunctDef.cc Iuh_CodecPort_CtrlFunct.ttcn Iuh_Emulation.ttcn DNS_Helpers.ttcn "
|
||||||
FILES+="MGCP_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc "
|
FILES+="SDP_Templates.ttcn MGCP_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc "
|
||||||
FILES+="RAN_Adapter.ttcnpp RAN_Emulation.ttcnpp BSSAP_CodecPort.ttcn SCCP_Templates.ttcn "
|
FILES+="RAN_Adapter.ttcnpp RAN_Emulation.ttcnpp BSSAP_CodecPort.ttcn SCCP_Templates.ttcn "
|
||||||
FILES+="PFCP_CodecPort.ttcn PFCP_CodecPort_CtrlFunct.ttcn PFCP_CodecPort_CtrlFunctDef.cc PFCP_Emulation.ttcn PFCP_Templates.ttcn "
|
FILES+="PFCP_CodecPort.ttcn PFCP_CodecPort_CtrlFunct.ttcn PFCP_CodecPort_CtrlFunctDef.cc PFCP_Emulation.ttcn PFCP_Templates.ttcn "
|
||||||
FILES+="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn "
|
FILES+="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn "
|
||||||
|
|
|
@ -12,6 +12,7 @@ module MGCP_Templates {
|
||||||
|
|
||||||
import from MGCP_Types all;
|
import from MGCP_Types all;
|
||||||
import from SDP_Types all;
|
import from SDP_Types all;
|
||||||
|
import from SDP_Templates all;
|
||||||
|
|
||||||
function f_mgcp_par_append(inout template MgcpParameterList list, template MgcpParameter par) {
|
function f_mgcp_par_append(inout template MgcpParameterList list, template MgcpParameter par) {
|
||||||
var integer len := lengthof(list);
|
var integer len := lengthof(list);
|
||||||
|
@ -288,142 +289,6 @@ template MgcpCommand tr_RSIP := {
|
||||||
sdp := *
|
sdp := *
|
||||||
}
|
}
|
||||||
|
|
||||||
/* SDP Templates */
|
|
||||||
template SDP_Origin ts_SDP_origin(charstring addr, charstring session_id,
|
|
||||||
charstring session_version := "1",
|
|
||||||
charstring addr_type := "IP4",
|
|
||||||
charstring user_name := "-") := {
|
|
||||||
user_name := user_name,
|
|
||||||
session_id := session_id,
|
|
||||||
session_version := session_version,
|
|
||||||
net_type := "IN",
|
|
||||||
addr_type := addr_type,
|
|
||||||
addr := addr
|
|
||||||
}
|
|
||||||
|
|
||||||
template SDP_connection ts_SDP_connection_IP(charstring addr, charstring addr_type := "IP4",
|
|
||||||
template integer ttl := omit,
|
|
||||||
template integer num_of_addr := omit) :={
|
|
||||||
net_type := "IN",
|
|
||||||
addr_type := addr_type,
|
|
||||||
conn_addr := {
|
|
||||||
addr := addr,
|
|
||||||
ttl := ttl,
|
|
||||||
num_of_addr := num_of_addr
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template SDP_connection tr_SDP_connection_IP(template charstring addr, template charstring addr_type := ?,
|
|
||||||
template integer ttl := *,
|
|
||||||
template integer num_of_addr := *) := {
|
|
||||||
net_type := "IN",
|
|
||||||
addr_type := addr_type,
|
|
||||||
conn_addr := {
|
|
||||||
addr := addr,
|
|
||||||
ttl := ttl,
|
|
||||||
num_of_addr := num_of_addr
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template SDP_time ts_SDP_time(charstring beg, charstring end) := {
|
|
||||||
time_field := {
|
|
||||||
start_time := beg,
|
|
||||||
stop_time := end
|
|
||||||
},
|
|
||||||
time_repeat := omit
|
|
||||||
}
|
|
||||||
|
|
||||||
template SDP_media_desc ts_SDP_media_desc(integer port_number, SDP_fmt_list fmts,
|
|
||||||
SDP_attribute_list attributes) := {
|
|
||||||
media_field := {
|
|
||||||
media := "audio",
|
|
||||||
ports := {
|
|
||||||
port_number := port_number,
|
|
||||||
num_of_ports := omit
|
|
||||||
},
|
|
||||||
transport := "RTP/AVP",
|
|
||||||
fmts := fmts
|
|
||||||
},
|
|
||||||
information := omit,
|
|
||||||
connections := omit,
|
|
||||||
bandwidth := omit,
|
|
||||||
key := omit,
|
|
||||||
attributes := attributes
|
|
||||||
}
|
|
||||||
|
|
||||||
template SDP_media_desc tr_SDP_media_desc(template integer port_number := ?,
|
|
||||||
template SDP_fmt_list fmts := ?,
|
|
||||||
template SDP_attribute_list attributes := ?) := {
|
|
||||||
media_field := {
|
|
||||||
media := "audio",
|
|
||||||
ports := {
|
|
||||||
port_number := port_number,
|
|
||||||
num_of_ports := omit
|
|
||||||
},
|
|
||||||
transport := "RTP/AVP",
|
|
||||||
fmts := fmts
|
|
||||||
},
|
|
||||||
information := *,
|
|
||||||
connections := *,
|
|
||||||
bandwidth := *,
|
|
||||||
key := *,
|
|
||||||
attributes := attributes
|
|
||||||
}
|
|
||||||
|
|
||||||
/* master template for generating SDP based in template arguments */
|
|
||||||
template SDP_Message ts_SDP(charstring local_addr, charstring remote_addr,
|
|
||||||
charstring session_id, charstring session_version,
|
|
||||||
integer rtp_port, SDP_fmt_list fmts,
|
|
||||||
SDP_attribute_list attributes) := {
|
|
||||||
protocol_version := 0,
|
|
||||||
origin := ts_SDP_origin(local_addr, session_id, session_version, f_mgcp_addr2addrtype(local_addr)),
|
|
||||||
session_name := "-",
|
|
||||||
information := omit,
|
|
||||||
uri := omit,
|
|
||||||
emails := omit,
|
|
||||||
phone_numbers := omit,
|
|
||||||
connection := ts_SDP_connection_IP(remote_addr, f_mgcp_addr2addrtype(remote_addr)),
|
|
||||||
bandwidth := omit,
|
|
||||||
times := { ts_SDP_time("0","0") },
|
|
||||||
timezone_adjustments := omit,
|
|
||||||
key := omit,
|
|
||||||
attributes := omit,
|
|
||||||
media_list := { ts_SDP_media_desc(rtp_port, fmts, attributes) }
|
|
||||||
}
|
|
||||||
|
|
||||||
template SDP_Message tr_SDP(template charstring remote_addr := ?, template integer rtp_port := ?) := {
|
|
||||||
protocol_version := 0,
|
|
||||||
origin := ?,
|
|
||||||
session_name := ?,
|
|
||||||
information := *,
|
|
||||||
uri := *,
|
|
||||||
emails := *,
|
|
||||||
phone_numbers := *,
|
|
||||||
connection := tr_SDP_connection_IP(remote_addr, ?),
|
|
||||||
bandwidth := *,
|
|
||||||
times := ?,
|
|
||||||
timezone_adjustments := *,
|
|
||||||
key := *,
|
|
||||||
attributes := *,
|
|
||||||
media_list := { tr_SDP_media_desc(rtp_port) }
|
|
||||||
}
|
|
||||||
|
|
||||||
template SDP_attribute ts_SDP_rtpmap(integer fmt, charstring val) := {
|
|
||||||
rtpmap := {
|
|
||||||
attr_value := int2str(fmt) & " " & val
|
|
||||||
}
|
|
||||||
}
|
|
||||||
template SDP_attribute ts_SDP_ptime(integer p) := {
|
|
||||||
ptime := {
|
|
||||||
attr_value := int2str(p)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
template SDP_attribute ts_SDP_fmtp(integer fmt, charstring val) := {
|
|
||||||
fmtp := {
|
|
||||||
attr_value := int2str(fmt) & " " & val
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function f_mgcp_addr2addrtype(charstring addr) return charstring {
|
function f_mgcp_addr2addrtype(charstring addr) return charstring {
|
||||||
for (var integer i := 0; i < lengthof(addr); i := i + 1) {
|
for (var integer i := 0; i < lengthof(addr); i := i + 1) {
|
||||||
if (addr[i] == ":") {
|
if (addr[i] == ":") {
|
||||||
|
|
|
@ -0,0 +1,159 @@
|
||||||
|
module SDP_Templates {
|
||||||
|
|
||||||
|
/* SDP Templates, building on top of SDP_Types from Ericsson.
|
||||||
|
*
|
||||||
|
* (C) 2017 by Harald Welte <laforge@gnumonks.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Released under the terms of GNU General Public License, Version 2 or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import from SDP_Types all;
|
||||||
|
|
||||||
|
/* SDP Templates */
|
||||||
|
template SDP_Origin ts_SDP_origin(charstring addr, charstring session_id,
|
||||||
|
charstring session_version := "1",
|
||||||
|
charstring addr_type := "IP4",
|
||||||
|
charstring user_name := "-") := {
|
||||||
|
user_name := user_name,
|
||||||
|
session_id := session_id,
|
||||||
|
session_version := session_version,
|
||||||
|
net_type := "IN",
|
||||||
|
addr_type := addr_type,
|
||||||
|
addr := addr
|
||||||
|
}
|
||||||
|
|
||||||
|
template SDP_connection ts_SDP_connection_IP(charstring addr, charstring addr_type := "IP4",
|
||||||
|
template integer ttl := omit,
|
||||||
|
template integer num_of_addr := omit) :={
|
||||||
|
net_type := "IN",
|
||||||
|
addr_type := addr_type,
|
||||||
|
conn_addr := {
|
||||||
|
addr := addr,
|
||||||
|
ttl := ttl,
|
||||||
|
num_of_addr := num_of_addr
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template SDP_connection tr_SDP_connection_IP(template charstring addr, template charstring addr_type := ?,
|
||||||
|
template integer ttl := *,
|
||||||
|
template integer num_of_addr := *) := {
|
||||||
|
net_type := "IN",
|
||||||
|
addr_type := addr_type,
|
||||||
|
conn_addr := {
|
||||||
|
addr := addr,
|
||||||
|
ttl := ttl,
|
||||||
|
num_of_addr := num_of_addr
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template SDP_time ts_SDP_time(charstring beg, charstring end) := {
|
||||||
|
time_field := {
|
||||||
|
start_time := beg,
|
||||||
|
stop_time := end
|
||||||
|
},
|
||||||
|
time_repeat := omit
|
||||||
|
}
|
||||||
|
|
||||||
|
template SDP_media_desc ts_SDP_media_desc(integer port_number, SDP_fmt_list fmts,
|
||||||
|
SDP_attribute_list attributes) := {
|
||||||
|
media_field := {
|
||||||
|
media := "audio",
|
||||||
|
ports := {
|
||||||
|
port_number := port_number,
|
||||||
|
num_of_ports := omit
|
||||||
|
},
|
||||||
|
transport := "RTP/AVP",
|
||||||
|
fmts := fmts
|
||||||
|
},
|
||||||
|
information := omit,
|
||||||
|
connections := omit,
|
||||||
|
bandwidth := omit,
|
||||||
|
key := omit,
|
||||||
|
attributes := attributes
|
||||||
|
}
|
||||||
|
|
||||||
|
template SDP_media_desc tr_SDP_media_desc(template integer port_number := ?,
|
||||||
|
template SDP_fmt_list fmts := ?,
|
||||||
|
template SDP_attribute_list attributes := ?) := {
|
||||||
|
media_field := {
|
||||||
|
media := "audio",
|
||||||
|
ports := {
|
||||||
|
port_number := port_number,
|
||||||
|
num_of_ports := omit
|
||||||
|
},
|
||||||
|
transport := "RTP/AVP",
|
||||||
|
fmts := fmts
|
||||||
|
},
|
||||||
|
information := *,
|
||||||
|
connections := *,
|
||||||
|
bandwidth := *,
|
||||||
|
key := *,
|
||||||
|
attributes := attributes
|
||||||
|
}
|
||||||
|
|
||||||
|
/* master template for generating SDP based in template arguments */
|
||||||
|
template SDP_Message ts_SDP(charstring local_addr, charstring remote_addr,
|
||||||
|
charstring session_id, charstring session_version,
|
||||||
|
integer rtp_port, SDP_fmt_list fmts,
|
||||||
|
SDP_attribute_list attributes) := {
|
||||||
|
protocol_version := 0,
|
||||||
|
origin := ts_SDP_origin(local_addr, session_id, session_version, f_sdp_addr2addrtype(local_addr)),
|
||||||
|
session_name := "-",
|
||||||
|
information := omit,
|
||||||
|
uri := omit,
|
||||||
|
emails := omit,
|
||||||
|
phone_numbers := omit,
|
||||||
|
connection := ts_SDP_connection_IP(remote_addr, f_sdp_addr2addrtype(remote_addr)),
|
||||||
|
bandwidth := omit,
|
||||||
|
times := { ts_SDP_time("0","0") },
|
||||||
|
timezone_adjustments := omit,
|
||||||
|
key := omit,
|
||||||
|
attributes := omit,
|
||||||
|
media_list := { ts_SDP_media_desc(rtp_port, fmts, attributes) }
|
||||||
|
}
|
||||||
|
|
||||||
|
template SDP_Message tr_SDP(template charstring remote_addr := ?, template integer rtp_port := ?) := {
|
||||||
|
protocol_version := 0,
|
||||||
|
origin := ?,
|
||||||
|
session_name := ?,
|
||||||
|
information := *,
|
||||||
|
uri := *,
|
||||||
|
emails := *,
|
||||||
|
phone_numbers := *,
|
||||||
|
connection := tr_SDP_connection_IP(remote_addr, ?),
|
||||||
|
bandwidth := *,
|
||||||
|
times := ?,
|
||||||
|
timezone_adjustments := *,
|
||||||
|
key := *,
|
||||||
|
attributes := *,
|
||||||
|
media_list := { tr_SDP_media_desc(rtp_port) }
|
||||||
|
}
|
||||||
|
|
||||||
|
template SDP_attribute ts_SDP_rtpmap(integer fmt, charstring val) := {
|
||||||
|
rtpmap := {
|
||||||
|
attr_value := int2str(fmt) & " " & val
|
||||||
|
}
|
||||||
|
}
|
||||||
|
template SDP_attribute ts_SDP_ptime(integer p) := {
|
||||||
|
ptime := {
|
||||||
|
attr_value := int2str(p)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
template SDP_attribute ts_SDP_fmtp(integer fmt, charstring val) := {
|
||||||
|
fmtp := {
|
||||||
|
attr_value := int2str(fmt) & " " & val
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function f_sdp_addr2addrtype(charstring addr) return charstring {
|
||||||
|
for (var integer i := 0; i < lengthof(addr); i := i + 1) {
|
||||||
|
if (addr[i] == ":") {
|
||||||
|
return "IP6";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "IP4";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -15,6 +15,7 @@ module MGCP_Test {
|
||||||
import from MGCP_Types all;
|
import from MGCP_Types all;
|
||||||
import from MGCP_Templates all;
|
import from MGCP_Templates all;
|
||||||
import from SDP_Types all;
|
import from SDP_Types all;
|
||||||
|
import from SDP_Templates all;
|
||||||
import from MGCP_CodecPort all;
|
import from MGCP_CodecPort all;
|
||||||
import from MGCP_CodecPort_CtrlFunct all;
|
import from MGCP_CodecPort_CtrlFunct all;
|
||||||
import from RTP_CodecPort all;
|
import from RTP_CodecPort all;
|
||||||
|
|
|
@ -38,7 +38,7 @@ FILES="TELNETasp_PT.cc TELNETasp_PT.hh TELNETasp_PortType.ttcn"
|
||||||
gen_links $DIR $FILES
|
gen_links $DIR $FILES
|
||||||
|
|
||||||
DIR=../library
|
DIR=../library
|
||||||
FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn
|
FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn SDP_Templates.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn
|
||||||
MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc "
|
MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc "
|
||||||
FILES+="AMR_Types.ttcn "
|
FILES+="AMR_Types.ttcn "
|
||||||
FILES+="RTP_CodecPort.ttcn RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_Emulation.ttcn IuUP_EncDec.cc "
|
FILES+="RTP_CodecPort.ttcn RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_Emulation.ttcn IuUP_EncDec.cc "
|
||||||
|
|
|
@ -41,6 +41,7 @@ import from MGCP_Types all;
|
||||||
import from MGCP_Emulation all;
|
import from MGCP_Emulation all;
|
||||||
import from MGCP_Templates all;
|
import from MGCP_Templates all;
|
||||||
import from SDP_Types all;
|
import from SDP_Types all;
|
||||||
|
import from SDP_Templates all;
|
||||||
|
|
||||||
import from MobileL3_Types all;
|
import from MobileL3_Types all;
|
||||||
import from MobileL3_CommonIE_Types all;
|
import from MobileL3_CommonIE_Types all;
|
||||||
|
|
|
@ -46,6 +46,7 @@ import from MGCP_Emulation all;
|
||||||
import from MGCP_Types all;
|
import from MGCP_Types all;
|
||||||
import from MGCP_Templates all;
|
import from MGCP_Templates all;
|
||||||
import from SDP_Types all;
|
import from SDP_Types all;
|
||||||
|
import from SDP_Templates all;
|
||||||
|
|
||||||
import from GSUP_Types all;
|
import from GSUP_Types all;
|
||||||
import from GSUP_Templates all;
|
import from GSUP_Templates all;
|
||||||
|
|
|
@ -96,7 +96,7 @@ FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn MN
|
||||||
FILES+="IPA_Types.ttcn IPA_Emulation.ttcnpp IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc "
|
FILES+="IPA_Types.ttcn IPA_Emulation.ttcnpp IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc "
|
||||||
FILES+="PCO_Types.ttcn GSUP_Types.ttcn GSUP_Templates.ttcn GSUP_Emulation.ttcn "
|
FILES+="PCO_Types.ttcn GSUP_Types.ttcn GSUP_Templates.ttcn GSUP_Emulation.ttcn "
|
||||||
FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn L3_Templates.ttcn RLCMAC_CSN1_Templates.ttcn RLCMAC_CSN1_Types.ttcn L3_Common.ttcn "
|
FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn L3_Templates.ttcn RLCMAC_CSN1_Templates.ttcn RLCMAC_CSN1_Types.ttcn L3_Common.ttcn "
|
||||||
FILES+="RAN_Emulation.ttcnpp BSSAP_CodecPort.ttcn BSSMAP_Templates.ttcn RAN_Adapter.ttcnpp MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_Emulation.ttcn "
|
FILES+="RAN_Emulation.ttcnpp BSSAP_CodecPort.ttcn BSSMAP_Templates.ttcn RAN_Adapter.ttcnpp SDP_Templates.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_Emulation.ttcn "
|
||||||
FILES+="RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunctDef.cc "
|
FILES+="RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunctDef.cc "
|
||||||
FILES+="MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunctDef.cc "
|
FILES+="MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunctDef.cc "
|
||||||
FILES+="SMPP_CodecPort.ttcn SMPP_CodecPort_CtrlFunct.ttcn SMPP_CodecPort_CtrlFunctDef.cc SMPP_Emulation.ttcn SMPP_Templates.ttcn "
|
FILES+="SMPP_CodecPort.ttcn SMPP_CodecPort_CtrlFunct.ttcn SMPP_CodecPort_CtrlFunctDef.cc SMPP_Emulation.ttcn SMPP_Templates.ttcn "
|
||||||
|
|
|
@ -67,7 +67,7 @@ FILES="TELNETasp_PT.cc TELNETasp_PT.hh TELNETasp_PortType.ttcn"
|
||||||
gen_links $DIR $FILES
|
gen_links $DIR $FILES
|
||||||
|
|
||||||
DIR=../library
|
DIR=../library
|
||||||
FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn BSSAP_LE_Types.ttcn RAN_Emulation.ttcnpp RLCMAC_CSN1_Templates.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn RAN_Adapter.ttcnpp Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn SCCP_Templates.ttcn IPA_Testing.ttcn GSM_SystemInformation.ttcn GSM_RestOctets.ttcn "
|
FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn BSSAP_LE_Types.ttcn RAN_Emulation.ttcnpp RLCMAC_CSN1_Templates.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Emulation.ttcn SDP_Templates.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn RAN_Adapter.ttcnpp Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn SCCP_Templates.ttcn IPA_Testing.ttcn GSM_SystemInformation.ttcn GSM_RestOctets.ttcn "
|
||||||
FILES+="BSSAP_LE_CodecPort.ttcn BSSAP_LE_Emulation.ttcn BSSAP_LE_Adapter.ttcn BSSLAP_Types.ttcn BSSMAP_LE_Templates.ttcn "
|
FILES+="BSSAP_LE_CodecPort.ttcn BSSAP_LE_Emulation.ttcn BSSAP_LE_Adapter.ttcn BSSLAP_Types.ttcn BSSMAP_LE_Templates.ttcn "
|
||||||
|
|
||||||
gen_links $DIR $FILES
|
gen_links $DIR $FILES
|
||||||
|
|
Loading…
Reference in New Issue