Newer
Older
conf:={preconditionType := p_preconditionType,
statusType := p_statusType,
direction := p_direction}
} //* end group SDP_Fields
} //* end group SDP_Templates
group SimpleMsgSummary_Templates {
template(value) SimpleMsgSummary m_SMS(template(value) Msg_summary_line_list p_summaryLineList, template(value) charstring p_uri) :=
{
msg_status_line := m_msgStatusLine_yes,
msg_account := m_msgAccount(p_uri),
msg_summary_line_list :=p_summaryLineList,
opt_msg_headers := omit
}
template(present) SimpleMsgSummary mw_SMS :=
{
msg_status_line := ?,
msg_account := *,
msg_summary_line_list := *,
opt_msg_headers := *
}
template(present) SimpleMsgSummary mw_SMS_yes :=
{
msg_status_line := mw_msgStatusLine_yes,
msg_account := *,
msg_summary_line_list := *,
opt_msg_headers := *
}
template(present) SimpleMsgSummary mw_SMS_yesUri :=
{
msg_status_line := mw_msgStatusLine_yes,
msg_account := mw_msgAccount,
msg_summary_line_list := *,
opt_msg_headers := *
}
template(present) SimpleMsgSummary mw_SMS_yesVoice :=
{
msg_status_line := mw_msgStatusLine_yes,
msg_account := *,
msg_summary_line_list := {mw_msgSummaryLine(c_voiceMessage)},
opt_msg_headers := *
}
template(present) SimpleMsgSummary mw_SMS_yesUriVoice :=
{
msg_status_line := mw_msgStatusLine_yes,
msg_account := mw_msgAccount,
msg_summary_line_list := {mw_msgSummaryLine(c_voiceMessage)},
opt_msg_headers := *
}
template(value) Msg_status_line m_msgStatusLine_yes:=
{
msg_type := c_messageWaiting,
msg_status := "yes"
}
template(present) Msg_status_line mw_msgStatusLine_yes:=
{
msg_type := c_messageWaiting,
msg_status := "yes"
}
template(value) Msg_account m_msgAccount(template(value) charstring p_uri) :=
msg_type_account := c_messageAccount,
account_URI := p_uri//m_SipUrl_NumberHostParam(PX_IMS_SUT_UE2_PUBLIC_USER,PX_IMS_SUT_UE2_HOME_DOMAIN,omit)
}
template(present) Msg_account mw_msgAccount :=
msg_type_account := c_messageAccount,
account_URI := ?
}
template(value) Msg_summary_line m_msgSummaryLine(template(value) charstring p_msgContexClass, template(value) charstring p_msgs, template(value) charstring p_urgent_msgs) :=
{
msg_context_class := p_msgContexClass,
msgs := p_msgs,
urgent_msgs := p_urgent_msgs
}
template(present) Msg_summary_line mw_msgSummaryLine(template(present) charstring p_msgContexClass) :=
{
msg_context_class := p_msgContexClass,
msgs := ?,
urgent_msgs :=*
}
} //end group Templates_SMS
group MessageBodies {
template(value) MessageBody m_MBody_SDP(template(value) SDP_Message p_SDP):=
{
sdpMessageBody := p_SDP
};
template(value) MessageBody m_MBody_XML(template(value) XmlBody p_xmlBody):=
{
xmlBody := p_xmlBody
};
template(value) MessageBody m_mBody_SMS(template(value) SimpleMsgSummary p_SMS):=
simpleMsgSummary := p_SMS
};
template(value) MessageBody m_MBody_longPlainText:=
{
textplain := c_longMessageContent_1300Bytes
};
template(value) MessageBody m_mBody_plainText(template(value) charstring p_plaitext):=
{
textplain := p_plaitext
};
template(value) MessageBody m_MBody_sipfrag(template(value) charstring p_sipfrag) := {
sipfrag := p_sipfrag
}
//TODO STF471 check fixed values vs. PIXITs
template(value) MessageBody m_MBody_MIMESdpXml(template(value) SDP_Message p_sdp, template(value) XmlBody p_xmlBody):=
mimeMessageBody := {boundary:="--boundary1", //"PX_SIP_MIME_Boundary",
mimeEncapsulatedList:= {
{content_type:="application/sdp",//"PX_SIP_SDP_ContentType",
content_disposition:=omit,
mime_encapsulated_part:={sdpMessageBody := p_sdp}},
{content_type:="application/vnd.3gpp.cw+xml",//"PX_SIP_ISUP_ContentType",
content_disposition:=omit,
mime_encapsulated_part:={xmlBody := p_xmlBody}}
}
}
}
template(present) MessageBody mw_MBody_SDP(template(present) SDP_Message p_SDP):=
{
sdpMessageBody := p_SDP
};
template(present) MessageBody mw_MBody_XML(template(present) XmlBody p_xmlBody):=
{
xmlBody := p_xmlBody
};
template(present) MessageBody mw_mBody_SMS(template(present) SimpleMsgSummary p_SMS):=
simpleMsgSummary := p_SMS
template(present) MessageBody mw_MBody_MIMESdpXml(template(present) SDP_Message p_sdp, template(present) XmlBody p_xmlBody):=
{
mimeMessageBody := {boundary:=?,
mimeEncapsulatedList:= {
{content_type:=?,
content_disposition:=*,
mime_encapsulated_part:={sdpMessageBody := p_sdp}},
{content_type:=?,
content_disposition:=*,
mime_encapsulated_part:={xmlBody := p_xmlBody}}
}
}
}
template(present) MessageBody mw_MBody_MIME_Ims3gpp(
template charstring p_disposition,
template(present) Ims_3gpp p_ims3gpp
):= {
mimeMessageBody := {boundary:=?,
mimeEncapsulatedList:= {
*,
{
content_disposition:= p_disposition,
mime_encapsulated_part :={
xmlBody := {
ims3gpp := p_ims3gpp
}
}
},
*
}
}
}
template(present) MessageBody mw_MBody_MIME_Ims3gppCW(
template charstring p_disposition,
template(present) Ims_3gpp p_ims3gpp
):= {
mimeMessageBody := {boundary:=?,
mimeEncapsulatedList:= {
*,
{
content_type:= c_ims3gppCwApplication,
content_disposition:= p_disposition,
mime_encapsulated_part :={
xmlBody := {
ims3gpp := p_ims3gpp
}
}
},
*
}
}
}
* @desc group TemplatePreparationFunctions contain functions which are used for templates
*/
group TemplatePreparationFunctions {
group MessageBody_Calculation{
/**
*
* @desc Calculation of Message Body length
* @param p_mb_par contain message body part
* @return message body length
*/
function f_MessageBodyLength(template(value) MessageBody p_mb_par) return integer {
var integer v_result:=0;
if (MB_LENGTH_FROM_ENCVAL){ //by default it is set to true
// in case the codec encodes the variant selector, this needs to be changed to ischosen...
v_result:= lengthof(encvalue(p_mb_par))/8; // length in bytes, let get length of encoded value
}
else{
// assume SDP_Message ONLY in the message body
if (ischosen(p_mb_par.sdpMessageBody))
{
};
// assume XML_Body ONLY in the message body
if (ischosen(p_mb_par.xmlBody))
{
v_result := f_XMLBody_Length(valueof(p_mb_par.xmlBody), USE_FX_FOR_XML_LENGTH);
// assume simpleMsgSummary_Body ONLY in the message body
if (ischosen(p_mb_par.simpleMsgSummary))
{
v_result := f_simpleMsgSummaryBody_Length(valueof(p_mb_par.simpleMsgSummary));
// assume MIME_Message in the message body
if (ischosen(p_mb_par.mimeMessageBody))
{
v_result := f_MIMElength(valueof(p_mb_par.mimeMessageBody));
};
//assume sipfrag in the message body
if (ischosen(p_mb_par.sipfrag))
{
v_result := f_TextPlainLength(p_mb_par); //same function due to same type with textplain
};
//assume textplain in the message body
if (ischosen(p_mb_par.textplain))
{
v_result := f_TextPlainLength(p_mb_par);
};
}
return v_result
}
group SDP_Len_calculation {
*
* @desc Calculation of SDP length
* @param p_mb contain sdp message
* @return sdp_lenght
*/
function f_SDPlength(SDP_Message p_mb) return integer
{
var integer v_result:=2; //* due to empty line beginning of message body
var charstring v_auxstring;
v_result := 2 + c_CRlen + lengthof(int2str(p_mb.protocol_version)); //* "v="
v_auxstring := p_mb.origin.user_name & " " & p_mb.origin.session_id & " " & p_mb.origin.session_version & " " & p_mb.origin.net_type & " " & p_mb.origin.addr_type & " " & p_mb.origin.addr;
v_result := v_result + 2 + c_CRlen + lengthof(v_auxstring); //* "o="
v_result := v_result + 2 + c_CRlen + lengthof(p_mb.session_name); //* "s="
if (ispresent(p_mb.information))
{v_auxstring:=p_mb.information; v_result := v_result + 2 + c_CRlen + lengthof(v_auxstring);}; //* "i= "
if (ispresent(p_mb.uri))
{v_auxstring:=p_mb.uri; v_result := v_result + 2 + c_CRlen + lengthof(v_auxstring);}; //* "u="
if (ispresent(p_mb.emails)) {
{v_result := v_result + 2 + c_CRlen + lengthof(p_mb.emails[i].addr_or_phone); //* "e="
if (ispresent(p_mb.emails[i].disp_name))
{v_auxstring:=p_mb.emails[i].disp_name; v_result := v_result + 1 + lengthof(v_auxstring);};
};
};
if (ispresent(p_mb.phone_numbers)) {
for (var integer i:=0; i<lengthof(p_mb.phone_numbers); i:=i+1)
{v_result := v_result + 2 + c_CRlen + lengthof(p_mb.phone_numbers[i].addr_or_phone); //* "p= "
if (ispresent(p_mb.phone_numbers[i].disp_name))
{v_auxstring:=p_mb.phone_numbers[i].disp_name; v_result := v_result + 1 + lengthof(v_auxstring);};
};
};
if (ispresent(p_mb.connection))
{
var integer v_len_con0 := f_SDPlength_connection(p_mb.connection);
v_result := v_result + v_len_con0;
}; //* "c="
if (ispresent(p_mb.bandwidth))
for (var integer i:=0; i<lengthof(p_mb.bandwidth); i:=i+1) { //* "b= "
v_auxstring:= p_mb.bandwidth[i].modifier & " ";
v_result := v_result + 2 + c_CRlen + lengthof(v_auxstring) +
lengthof(int2str(p_mb.bandwidth[i].bandwidth));
v_auxstring:= p_mb.times[i].time_field.start_time & " " & p_mb.times[i].time_field.stop_time;
v_result := v_result + 2 + c_CRlen + lengthof(v_auxstring);//* "t="
if (ispresent(p_mb.times[i].time_repeat))
{
for (var integer j:=0; j<lengthof(p_mb.times[i].time_repeat); j:=j+1)
v_result := v_result + 2 + c_CRlen + lengthof(int2str(p_mb.times[i].time_repeat[j].repeat_interval.time)); //* "r="
if (ispresent(p_mb.times[i].time_repeat[j].repeat_interval.unit))
{
v_auxstring:=p_mb.times[i].time_repeat[j].repeat_interval.unit;
v_result := v_result + 1 + lengthof(v_auxstring);
};
v_result := v_result + 1 + lengthof(int2str(p_mb.times[i].time_repeat[j].active.time));
if (ispresent(p_mb.times[i].time_repeat[j].active.unit))
{
v_auxstring:=p_mb.times[i].time_repeat[j].active.unit;
v_result := v_result + 1 + lengthof(v_auxstring);
};
for (var integer k:=0; k<lengthof(p_mb.times[i].time_repeat[j].offsets); k:=k+1)
{
v_result := v_result + 1 + lengthof(int2str(p_mb.times[i].time_repeat[j].offsets[k].time));
if (ispresent(p_mb.times[i].time_repeat[j].offsets[k].unit))
{
v_auxstring:=p_mb.times[i].time_repeat[j].offsets[k].unit;
v_result := v_result + 1 + lengthof(v_auxstring);
};
}
}
};
};
if (ispresent(p_mb.timezone_adjustments))
{log("timezone adjustments have not been considered in SDP length calculation yet");
}; //* "z="
if (ispresent(p_mb.key)) {
v_result := v_result + 2 + c_CRlen + lengthof(p_mb.key.method); //* "k= "
if (ispresent(p_mb.key.key))
{v_auxstring:=p_mb.key.key; v_result := v_result + 1 + lengthof(v_auxstring);};
};
if (ispresent(p_mb.attributes)) {
for (var integer i:=0; i<lengthof(p_mb.attributes); i:=i+1){ //* "a= "
var integer v_len_con1 := f_SDPlength_attribute(p_mb.attributes[i]);
v_result := v_result + v_len_con1;
};
}; //* "a="
if (ispresent(p_mb.media_list))
{
for (var integer i:=0; i<lengthof(p_mb.media_list); i:=i+1){ //* "m= "
//* for each media_field
//* log("p_mb.media_list[i] ",p_mb.media_list[i]);
v_result := v_result + 2 + c_CRlen + lengthof(p_mb.media_list[i].media_field.media)
+ 1 + lengthof(int2str(p_mb.media_list[i].media_field.ports.port_number));
if (ispresent(p_mb.media_list[i].media_field.ports.num_of_ports))
{v_result := v_result + 1 + lengthof(int2str(p_mb.media_list[i].media_field.ports.num_of_ports));};
v_result := v_result + 1 + lengthof(p_mb.media_list[i].media_field.transport);
for (var integer j:=0; j<lengthof(p_mb.media_list[i].media_field.fmts); j:=j+1){
v_result := v_result + 1 + lengthof(p_mb.media_list[i].media_field.fmts[j]);
}
if (ispresent(p_mb.media_list[i].information)) {
v_auxstring:=p_mb.media_list[i].information;
v_result := v_result + 2 + c_CRlen + lengthof(v_auxstring); //* "i= "
};
if (ispresent(p_mb.media_list[i].connections)) {
for (var integer j:=0; j<lengthof(p_mb.media_list[i].connections); j:=j+1){
var integer v_len_con2 := f_SDPlength_connection(p_mb.media_list[i].connections[j]);
v_result := v_result + v_len_con2;
}; //* end for
if (ispresent(p_mb.media_list[i].bandwidth)) { //* "b= "
for (var integer j:=0; j<lengthof(p_mb.media_list[i].bandwidth); j:=j+1){
v_result := v_result + 2 + c_CRlen + lengthof(p_mb.media_list[i].bandwidth[j].modifier)
+ 1 + lengthof(int2str(p_mb.media_list[i].bandwidth[j].bandwidth));
}; //* end for
if (ispresent(p_mb.media_list[i].key)) { //* "k= "
v_result := v_result + 1 + lengthof(p_mb.media_list[i].key.method);
if (ispresent(p_mb.media_list[i].key.key)) {
v_auxstring := p_mb.media_list[i].key.key;
v_result := v_result + 1 + lengthof(v_auxstring);
};
};
if (ispresent(p_mb.media_list[i].attributes)) {
for (var integer j:=0; j<lengthof(p_mb.media_list[i].attributes); j:=j+1){ //* "a= "
var integer v_len_attr := f_SDPlength_attribute(p_mb.media_list[i].attributes[j]);
v_result := v_result + v_len_attr;
} //* end for j
}; //* end for i
}; //* end if media_list
};//* end function f_SDPlength
function f_SDPlength_connection(SDP_connection p_element) return integer //* "c="
{
var integer v_result:=0;
var charstring v_auxstring;
v_result := v_result + 2 + c_CRlen + lengthof(p_element.net_type & " " &
p_element.addr_type & " " &
p_element.conn_addr.addr);
if (ispresent(p_element.conn_addr.ttl) and p_element.conn_addr.ttl>0)
{v_result := v_result + 1 + lengthof(int2str(p_element.conn_addr.ttl));};
if (ispresent(p_element.conn_addr.num_of_addr) and p_element.conn_addr.num_of_addr>0)
{v_result := v_result + 1 + lengthof(int2str(p_element.conn_addr.num_of_addr));};
return v_result
} //* f_SDPlength_connection
function f_SDPlength_attribute(SDP_attribute p_element) return integer //* "a="
{
var integer v_result:=0;
var charstring v_auxstring;
if (ischosen(p_element.cat)) {v_result := v_result + 2 + c_CRlen + lengthof("cat:" & p_element.cat.attr_value)};
if (ischosen(p_element.keywds)) {v_result := v_result + 2 + c_CRlen + lengthof("keywds:" & p_element.keywds.attr_value)};
if (ischosen(p_element.tool)) {v_result := v_result + 2 + c_CRlen + lengthof("tool:" & p_element.tool.attr_value)};
if (ischosen(p_element.ptime)) {v_result := v_result + 2 + c_CRlen + lengthof("ptime:" & p_element.ptime.attr_value)};
if (ischosen(p_element.recvonly)) {v_result := v_result +c_CRlen + lengthof("recvonly")};
if (ischosen(p_element.sendrecv)) {v_result := v_result +c_CRlen + lengthof("sendrecv")};
if (ischosen(p_element.sendonly)) {v_result := v_result +c_CRlen + lengthof("sendonly")};
if (ischosen(p_element.inactive)) {v_result := v_result +c_CRlen + lengthof("inactive")};
if (ischosen(p_element.orient)) {v_result := v_result + 2 + c_CRlen + lengthof("orient:" & p_element.orient.attr_value)};
if (ischosen(p_element.sdp_type)) {v_result := v_result + 2 + c_CRlen + lengthof("type:" & p_element.sdp_type.attr_value)};
if (ischosen(p_element.charset)) {v_result := v_result + 2 + c_CRlen + lengthof("charset" & p_element.charset.attr_value)};
if (ischosen(p_element.sdplang)) {v_result := v_result + 2 + c_CRlen + lengthof("sdplang:" & p_element.sdplang.attr_value)};
if (ischosen(p_element.lang)) {v_result := v_result + 2 + c_CRlen + lengthof("lang:" & p_element.lang.attr_value)};
if (ischosen(p_element.framerate)) {v_result := v_result + 2 + c_CRlen + lengthof("framerate:" & p_element.framerate.attr_value)};
if (ischosen(p_element.quality)) {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)};
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)};
if (ischosen(p_element.des)) {v_result := v_result + 2 + c_CRlen + lengthof("des:" & p_element.des.preconditionType & " "
& p_element.des.strength & " " & p_element.des.statusType & " " & p_element.des.direction)};
if (ischosen(p_element.conf)) {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)};
if (ischosen(p_element.rtcp)) {v_result := v_result + 2 + c_CRlen + lengthof("rtcp:" & p_element.rtcp.attr_value)};
if (ischosen(p_element.unknown))
{v_result := v_result + 2 + c_CRlen + lengthof(p_element.unknown.name);
if (ispresent(p_element.unknown.attr_value))
{var charstring aux := p_element.unknown.attr_value;
v_result := v_result + lengthof(":" & p_element.unknown.attr_value);
};
};
//* log("axr: length attribute=", v_result);
} //* f_SDPlength_attribute
} //* group SDPlen_calculation
group XML_Len_calculation{
/**
* @desc Declaration of external functions to calculate length of message bodies
* switching of internal or external functions are made by boolean module parameter/PIXIT
* USE_FX_FOR_XML_LENGTH declared at top of this module
*/
external function fx_calculateXMLBodyLen(XmlBody p_mb) return integer;
/**
*
* @desc Calculation of XML body length
* @param p_mb contain XML body
* @return xml_length
*/
function f_XMLBody_Length(XmlBody p_mb, boolean p_ext_func) return integer
{
var integer v_result:=0;
if ( p_ext_func){
v_result := fx_calculateXMLBodyLen(p_mb);
}else{
// assume ConferenceInfo ONLY in the XML message body
bergengruen
committed
if (ischosen(p_mb.conference))
bergengruen
committed
v_result := f_XMLBody_ConferenceInfo_Length(p_mb.conference);
};
// assume CUG ONLY in the XML message body
if (ischosen(p_mb.cug))
{
v_result := f_XMLBody_Cug_Length(p_mb.cug);
};
// assume MCID ONLY in the XML message body
if (ischosen(p_mb.mcid))
{
v_result := f_XMLBody_Mcid_Length(p_mb.mcid);
};
// assume CW ONLY in the XML message body
if (ischosen(p_mb.cw))
{
v_result := f_XMLBody_Cw_Length(p_mb.cw);
};
// assume CDIV ONLY in the XML message body
if (ischosen(p_mb.cdivn))
{
v_result := f_XMLBody_Cdivn_Length(p_mb.cdivn);
};
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
// assume PSTNTransit ONLY in the XML message body
if (ischosen(p_mb.pstnTransit))
{
v_result := f_XMLBody_PSTNTransit_Length(p_mb.pstnTransit);
};
// assume Simservs ONLY in the XML message body
if (ischosen(p_mb.simservs))
{
v_result := f_XMLBody_Simservs_Length(p_mb.simservs);
};
// assume ResourceLists ONLY in the XML message body
if (ischosen(p_mb.resourceLists))
{
v_result := f_XMLBody_ResourceList_Length(p_mb.resourceLists);
};
// assume Ims3GPP ONLY in the XML message body
if (ischosen(p_mb.ims3gpp))
{
v_result := f_XMLBody_Ims3GPP_Length(p_mb.ims3gpp);
};
/** Add aditional checks regarding to new variants,
* also implement appropriate function for calculation
*/
}
return v_result
} //* f_XMLBodyLength
group XMLBodies_calculation{
/**
*
* @desc Calculation of XML ConferenceInfo element length
* @param p_mb contain XML ConfInfo body
* @return xml_length
*/
function f_XMLBody_ConferenceInfo_Length(template(value) Conference_type p_mb) return integer
var integer v_result:= lengthof(encvalue(p_mb))/8;
return v_result
} //* f_XMLBody_ConferenceInfo_Length
/**
*
* @desc Calculation of XML CUG element length
* @param p_mb contain XML CUG body
* @return xml_length
*/
function f_XMLBody_Cug_Length(template(value) Cug p_mb) return integer
var integer v_result:= lengthof(encvalue(p_mb))/8;
return v_result
} //* f_XMLBody_Cug_Length
/**
*
* @desc Calculation of XML MCID element length
* @param p_mb contain XML MCID body
* @return xml_length
*/
function f_XMLBody_Mcid_Length(template(value) Mcid p_mb) return integer
var integer v_result:= lengthof(encvalue(p_mb))/8;
return v_result
} //* f_XMLBody_Mcid_Length
/**
*
* @desc Calculation of XML CW element length
* @param p_mb contain XML CW body
* @return xml_length
*/
function f_XMLBody_Cw_Length(template(value) Ims_cw p_mb) return integer
{
var integer v_result:= lengthof(encvalue(p_mb))/8;
return v_result
} //* f_XMLBody_Cw_Length
/**
*
* @desc Calculation of XML CDIVN element length
* @param p_mb contain XML CDIVN body
* @return xml_length
*/
function f_XMLBody_Cdivn_Length(template(value) Comm_div_info_type p_mb) return integer
{
var integer v_result:= lengthof(encvalue(p_mb))/8;
return v_result
} //* f_XMLBody_Cdivn_Length
/**
*
* @desc Calculation of XML PSTNTransit element length
* @param p_mb contain XML PSTNTransit body
* @return xml_length
*/
function f_XMLBody_PSTNTransit_Length(template(value) PSTN_transit p_mb) return integer
var integer v_result:= lengthof(encvalue(p_mb))/8;
return v_result
} //* f_XMLBody_PSTNTransit_Length
/** @desc Calculation of XML Simservs element length
* @param p_mb contain XML Simservs body
* @return xml_length
*/
function f_XMLBody_Simservs_Length(template(value) Simservs p_mb) return integer
var integer v_result:= lengthof(encvalue(p_mb))/8;
return v_result
} //* f_XMLBody_Simservs_Length
/** @desc Calculation of XML ResourceList length
* @param p_mb contain XML ResourceList body
* @return xml_length
*/
function f_XMLBody_ResourceList_Length(template(value) Resource_lists p_mb) return integer
var integer v_result:= lengthof(encvalue(p_mb))/8;
return v_result
} //* f_XMLBody_ResourceList_Length
/** @desc Calculation of XML Ims3GPP length
* @param p_mb contain XML Ims3GPP body
* @return xml_length
*/
function f_XMLBody_Ims3GPP_Length(template(value) TIMS3GPP p_mb) return integer
var integer v_result:= lengthof(encvalue(p_mb))/8;
return v_result
} //* f_XMLBody_Ims3GPP_Length
} //* XMLBodies_calculation
}//* group XMLlen_calculation
group simpleMsgSummaryBody_Length{
function f_simpleMsgSummaryBody_Length(SimpleMsgSummary p_mb) return integer
{
var integer v_result:=2; //* due to empty line beginning of message body
var charstring v_auxstring;
v_result := 2+lengthof(p_mb.msg_status_line.msg_type) + 2 + lengthof(p_mb.msg_status_line.msg_status)+c_CRlen; //* "Message-Waiting: yes"
if (ispresent(p_mb.msg_account)) //* "Message-Account"
{v_result := v_result + 2 + lengthof(p_mb.msg_account.msg_type_account)+2+lengthof(p_mb.msg_account.account_URI)+c_CRlen;};
if (ispresent(p_mb.msg_summary_line_list)) {
for (var integer i:=0; i<lengthof(p_mb.msg_summary_line_list); i:=i+1)
{v_result := v_result + 2 + c_CRlen + lengthof(p_mb.msg_summary_line_list[i].msg_context_class)+2+lengthof(p_mb.msg_summary_line_list[i].msgs);
if (ispresent(p_mb.msg_summary_line_list[i].urgent_msgs))
{v_auxstring:=p_mb.msg_summary_line_list[i].urgent_msgs; v_result := v_result + 1 + lengthof(v_auxstring);};
};
};
if (ispresent(p_mb.opt_msg_headers)) {
for (var integer i:=0; i<lengthof(p_mb.opt_msg_headers); i:=i+1)
{v_result := v_result + 2 + c_CRlen + lengthof(p_mb.opt_msg_headers[i]);
};
};
return v_result
}
}
group MIME_Len_calculation{
/**
*
* @desc Calculation of MIME length
* @param p_mb contain MIME message
* @return xml_length
*/
function f_MIMElength(MIME_Message p_mb) return integer
{
var integer v_result:=2; //0d0a
v_result := v_result + lengthof(p_mb.boundary) + 2/*0d0a*/;
for (var integer i:=0; i<lengthof(p_mb.mimeEncapsulatedList); i:=i+1){
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
v_result := v_result + lengthof("Content-Type: ")+ lengthof(p_mb.mimeEncapsulatedList[i].content_type) + 2/*0d0a*/ ;
if (ispresent(p_mb.mimeEncapsulatedList[i].content_disposition)){
v_result := v_result + lengthof("Content-Disposition: ")+ lengthof(p_mb.mimeEncapsulatedList[i].content_disposition) + 2/*0d0a*/ ;
}
//v_result := v_result +2/*0d0a*/; ??? to check
// assume SDP_Message ONLY in the message body
if (ischosen(p_mb.mimeEncapsulatedList[i].mime_encapsulated_part.sdpMessageBody))
{
v_result := v_result + f_SDPlength(p_mb.mimeEncapsulatedList[i].mime_encapsulated_part.sdpMessageBody);
};
// assume XML_Body ONLY in the message body
if (ischosen(p_mb.mimeEncapsulatedList[i].mime_encapsulated_part.xmlBody))
{
v_result := v_result + f_XMLBody_Length(p_mb.mimeEncapsulatedList[i].mime_encapsulated_part.xmlBody, USE_FX_FOR_XML_LENGTH );
};
// //assume XML_Message ONLY in the message body
// if (ischosen(p_mb.mimeEncapsulatedList[i].mime_encapsulated_part.xmlMessage))
// {
// v_result := v_result + f_XMLlength(p_mb.mimeEncapsulatedList[i].mime_encapsulated_part.xmlMessage, USE_FX_FOR_XML_LENGTH );
// };
//v_result := v_result +2/*0d0a*/; ??? to check
}
//v_result := v_result +2/*0d0a*/; ??? to check
return v_result
} //* f_MIMElength
}//* group MIMElen_calculation
group TextPlain_Len_calculation{
/**
*
* @desc Calculation of messagebody-textplain type length
* @param p_mb contain textplain message
* @return lenght
*/
function f_TextPlainLength(template(value) MessageBody p_mb) return integer
v_result:=v_result+lengthof(p_mb.textplain);
return v_result;
}//* end function f_TextPlainLength
}//*end group TextPlainLen_calculation
}//*group MessageBody_Calculation
group GiveHeaders {
/**
*
* @desc Return component variable of recordRoute header if vc_boo_recordRoute is true
* @return component variable of recordRoute header
*/
function f_recordroute() runs on SipComponent return template(omit) RecordRoute
{
template RecordRoute v_recordRoute := omit;
if (vc_boo_recordRoute)
{return vc_recordRoute}
else {return(v_recordRoute)} //* TODO: RecordRoute is not OPTIONAL!!! Check IT!
}
/**
*
* @desc Return component variable of Route header if vc_boo_route is true
* @return component variable of recordRoute header
*/
function f_route() runs on SipComponent return template(omit) Route
template(omit) Route v_route := omit;
if (vc_boo_route)
{return v_route} //* TODO: Route header need to be in reverse order than RecordRoute, question of return value - RecordRoute
else {return(v_route)} //* TODO: Route is not OPTIONAL!!! Check IT!
} //* end group GiveHeaders
group others {
/*
*
* @desc function combines two comma parameter lists
* @param p_list1 first list
* @param p_list2 second list
* @return comma parameter list that contains parameters from both input lists
function f_merge_CommaParam_List(template(value) CommaParam_List p_list1, template(value) CommaParam_List p_list2) return template(value) CommaParam_List
for (var integer i:=0; i<limit1; i:=i+1) {
p_result[i] := p_list1[i]
};
p_result[i+limit1] := p_list2[i]
};
return p_result
}
} //* end group others
} //* group TemplatePreparationFunctions
} //* end module LibSip_Templates