SIP_Templates: Allow passing 'Allow' field

Change-Id: I10dd36d8c0ef8dbcbb58016c9684d877a0455b03
This commit is contained in:
Pau Espin 2024-05-13 16:25:11 +02:00
parent 7f41156603
commit cb3a15b6d0
1 changed files with 14 additions and 22 deletions

View File

@ -66,6 +66,16 @@ return template (value) SipUrl {
}
}
// [20.5]
template (present) Allow tr_Allow(template Method_List methods := *) := {
fieldName := ALLOW_E,
methods := methods
}
template (value) Allow ts_Allow(template (omit) Method_List methods := omit) := {
fieldName := ALLOW_E,
methods := methods
}
template (value) Credentials ts_Credentials_DigestResponse(template (value) CommaParam_List digestResponse) := {
digestResponse := digestResponse
}
@ -511,7 +521,7 @@ ts_SIP_msgh_std(template (value) CallidString call_id,
template (value) Via via,
template (omit) ContentType content_type := omit,
template (omit)Authorization authorization := omit,
template (value) Method_List allow_methods := c_SIP_defaultMethods,
template (omit) Allow allow := ts_Allow(c_SIP_defaultMethods),
template (omit) Expires expires := omit,
template (omit) Require require := omit,
template (omit) Security_client security_client := omit,
@ -519,10 +529,7 @@ ts_SIP_msgh_std(template (value) CallidString call_id,
template (omit) Supported supported := omit,
template (omit) WwwAuthenticate wwwAuthenticate := omit
) modifies ts_SIP_msgHeader_empty := {
allow := {
fieldName := ALLOW_E,
methods := allow_methods
},
allow := allow,
authorization := authorization,
callId := {
fieldName := CALL_ID_E,
@ -560,21 +567,6 @@ ts_SIP_msgh_std(template (value) CallidString call_id,
wwwAuthenticate := wwwAuthenticate
}
function tr_AllowMethods(template Method_List allow_methods) return template Allow {
if (istemplatekind(allow_methods, "omit")) {
return omit;
} else if (istemplatekind(allow_methods, "*")) {
return *;
} else if (istemplatekind(allow_methods, "?")) {
return ?;
}
var template (present) Allow ret := {
fieldName := ALLOW_E,
methods := allow_methods
}
return ret
}
template (present) MessageHeader
tr_SIP_msgh_std(template CallidString call_id,
template SipAddr from_addr,
@ -584,7 +576,7 @@ tr_SIP_msgh_std(template CallidString call_id,
template charstring method,
template ContentType content_type := *,
template integer seq_nr := ?,
template Method_List allow_methods := *,
template Allow allow := *,
template Expires expires := *,
template Require require := *,
template Security_client security_client := *,
@ -592,7 +584,7 @@ tr_SIP_msgh_std(template CallidString call_id,
template Supported supported := *,
template WwwAuthenticate wwwAuthenticate := *
) modifies t_SIP_msgHeader_any := {
allow := tr_AllowMethods(allow_methods),
allow := allow,
callId := {
fieldName := CALL_ID_E,
callid := call_id