I am having a trouble for days to figure out how to configure pjsip trunk. I gave up on further searching and I know that this may be asked often but I am in a dead end.
Asterisk still showing this error:
WARNING[29555]: res_pjsip_registrar.c:1068 find_registrar_aor: AOR '' not found for endpoint '200' (<ip address of other PBX>)
So the blank AOR is causing the problem, but how to I assign proper AOR for 200 endpoint?
My trunk Setting:
Trunk Name : 200
Authentication: None
Registration : None
SIP Server: <ip address of other PBX>
I could well be wrong, but I suspect the endpoint is behaving as though you had Registration: Inbound. and also not passing a user part in the To header. However, without reading the code, or seeing the relevant pjsip set logger on output, I could be wildly wrong.
It doesn’t make sense to me to have the IP address, unless it is reacting to something inbound, and the only inbound operation that deals with AORs is registration.
If a bad configuration has been generated, I think I’d want to see the generated type=endpoint and type=aor sections, to understand what is going on.
But his registration also doesn’t support registration; it has the contact hard coded, as you would expect from setting Registration to none in FreePBX.
The OP should turn off registration in the device or set FreePBX for inbound registration and dynamic hosts.
(It’s also just possible that there are two potential endpoints, on the same machine, one for 300, set to register, and one for 200, set not to register. Because they have the same IP address, Asterisk will, depending on the match order and the existence of an entry for 300, match 300 based on the IP address.)
David has right - on Other PBX (PATTON as you can see in messages) there is one registration 300 for analog and its working with PBX correct (300 is as classic endpoint so no problem here)
but 200 is also on PATTON but withnout any registration needed.
It works with old Asterisk 1.8 where were this settings:
[200]
type=peer
allow=alaw
username=200
host=<ip address of other PBX>
context=contextP
qualify=yes
nat=no
And dialing was due SIP/200/
So I need to transfer it somehow into PJSIP language
As David mentioned, should I turn FreePBX to inbound registration?
And where exactly allow dynamic hosts?
Dynamic hosts are the normal arrangement for extensions.
Having multiple endpoints for the same machine is always going to be a problem. The better solution here is likely to be to change it into a trunk, at both ends.
I wouldn’t consider anything but a single trunk in such circumstances unless I was creating a test rig where one side was simulating extensions. As such I’ve never thought through what you would have to do to ensure both sides recognize two distinct endpoints.
However, you really need to step back and get a clear understanding of what you are really trying to achieve, before you consider how that might be implemented in FreePBX/Asterisk, or even extensions and trunks.
It would seem this is an ongoing issue with people switching over without really digging into the documents for Chan_PJSIP. There is an authentication order in chan_pjsip and the order is: ip, username, anonymous, auth_user, header.
This means if you have devices A and B with endpoint A’s config having a match/permit set to an IP while B is set to register via a username but both are behind the same IP…A is always going to match against both because IP is priority and A has a match setting to an IP.
Good news is this authentication can be prioritized meaning you can sort username first followed by IP which will then check for an endpoint matching the username first then match against an match=IP on endpoints.
So if 200 is set with Permit (Match) setting with the IP of the Patton then when 300 (or any other user account) tries to register from the Patton, they will always match on 200 first. Once you change the priority order, 200 should still match against the IP but 300 will be able to register.
Hello guys,
many thanks for your advices. I decided to use different approach and now it works.
So very good point was with prioritizing authentication.