There is Asterisk 20.4.0 with PJSIP 2.13.1 worked on Ubuntu 22.04 x64.
It is necessary to allow only single IP which hard/soft phone can be used for connection with appropriate PBX extension from:
I read that Asterisk with PJSIP now suports endpoint (extension) based ACLs.
[Apr 14 17:58:00] NOTICE[88846]: acl.c:784 ast_apply_acl_internal: SIP ACL: Rejecting '192.168.0.100' due to a failure to pass ACL '(BASELINE)'
[Apr 14 17:58:00] WARNING[88846]: res_pjsip_acl.c:134 apply_acl: Incoming SIP message from 192.168.0.100:59130 did not pass ACL test
Also I tried to set such ACLs at acl.conf:
acl.conf
[marketing]
type = endpoint
................
acl = marketing_acl
But there is no success.
If such IPs is to put to global ACL section all works.
But global ACL can content of several IPs.
But I need single and exact (different) allowed IP for each necessary extension.
What is wrong or what is necessary to set up instead or additionally ?
If you have a /32 address, you don’t need ACLs. Use identify_by=ip in the enpoint sectin and use contact, rather than max_contacts, in the type=aor section. Use a type=identify section with the IP.
It’s great to identify by ip, but i have trunk where several extensions connects to using the same IP and I need to use match_header.
But there is no user_id and ip at one header and I need either multiple match - by ip and header or restrict ip and match by header.
Anyway I need also user/pass, that is userpass AND ip.
* Endpoint IP Access Controls
Added new configuration Endpoint options:
"acl" - list of IP ACL section names in acl.conf
"deny" - List of IP addresses to deny access from
"permit" - List of IP addresses to permit access from
"contact_acl" - List of Contact ACL section names in acl.conf
"contact_deny" - List of Contact header addresses to deny
"contact_permit" - List of Contact header addresses to permit
I don’t know which link you cannot open. Both work for me, although the second one is not the definitive repository for Asterisk. The definitive link for the second would be:
If you are trying to use the ACL to resolve an ambiguity in other idnetifiers, I suspect that the ACL is only applied after the final selection has been made, so will reject the call, rather than looking for an alternative match that is consistent with the ACL.
I need that either local client (hard or soft) or some remote trunk could place an incoming call to the PBX using appropriate extension only with authentication by user/pass AND ip.
But some extensions can be used wih the trubk with the same ip and port
And it works as it should. But I can remember some weeks ago also getting this “due to a failure to pass ACL ‘(BASELINE)’” message and I was not sure why. I was a bit in a hurry and got it working then somehow after some conf editing and restarts. I then thought that it was maybe a typo in the first place.
There is Asterisk 20.6.0 with PJSIP 2.13.1 worked on Ubuntu 22.04 x64.
There are some trunks.
Some of them have the same IP and port but diffrent usernames/passwords.
I need that incoming (inbound)calls from such trunks to Asterisk could be received by Asterisk only after IP, port AND username matching.
For example, if a call comes from trunk with IP 192.168.0.200:6000 as anonymous or with username ‘trunk2’ Asterisk will not receive such call. but if a call comes from trunk with the same IP 192.168.0.200:6000 but with different username ‘abc22’ such call will be accepted and handled by Asterisk further…
What is the best and most right way to authorize these trunks with the same IP and port using IP AND username ?