Compare Revisions

The credentials to download the source code are:
 Username: svnusers
 Password: svnusers

Ignore whitespace Rev 619 → Rev 620

/branches/v3/ttcn/LibSip_MessageBodyTypes.ttcn
15,12 → 15,17
import from LibSip_SimpleMsgSummaryTypes all;
import from LibSip_XMLTypes all;
 
// type charstring XmlBody;
/*
* Simple body types that can be used instead of the more detailed XML and SDP
* without codec support
* */
//type charstring XmlBody;
//type charstring SDP_Message;
 
group MIMETypes {
type union MIME_Encapsulated_Parts {
SDP_Message sdpMessageBody,
XmlBody
xmlBody // if there is XML body
XmlBody xmlBody // if there is XML body
}
 
type record MIME_Encapsulated_Part {
54,7 → 59,6
// if content type is text/plain (for testing long messages)
SimpleMsgSummary simpleMsgSummary,
// RFC 3842
octetstring
smsMessage // encoded SMS message 3GPP 23.040, 24.011
octetstring smsMessage // encoded SMS message 3GPP 23.040, 24.011
}
}
}
/branches/v3/ttcn/LibSip_PIXITS.ttcn
42,8 → 42,13
/**
* @desc charstring for SDP media attribute encoding supported by the IUT
*/
modulepar charstring PX_SIP_SDP_ENCODING := "PCMU/8000";
modulepar charstring PX_SIP_SDP_ENCODING := "PCMU";
 
/**
* @desc charstring for SDP media attribute encoding clockrate supported by the IUT
*/
modulepar charstring PX_SIP_SDP_CLOCKRATE := "8000";
 
} // group SDP Parameter
group XMLCOnfiguration{
/branches/v3/ttcn/LibSip_SDPTypes.ttcn
11,6 → 11,7
* @remark Adding of new attributes types is ok; Adding of new optional attributes in @see SDP_attribute type is ok; Existing attribute types shall not be changed or removed - change requests shall be made to http://t-ort.etsi.org
*/
module LibSip_SDPTypes {
import from LibSip_SIPTypesAndValues all;
group Constants {
group SimpleConstants {
// SDP net_type
107,8 → 108,14
charstring attr_value
}
 
type union SDP_attribute_fmtp_format_specific_params {
SemicolonParam_List paramList,
charstring unstructured
}
 
type record SDP_attribute_fmtp {
charstring attr_value
charstring format,
SDP_attribute_fmtp_format_specific_params params
}
 
type record SDP_attribute_curr {
130,12 → 137,20
charstring direction
}
 
type record SDP_attribute_rtpmap_codec {
charstring encoding,
charstring clockrate,
charstring parameters optional
}
 
type record SDP_attribute_rtpmap {
charstring attr_value
charstring payload_type,
SDP_attribute_rtpmap_codec codec
}
 
type record SDP_attribute_rtcp {
charstring attr_value
integer portnumber,
SDP_connection connection optional
}
 
type record SDP_attribute_msrp {
147,7 → 162,53
charstring attr_value optional
}
 
type record SDP_attribute_maxptime {
charstring attr_value
}
 
type record SDP_attribute_tcap {
integer trpr_cap_num,
Charstring_List proto_list
}
 
type record SDP_attribute_pcfg {
integer config_number,
Charstring_List pot_cfg_list optional
}
 
type record SDP_attribute_acfg {
integer config_number,
Charstring_List sel_cfg_list optional
}
 
type record SDP_attribute_ecn_capable_rtp {
Charstring_List init_list,
Charstring_List parm_list optional
}
 
type record SDP_attribute_rtcp_fb {
charstring rtcp_fb_pt,
charstring rtcp_fb_val
}
 
type record SDP_attribute_rtcp_xr {
Charstring_List xr_format_list optional
}
 
type record SDP_attribute_rtcp_rsize {
}
 
type record SDP_attribute_3ge2ae {
charstring indicator
}
 
type record SDP_attribute_crypto {
charstring tag,
charstring crypto_suite,
charstring key_params,
Charstring_List session_params optional
}
 
type union SDP_attribute {
SDP_attribute_cat cat,
SDP_attribute_keywds keywds,
171,6 → 232,16
SDP_attribute_rtpmap rtpmap,
SDP_attribute_rtcp rtcp,
SDP_attribute_msrp msrp,
SDP_attribute_maxptime maxptime,
SDP_attribute_tcap tcap,
SDP_attribute_pcfg pcfg,
SDP_attribute_acfg acfg,
SDP_attribute_ecn_capable_rtp ecn_capable_rtp,
SDP_attribute_rtcp_fb rtcp_fb,
SDP_attribute_rtcp_xr rtcp_xr,
SDP_attribute_rtcp_rsize rtcp_rsize,
SDP_attribute_3ge2ae e2ae,
SDP_attribute_crypto crypto,
//* unknown has to be the last else encoding/decoding won't work!
SDP_attribute_unknown unknown
}
/branches/v3/ttcn/LibSip_SIPTypesAndValues.ttcn
161,12 → 161,12
 
const integer c_CRlen := 2;
// length of new line (0d0a)
const GenericParam c_Integrity_protected_yes := {"integrity-protected", "yes"};
const GenericParam c_Integrity_protected_no := {"integrity-protected", "no"};
const GenericParam c_Integrity_protected_ip_assoc_pending := {"integrity-protected", "ip-assoc-pending"};
const GenericParam c_Integrity_protected_yes := {"integrity-protected", {tokenOrHost := "yes"}};
const GenericParam c_Integrity_protected_no := {"integrity-protected", {tokenOrHost := "no"}};
const GenericParam c_Integrity_protected_ip_assoc_pending := {"integrity-protected", {tokenOrHost := "ip-assoc-pending"}};
 
const charstring c_algorithm := "MD5";
 
 
} // end group SimpleConstants
 
group AuthorizationConstants {
517,7 → 517,8
GEOLOCATION_ROUTING_E,
SESSION_ID_E,
SIP_ETAG_E,
SIP_IF_MATCH_E
SIP_IF_MATCH_E,
FEATURE_CAPS_E
}
 
// [7.1 ]
546,11 → 547,16
UNKNOWN_METHOD_E
}
 
type union GenValue {
charstring tokenOrHost,
charstring quotedString
}
 
// [20.1, 20.3, 20.4, 20.7, 20.9, 20.10, 20.11, 20.18, 20.20, 20.27, 20.28, 20.30, 20.31,
// 20.33, 20.34, 20.39, 20.42, 20.44 ]
type record GenericParam {
charstring id,
charstring paramValue optional
GenValue paramValue optional
}
 
// [? ]
562,6 → 568,8
// [? ]
type set of GenericParam CommaParam_List;
 
type set length (1..infinity) of charstring Charstring_List;
 
// [20.10, 20.20, 20.30, 20.31, 20.34, 20.39, 20.42, 20.43 ]
type record HostPort {
charstring host optional,
834,6 → 842,11
 
type record of PrivacyValue PrivacyValue_List;
 
type set of FcValue FcValue_List;
type record FcValue {
charstring wildcard(c_WILDCARD),
SemicolonParam_List fcParams optional
}
 
 
} // end group TokensType
961,6 → 974,12
DeltaSec deltaSec
}
 
//[6809]
type record FeatureCaps {
FieldName fieldName(FEATURE_CAPS_E),
FcValue_List fcValues
}
 
// [20.20 ]
type record From {
FieldName fieldName (FROM_E) ,
1440,6 → 1459,8
SemicolonParam_List hiExtention optional
}
 
type record of charstring StringList;
 
} // end group RFC4244HeaderFieldTypes
 
group RFC5009PEarlyMediaHeader {
/branches/v3/ttcn/LibSip_Steps.ttcn
90,15 → 90,15
// Construct credentials for an Authorization field of a request.
v_digestResponse[0] := {
id := "username",
paramValue := v_username
paramValue := { quotedString := v_username }
};
v_digestResponse[1] := {
id := "realm",
paramValue := v_realm
paramValue := { quotedString := v_realm }
};
v_digestResponse[2] := {
id := "uri",
paramValue := v_uri
paramValue := { quotedString := v_uri }
};
v_digestResponse[3] := {
id := "nonce=""""",
112,7 → 112,7
if (p_algorithm) {
v_digestResponse[5] := {
id := "algorithm",
paramValue := PX_AUTH_ALGORITHM
paramValue := { tokenOrHost := PX_AUTH_ALGORITHM }
}; // already enclosed to " characters
}
v_result := {digestResponse := v_digestResponse};
178,55 → 178,55
// TODO STF471 change: avoid setting absent opaque value
v_digestResponse[0] := {
id := "username",
paramValue := v_username
paramValue := { quotedString := v_username }
};
v_digestResponse[1] := {
id := "realm",
paramValue := v_realm
paramValue := { quotedString := v_realm }
};
v_digestResponse[2] := {
id := "nonce",
paramValue := v_nonce
paramValue := { quotedString := v_nonce }
};
v_digestResponse[3] := {
id := "uri",
paramValue := v_uri
paramValue := { quotedString := v_uri }
};
v_digestResponse[4] := {
id := "response",
paramValue := v_response
paramValue := { quotedString := v_response }
};
v_digestResponse[5] := {
id := "algorithm=md5",
paramValue := omit
id := "algorithm",
paramValue := { tokenOrHost := "md5" }
}; // algorithm is not enclosed to " characters
v_digestResponse[6] := {
id := "cnonce",
paramValue := v_cnonce
paramValue := { quotedString := v_cnonce }
};
 
if (v_opaque == "") {
v_digestResponse[7] := {
id := "qop=" & v_qop,
paramValue := omit
id := "qop",
paramValue := { tokenOrHost := v_qop }
}; // qop
v_digestResponse[8] := {
id := "nc=" & cl_nonceCount,
paramValue := omit
id := "nc",
paramValue := { tokenOrHost := cl_nonceCount }
}; // nonceCount
}
else {
v_digestResponse[7] := {
id := "opaque",
paramValue := v_opaque
paramValue := { quotedString := v_opaque }
}; // already enclosed to " characters
v_digestResponse[8] := {
id := "qop=" & v_qop,
paramValue := omit
id := "qop",
paramValue := { tokenOrHost := v_qop }
}; // qop
v_digestResponse[9] := {
id := "nc=" & cl_nonceCount,
paramValue := omit
id := "nc",
paramValue := { tokenOrHost := cl_nonceCount }
}; // nonceCount
}
v_result := {digestResponse := v_digestResponse};
291,51 → 291,51
// TODO STF471 change: avoid setting absent opaque value
v_digestResponse[0] := {
id := "username",
paramValue := v_username
paramValue := { quotedString := v_username }
};
v_digestResponse[1] := {
id := "realm",
paramValue := v_realm
paramValue := { quotedString := v_realm }
};
v_digestResponse[2] := {
id := "nonce",
paramValue := v_nonce
paramValue := { quotedString := v_nonce }
};
v_digestResponse[3] := {
id := "uri",
paramValue := v_uri
paramValue := { quotedString := v_uri }
};
v_digestResponse[4] := {
id := "algorithm=md5",
paramValue := omit
id := "algorithm",
paramValue := { tokenOrHost := "md5" }
}; // algorithm is not enclosed to " characters
v_digestResponse[5] := {
id := "cnonce",
paramValue := v_cnonce
paramValue := { quotedString := v_cnonce }
};
 
if (v_opaque == "") {
v_digestResponse[6] := {
id := "qop=" & v_qop,
paramValue := omit
id := "qop",
paramValue := { tokenOrHost := v_qop }
}; // qop
v_digestResponse[7] := {
id := "nc=" & cl_nonceCount,
paramValue := omit
id := "nc",
paramValue := { tokenOrHost := cl_nonceCount }
}; // nonceCount
}
else {
v_digestResponse[6] := {
id := "opaque",
paramValue := v_opaque
paramValue := { quotedString := v_opaque }
}; // already enclosed to " characters
v_digestResponse[7] := {
id := "qop=" & v_qop,
paramValue := omit
id := "qop",
paramValue := { tokenOrHost := v_qop }
}; // qop
v_digestResponse[8] := {
id := "nc=" & cl_nonceCount,
paramValue := omit
id := "nc",
paramValue := { tokenOrHost := cl_nonceCount }
}; // nonceCount
}
v_result := {digestResponse := v_digestResponse};
390,28 → 390,28
digestCln := {
{
id := "realm",
paramValue := v_realm
paramValue := { quotedString := v_realm }
},
{
id := "nonce",
paramValue := "0edff6c521cc3f407f2d9e01cf6ed82b"
paramValue := { quotedString := "0edff6c521cc3f407f2d9e01cf6ed82b" }
},
{
id := "algorithm",
paramValue := PX_AUTH_ALGORITHM
paramValue := { tokenOrHost := PX_AUTH_ALGORITHM }
}, // algorithm is not enclosed with " characters
{
id := "ck",
paramValue := "00112233445566778899aabbccddeeff"
paramValue := { quotedString := "00112233445566778899aabbccddeeff" }
},
{
id := "ik",
paramValue := "ffeeddccbbaa99887766554433221100"
paramValue := { quotedString := "ffeeddccbbaa99887766554433221100" }
}, // already enclosed to " characters
// TODO STF471 change: check why v_qop was not a paramValue!!!
{
id := "qop",
paramValue := v_qop
paramValue := { tokenOrHost := v_qop }
} // qop
}
};
479,55 → 479,55
// TODO STF471 change: avoid setting absent opaque value
v_digestResponse[0] := {
id := "username",
paramValue := "DifferentToPrivateUser"
paramValue := { quotedString := "DifferentToPrivateUser" }
};
v_digestResponse[1] := {
id := "realm",
paramValue := v_realm
paramValue := { quotedString := v_realm }
};
v_digestResponse[2] := {
id := "nonce",
paramValue := v_nonce
paramValue := { quotedString := v_nonce }
};
v_digestResponse[3] := {
id := "uri",
paramValue := v_uri
paramValue := { quotedString := v_uri }
};
v_digestResponse[4] := {
id := "response",
paramValue := v_response
paramValue := { quotedString := v_response }
};
v_digestResponse[5] := {
id := "algorithm=md5",
paramValue := omit
id := "algorithm",
paramValue := { tokenOrHost := "md5" }
}; // algorithm is not enclosed to " characters
v_digestResponse[6] := {
id := "cnonce",
paramValue := v_cnonce
paramValue := { quotedString := v_cnonce }
};
 
if (v_opaque == "") {
v_digestResponse[7] := {
id := "qop=" & v_qop,
paramValue := omit
id := "qop",
paramValue := { tokenOrHost := v_qop }
}; // qop
v_digestResponse[8] := {
id := "nc=" & cl_nonceCount,
paramValue := omit
id := "nc",
paramValue := { tokenOrHost := cl_nonceCount }
};
}
else {
v_digestResponse[7] := {
id := "opaque=""""",
paramValue := omit
id := "opaque",
paramValue := { quotedString := "" }
}; // already enclosed to " characters
v_digestResponse[8] := {
id := "qop=" & v_qop,
paramValue := omit
id := "qop",
paramValue := { tokenOrHost := v_qop }
}; // qop
v_digestResponse[9] := {
id := "nc=" & cl_nonceCount,
paramValue := omit
id := "nc",
paramValue := { tokenOrHost := cl_nonceCount }
};
}
v_result := {digestResponse := v_digestResponse};
646,7 → 646,11
for (i := 0; i < v_len; i := i + 1) {
if (fx_putInLowercase(p_challenge[i].id) == v_id) {
if (isvalue(p_challenge[i].paramValue)) {
v_result := valueof(p_challenge[i].paramValue);
if(ischosen(p_challenge[i].paramValue.quotedString)) {
v_result := valueof(p_challenge[i].paramValue.quotedString);
} else {
v_result := valueof(p_challenge[i].paramValue.tokenOrHost);
}
}
}
}
768,7 → 772,7
function f_addTagInTo(
inout To p_to
) runs on SipComponent {
f_addParameterTagIfNotPresent(c_tagId, f_getRndTag(), p_to);
f_addParameterTagIfNotPresent(c_tagId, { tokenOrHost := f_getRndTag() }, p_to);
}
 
/**
780,7 → 784,7
*/
function f_addParameterIfNotPresent(
in charstring p_parameter_name,
in charstring p_parameter_value,
in GenValue p_parameter_value,
inout ViaBody p_viaBody
) {
if (isvalue(p_viaBody.viaParams)) {
803,7 → 807,7
*/
function f_addParameterTagIfNotPresent(
in charstring p_parameter_name,
in charstring p_parameter_value,
in GenValue p_parameter_value,
inout To p_to
) {
if (isvalue(p_to.toParams)) {
1053,7 → 1057,7
// C:\WINDOWS\system32\drivers\etc\hosts).
// TODO produce an error because of unkown host exception
if (not f_equivalentHostAddr(valueof(v_viaBody.sentBy.host), valueof(p_source_address.host))) {
f_addParameterIfNotPresent(c_receivedId, valueof(p_source_address.host), v_viaBody);
f_addParameterIfNotPresent(c_receivedId, { tokenOrHost := valueof(p_source_address.host) }, v_viaBody);
}
if (isvalue(v_viaBody.sentBy.portField)) {
p_source_address.portField := valueof(v_viaBody.sentBy.portField);
1322,7 → 1326,9
v_params := {
{
id := c_tagId,
paramValue := f_getRndTag()
paramValue := {
tokenOrHost := f_getRndTag()
}
}
};
vc_from := {
1345,7 → 1351,9
v_params := {
{
id := c_expiresId,
paramValue := c_shortRegistration
paramValue := {
tokenOrHost := c_shortRegistration
}
}
};
vc_contact.contactBody.contactAddresses[0].contactParams := v_params;
1521,7 → 1529,9
v_params := {
{
id := c_tagId,
paramValue := f_getRndTag()
paramValue := {
tokenOrHost := f_getRndTag()
}
}
};
vc_from := {
1672,7 → 1682,9
v_params := {
{
id := c_tagId,
paramValue := f_getRndTag()
paramValue := {
tokenOrHost := f_getRndTag()
}
}
};
vc_from := {
1957,7 → 1969,9
vc_to.toParams := {
{
id := c_tagId,
paramValue := f_getRndTag()
paramValue := {
tokenOrHost := f_getRndTag()
}
}
};
vc_caller_To := vc_to;
2418,10 → 2432,16
integer p_loc_codec
) runs on SipComponent
return SDP_media_desc {
var charstring v_codecs[32] := {"PCMU/8000", "GSM/8000", "G723/8000", "DVI4/8000", "DVI4/16000", "LPC/8000", "PCMA/8000", "G722/8000", "L16/44100/2", "L16/44100", "QCELP/8000", "CN/8000", "MPA/90000", "G728/8000", "DVI4/11025", "DVI4/22050", "G729/8000", "G726-40/8000", "G726-32/8000", "G726-24/8000", "G726-16/8000", "G726D/8000", "G726E/8000", "GSM-EFR/8000", "CelB/90000", "JPEG/90000", "Nv/90000", "H261/90000", "MPV/90000", "MP2T/90000", "H263/90000", "H263-1998/90000"};
var
SDP_media_desc
v_media := {
var SDP_attribute_rtpmap_codec v_codecs[32] := {
{"PCMU", "8000", omit}, {"GSM", "8000", omit}, {"G723", "8000", omit}, {"DVI4", "8000", omit},
{"DVI4", "16000", omit}, {"LPC", "8000", omit}, {"PCMA", "8000", omit}, {"G722", "8000", omit},
{"L16", "44100", "2"}, {"L16", "44100", omit}, {"QCELP", "8000", omit}, {"CN","8000", omit},
{"MPA", "90000", omit}, {"G728", "8000", omit}, {"DVI4", "11025", omit}, {"DVI4", "22050", omit},
{"G729", "8000", omit}, {"G726-40", "8000", omit}, {"G726-32", "8000", omit}, {"G726-24", "8000", omit},
{"G726-16", "8000", omit}, {"G726D", "8000", omit}, {"G726E", "8000", omit}, {"GSM-EFR", "8000", omit},
{"CelB", "90000", omit}, {"JPEG", "90000", omit}, {"Nv", "90000", omit}, {"H261", "90000", omit},
{"MPV", "90000", omit}, {"MP2T" ,"90000", omit}, {"H263", "90000", omit}, {"H263-1998", "90000", omit}};
var SDP_media_desc v_media := {
media_field := {
media := "audio",
ports := {
2453,7 → 2473,10
v_media.media_field.fmts := {PX_SIP_SDP_DYN}; // { "98", "0" };
v_media.attributes := {
{
rtpmap := {attr_value := PX_SIP_SDP_DYN & " " & v_codecs[p_loc_codec - 1]} // PX_SIP_SDP_DYN := 98
rtpmap := {
payload_type := PX_SIP_SDP_DYN,
codec := v_codecs[p_loc_codec - 1]
}
}
};
}
2462,7 → 2485,14
}
else if (p_loc_sdp == 4) {
v_media.media_field.fmts := {"99", "8"};
v_media.attributes := {{rtpmap := {attr_value := "99 " & v_codecs[p_loc_codec - 1]}}};
v_media.attributes := {
{
rtpmap := {
payload_type := "99",
codec := v_codecs[p_loc_codec - 1]
}
}
};
}
else if (p_loc_sdp == 5) {
v_media.media_field.media := "image";
2499,7 → 2529,8
function f_prepare_SDP_answer(
) runs on SipComponent {
var integer v_mn, v_cn := 0, i, j, k := 0;
var charstring v_PT, v_rtpmap := "";
var charstring v_PT;
var SDP_attribute_rtpmap_codec v_rtpmap := { "", "", omit};
var SDP_attribute_list v_mediaAttributes := {};
// increase session version
vc_sdp_local.origin.session_version := int2str(str2int(vc_sdp_remote.origin.session_version) + 1);
2516,9 → 2547,9
vc_sdp_local.media_list[i].media_field.fmts := {v_PT};
for (j := 0; j < v_cn; j := j + 1) {
if (ischosen(vc_sdp_remote.media_list[i].attributes[j].rtpmap)) {
if (v_PT == regexp(vc_sdp_remote.media_list[i].attributes[j].rtpmap.attr_value, "[ \t]#(0,)([\d]+)*", 0)) {
v_rtpmap := vc_sdp_remote.media_list[i].attributes[j].rtpmap.attr_value;
v_mediaAttributes[k] := {rtpmap := {attr_value := v_rtpmap}};
if (v_PT == vc_sdp_remote.media_list[i].attributes[j].rtpmap.payload_type) {
v_rtpmap := vc_sdp_remote.media_list[i].attributes[j].rtpmap.codec;
v_mediaAttributes[k] := {rtpmap := {v_PT, v_rtpmap}};
k := k + 1;
} // else line is not copied
}
4272,7 → 4303,7
 
// Preamble
//NOTE STF471: removed f_init_userprofile(p_userprofile); // assignment of PIXIT values to component variable
vc_sdp_local := valueof(m_SDP_bandwidth(m_media_dynPT(PX_SIP_SDP_DYN, PX_SIP_SDP_ENCODING), vc_userprofile));
vc_sdp_local := valueof(m_SDP_bandwidth(m_media_dynPT(PX_SIP_SDP_DYN, PX_SIP_SDP_ENCODING, PX_SIP_SDP_CLOCKRATE, omit), vc_userprofile));
}
 
/**
/branches/v3/ttcn/LibSip_Templates.ttcn
106,20 → 106,20
) := {
{
"cpc",
p_ISUP_CPC_value
{tokenOrHost := p_ISUP_CPC_value}
}
}
 
template(value) SemicolonParam_List m_ReasonParams(
template(omit) charstring p_cause := omit,
template(value) charstring p_text
template(omit) GenValue p_cause := omit,
template(value) GenValue p_text
) := {
m_Cause(p_cause), m_Text(p_text)
}
 
template(present) SemicolonParam_List mw_ReasonParams(
template charstring p_cause,
template charstring p_text
template GenValue p_cause,
template GenValue p_text
) := {
mw_Cause_base(p_cause), mw_Text(p_text)
}
135,43 → 135,43
}
 
template(value) ReasonValue m_ReasonValue_param(
template(value) charstring p_cause,
template(value) charstring p_text
template(value) GenValue p_cause,
template(value) GenValue p_text
) modifies m_ReasonValue_Base := {
reasonParams := m_ReasonParams(p_cause, p_text)
}
 
template(present) ReasonValue mw_ReasonValue_param(
template charstring p_cause,
template charstring p_text
template GenValue p_cause,
template GenValue p_text
) modifies mw_ReasonValue_Base := {
reasonParams := mw_ReasonParams(p_cause, p_text)
}
 
template(value) ReasonValue m_ReasonValue(
template(value) charstring p_cause,
template(value) charstring p_text
template(value) GenValue p_cause,
template(value) GenValue p_text
) modifies m_ReasonValue_param := {
token := "Q.850"
}
 
template(present) ReasonValue mw_ReasonValue(
template charstring p_cause,
template charstring p_text
template GenValue p_cause,
template GenValue p_text
) modifies mw_ReasonValue_param := {
token := "Q.850"
}
 
template(value) ReasonValue m_ReasonValueSIP(
template(value) charstring p_cause,
template(value) charstring p_text
template(value) GenValue p_cause,
template(value) GenValue p_text
) modifies m_ReasonValue_param := {
token := "SIP"
}
 
template(present) ReasonValue mw_ReasonValueSIP(
template charstring p_cause,
template charstring p_text
template GenValue p_cause,
template GenValue p_text
) modifies mw_ReasonValue_param := {
token := "SIP"
}
616,7 → 616,7
}
 
template(value) GenericParam m_Cause(
template(omit) charstring p_cause := omit
template(omit) GenValue p_cause := omit
) := {
id := "cause",
paramValue := p_cause
623,7 → 623,7
}
 
template(present) GenericParam mw_Cause_base(
template charstring p_cause
template GenValue p_cause
) := {
id := "cause",
paramValue := p_cause
633,7 → 633,7
template(value) charstring p_cause
) := {
id := ?,
paramValue := pattern "*{p_cause}*"
paramValue := { tokenOrHost := pattern "*{p_cause}*" }
}
 
template(value) Authorization m_Authorization(
708,7 → 708,7
 
template(value) Contact m_Contact_profile_expires(
template(value) SipUserProfile p_userprofile,
template(value) charstring p_expires
template(value) GenValue p_expires
) := {
fieldName := CONTACT_E,
contactBody := {
728,7 → 728,7
 
template(value) From m_From(
template(value) NameAddr p_nameAddr,
template(value) charstring p_tag_str
template(value) GenValue p_tag_str
) := {
fieldName := FROM_E,
addressField := {nameAddr := p_nameAddr}, //* end addressField
741,7 → 741,7
}
 
template(value) From m_From_Anonymous(
template(value) charstring p_tag_str
template(value) GenValue p_tag_str
) := {
fieldName := FROM_E,
addressField := {
917,12 → 917,12
template(value) integer p_cause
) := {
fieldName := REASON_E,
reasonValues := {m_ReasonValue(int2str(valueof(p_cause)), "dummy")}
reasonValues := {m_ReasonValue({tokenOrHost := int2str(valueof(p_cause))}, { tokenOrHost := "dummy"})}
}
 
template(value) Reason m_Reason21 := {
fieldName := REASON_E,
reasonValues := {m_ReasonValue(int2str(21), "call reject")}
reasonValues := {m_ReasonValue({tokenOrHost := int2str(21)}, { tokenOrHost := "call reject"})}
}
 
template(present) Reason mw_Reason_Base := {
931,13 → 931,13
}
 
template(present) Reason mw_Reason(
template(value) charstring p_cause
template(value) GenValue p_cause
) modifies mw_Reason_Base := {
reasonValues := {mw_ReasonValue(p_cause, ?)}
}
 
template(present) Reason mw_ReasonSIP(
template(value) charstring p_cause
template(value) GenValue p_cause
) modifies mw_Reason_Base := {
reasonValues := {mw_ReasonValueSIP(p_cause, ?)}
}
1039,7 → 1039,7
 
template(value) ReferTo m_ReferTo_SipUrl(
template(value) SipUrl p_sipUrl,
template(value) charstring p_method
template(value) GenValue p_method
) := {
fieldName := REFER_TO_E,
nameAddr :=
1067,8 → 1067,8
 
template(value) Replaces m_Replaces(
template(value) charstring p_callId,
template(value) charstring p_toTag,
template(value) charstring p_fromTag
template(value) GenValue p_toTag,
template(value) GenValue p_fromTag
) := {
fieldName := REPLACES_E,
replacesParams := {
1104,7 → 1104,7
substateParams := {
{
id := "expires",
paramValue := "60000"
paramValue := {tokenOrHost := "60000"}
}
}
}
1123,7 → 1123,7
template(value) Supported m_Supported_100rel_prec modifies m_Supported_empty := {optionsTags := {c_tag100rel, c_tagPrecond}}
 
template(value) GenericParam m_Text(
template(value) charstring p_text
template(value) GenValue p_text
) := {
id := "text",
paramValue := p_text
1130,7 → 1130,7
}
 
template(present) GenericParam mw_Text(
template charstring p_text
template GenValue p_text
) := {
id := "text",
paramValue := p_text
1138,12 → 1138,12
 
template(value) GenericParam m_UserPhone := {
id := "user",
paramValue := "phone"
paramValue := { quotedString := "phone" }
}
 
template(value) GenericParam m_UserToUserEncodingHex := {
id := "encoding",
paramValue := "hex"
paramValue := { quotedString := "hex" }
}
 
template(value) UserToUser m_UserToUserData(
1227,7 → 1227,9
viaParams := {
{
id := c_branchId,
paramValue := p_branch_val
paramValue := {
tokenOrHost := p_branch_val
}
}
}
}
2686,7 → 2688,7
 
template(present) BYE_Request mw_BYE_Request_Reason(
template CallId p_callId,
template(value) charstring p_cause
template(value) GenValue p_cause
) modifies mw_BYE_Request_Base := {
msgHeader := {reason := mw_Reason(p_cause)}
}
2693,7 → 2695,7
 
template(present) BYE_Request mw_BYE_Request_ReasonSIP(
template CallId p_callId,
template(value) charstring p_cause
template(value) GenValue p_cause
) modifies mw_BYE_Request_Base := {
msgHeader := {reason := mw_ReasonSIP(p_cause)}
}
3032,7 → 3034,7
template(present) StatusLine p_statusLine := ?,
template CallId p_callId,
template CSeq p_cSeq,
template(value) charstring p_cause
template(value) GenValue p_cause
) modifies mw_Response_Base := {
statusLine := mw_statusLine(p_statusLine.statusCode, ?),
msgHeader := {reason := mw_Reason(p_cause)}
3363,8 → 3365,10
}
 
template(value) SDP_media_desc m_media_dynPT(
template(value) charstring p_PT,
template(value) charstring p_encod,
template(value) charstring p_payloadType,
template(value) charstring p_encoding,
template(value) charstring p_clockrate,
template(omit) charstring p_parameters := omit,
template(omit) SDP_key p_sdpKey := omit
) := {
media_field := {
3374,13 → 3378,21
num_of_ports := omit
},
transport := c_rtpAvp, //* "RTP/AVP",
fmts := {p_PT}
fmts := { p_payloadType }
}, //* m=audio 8500 RTP/AVP 8
information := omit,
connections := omit,
bandwidth := omit,
key := p_sdpKey,
attributes := {{rtpmap := {attr_value := p_PT & " " & p_encod}}} //* a=rtpmap:8 PCMA/8000
attributes := {{rtpmap := {
payload_type := p_payloadType,
codec := {
encoding := p_encoding,
clockrate := p_clockrate,
parameters := p_parameters
}
}
}} //* a=rtpmap:8 PCMA/8000
}
 
/**
3394,7 → 3406,7
*/
template(value) SDP_media_desc m_media_unsupported(
template(value) charstring p_mediaTransport,
template(value) charstring p_mediaAttribute,
template(value) SDP_attribute_rtpmap p_mediaAttribute,
template(value) charstring p_mediaType := "video"
) := {
media_field := {
3410,7 → 3422,7
connections := omit,
bandwidth := omit,
key := omit,
attributes := {{rtpmap := {attr_value := p_mediaAttribute}}}
attributes := {{rtpmap := p_mediaAttribute}}
}
 
template(value) SDP_bandwidth m_bandwidth(
3536,60 → 3548,58
template(present) SDP_attribute mw_attribute_sendonly_inactive := (mw_attribute_sendonly, mw_attribute_inactive);
template SDP_attribute mw_attribute_sendrecv_recvonly_omit := (mw_attribute_sendrecv, mw_attribute_recvonly, omit);
template(value) SDP_attribute m_attribute_base(
template(value) charstring p_attr_value
template(value) SDP_attribute_rtpmap p_attr_value
) := {
rtpmap := {
attr_value := p_attr_value
}
rtpmap := p_attr_value
}
/**
* @desc send template for a specific media attribute
* @param attribte value, former PX_SIP_SDP_DYN & " " & PX_SIP_SDP_MEDIA_TRANSPORT_AMR
*/
template(value) SDP_attribute m_attribute_AMR_DPT(
template(value) charstring p_attr_value := "0 AMR"
template(value) SDP_attribute m_attribute_AMR_DPT(//"0 AMR"
template(value) SDP_attribute_rtpmap p_attr_value := {"0", {"AMR", "8000", omit}}
) := m_attribute_base(p_attr_value);
/**
* @desc send template for a specific media attribute
* @param attribte value, former PX_SIP_SDP_DYN & " " & PX_SIP_SDP_MEDIA_TRANSPORT_CLE
*/
template(value) SDP_attribute m_attribute_CLEARMODE_DPT(
template(value) charstring p_attr_value := "0 CLEARMODE/8000"
template(value) SDP_attribute m_attribute_CLEARMODE_DPT(//"0 CLEARMODE/8000"
template(value) SDP_attribute_rtpmap p_attr_value := {"0", {"CLEARMODE", "8000", omit}}
) := m_attribute_base(p_attr_value);
/**
* @desc send template for a specific media attribute
* @param attribte value, former PX_SIP_SDP_ENCODING_ATTRIBUTE_G222
*/
template(value) SDP_attribute m_attribute_G722(
template(value) charstring p_attr_value := "9 G722/8000"
template(value) SDP_attribute m_attribute_G722(//"9 G722/8000"
template(value) SDP_attribute_rtpmap p_attr_value := {"9", {"G722", "8000", omit}}
) := m_attribute_base(p_attr_value);
/**
* @desc send template for a specific media attribute
* @param attribte value, former PX_SIP_SDP_ENCODING_ATTRIBUTE_PCMU
*/
template(value) SDP_attribute m_attribute_PCMU(
template(value) charstring p_attr_value := "0 PCMU/8000"
template(value) SDP_attribute m_attribute_PCMU(//"0 PCMU/8000"
template(value) SDP_attribute_rtpmap p_attr_value := {"0", {"PCMU", "8000", omit}}
) := m_attribute_base(p_attr_value);
/**
* @desc send template for a specific media attribute
* @param attribte value, former PX_SIP_SDP_DYN & " " & PX_SIP_SDP_MEDIA_TRANSPORT_PCMU
*/
template(value) SDP_attribute m_attribute_PCMU_DPT(
template(value) charstring p_attr_value := "0 PCMU/8000"
template(value) SDP_attribute m_attribute_PCMU_DPT(//"0 PCMU/8000"
template(value) SDP_attribute_rtpmap p_attr_value := {"0", {"PCMU", "8000", omit}}
) := m_attribute_base(p_attr_value);
/**
* @desc send template for a specific media attribute
* @param attribte value, former PX_SIP_SDP_ENCODING_ATTRIBUTE_PCMA
*/
template(value) SDP_attribute m_attribute_PCMA(
template(value) charstring p_attr_value := "8 PCMA/8000"
template(value) SDP_attribute m_attribute_PCMA(//"8 PCMA/8000"
template(value) SDP_attribute_rtpmap p_attr_value := {"8", {"PCMA", "8000", omit}}
) := m_attribute_base(p_attr_value);
/**
* @desc send template for a specific media attribute
* @param attribte value, former PX_SIP_SDP_DYN & " " & PX_SIP_SDP_MEDIA_TRANSPORT_PCMA
*/
template(value) SDP_attribute m_attribute_PCMA_DPT(
template(value) charstring p_attr_value := "0 PCMA/8000"
template(value) SDP_attribute m_attribute_PCMA_DPT(//"0 PCMA/8000"
template(value) SDP_attribute_rtpmap p_attr_value := {"0", {"PCMA", "8000", omit}}
) := m_attribute_base(p_attr_value);
// TODO: STF471 template name suggests that this is a send
// template, while it contains matching mechanisms
4176,7 → 4186,7
v_result := v_result + 2 + c_CRlen + lengthof("quality:" & p_element.quality.attr_value);
}
if (ischosen(p_element.fmtp)) {
v_result := v_result + 2 + c_CRlen + lengthof("fmtp:" & p_element.fmtp.attr_value);
v_result := v_result + 2 + c_CRlen + lengthof("fmtp:" & p_element.fmtp.format & " " & f_fmtpparams_to_charstring(p_element.fmtp.params));
}
if (ischosen(p_element.curr)) {
v_result := v_result + 2 + c_CRlen + lengthof("curr:" & p_element.curr.preconditionType & " " & p_element.curr.statusType & " " & p_element.curr.direction);
4188,10 → 4198,10
v_result := v_result + 2 + c_CRlen + lengthof("conf:" & p_element.conf.preconditionType & " " & p_element.conf.statusType & " " & p_element.conf.direction);
}
if (ischosen(p_element.rtpmap)) {
v_result := v_result + 2 + c_CRlen + lengthof("rtpmap:" & p_element.rtpmap.attr_value);
v_result := v_result + 2 + c_CRlen + lengthof("rtpmap:" & f_rtpmap_to_charstring(p_element.rtpmap));
}
if (ischosen(p_element.rtcp)) {
v_result := v_result + 2 + c_CRlen + lengthof("rtcp:" & p_element.rtcp.attr_value);
v_result := v_result + 2 + c_CRlen + lengthof("rtcp:" & f_rtcp_to_charstring(p_element.rtcp));
}
if (ischosen(p_element.unknown)) {
v_result := v_result + 2 + c_CRlen + lengthof(p_element.unknown.name);
4203,7 → 4213,67
return v_result;
} //* f_SDPlength_attribute
 
function f_fmtpparams_to_charstring(
SDP_attribute_fmtp_format_specific_params p_params
) return charstring {
var charstring v_result := "";
if(ischosen(p_params.unstructured)){
v_result := p_params.unstructured;
}
else
{
for(var integer v_idx := 0; v_idx < lengthof(p_params.paramList); v_idx := v_idx + 1) {
if(v_idx != 0)
{
v_result := v_result & "; "
}
v_result := v_result & p_params.paramList[v_idx].id;
if(ispresent(p_params.paramList[v_idx].paramValue)){
if(ischosen(p_params.paramList[v_idx].paramValue.tokenOrHost))
{
v_result := v_result & "=" & p_params.paramList[v_idx].paramValue.tokenOrHost;
}
else
{
v_result := v_result & "=""" & p_params.paramList[v_idx].paramValue.quotedString & """";
}
}
}
}
return v_result;
}
 
function f_rtpmap_to_charstring(
SDP_attribute_rtpmap p_rtpmap
) return charstring {
var charstring v_result := "";
v_result := p_rtpmap.payload_type & " " & p_rtpmap.codec.encoding & "/" & p_rtpmap.codec.clockrate;
if(ispresent(p_rtpmap.codec.parameters))
{
v_result := v_result & "/" & p_rtpmap.codec.parameters;
}
return v_result;
}
 
function f_rtcp_to_charstring(
SDP_attribute_rtcp p_rtcp
) return charstring {
var charstring v_result := int2str(p_rtcp.portnumber);
if(ispresent(p_rtcp.connection))
{
v_result := v_result & " " & p_rtcp.connection.net_type & " " & p_rtcp.connection.addr_type & " " & p_rtcp.connection.conn_addr.addr;
if(ispresent(p_rtcp.connection.conn_addr.ttl))
{
v_result := v_result & "/" & int2str(p_rtcp.connection.conn_addr.ttl);
if(ispresent(p_rtcp.connection.conn_addr.num_of_addr))
{
v_result := v_result & "/" & int2str(p_rtcp.connection.conn_addr.num_of_addr);
}
}
}
return v_result;
}
 
} //* group SDPlen_calculation
 
group XML_Len_calculation {