res_pjsip_endpoint_identifier_ip: Add endpoint identifier transport address.

Add a new identify_by option to res_pjsip_endpoint_identifier_ip
called 'transport' this matches endpoints based on the bound
ip address (local) instead of the 'ip' option, which matches on
the source ip address (remote).

UserNote: set identify_by=transport for the pjsip endpoint. Then
use the existing 'match' option and the new 'transport' option of
the identify.

Fixes: #672
This commit is contained in:
Sperl Viktor
2024-03-28 16:22:24 +01:00
committed by asterisk-org-access-app[bot]
parent b23f089472
commit 0ab4a5ef6b
6 changed files with 176 additions and 15 deletions

View File

@@ -426,6 +426,9 @@ static const char *sip_endpoint_identifier_type2str(enum ast_sip_endpoint_identi
case AST_SIP_ENDPOINT_IDENTIFY_BY_REQUEST_URI:
str = "request_uri";
break;
case AST_SIP_ENDPOINT_IDENTIFY_BY_TRANSPORT:
str = "transport";
break;
}
return str;
}
@@ -453,6 +456,8 @@ static int sip_endpoint_identifier_str2type(const char *str)
method = AST_SIP_ENDPOINT_IDENTIFY_BY_HEADER;
} else if (!strcasecmp(str, "request_uri")) {
method = AST_SIP_ENDPOINT_IDENTIFY_BY_REQUEST_URI;
} else if (!strcasecmp(str, "transport")) {
method = AST_SIP_ENDPOINT_IDENTIFY_BY_TRANSPORT;
} else {
method = -1;
}