mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-26 06:26:41 +00:00
res_pjsip_endpoint_identifier_ip: Endpoint identifier request URI
Add ability to match against PJSIP request URI. UserNote: this new feature let users match endpoints based on the indound SIP requests' URI. To do so, add 'request_uri' to the endpoint's 'identify_by' option. The 'match_request_uri' option of the identify can be an exact match for the entire request uri, or a regular expression (between slashes). It's quite similar to the header identifer. Fixes: #599
This commit is contained in:
committed by
asterisk-org-access-app[bot]
parent
c8ab570c6f
commit
895ab9d798
@@ -557,6 +557,14 @@
|
||||
endpoint identification.
|
||||
</para>
|
||||
</enum>
|
||||
<enum name="request_uri">
|
||||
<para>Matches the endpoint based on the configured SIP
|
||||
request uri.
|
||||
</para>
|
||||
<para>This method of identification is not configured here
|
||||
but simply allowed by this configuration option.
|
||||
</para>
|
||||
</enum>
|
||||
</enumlist>
|
||||
</description>
|
||||
</configOption>
|
||||
|
||||
@@ -423,6 +423,9 @@ static const char *sip_endpoint_identifier_type2str(enum ast_sip_endpoint_identi
|
||||
case AST_SIP_ENDPOINT_IDENTIFY_BY_HEADER:
|
||||
str = "header";
|
||||
break;
|
||||
case AST_SIP_ENDPOINT_IDENTIFY_BY_REQUEST_URI:
|
||||
str = "request_uri";
|
||||
break;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
@@ -448,6 +451,8 @@ static int sip_endpoint_identifier_str2type(const char *str)
|
||||
method = AST_SIP_ENDPOINT_IDENTIFY_BY_IP;
|
||||
} else if (!strcasecmp(str, "header")) {
|
||||
method = AST_SIP_ENDPOINT_IDENTIFY_BY_HEADER;
|
||||
} else if (!strcasecmp(str, "request_uri")) {
|
||||
method = AST_SIP_ENDPOINT_IDENTIFY_BY_REQUEST_URI;
|
||||
} else {
|
||||
method = -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user