What are the possible values of “prot” parameter of “SecurityClient” header in a SIP Request? - sip

What are the possible values of prot parameter of SecurityClient header in an SIP Request?
Example:
Security-Client: ipsec-3gpp;prot=<?>

The possible values of “prot” parameter are “ah” , “no” ,”esp”
Example : prot=ah, prot=no, prot=esp

Related

AWS Api Gateway Setting the header value to a default value using http Integration

I am using AWS API Gateway and I want to set my Integration type to http. I have the integrated url as https:// xxxxxx.com which takes a header "apikey". I am not expecting the end user to pass the header rather I want to set the apikey to some constant value.
I see that there is a way to force the user to make him pass the header(by making header required under the Method Request section. However, I want to set it to default.
For example in all the requests which are internally calling the URL inside the API gateway should pass the header value as "12345".
You can add/remove/override headers with an Integration Request Mapping Template.
In the API Gateway console, chose the relevant api/resourece/method. Go to Integration Request > Mapping Templates and chose your Content-Type (if requests are going to be received without a Content-Type header, set the Content-Type for the mapping template to application/json, which is the default behaviour).
Then in the actual mapping template add the following:
{
#set($context.requestOverride.header.apikey= "testMe")
}
This will add (or overwrite if it already exists) a header called apikey with the value "testMe" to all http requests downstream.
If you take this route, then you will need to also map over any other headers, path parameters, query parameters or body that you wish to pass through.
You could loop through the headers and query parameters like this.
## First set the header you are adding
#set($context.requestOverride.header.apikey= "testMe")
## Loop through all incoming headers and set them for downstream request
#foreach($param in $input.params().header.keySet())
#set($context.requestOverride.header[$param]= $input.params().header.get($param))
#if($foreach.hasNext) #end
#end
## Loop through all incoming query parameters and set them for downstream request
#foreach($param in $input.params().querystring.keySet())
#set($context.requestOverride.querystring[$param]= $input.params().querystring.get($param))
#if($foreach.hasNext) #end
#end
As you need to ensure that the header apikey is set to a default value, you should set the override for apikey before looping through the rest of the headers as only the first override will take effect.
The relevant AWS documentation can be found here.
The other alternative would be to point your API Gateway at a Lambda and make the call from the Lambda instead.
Firstly thanks to #KMO for his help. The following is the solution:-
Enable Http Proxy Integration.
Add the headers apikey=xxxx and Accept-Encoding=identity under the same Integration
Request -> Http Headers.
Under Settings -> Binary Media Types set the following as separate Binary Media Types
'*', */*. I mean as two different lines.This step is needed to resolve the Gzip action while returning the response.
Add the Query parameter country in the URL Query String Parameters section.
In the Integration Request map the country parameter to ctry by adding the value under mapped from as method.request.querystring.country. This will ensure that the query parameter country you passed in the main URL will be fed to the downstream url as parameter ctry.
The advantage of this apporoach is that, even if you override the header apikey, the one set under the Http Headers will take the precedence.

Extracting params from the Referer Header field in HAProxy

I understand that I can use url_param / urlp to extract the query parameters from the URL that is requested, in HAProxy.
However, I need similar function for extracting parameters from the URL sent as HTTP Header field Referer. I guess url_param is only available for the requested URL, and not possible to use for HTTP Header values? If so, what other options do I have? I need to retrieve the value from query parameter and send it as specific HTTP Header to the backend server.
Sharing my solution (although Im not sure this is the most efficient and accurate way). I solved it with Regex.
# Example HTTP Referer: http://myexample.com/users?user-id=12345
# ACL
acl is_uid_in_hdr_referer hdr_sub(Referer) -i user-id
# Set value from query param "user-id" from Referer header to custom header "user-id"
http-request set-header user-id %[req.hdr(Referer),regsub(.+?user-id=,,g)] if is_uid_in_hdr_referer

How Can I modify a request header value from A to B by using Haproxy

Currently we are using Haproxy as a software loadbalancer.
I have an assignment, where I need to inspect each and request coming into my application and I need to look for a specific header (let's say Accept header) and I need to modify the value of header from A --> B.
Could you please guide me how can I do this by using HAPROXY.
Regards,
-Srini.
To replace one request header with another, example:
Accept: application/json # existing value
Accept: application/xml # desired value
Test the current value then set a header with the desired header.
http-request set-header Accept application/xml if { hdr(accept) -m str application/json }
Using http-request set-header removes any/all existing headers with the same name, which is what you would wanrtin this case. Using -m str specifies a case-sensitive string match on the value. Header name matching is always case-insensitive.
http://cbonte.github.io/haproxy-dconv/1.6/configuration.html#4-http-request

Can we override wsa:To value in SOAP 1.2

I want to override wsa:To element value in SOAP 1.2 message. Can I do this by adding "To" HTTP header to the request ?
Could you explain the use of this wsa:To element value on the SOAP 1.2 message header ?
No. wsa:To is a SOAP header block, not an HTTP header.

values of SIP Accept and SIP Accept-Contact

I am trying to find out the range of possible values of Accept and Accept-Contact header fields, but I can't find a complete list in the RFCs. Does anyone know where they are? I often see
Accept: application/sdp;level=1, application/x-private, text/html
but don't know all possible values. More generally, where can I find all possible values of SIP headers?
Thanks,
A lot of sections in the [SIP RFC]1 are based on the [HTTP 1.1 RFC]2 in acknowledgement that the semantics of SIP and HTTP are very similar. The SIP Accept header is a good case in point. The SIP RFC section that deals with the Accept header refers to [H14.1] which translates to section 14.1 in the HTTP 1.1 RFC and which goes into detail about how the Accept header can be used to specify the different types of media that are acceptable in the response.
That all being said in the real World 90% of the time the SIP response media is going to be application/sdp. There will be SIP requests that accept other types of response media but they are not that common.
Bob what you are looking is MIME types.
You find some common MIME type here
http://en.wikipedia.org/wiki/Internet_media_type
A text formation of SIP is derive from HTTP so you can refer HTTP headers also to fine possible values of other headers.
Most headers and parameter with their corresponding RFC are listed: http://www.iana.org/assignments/sip-parameters