Newer
Older
* @author STF 346, STF366, STF368, STF369
* @version $Id$
* @desc This module defines SIP Templates for message, header, and
* structured types. <br>
* Note that any changes made to the definitions in this module
* may be overwritten by future releases of this library
* End users are encouraged to contact the distributers of this
* module regarding their modifications or additions
* @remark Any additions to the templates shall follow the design rules
* and always modify base templates only;
* Existing templates shall not be changed or removed -
* change requests shall be made to http://t-ort.etsi.org
module LibSip_Templates
{
//LibSip
import from LibSip_SIPTypesAndValues all;
import from LibSip_SDPTypes all;
import from LibSip_Interface all;
import from LibSip_PIXITS all;
import from LibSip_XMLTypes all;
group SubFields
{
template Addr_Union m_AddrUnion_NameAddr(template NameAddr p_nameAddr) :=
{
nameAddr := p_nameAddr
}
template Addr_Union m_AddrUnion_DisplayAndSipUrl(template charstring p_displayName, template SipUrl p_addrSpec) :=
{
nameAddr := m_CallingAddr(p_displayName, p_addrSpec)
}
template NameAddr m_CallingAddr(template charstring p_displayName, template SipUrl p_addrSpec) :=
{
displayName := p_displayName,
addrSpec := p_addrSpec
}
template CommaParam_List mw_digestResponse(in GenericParam p_genericParam) :=
{
*,p_genericParam,* //* c_Integrity_protected_yes
}
template SemicolonParam_List m_cpc :=
{{"cpc",PX_SIP_ISUP_CPC_VALUE}};
template SemicolonParam_List m_ReasonParams
(template charstring p_cause, template charstring p_text) :=
{m_Cause(p_cause),m_Text(p_text)};
template ReasonValue m_ReasonValue
(template charstring p_cause, template charstring p_text) :=
{
token := "Q.850",
reasonParams := m_ReasonParams(p_cause,p_text)
};
template RouteBody mw_routeBody (template SipUrl p_sipurl):=
{
nameAddr :=
{
displayName := *,
addrSpec := p_sipurl
},
rrParam := *
}
template SentProtocol m_SentProtocol (charstring p_protocol) :=
{protocolName := c_sipName,
protocolVersion:= c_sipVersion,
transport:= p_protocol};
template SipUrl m_SipUrl_currDomain(in SipUserProfile p_userprofile) := //* SIP-URL of the test system on SIP side
scheme := c_sipScheme, //* contains "sip"
userInfo := //* optional
userOrTelephoneSubscriber := p_userprofile.publUsername,//* charstring
password := omit //* optional charstring
host := p_userprofile.homeDomain, //* hostname, IPv4 or IPv6 as a charstring
portField := omit //* p_userprofile.currPort //* optional integer
},
urlParameters := omit,
headers := omit
}
template SipUrl m_SipUrl_contactIpaddr(in SipUserProfile p_userprofile) := //* SIP-URL of the test system on SIP side
scheme := c_sipScheme, //* contains "sip"
userInfo := //* optional
userOrTelephoneSubscriber := p_userprofile.publUsername,//* charstring
password := omit //* optional charstring
host := p_userprofile.contactIpaddr, //* hostname, IPv4 or IPv6 as a charstring
portField := p_userprofile.contactPort //* optional integer
},
urlParameters := omit,
headers := omit
}
template SipUrl m_SipUrl_contactIpaddrAndCpc(in SipUserProfile p_userprofile) := //* SIP-URL of the test system on SIP side
scheme := c_sipScheme, //* contains "sip"
userInfo := //* optional
userOrTelephoneSubscriber := p_userprofile.publUsername & "; cpc=" & PX_SIP_ISUP_CPC_VALUE,//* charstring
password := omit //* optional charstring
host := p_userprofile.contactIpaddr, //* hostname, IPv4 or IPv6 as a charstring
portField := p_userprofile.contactPort //* optional integer
},
urlParameters := omit,
headers := omit
}
template SipUrl m_SipUrl_currIpaddr(in SipUserProfile p_userprofile) := //* SIP-URL of the test system on SIP side
scheme := c_sipScheme, //* contains "sip"
userInfo := //* optional
userOrTelephoneSubscriber := p_userprofile.publUsername,//* charstring
password := omit //* optional charstring
host := p_userprofile.currIpaddr, //* hostname, IPv4 or IPv6 as a charstring
portField := p_userprofile.currPort //* optional integer
},
urlParameters := omit,
headers := omit
}
template SipUrl m_SipUrl_Anonymous := //* SIP-URL with a calles party number
scheme := c_sipScheme, //* contains "sip"
userInfo := //* optional
userOrTelephoneSubscriber := "Anonymous",//* charstring
password := omit //* optional charstring
host := "Anonymous.invalid", //* hostname, IPv4 or IPv6 as a charstring
portField := omit //* optional integer
},
urlParameters := omit,
headers := omit
};
template SipUrl m_TelUrl_publUser(in SipUserProfile p_userprofile) := //* SIP-URL of the test system on SIP side
scheme := c_telScheme, //* contains "tel"
userInfo := //* optional
userOrTelephoneSubscriber := p_userprofile.publUsername,//* charstring
password := omit //* optional charstring
host := omit, //* hostname, IPv4 or IPv6 as a charstring
portField := omit //* p_userprofile.currPort //* optional integer
},
urlParameters := omit,
headers := omit
}
template SipUrl mw_TelSip_unavailableInvalidUri :=
{
scheme := (c_telScheme,c_sipScheme),
userInfo := {userOrTelephoneSubscriber:="unavailable", password:=omit},
hostPort := {host:="anonymous.invalid", portField:=c_defaultSipPort},
urlParameters := omit,
headers := omit
};
template SipUrl mw_TelSip_unavailableUri (charstring p_host):=
{
scheme := (c_telScheme,c_sipScheme),
userInfo := {userOrTelephoneSubscriber:="unavailable", password:=omit},
hostPort := {host:=p_host, portField:=c_defaultSipPort},
urlParameters := omit,
headers := omit
};
template SipUrl mw_SipUrl_Number(charstring p_number) := //* SIP-URL with a calling party number
scheme := c_sipScheme, //* contains "sip"
userInfo:= {userOrTelephoneSubscriber:=p_number, password:=*},
hostPort := ?,
urlParameters := *,
headers := *
};
template SipUrl mw_TelSipUrl_Number(template charstring p_number) := //* SIP-URL with a calling party number
scheme := (c_telScheme,c_sipScheme), //* contains "sip" or "tel"
userInfo:= {userOrTelephoneSubscriber:=p_number, password:=*}, //* nat or int format
hostPort := ?,
urlParameters := *,
headers := *
};
template SipUrl mw_SipUrl_Host(charstring p_host) := //* SIP-URL with a calling party number
scheme := c_sipScheme, //* contains "sip"
userInfo:= {userOrTelephoneSubscriber:=?, password:=*},
hostPort := {host:=p_host, portField:=*},
urlParameters := *,
headers := *
};
template SipUrl mw_SipUrl_NumberHost(charstring p_number, charstring p_host) := //* SIP-URL with a calling party number
scheme := c_sipScheme, //* contains "sip"
userInfo:= {userOrTelephoneSubscriber:=p_number, password:=*},
hostPort := {host:=p_host, portField:=*},
urlParameters := *,
headers := *
};
template SipUrl mw_SipUrl_NumberHostParam(charstring p_number, charstring p_host, template SemicolonParam_List p_urlParameters) := //* SIP-URL with a calling party number
{
scheme := c_sipScheme, //* contains "sip"
userInfo:= {userOrTelephoneSubscriber:=p_number, password:=*},
hostPort := {host:=p_host, portField:=*},
urlParameters := p_urlParameters,
headers := *
};
template SipUrl mw_SipUrl_Anonymous := //* SIP-URL with a calles party number
scheme := c_sipScheme, //* contains "sip"
userInfo := //* optional
userOrTelephoneSubscriber := "Anonymous",//* charstring
password := omit //* optional charstring
host := "anonymous.invalid", //* hostname, IPv4 or IPv6 as a charstring
portField := * //* optional integer
},
urlParameters := *,
headers := *
};
template SipUrl mw_SipUrl_urlParam(template SemicolonParam_List p_urlParameters) := //* SIP-URL with a calling party number
scheme := c_sipScheme, //* contains "sip"
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
userInfo:= *,
hostPort := *,
urlParameters := p_urlParameters,
headers := *
};
template ContactAddress mw_ContactAddress :=
{
addressField := ?,
contactParams := *
};
template HostPort mw_hostPort(template charstring p_host) :=
{
host := p_host,
portField := *
};
template StatusLine mw_statusLine1xx := {sipVersion := c_sipNameVersion, statusCode := (100..199), reasonPhrase := ?};
template StatusLine mw_statusLine4xx := {sipVersion := c_sipNameVersion, statusCode := (400..499), reasonPhrase := ?};
template StatusLine mw_statusLineFinal := {sipVersion := c_sipNameVersion, statusCode := (200..699), reasonPhrase := ?};
template NameAddr mw_NameAddr_DispName_User_Host(template charstring p_dn, template charstring p_user, template charstring p_host) :=
{
displayName := p_dn,
addrSpec :=
{
scheme := c_sipScheme, //* contains "sip"
userInfo := {userOrTelephoneSubscriber :=p_user, password := *},
hostPort :=
{
host := p_host, //* hostname, IPv4 or IPv6 as a charstring
portField := * //* optional integer
},
urlParameters := {m_UserPhone},
headers := *
}
}
template Addr_Union mw_AddrUnion_Nameaddr(template charstring p_dn, template charstring p_user, template charstring p_host):=
{
nameAddr:=mw_NameAddr_DispName_User_Host(p_dn,p_user,p_host)
}
template SipUrl mw_SipUrl_User_Host(template charstring p_user, template charstring p_host) :=
{
scheme := c_sipScheme, //* contains "sip"
userInfo := {userOrTelephoneSubscriber :=p_user, password := *},
hostPort :=
{
host := p_host, //* hostname, IPv4 or IPv6 as a charstring
portField := * //* optional integer
},
urlParameters := {m_UserPhone},
headers := *
}
template Addr_Union mw_AddrUnion_SipUrl(template charstring p_user, template charstring p_host):=
{
addrSpecUnion:=mw_SipUrl_User_Host(p_user,p_host)
}
} //* end group Subfields
group HeaderFieldTemplates {
template Allow m_Allow (template Method_List p_methods) := {
fieldName := ALLOW_E,
methods := p_methods
}
template Allow mw_Allow (charstring p_method) := {
fieldName := ALLOW_E,
methods := superset(p_method)
}
template GenericParam m_Cause (template charstring p_cause):=
{id:="cause", paramValue:=p_cause}
template Authorization m_Authorization (template Credentials p_Credentials):=
{
fieldName := AUTHORIZATION_E,
body := {p_Credentials}
}
template Authorization m_Authorization_digest (template CommaParam_List p_CommaParam_List):=
{
fieldName := AUTHORIZATION_E,
body := {{digestResponse := p_CommaParam_List}}
}
template Authorization m_add_Authorization_digest (in Authorization p_auth, template CommaParam_List p_CommaParam_List):=
{
fieldName := AUTHORIZATION_E,
body := {{digestResponse := f_merge_CommaParam_List(p_auth.body[0].digestResponse,valueof(p_CommaParam_List))}}
}
template Authorization m_Authorization_other :=
{
fieldName := AUTHORIZATION_E,
body := {{otherResponse := ?}}
}
template Contact m_Contact(template SipUrl p_sipUrl) :=
{
fieldName := CONTACT_E,
contactBody :=
{
contactAddresses :=
{
{
addressField := { addrSpecUnion := p_sipUrl},
contactParams := omit
}
}
} //* end contactBody
}//* end m_Contact
template Contact m_Contact_profile(in SipUserProfile p_userprofile) :=
{
fieldName := CONTACT_E,
contactBody :=
{
contactAddresses :=
{
{
addressField := { addrSpecUnion := m_SipUrl_contactIpaddr(p_userprofile)},
contactParams := omit
}
}
} //* end contactBody
}//* end m_Contact
template Contact m_Contact_profile_expires(in SipUserProfile p_userprofile, in charstring p_expires) :=
{
fieldName := CONTACT_E,
contactBody :=
{
contactAddresses :=
{
{
addressField := { addrSpecUnion := m_SipUrl_contactIpaddr(p_userprofile)},
contactParams := {{"expires",p_expires}}
}
}
} //* end contactBody
}//* end m_Contact
template From m_From(template NameAddr p_nameAddr, charstring p_tag_str) :=
{
fieldName := FROM_E,
addressField :=
{nameAddr := p_nameAddr},//* end addressField
fromParams := {{id := c_tagId, paramValue := p_tag_str}}
};
template From m_From_Anonymous(charstring p_tag_str) :=
{
fieldName := FROM_E,
addressField :=
{nameAddr := {
displayName := "Anonymous", //* optional charstring
addrSpec := m_SipUrl_Anonymous //* SipUrl
}},//* end addressField
fromParams := {{id := c_tagId, paramValue := p_tag_str}}
};
template From m_From_SipUrl(template SipUrl p_sipUrl) :=
{
fieldName := FROM_E,
addressField :=
{nameAddr := {
displayName := omit, //* optional charstring
addrSpec := p_sipUrl //* SipUrl
}},//* end addressField
fromParams := omit
};
template Event m_Event_refer :=
{
fieldName := EVENT_E,
eventType := "refer",
eventParams := omit
};
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
template Event m_Event_conference :=
{
fieldName := EVENT_E,
eventType := "conference",
eventParams := omit
};
template Event m_Event_presence :=
{
fieldName := EVENT_E,
eventType := "presence",
eventParams := omit
};
template Event m_Event_reg :=
{
fieldName := EVENT_E,
eventType := "reg",
eventParams := omit
};
template Expires m_Expires_600000 :=
{
fieldName := EXPIRES_E,
deltaSec := "600000"
};
template Expires m_Expires (charstring p_deltaSec):=
{
fieldName := EXPIRES_E,
deltaSec := p_deltaSec
};
template PAssertedID m_PAssertedID(template Addr_Union p_pAssertedIDValue) :=
{
fieldName := P_ASSERTED_ID_E,
pAssertedIDValueList := {p_pAssertedIDValue}
};
template HistoryInfo mw_HistoryInfo(template HistoryInfo_List p_HistoryInfo_List) :=
{
fieldName := HISTORY_INFO_E,
historyInfoList := p_HistoryInfo_List
};
template HistoryInfoEntry mw_HistoryInfoEntry(template SipUrl p_Url, template IntegerList p_index, template SemicolonParam_List p_paramlist) :=
{
nameAddr := {displayName:=*, addrSpec:= p_Url},
hiIndex := p_index,
hiExtention := p_paramlist
}
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
template PAssertedID m_PAssertedID_2x(template Addr_Union p_pAssertedIDValue1, template Addr_Union p_pAssertedIDValue2) :=
{
fieldName := P_ASSERTED_ID_E,
pAssertedIDValueList := {p_pAssertedIDValue1, p_pAssertedIDValue2}
};
template PAssertedID mw_PAssertedID(template PAssertedIDValue p_pAssertedIDValue) :=
{
fieldName := P_ASSERTED_ID_E,
pAssertedIDValueList := {p_pAssertedIDValue}
};
template PAssertedIDValue mw_PAssertedIDValue(template SipUrl p_SipUrl) :=
{
addrSpecUnion := p_SipUrl
};
template PPreferredID m_PPreferredID(template Addr_Union p_pPreferredIDValue) :=
{
fieldName := P_PREFERRED_ID_E,
pPreferredIDValueList := {p_pPreferredIDValue}
};
template Privacy m_Privacy(PrivacyValue p_privacy) :=
{
fieldName := PRIVACY_E,
privValueList := {p_privacy}
};
template Privacy mw_Privacy_without(PrivacyValue p_privacy) :=
privValueList := ?//superset(complement(p_privacy))
template RAck m_RAck(integer p_responseNum, integer p_seqNumber, charstring p_method) :=
{
fieldName := RACK_E,
responseNum := p_responseNum,
seqNumber := p_seqNumber,
method := p_method
};
template Reason m_Reason(integer p_cause) :=
{
fieldName := REASON_E,
reasonValues := {m_ReasonValue(int2str(p_cause),"dummy")}
};
template Reason m_Reason21 :=
{
fieldName := REASON_E,
reasonValues := {m_ReasonValue(int2str(21),"call reject")}
};
template RecordRoute m_recordRoute_currIpAddr (in SipUserProfile p_userprofile):=
{
fieldName := RECORD_ROUTE_E,
routeBody := {{nameAddr := {displayName := omit,
addrSpec := {scheme := c_sipScheme, //* contains "sip"
userInfo := omit,
hostPort := {host:=p_userprofile.currIpaddr, portField:= p_userprofile.currPort},
urlParameters := omit,
headers := omit}
},
rrParam := omit}
}};
template ReferredBy m_ReferredBy_SipUrl(template SipUrl p_sipUrl) :=
{
fieldName := REFERRED_BY_E,
nameAddr :={displayName := omit, addrSpec:=p_sipUrl},
referredbyIdParams := omit
}
template ReferTo m_ReferTo_SipUrl(template SipUrl p_sipUrl, charstring p_method) :=
{
fieldName := REFER_TO_E,
nameAddr :={displayName := omit, addrSpec:=p_sipUrl},
referToParams := {{id:="method",paramValue :=p_method}}
}
template Require m_Require_100rel :=
{
fieldName := REQUIRE_E,
optionsTags := {c_tag100rel}
};
template Require m_Require_prec :=
{
fieldName := REQUIRE_E,
optionsTags := {c_tagPrecond}
};
template Supported m_Supported_fromChange :=
{
fieldName:=SUPPORTED_E,
optionsTags:={c_tagFromChange}
}
template Supported m_Supported_prec :=
{
fieldName:=SUPPORTED_E,
optionsTags:={c_tagPrecond}
}
template Supported m_Supported_100rel :=
{
fieldName:=SUPPORTED_E,
optionsTags:={c_tag100rel}
}
template Supported m_Supported_100rel_prec :=
{
fieldName:=SUPPORTED_E,
optionsTags:={c_tag100rel, c_tagPrecond}
}
template GenericParam m_Text (template charstring p_text):=
{id:="text", paramValue:=p_text}
template GenericParam m_UserPhone :=
{
id := "user",
paramValue := "phone"
}
template To m_To(template SipUrl p_sipUrl) :=
{
fieldName := TO_E,
addressField :=
{nameAddr := {
displayName := "ETSI Tester", //* optional charstring
addrSpec := p_sipUrl //* SipUrl
}},//* end addressField
toParams := omit
};
template To m_To_SipUrl(SipUrl p_sipUrl) :=
{
fieldName := TO_E,
addressField :=
{nameAddr := {
displayName := omit, //* optional charstring
addrSpec := p_sipUrl //* SipUrl
}},//* end addressField
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
toParams := omit
};
template To mw_To_NameAddr_SipUrl(template charstring p_dn, template charstring p_user, template charstring p_host) :=
{
fieldName := TO_E,
addressField := (mw_AddrUnion_Nameaddr(p_dn,p_user,p_host),mw_AddrUnion_SipUrl(p_user,p_host)),
toParams := omit
}
template From mw_From(template SipUrl p_sipUrl) := {
fieldName := FROM_E,
addressField := { addrSpecUnion := p_sipUrl},
fromParams:= *
}
template ViaBody m_ViaBody_currIpaddr(charstring branch_val,in SipUserProfile p_userprofile) :=
{
sentProtocol := m_SentProtocol(PX_SIP_TRANSPORT),
sentBy:={host:=p_userprofile.currIpaddr, portField:= p_userprofile.currPort},
viaParams:={{id :=c_branchId,paramValue :=branch_val}}
}
template ViaBody mw_ViaBody_interface(HostPort p_hostport) :=
{
sentProtocol := m_SentProtocol(PX_SIP_TRANSPORT),
sentBy:={host:=p_hostport.host, portField:= p_hostport.portField},
viaParams:=*
}
template Via mw_Via(template ViaBody p_viabody) :=
{
fieldName := VIA_E,
viaBody:= ? //* superset(p_viabody)
}
template CallId mw_CallId_any :=
{
fieldName := CALL_ID_E,
callid := ?
}
template Privacy mw_Privacy_id :=
{
fieldName := PRIVACY_E,
privValueList := {*,"id",*}
};
template Privacy mw_Privacy_notId :=
{
fieldName := PRIVACY_E,
};
template Privacy mw_Privacy_user :=
{
fieldName := PRIVACY_E,
privValueList := {*,"user",*}
};
template Reason mw_Reason(integer p_cause) :=
{
fieldName := REASON_E,
reasonValues := {m_ReasonValue(int2str(p_cause),?)}
};
template Require mw_Require_not_100rel :=
{
fieldName := REQUIRE_E,
template Require mw_require_100rel :=
{
fieldName := REQUIRE_E,
optionsTags := superset(c_tag100rel)
};
template RecordRoute mw_recordroute (template RouteBody p_routeBody):=
{
fieldName := RECORD_ROUTE_E,
routeBody := ? //* superset(p_routeBody)
};
template Route mw_route (template RouteBody_List p_routeBody):=
{
fieldName := ROUTE_E,
routeBody := p_routeBody
};
template Supported mw_Supported_100rel_prec :=
{
fieldName:=SUPPORTED_E,
optionsTags:= superset(c_tag100rel, c_tagPrecond)
}
template Supported mw_Supported_100rel :=
{
fieldName:=SUPPORTED_E,
optionsTags:= superset(c_tag100rel)
}
template Supported mw_Supported_fromChange :=
{
fieldName:=SUPPORTED_E,
optionsTags:= superset(c_tagFromChange)
}
template Contact mw_Contact_conference :=
{
fieldName := CONTACT_E,
contactBody :=
{
contactAddresses :=
{
{
addressField := ?,//MRO
contactParams := {{"isfocus",*}}
}
}
}
}
} //* end of group HeaderFieldTemplates
group MessageTemplates {
group dummy_templates {
group dummy_parameter_send {
template RequestLine m_requestLine_dummy :=
{
method := ACK_E,
requestUri := c_empty_RequestUri,
sipVersion := c_sipNameVersion
}
template MessageHeader m_msgHeader_dummy :=
{
accept := omit,
acceptContact := omit,
acceptEncoding := omit,
acceptLanguage := omit,
alertInfo := omit,
allow := omit,
allowEvents := omit, //* RFC3265
authenticationInfo := omit,
authorization := omit,
callId := c_empty_CallId,
callInfo := omit,
contact := omit,
contentDisposition := omit,
contentEncoding := omit,
contentLanguage := omit,
contentLength := {fieldName := CONTENT_LENGTH_E, len:= 0},
contentType := omit, //* if message body present m, else not present
cSeq := c_empty_cSeq,
date := omit,
errorInfo := omit,
event := omit, //* RFC3265
expires := omit,
fromField := c_empty_From,
historyInfo := omit, //* RFC4244
inReplyTo := omit,
maxForwards := c_maxForwards70,
mimeVersion := omit,
minExpires := omit,
minSE := omit, //* RFC4028
pAccessNetworkInfo := omit, //* RFC3455
pAssertedID := omit,
pAssertedService := omit,
pAssociatedURI := omit,
path := omit, //* RFC3327
pCalledPartyID := omit, //* RFC3455
pChargingFunctionAddresses := omit, //* RFC3455
pChargingVector := omit, //* RFC3455
pEarlyMedia := omit, //* RFC5009
pMediaAuthorization := omit, //* RFC3313
pPreferredID := omit,
priority := omit,
privacy := omit,
proxyAuthenticate := omit,
proxyAuthorization := omit,
proxyRequire := omit,
pVisitedNetworkID := omit, //* RFC3455
rAck := omit,
rSeq := omit,
reason := omit,
recordRoute := omit,
referredBy := omit, //* RFC3892 - REFER method
referTo := omit, //* RFC3515 - REFER method
replyTo := omit,
require := omit,
retryAfter := omit,
route := omit,
securityClient := omit, //* RFC3329
securityServer := omit, //* RFC3329
securityVerify := omit, //* RFC3329
serviceRoute := omit, //* RFC3608
sessionExpires := omit, //* RFC4028
subscriptionState := omit, //* RFC3265
supported := omit,
timestamp := omit,
toField := c_empty_To,
unsupported := omit,
userAgent := omit,
via := c_empty_Via,
warning := omit,
wwwAuthenticate := omit,
undefinedHeader_List := omit
}
} //* group dummy_parameter_send
group dummy_parameter_receive {
template RequestLine mw_requestLine_dummy :=
{
method := ACK_E,
requestUri := ?,
sipVersion := c_sipNameVersion
}
template MessageHeader mw_msgHeader_dummy :=
{
accept := *,
acceptContact := *,
acceptEncoding := *,
acceptLanguage := *,
alertInfo := *,
allow := *,
allowEvents := *, //* RFC3265
authenticationInfo := *,
authorization := *,
callId := ?,
callInfo := *,
contact := *,
contentDisposition := *,
contentEncoding := *,
contentLanguage := *,
contentLength := ?,
contentType := *,
cSeq := ?,
date := *,
errorInfo := *,
event := *, //* RFC3265
expires := *,
fromField := ?,
historyInfo := *, //* RFC4244
inReplyTo := *,
maxForwards := ?,
mimeVersion := *,
minExpires := *,
minSE := *, //* RFC4028
pAccessNetworkInfo := *, //* RFC3455
pAssertedID := *,
pAssertedService := *,
pAssociatedURI := *,
path := *, //* RFC3327
pCalledPartyID := *, //* RFC3455
pChargingFunctionAddresses := *, //* RFC3455
pChargingVector := *, //* RFC3455
pEarlyMedia := *, //* RFC5009
pMediaAuthorization := *, //* RFC3313
pPreferredID := *,
priority := *,
privacy := *,
proxyAuthenticate := *,
proxyAuthorization := *,
proxyRequire := *,
pVisitedNetworkID := *, //* RFC3455
rAck := *,
rSeq := *,
reason := *,
recordRoute := *,
referredBy := *, //* RFC3892 - REFER method
referTo := *, //* RFC3515 - REFER method
replyTo := *,
require := *,
retryAfter := *,
route := *,
securityClient := *, //* RFC3329
securityServer := *, //* RFC3329
securityVerify := *, //* RFC3329
serviceRoute := *, //* RFC3608
sessionExpires := *, //* RFC4028
subscriptionState := *, //* RFC3265
supported := *,
timestamp := *,
toField := ?,
unsupported := *,
userAgent := *,
via := ?,
warning := *,
wwwAuthenticate := *,
undefinedHeader_List := *
}
}//* end group dummy_parameter_receive
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
group dummy_request_templates_send {
template ACK_Request m_ACK_Dummy :=
{
requestLine := m_requestLine_dummy,
msgHeader := m_msgHeader_dummy,
messageBody := omit,
payload := omit
}
template BYE_Request m_BYE_Dummy :=
{
requestLine := m_requestLine_dummy,
msgHeader := m_msgHeader_dummy,
messageBody := omit,
payload := omit
}
template CANCEL_Request m_CANCEL_Dummy :=
{
requestLine := m_requestLine_dummy,
msgHeader := m_msgHeader_dummy,
messageBody := omit,
payload := omit
}
template INFO_Request m_INFO_Dummy :=
{
requestLine := m_requestLine_dummy,
msgHeader := m_msgHeader_dummy,
messageBody := omit,
payload := omit
}
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
template INVITE_Request m_INVITE_Dummy :=
{
requestLine := m_requestLine_dummy,
msgHeader := m_msgHeader_dummy,
messageBody := omit,
payload := omit
}
template MESSAGE_Request m_MESSAGE_Dummy :=
{
requestLine := m_requestLine_dummy,
msgHeader := m_msgHeader_dummy,
messageBody := omit,
payload := omit
}
template NOTIFY_Request m_NOTIFY_Dummy :=
{
requestLine := m_requestLine_dummy,
msgHeader := m_msgHeader_dummy,
messageBody := omit,
payload := omit
}
template PRACK_Request m_PRACK_Dummy :=
{
requestLine := m_requestLine_dummy,
msgHeader := m_msgHeader_dummy,
messageBody := omit,
payload := omit
}
template PUBLISH_Request m_PUBLISH_Dummy :=
{
requestLine := m_requestLine_dummy,
msgHeader := m_msgHeader_dummy,
messageBody := omit,
payload := omit
}
template REGISTER_Request m_REGISTER_Dummy :=
{
requestLine := m_requestLine_dummy,
msgHeader := m_msgHeader_dummy,
messageBody := omit,
payload := omit
}
template REFER_Request m_REFER_Dummy :=
{
requestLine := m_requestLine_dummy,
msgHeader := m_msgHeader_dummy,
messageBody := omit,
payload := omit
}
template SUBSCRIBE_Request m_SUBSCRIBE_Dummy :=
{
requestLine := m_requestLine_dummy,
msgHeader := m_msgHeader_dummy,
messageBody := omit,
payload := omit
}
template UPDATE_Request m_UPDATE_Dummy :=
{
requestLine := m_requestLine_dummy,
msgHeader := m_msgHeader_dummy,
messageBody := omit,
payload := omit
}
}//* end group dummy_request_templates_send
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
group dummy_request_templates_receive{
template ACK_Request mw_ACK_Dummy :=
{
requestLine := mw_requestLine_dummy,
msgHeader := mw_msgHeader_dummy,
messageBody := *,
payload := *
}
template BYE_Request mw_BYE_Dummy :=
{
requestLine := mw_requestLine_dummy,
msgHeader := mw_msgHeader_dummy,
messageBody := *,
payload := *
}
template CANCEL_Request mw_CANCEL_Dummy :=
{
requestLine := mw_requestLine_dummy,
msgHeader := mw_msgHeader_dummy,
messageBody := *,
payload := *
}
template INFO_Request mw_INFO_Dummy :=
{
requestLine := mw_requestLine_dummy,
msgHeader := mw_msgHeader_dummy,
messageBody := *,
payload := *
}
template INVITE_Request mw_INVITE_Dummy :=
{
requestLine := mw_requestLine_dummy,
msgHeader := mw_msgHeader_dummy,
messageBody := *,
payload := *
}
template MESSAGE_Request mw_MESSAGE_Dummy :=
{
requestLine := mw_requestLine_dummy,
msgHeader := mw_msgHeader_dummy,
messageBody := *,
payload := *
}
template NOTIFY_Request mw_NOTIFY_Dummy :=
{
requestLine := mw_requestLine_dummy,
msgHeader := mw_msgHeader_dummy,
messageBody := *,
payload := *
}
template PRACK_Request mw_PRACK_Dummy :=
{
requestLine := mw_requestLine_dummy,
msgHeader := mw_msgHeader_dummy,
messageBody := *,
payload := *
}
template PUBLISH_Request mw_PUBLISH_Dummy :=
{
requestLine := mw_requestLine_dummy,
msgHeader := mw_msgHeader_dummy,
messageBody := *,
payload := *
}
template REFER_Request mw_REFER_Dummy :=
{
requestLine := mw_requestLine_dummy,
msgHeader := mw_msgHeader_dummy,
messageBody := *,
payload := *
}
template REGISTER_Request mw_REGISTER_Dummy :=
{
requestLine := mw_requestLine_dummy,
msgHeader := mw_msgHeader_dummy,
messageBody := *,
payload := *
}
template SUBSCRIBE_Request mw_SUBSCRIBE_Dummy :=
{
requestLine := mw_requestLine_dummy,
msgHeader := mw_msgHeader_dummy,
messageBody := *,
payload := *
}
template UPDATE_Request mw_UPDATE_Dummy :=
{
requestLine := mw_requestLine_dummy,
msgHeader := mw_msgHeader_dummy,
messageBody := *,
payload := *
}
}//* end group dummy_request_templates_receive
group dummy_response_templates_send{
template Response m_Response_Dummy :=
{
statusLine := c_statusLine100,
msgHeader := m_msgHeader_dummy,
messageBody := omit,
payload := omit
}
} //* group dummy_response_templates_send
group dummy_response_templates_receive{
template Response mw_Response_Dummy :=
{
statusLine := ?,
msgHeader := mw_msgHeader_dummy,
messageBody := *,
payload := *
}
} //* group dummy_response_templates_receive
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
}
group base_templates{
group request_send {
template ACK_Request m_ACK_Request_Base (SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq,
From p_from, To p_to, Via p_via) modifies m_ACK_Dummy :=
{
requestLine :=
{
method := ACK_E,
requestUri := p_requestUri
},
msgHeader :=
{
callId := p_callId,
cSeq := {fieldName:=CSEQ_E, seqNumber:= p_cSeq.seqNumber, method:= "ACK"},
fromField := p_from,
toField := p_to,
via := p_via
}
}
template BYE_Request m_BYE_Request_Base (SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq, From p_from, To p_to,
Via p_via) modifies m_BYE_Dummy :=
{
requestLine :=
{
method := BYE_E,
requestUri :=
{
hostPort:= p_requestUri.hostPort
}
},
msgHeader :=
{
callId := p_callId,
cSeq := p_cSeq,
fromField := p_from,
toField := p_to,
via := p_via
}
}
template CANCEL_Request m_CANCEL_Request_Base (SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq, From p_from, To p_to,
Via p_via) modifies m_CANCEL_Dummy :=
{
requestLine :=
{
method := CANCEL_E,
requestUri :=
{
hostPort:= p_requestUri.hostPort
}
},
msgHeader :=
{
callId := p_callId,
cSeq := p_cSeq,
fromField := p_from,
toField := p_to,
via := p_via
}
}
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
template INFO_Request m_INFO_Request_Base (SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq, From p_from, To p_to,
Via p_via) modifies m_INFO_Dummy :=
{
requestLine :=
{
method := INFO_E,
requestUri :=
{
hostPort:= p_requestUri.hostPort
}
},
msgHeader :=
{
callId := p_callId,
cSeq := p_cSeq,
fromField := p_from,
toField := p_to,
via := p_via
}
}
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
template INVITE_Request m_INVITE_Request_Base (SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq,
From p_from, To p_to, Via p_via, Contact p_contact) modifies m_INVITE_Dummy :=
{
requestLine :=
{
method := INVITE_E,
requestUri := p_requestUri
},
msgHeader :=
{
callId := p_callId,
contact := p_contact,
cSeq := p_cSeq,
fromField := p_from,
toField := p_to,
via := p_via
}
}
template MESSAGE_Request m_MESSAGE_Request_Base (SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq, From p_from, To p_to, Via p_via) modifies m_MESSAGE_Dummy :=
{
requestLine :=
{
method := MESSAGE_E,
requestUri := p_requestUri
},
msgHeader :=
{
callId := p_callId,
cSeq := p_cSeq,
fromField := p_from,
toField := p_to,
via := p_via
}
}
template NOTIFY_Request m_NOTIFY_Request_Base (SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq,
From p_from, To p_to, Via p_via) modifies m_NOTIFY_Dummy :=
{
requestLine :=
{
method := NOTIFY_E,
requestUri :=
{
hostPort:= p_requestUri.hostPort
}
},
msgHeader :=
{
callId := p_callId,
//* contentLength := {fieldName := CONTENT_LENGTH_E, len:= f_MessageBodyLength(valueof(p_mb))},
//* contentType := {fieldName := CONTENT_TYPE_E, mediaType := c_sdpAplication},
cSeq := {fieldName:=CSEQ_E, seqNumber:= p_cSeq.seqNumber, method:= "NOTIFY"},
fromField := p_from,
toField := p_to,
via := p_via
}//* ,
//* messageBody := p_mb
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
}
template PRACK_Request m_PRACK_Request_Base (SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq,
From p_from, To p_to, Via p_via, RAck p_RAck)
modifies m_PRACK_Dummy :=
{
requestLine :=
{
method := PRACK_E,
requestUri :=
{
hostPort:= p_requestUri.hostPort
}
},
msgHeader :=
{
callId := p_callId,
cSeq := {fieldName:=CSEQ_E, seqNumber:= p_cSeq.seqNumber, method:= "PRACK"},
fromField := p_from,
rAck := p_RAck,
toField := p_to,
via := p_via
},
messageBody := omit
}
//* in reality PUBLISH request contain xml in content
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
template PUBLISH_Request m_PUBLISH_Request_Base (SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq,
From p_from, To p_to, Via p_via, template Event p_event, template RAck p_RAck, template MessageBody p_mb)
modifies m_PUBLISH_Dummy :=
{
requestLine :=
{
method := PUBLISH_E,
requestUri :=
{
hostPort:= p_requestUri.hostPort
}
},
msgHeader :=
{
callId := p_callId,
contentLength := {fieldName := CONTENT_LENGTH_E, len:= f_MessageBodyLength(valueof(p_mb))},
contentType := {fieldName := CONTENT_TYPE_E, mediaType := c_sdpAplication},
cSeq := {fieldName:=CSEQ_E, seqNumber:= p_cSeq.seqNumber, method:= "PUBLISH"},
event := p_event,
fromField := p_from,
toField := p_to,
via := p_via
},
messageBody := p_mb
}
template REFER_Request m_REFER_Request_Base (SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq, Contact p_contact,
From p_from, template To p_to, Via p_via, template ReferTo p_referTo, template ReferredBy p_referredBy)
modifies m_REFER_Dummy :=
{
requestLine :=
{
method := REFER_E,
requestUri := p_requestUri
},
msgHeader :=
{
callId := p_callId,
contact := p_contact,
cSeq := {fieldName:=CSEQ_E, seqNumber:= p_cSeq.seqNumber, method:= "REFER"},
fromField := p_from,
referTo := p_referTo,
referredBy := p_referredBy,
toField := p_to,
via := p_via
}
}
template REGISTER_Request m_REGISTER_Request_Base (SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq,
From p_from, To p_to, Via p_via, Contact p_contact, template Authorization p_authorization) modifies m_REGISTER_Dummy :=
{
requestLine :=
{
method := REGISTER_E,
requestUri := p_requestUri
},
msgHeader :=
{
authorization := p_authorization,
callId := p_callId,
contact := p_contact,
cSeq := p_cSeq,
fromField := p_from,
toField := p_to,
via := p_via
}
}
template SUBSCRIBE_Request m_SUBSCRIBE_Request_Base (SipUrl p_requestUri, CallId p_callId,
CSeq p_cSeq, From p_from, To p_to, Via p_via) modifies m_SUBSCRIBE_Dummy :=
{
requestLine :=
{
method := SUBSCRIBE_E,
requestUri :=
{
hostPort:= p_requestUri.hostPort
}
},
msgHeader :=
{
callId := p_callId,
cSeq := {fieldName:=CSEQ_E, seqNumber:= p_cSeq.seqNumber, method:= "SUBSCRIBE"},
fromField := p_from,
toField := p_to,
via := p_via
}
}
template UPDATE_Request m_UPDATE_Request_Base (SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq,
From p_from, To p_to, Via p_via, Contact p_contact, template MessageBody p_mb) modifies m_UPDATE_Dummy :=
{
requestLine :=
{
method := UPDATE_E,
requestUri :=
{
hostPort:= p_requestUri.hostPort
}
},
msgHeader :=
{
callId := p_callId,
contact := p_contact,
contentLength := {fieldName := CONTENT_LENGTH_E, len:= f_MessageBodyLength(valueof(p_mb))},
contentType := {fieldName := CONTENT_TYPE_E, mediaType := c_sdpAplication},
cSeq := {fieldName:=CSEQ_E, seqNumber:= p_cSeq.seqNumber, method:= "UPDATE"},
fromField := p_from,
toField := p_to,
via := p_via
},
messageBody := p_mb
}
} //* end of group message_send
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
group request_receive {
template ACK_Request mw_ACK_Request_Base (template CallId p_callId) modifies mw_ACK_Dummy :=
{
requestLine :=
{
method := ACK_E
},
msgHeader :=
{
callId := p_callId
}
}
template BYE_Request mw_BYE_Request_Base(template CallId p_callId) modifies mw_BYE_Dummy :=
{
requestLine :=
{
method := BYE_E
},
msgHeader :=
{
callId := p_callId
}
}
template CANCEL_Request mw_CANCEL_Request_Base (template CallId p_callId) modifies mw_CANCEL_Dummy :=
{
requestLine :=
{
method := CANCEL_E
},
msgHeader :=
{
callId := p_callId
}
}
template INFO_Request mw_INFO_Request_Base(template CallId p_callId) modifies mw_INFO_Dummy :=
{
requestLine :=
{
method := INFO_E
},
msgHeader :=
{
callId := p_callId
}
}
template INVITE_Request mw_INVITE_Request_Base modifies mw_INVITE_Dummy :=
{
requestLine :=
{
method := INVITE_E
}
}
template MESSAGE_Request mw_MESSAGE_Request_Base(template CallId p_callId) modifies mw_MESSAGE_Dummy :=
{
requestLine :=
{
method := MESSAGE_E
},
msgHeader :=
{
callId := p_callId,
contact := omit
}
}
template NOTIFY_Request mw_NOTIFY_Request_Base (CallId p_callId) modifies mw_NOTIFY_Dummy :=
{
requestLine :=
{
method := NOTIFY_E
},
msgHeader :=
{
callId := p_callId
}
}
template PRACK_Request mw_PRACK_Request_Base(template CallId p_callId) modifies mw_PRACK_Dummy :=
{
requestLine :=
{
method := PRACK_E
},
msgHeader :=
{
callId := p_callId
}
}
template PUBLISH_Request mw_PUBLISH_Request_Base(template CallId p_callId) modifies mw_PUBLISH_Dummy :=
{
requestLine :=
{
method := PUBLISH_E
},
msgHeader :=
{
callId := p_callId
}
}
template REFER_Request mw_REFER_Request_Base (CallId p_callId) modifies mw_REFER_Dummy :=
{
requestLine :=
{
method := REFER_E
},
msgHeader :=
{
callId := p_callId
}
}
template REGISTER_Request mw_REGISTER_Request_Base modifies mw_REGISTER_Dummy :=
{
requestLine :=
{
method := REGISTER_E
}
}
template SUBSCRIBE_Request mw_SUBSCRIBE_Request_Base modifies mw_SUBSCRIBE_Dummy :=
{
requestLine :=
{
method := SUBSCRIBE_E
}
}
template UPDATE_Request mw_UPDATE_Request_Base(template CallId p_callId) modifies mw_UPDATE_Dummy :=
{
requestLine :=
{
method := UPDATE_E
},
msgHeader :=
{
callId := p_callId
}
}
} //* end group request_receive
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
group response_send {
template Response m_Response_Base (StatusLine p_statusLine, CallId p_callId, CSeq p_cSeq,
From p_from, To p_to, Via p_via) modifies m_Response_Dummy:=
{
statusLine := p_statusLine,
msgHeader :=
{
callId := p_callId,
cSeq := p_cSeq,
fromField := p_from,
maxForwards := omit,
toField := p_to,
via := p_via
},
messageBody := omit,
payload := omit
}
} //* end group response_send
group response_receive {
template Response mw_Response_Base (template StatusLine p_statusLine, template CallId p_callId,
template CSeq p_cSeq) modifies mw_Response_Dummy:=
{
statusLine := {sipVersion := c_sipNameVersion, statusCode := p_statusLine.statusCode, reasonPhrase := ?},
msgHeader :=
{
callId := p_callId,
contentLength := *,
cSeq := p_cSeq,
fromField := ?,
maxForwards := *,
toField := ?,
via := ?
}
}
} //* end group message_receive
} //* end group full_templates
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
group modified_templates {
group request_send {
template ACK_Request m_ACK_Request_route (SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq,
From p_from, To p_to, Via p_via, Route p_route)
modifies m_ACK_Request_Base
:=
{
msgHeader :=
{
route := p_route
}
}
template ACK_Request m_ACK_Request_sdp (SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq,
From p_from, To p_to, Via p_via,template MessageBody p_mb )
modifies m_ACK_Request_Base
:=
{
msgHeader :=
{
contentLength := {fieldName := CONTENT_LENGTH_E, len:= f_MessageBodyLength(valueof(p_mb))},
contentType := {fieldName := CONTENT_TYPE_E, mediaType := c_sdpAplication}
},
messageBody := p_mb
}
template BYE_Request m_BYE_Request_cause
(SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq, From p_from, To p_to, Via p_via, integer p_cause)
modifies m_BYE_Request_Base
:=
{
msgHeader :=
{
reason := m_Reason(p_cause) //* PIXIT value
}
}
template INVITE_Request m_INVITE_Request_sdp
(SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq, From p_from, To p_to,
Via p_via, Contact p_contact, template MessageBody p_mb)
modifies m_INVITE_Request_Base
:=
{
msgHeader :=
{
contentLength := {fieldName := CONTENT_LENGTH_E, len:= f_MessageBodyLength(valueof(p_mb))},
contentType := {fieldName := CONTENT_TYPE_E, mediaType := c_sdpAplication}
},
messageBody := p_mb
}
template INVITE_Request m_INVITE_Request_ResourceList
(SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq, From p_from, To p_to,
Via p_via, Contact p_contact, template MessageBody p_mb)
modifies m_INVITE_Request_Base
:=
{
msgHeader :=
{
contentLength := {fieldName := CONTENT_LENGTH_E, len:= f_MessageBodyLength(valueof(p_mb))},
contentType := {fieldName := CONTENT_TYPE_E, mediaType := "application/resource-lists+xml"},
contentDisposition := {
fieldName := CONTENT_DISPOSITION_E,
dispositionType := "recipient-list",
dispositionParams := omit
},
require := {
fieldName := REQUIRE_E,
}
template REGISTER_Request m_REGISTER_Request_expires
(SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq,
From p_from, To p_to, Via p_via, Contact p_contact,
template Authorization p_authorization, charstring p_expires)
modifies m_REGISTER_Request_Base
:=
{
msgHeader :=
{
authorization := p_authorization,
expires := {
fieldName := EXPIRES_E,
deltaSec := p_expires }
}
}
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
template NOTIFY_Request m_NOTIFY_Request_sipfrag (
SipUrl p_requestUri,
CallId p_callId,
CSeq p_cSeq,
From p_from,
To p_to,
Via p_via,
charstring p_state,
charstring p_sipfrag
) modifies m_NOTIFY_Request_Base := {
requestLine :=
{
method := NOTIFY_E,
requestUri :=
{
hostPort:= p_requestUri.hostPort
}
},
msgHeader :=
{
contentLength := {fieldName := CONTENT_LENGTH_E, len:= lengthof(p_sipfrag)},
contentType := {fieldName := CONTENT_TYPE_E, mediaType := "message/sipfrag"},
subscriptionState := {
fieldName := SUBSCRIPTION_STATE_E,
subState := p_state,
substateParams := omit
},
event := m_Event_refer
},
messageBody := {
sipfrag := p_sipfrag
}
}
} //* end group request_send
group request_receive {
template BYE_Request mw_BYE_Request_Reason(template CallId p_callId, integer p_cause) modifies mw_BYE_Request_Base :=
{
msgHeader :=
{
reason := mw_Reason(p_cause)
}
}
template INFO_Request mw_INFO_Request_MB (template CallId p_callId, template MessageBody p_mb) modifies mw_INFO_Request_Base :=
{
messageBody := p_mb
}
template INVITE_Request mw_INVITE_Request_expires modifies mw_INVITE_Request_Base
:=
{
msgHeader := {expires := ?}
}
template INVITE_Request mw_INVITE_Request_callid(CallId p_callid) modifies mw_INVITE_Request_Base
:=
{
msgHeader := {callId := p_callid}
}
template INVITE_Request mw_INVITE_Request_MB (CallId p_callId, template MessageBody p_mb) modifies mw_INVITE_Request_Base :=
{
msgHeader := {callId := p_callId},
messageBody := p_mb
}
template INVITE_Request mw_INVITE_Request_noPaccessNetworkInfo (template CallId p_callId)
modifies mw_INVITE_Request_Base
:=
{
msgHeader := { pAccessNetworkInfo := omit}
}
template INVITE_Request mw_INVITE_Request_PaccessNetworkInfo (template CallId p_callId)
modifies mw_INVITE_Request_Base
:=
{
msgHeader := { pAccessNetworkInfo := ?}
}
template REGISTER_Request mw_REGISTER_Request_ISC (template PAccessNetworkInfo p_access , template PVisitedNetworkID p_visited )modifies mw_REGISTER_Request_Base :=
{
msgHeader := {
pAccessNetworkInfo := p_access,
pVisitedNetworkID := p_visited
}
template UPDATE_Request mw_UPDATE_Request_SDP(template CallId p_callId, template MessageBody p_mb) modifies mw_UPDATE_Dummy :=
{
messageBody := p_mb
}
template NOTIFY_Request mw_NOTIFY_Request_MB (CallId p_callId, template MessageBody p_mb) modifies mw_NOTIFY_Request_Base :=
{
messageBody := p_mb
}
} //* end group request_receive
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
group response_send {
template Response m_Response_ext (StatusLine p_statusLine, CallId p_callId, CSeq p_cSeq,
From p_from, To p_to, Via p_via) modifies m_Response_Base:=
{
msgHeader :={
route := f_route(),
recordRoute := f_recordroute()
}
}
template Response m_Response_mbody (StatusLine p_statusLine, CallId p_callId, CSeq p_cSeq,
From p_from, To p_to, Via p_via, MessageBody p_mb) modifies m_Response_ext:=
{
msgHeader :=
{
contentLength := {fieldName := CONTENT_LENGTH_E, len:= f_MessageBodyLength(valueof(p_mb))},
contentType := {fieldName := CONTENT_TYPE_E, mediaType := c_sdpAplication}
},
messageBody := p_mb
}
template Response m_Response_PAsserted_Privacy (StatusLine p_statusLine, CallId p_callId, CSeq p_cSeq,
From p_from, To p_to, Via p_via, template PAssertedID p_pAssertedID, template Privacy p_privacy) modifies m_Response_ext:=
{
msgHeader :=
{
pAssertedID := p_pAssertedID,
privacy := p_privacy
}
}
template Response m_Response_PAsserted_Privacy_mbody (StatusLine p_statusLine, CallId p_callId, CSeq p_cSeq,
From p_from, To p_to, Via p_via, template PAssertedID p_pAssertedID, template Privacy p_privacy, MessageBody p_mb) modifies m_Response_ext:=
{
msgHeader :=
{
contentLength := {fieldName := CONTENT_LENGTH_E, len:= f_MessageBodyLength(valueof(p_mb))},
contentType := {fieldName := CONTENT_TYPE_E, mediaType := c_sdpAplication},
pAssertedID := p_pAssertedID,
privacy := p_privacy
},
messageBody := p_mb
}
} //* end group response_send
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
group response_receive {
template Response mw_Response_Expires (template StatusLine p_statusLine, template CallId p_callId,
template CSeq p_cSeq, template DeltaSec p_deltaSec) modifies mw_Response_Base:=
{
statusLine := {sipVersion := c_sipNameVersion, statusCode := p_statusLine.statusCode, reasonPhrase := ?},
msgHeader :=
{
expires := {fieldName := EXPIRES_E, deltaSec := p_deltaSec}
}
}
template Response mw_Response_PAsserted_Privacy (template StatusLine p_statusLine, template CallId p_callId,
template CSeq p_cSeq, template PAssertedID p_pAssertedID, template Privacy p_privacy) modifies mw_Response_Base:=
{
statusLine := {sipVersion := c_sipNameVersion, statusCode := p_statusLine.statusCode, reasonPhrase := ?},
msgHeader :=
{
pAssertedID := p_pAssertedID,
privacy := p_privacy
}
}
template Response mw_Response_Reason (template StatusLine p_statusLine, template CallId p_callId,
template CSeq p_cSeq, integer p_cause) modifies mw_Response_Base:=
{
statusLine := {sipVersion := c_sipNameVersion, statusCode := p_statusLine.statusCode, reasonPhrase := ?},
msgHeader :=
{
reason := mw_Reason(p_cause)
}
}
template Response mw_Response_RecordRoute (template StatusLine p_statusLine, template CallId p_callId,
template CSeq p_cSeq, template RecordRoute p_recordRoute) modifies mw_Response_Base:=
{
statusLine := {sipVersion := c_sipNameVersion, statusCode := p_statusLine.statusCode, reasonPhrase := ?},
msgHeader :=
{
recordRoute := p_recordRoute
}
}
template Response mw_Response_Via (template StatusLine p_statusLine, template CallId p_callId,
template CSeq p_cSeq, template Via p_via) modifies mw_Response_Base:=
{
statusLine := {sipVersion := c_sipNameVersion, statusCode := p_statusLine.statusCode, reasonPhrase := ?},
msgHeader :=
{
via := p_via
}
}
template Response mw_Response_Contact (template StatusLine p_statusLine, template CallId p_callId,
template CSeq p_cSeq, template Contact p_contact) modifies mw_Response_Base:=
{
statusLine := {sipVersion := c_sipNameVersion, statusCode := p_statusLine.statusCode, reasonPhrase := ?},
msgHeader :=
{
contact := p_contact
}
}
template Response mw_Response_messageBody (
template StatusLine p_statusLine,
template CallId p_callId,
template CSeq p_cSeq,
template Require p_require,
template MessageBody p_mb
) modifies mw_Response_Base:= {
statusLine := {sipVersion := c_sipNameVersion, statusCode := p_statusLine.statusCode, reasonPhrase := ?},
msgHeader :=
{
require := p_require
},
messageBody := p_mb
}
template Response mw_Response_Require (template StatusLine p_statusLine, template CallId p_callId,
template CSeq p_cSeq, template Require p_require) modifies mw_Response_Base:=
{
statusLine := {sipVersion := c_sipNameVersion, statusCode := p_statusLine.statusCode, reasonPhrase := ?},
msgHeader :=
{
require := p_require
}
}
template Response mw_Response_Require_ifpresent (template StatusLine p_statusLine, template CallId p_callId,
template CSeq p_cSeq, template Require p_require) modifies mw_Response_Base:=
{
statusLine := {sipVersion := c_sipNameVersion, statusCode := p_statusLine.statusCode, reasonPhrase := ?},
msgHeader :=
{
require := p_require ifpresent
}
}
template Response mw_Response_Supported (template StatusLine p_statusLine, template CallId p_callId,
template CSeq p_cSeq, template Supported p_supported) modifies mw_Response_Base:=
{
statusLine := {sipVersion := c_sipNameVersion, statusCode := p_statusLine.statusCode, reasonPhrase := ?},
msgHeader :=
{
supported := p_supported
}
}
} //* end group response_receive
} //* end group modified_templates
} //* end group MessageTemplates
group SDP_Templates {
group SDP_Messages {
group base_templates {
template SDP_Message m_SDP(SDP_media_desc p_media, in SipUserProfile p_userprofile) := {
protocol_version := 0, //* v=0
origin := {
user_name := "voicesession",
session_id := "30000",
session_version := "0",
net_type := c_in,
addr_type := c_ip4,
addr := p_userprofile.contactIpaddr },
//* o=voicesession 12345 12345 IN IP4 172.27.1.219
session_name := "Voice Session", //* s=Voice Session
information := omit,
uri := omit,
emails := omit,
phone_numbers := omit,
connection := {
net_type := c_in,
addr_type := c_ip4,
conn_addr := { addr:= p_userprofile.bearerIpaddr, ttl:=omit, num_of_addr:=omit }
}, //* c=IN IP4 172.27.1.219
bandwidth := omit,
times := { { time_field := { "0", "0" }, time_repeat:=omit
}
}, //* t=0 0
timezone_adjustments := omit,
key := omit,
attributes := omit,
media_list := {p_media}
};
template SDP_Message m_SDP_mediaList(SDP_media_desc_list p_media_list, in SipUserProfile p_userprofile)
:= {
protocol_version := 0, //* v=0
origin := {
user_name := "voicesession",
session_id := "30000",
session_version := "0",
net_type := c_in,
addr_type := c_ip4,
addr := p_userprofile.contactIpaddr },
//* o=voicesession 12345 12345 IN IP4 172.27.1.219
session_name := "Voice Session", //* s=Voice Session
information := omit,
uri := omit,
emails := omit,
phone_numbers := omit,
connection := {
net_type := c_in,
addr_type := c_ip4,
conn_addr := { addr:= p_userprofile.bearerIpaddr, ttl:=omit, num_of_addr:=omit }
}, //* c=IN IP4 172.27.1.219
bandwidth := omit,
times := { { time_field := { "0", "0" }, time_repeat:=omit
}
}, //* t=0 0
timezone_adjustments := omit,
key := omit,
attributes := omit,
media_list := p_media_list
};
template SDP_Message m_SDP_media_attr_preconditions(SDP_media_desc p_media, in SipUserProfile p_userprofile, SDP_attribute_list p_attribute_list)
modifies m_SDP
:= {
media_list := {
{
media_field := {
media := c_audio,
ports := { port_number := 8500, num_of_ports:=omit },
transport := c_rtpAvp,
fmts := { "0" }
}, //* m=audio 8500 RTP/AVP 0
information := omit,
connections := omit,
bandwidth := omit,
key := omit,
}}
}
template SDP_Message m_SDP_attribute(SDP_media_desc p_media, in SipUserProfile p_userprofile, SDP_attribute loc_attribute)
modifies m_SDP
:= {
attributes := {loc_attribute}
};
template SDP_Message mw_SDP := {
protocol_version := 0, //* v=0
origin := ?,
session_name := ?,
information := omit,
uri := omit,
emails := omit,
phone_numbers := omit,
connection := ?,
bandwidth := omit,
times := { { time_field := { "0", "0" }, time_repeat:=omit
}
}, //* t=0 0
timezone_adjustments := omit,
key := omit,
attributes := omit,
media_list := ?
};
}//* end group base_templates
group modified_templates{
template SDP_Message m_SDP_bandwidth(SDP_media_desc p_media, in SipUserProfile p_userprofile)
modifies m_SDP
:= {
bandwidth := {{PX_SIP_SDP_b_modifier, PX_SIP_SDP_b_bandwidth}}
};
template SDP_Message m_SDP_unacceptable(SDP_media_desc p_media, in SipUserProfile p_userprofile)
modifies m_SDP
:= {
protocol_version := 1, //* v=1 unacceptable version of SDP
bandwidth := {{PX_SIP_SDP_b_modifier, PX_SIP_SDP_b_bandwidth}}
};
template SDP_Message m_SDP_encrypted(SDP_media_desc p_media, in SipUserProfile p_userprofile)
modifies m_SDP
:= {
protocol_version := 1, //* v=1 unacceptable version of SDP
bandwidth := {{PX_SIP_SDP_b_modifier, PX_SIP_SDP_b_bandwidth}}
};
}//* end group modified_templates
} //* end group SDP_Messages
group SDP_Fields {
template SDP_media_desc m_media(template SDP_media_field p_mf) := {
media_field := p_mf,
information := omit,
connections := omit,
bandwidth := omit,
key := omit,
attributes := omit
};
template SDP_media_desc m_mediaFieldBandwdthAttributes(template SDP_media_field p_mf, template SDP_bandwidth p_bw, template SDP_attribute_list p_attributes) := {
media_field := p_mf,
information := omit,
connections := omit,
bandwidth := p_bw,
key := omit,
attributes := p_attributes
};
template SDP_media_desc m_media_dynPT(charstring p_PT, charstring p_encod) := {
media_field := {
media := c_audio,//* "audio",
ports := { port_number := 8500, num_of_ports:=omit },
transport := c_rtpAvp,//* "RTP/AVP",
}, //* m=audio 8500 RTP/AVP 8
information := omit,
connections := omit,
bandwidth := omit,
key := omit,
attributes := { { rtpmap := { attr_value := p_PT & " " & p_encod }
}
} //* a=rtpmap:8 PCMA/8000
};
template SDP_media_desc m_media_unsupported := {
media_field := {
media := "video",
ports := { port_number := 11500, num_of_ports:=omit },
transport := "RTP/AVP",
fmts := { "99" }
}, //* m=audio 8500 RTP/AVP 0
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
information := omit,
connections := omit,
bandwidth := omit,
key := omit,
attributes := { {
rtpmap := { attr_value := "99 X-Experimental/180000"}
}}
};
template SDP_bandwidth m_bandwidth(template charstring loc_m, template integer loc_b) := {
modifier:=loc_m,
bandwidth:=loc_b
};
template SDP_bandwidth m_bandwidth_as_64:=
{
modifier:="AS",
bandwidth:=64
}
template SDP_bandwidth mw_bandwidth_rs:=
{
modifier:="RS",
bandwidth:=?
}
template SDP_bandwidth mw_bandwidth_rr:=
{
modifier:="RR",
bandwidth:=?
}
template SDP_media_field m_media_field(charstring p_media, integer p_portNum, charstring p_transport, charstring p_fmts) :=
{
media := p_media,
ports := { port_number := p_portNum, num_of_ports:=omit },
transport := p_transport,
fmts := { p_fmts }
}
template SDP_media_field mw_media_PCMU :=
{
media := c_audio,
ports := { port_number := ?, num_of_ports:=* },
transport := c_rtpAvp,
fmts := { "0" }
}
template SDP_media_field mw_media_PCMA :=
{
media := c_audio,
ports := { port_number := 8500, num_of_ports:=omit },
transport := c_rtpAvp,
fmts := { "8" }
}
template SDP_media_field mw_media_PCMA_U_DPT :=
{
media := c_audio,
ports := { port_number := ?, num_of_ports:=* },
transport := c_rtpAvp,
fmts := { * }
}
template SDP_media_field mw_media_T38 :=
{
media := c_image,
ports := { port_number := ?, num_of_ports:=* },
transport := pattern "*ptl", //* udptl,tcptl
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
fmts := { "t38" }
}
template SDP_media_field mw_media_G722 :=
{
media := c_audio,
ports := { port_number := ?, num_of_ports:=* },
transport := "RTP/AVP",
fmts := { "9" }
}
template SDP_media_field mw_media_AMR_DPT :=
{
media := c_audio,
ports := { port_number := ?, num_of_ports:=* },
transport := c_rtpAvp,
fmts := { * }
}
template SDP_attribute m_attribute_sendonly := {sendonly:={}};
template SDP_attribute mw_attribute_sendonly := {sendonly:={}};//MRO
template SDP_attribute m_attribute_recvonly := {recvonly:={}};
template SDP_attribute mw_attribute_recvonly := {recvonly:={}};//MRO
template SDP_attribute m_attribute_sendrecv := {sendrecv:={}};
template SDP_attribute mw_attribute_sendrecv := {sendrecv:={}};//MRO
template SDP_attribute m_attribute_inactive := {inactive:={}};
template SDP_attribute mw_attribute_inactive := {inactive:={}};//MRO
template 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 SDP_attribute m_attribute_AMR_DPT := { rtpmap := { attr_value := /*pattern "**/PX_SIP_SDP_dyn & " AMR" }};
template SDP_attribute m_attribute_CLEARMODE_DPT := {rtpmap := { attr_value := /*pattern "**/PX_SIP_SDP_dyn & " CLEARMODE/8000" }};
template SDP_attribute m_attribute_G722 := { rtpmap := { attr_value := "9 G722/8000" }};
template SDP_attribute m_attribute_PCMU := { rtpmap := { attr_value := "0 PCMU/8000" }};
template SDP_attribute m_attribute_PCMU_DPT := { rtpmap := { attr_value := /*pattern "**/PX_SIP_SDP_dyn & " PCMU/8000" }};
template SDP_attribute m_attribute_PCMA := { rtpmap := { attr_value := "8 PCMA/8000" }};
template SDP_attribute m_attribute_PCMA_DPT := { rtpmap := { attr_value := /*pattern "**/PX_SIP_SDP_dyn & " PCMA/8000" }};
template SDP_attribute m_attribute_T38 := { unknown := { name:=?, attr_value := pattern "*t38*" }};
template SDP_attribute m_attribute_curr (charstring p_preconditionType, charstring p_statusType, charstring p_direction):=
{
curr:={preconditionType := p_preconditionType,
statusType := p_statusType,
direction := p_direction}
};
template SDP_attribute mw_attribute_curr :=
{
curr := ?
};
template SDP_attribute m_attribute_des (charstring p_preconditionType, charstring p_strength, charstring p_statusType, charstring p_direction):=
{
des:={preconditionType := p_preconditionType,
strength := p_strength,
statusType := p_statusType,
direction := p_direction}
};
template SDP_attribute mw_attribute_des :=
{
des := ?
};
template SDP_attribute m_attribute_conf (charstring p_preconditionType, charstring p_statusType, charstring p_direction):=
{
conf:={preconditionType := p_preconditionType,
statusType := p_statusType,
direction := p_direction}
} //* end group SDP_Fields
} //* end group SDP_Templates
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
group MessageBodies {
template MessageBody m_MBody_SDP(template SDP_Message p_SDP):=
{
sdpMessageBody := p_SDP
};
template MessageBody m_MBody_XML(template XmlBody p_xmlBody):=
{
xmlBody := p_xmlBody
};
template MessageBody m_MBody_longPlainText:=
{
textplain := c_longMessageContent_1300Bytes
};
template MessageBody m_mBody_plainText(charstring p_plaitext):=
{
textplain := p_plaitext
};
template MessageBody m_MBody_sipfrag(charstring p_sipfrag) := {
sipfrag := p_sipfrag
}
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
template MessageBody m_MBody_MIMESdpXml(template SDP_Message p_sdp, template XmlBody p_xmlBody):=
{
mimeMessageBody := {boundary:="PX_SIP_MIME_Boundary",
mimeEncapsulatedList:= {
{content_type:="PX_SIP_SDP_ContentType",
content_disposition:=omit,
mime_encapsulated_part:={sdpMessageBody := p_sdp}},
{content_type:="PX_SIP_ISUP_ContentType",
content_disposition:=omit,
mime_encapsulated_part:={xmlBody := p_xmlBody}}
}
}
}
template MessageBody mw_MBody_SDP(template SDP_Message p_SDP):=
{
sdpMessageBody := p_SDP
};
template MessageBody mw_MBody_XML(template XmlBody p_xmlBody):=
{
xmlBody := p_xmlBody
};
template MessageBody mw_MBody_MIMESdpXml(template SDP_Message p_sdp, template 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}}
}
}
}
}
/*
* @desc group TemplatePreparationFunctions contain functions which are used for templates
*/
group TemplatePreparationFunctions {
group SDPlen_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_result := v_result + 2+c_CRlen + lengthof(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
); //* "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)) {
for (var integer i:=0; i<sizeof(p_mb.emails); i:=i+1)
{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<sizeof(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<sizeof(p_mb.bandwidth); i:=i+1) { //* "b= "
v_result := v_result + 2+c_CRlen + lengthof(p_mb.bandwidth[i].modifier & " ") +
lengthof(int2str(p_mb.bandwidth[i].bandwidth));
}
};
for (var integer i:=0; i<sizeof(p_mb.times); i:=i+1) {
v_result := v_result + 2+c_CRlen + lengthof(p_mb.times[i].time_field.start_time & " "
& p_mb.times[i].time_field.stop_time);//* "t="
if (ispresent(p_mb.times[i].time_repeat))
{
for (var integer j:=0; j<sizeof(p_mb.times[i].time_repeat[j]); j:=j+1)
{
v_result := v_result + 2+c_CRlen + lengthof(int2str(p_mb.times[i].time_repeat[j].repeat_interval.time)); //* "r="
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
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; j<sizeof(p_mb.times[i].time_repeat[j].offsets[k]); 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<sizeof(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<sizeof(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<sizeof(p_mb.media_list[i].media_field.fmts); j:=j+1){
v_result := v_result + 1 + lengthof(valueof(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<sizeof(p_mb.media_list[i].media_field.fmts); 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= "
v_result := v_result + 2+c_CRlen + lengthof(p_mb.media_list[i].bandwidth.modifier)
+ 1 + lengthof(int2str(p_mb.media_list[i].bandwidth.bandwidth));
};
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<sizeof(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
/**
*
* @desc Calculation of messagebody-textplain type length
* @param p_mb contain textplain message
* @return lenght
*/
function f_TextPlainLength(MessageBody p_mb) return integer
{
var integer v_result:=2;
v_result:=v_result+lengthof(p_mb.textplain);
return v_result;
};//* end function f_SDPlength
/**
*
* @desc Calculation of Message Body length
* @param p_mb_par contain message body part
* @return message body length
*/
function f_MessageBodyLength(MessageBody p_mb_par) return integer {
var integer v_result:=0;
//* assume SDP_Message ONLY in the message body
if (ischosen(p_mb_par.sdpMessageBody))
{
v_result := f_SDPlength(p_mb_par.sdpMessageBody);
};
// TODO f_XMLlength and f_MIMElength
/* // assume XML_Message ONLY in the message body
if (ischosen(p_mb_par.xmlBody))
{
v_result := f_XMLlength(p_mb_par.xmlBody);
};
// assume MIME_Message in the message body
if (ischosen(p_mb_par.mimeMessageBody))
{
v_result := f_MIMElength(p_mb_par.mimeMessageBody);
};
*/
return v_result
};
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))
{v_result := v_result + 1 + lengthof(int2str(p_element.conn_addr.ttl));};
if (ispresent(p_element.conn_addr.num_of_addr))
{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="
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
{
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 + 2+c_CRlen + lengthof("recvonly")};
if (ischosen(p_element.sendrecv)) {v_result := v_result + 2+c_CRlen + lengthof("sendrecv")};
if (ischosen(p_element.sendonly)) {v_result := v_result + 2+c_CRlen + lengthof("sendonly")};
if (ischosen(p_element.inactive)) {v_result := v_result + 2+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.des.statusType & " " & p_element.des.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 GiveHeaders {
/**
*
* @desc Return component variable of recordRoute header if vc_boo_recordRoute is true
* @return component variable of recordRoute header
*/
//TODO: clarify if function defined on SipComponent can be used in templates
// function f_recordroute() runs on SipComponent return template RecordRoute
// {
// if (vc_boo_recordRoute)
// {return vc_recordRoute}
// else {return(omit)}
// }
function f_recordroute() return template RecordRoute
/**
*
* @desc Return component variable of Route header if vc_boo_route is true
* @return component variable of recordRoute header
*/
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
//TODO: clarify if function defined on SipComponent can be used in templates
// function f_route() runs on SipComponent return template RecordRoute
// {
// if (vc_boo_route)
// {return vc_route} //* TODO: Route header need to be in reverse order than RecordRoute, question of return value - RecordRoute
// else {return(omit)}
// }
function f_route() return template RecordRoute
{
return(omit)
}
/**
*
* @desc Return RecordRoute (2nd parameter) if recordRoute indicator (1st parameter) is true
* @return recordRoute header
*/
function f_recordroute_par(in boolean p_boo_recordRoute, in RecordRoute p_RecordRoute) return template RecordRoute
{
if (p_boo_recordRoute)
{return p_RecordRoute}
else {return(omit)}
}
/**
*
* @desc Return Route (2nd parameter) if recordRoute indicator (1st parameter) is true
* @return Route header
*/
function f_route_par(in boolean p_boo_recordRoute, in Route p_Route) return template Route
if (p_boo_recordRoute)
{return p_Route} //* TODO: Route header need to be in reverse order than RecordRoute, question of return value - RecordRoute
else {return(omit)}
} //* 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
* @verdict
*/
function f_merge_CommaParam_List(CommaParam_List p_list1, CommaParam_List p_list2) return template CommaParam_List
{ var CommaParam_List p_result;
var integer limit1 := sizeof(p_list1);
for (var integer i:=0; i<limit1; i:=i+1) {
p_result[i] := p_list1[i]
};
for (var integer i:=limit1; i<limit1+sizeof(p_list2); i:=i+1) {
p_result[i] := p_list2[i]
};
return p_result
}
} //* end group others
} //* group TemplatePreparationFunctions
} //* end module LibSip_Templates