I have set up a SIP trunk between two Asterisk servers, asterisk1 and asterisk2.
asterisk1 uses PJSIP and asterisk2 uses SIP. The trunk is set up without registration. Both Asterisk servers use the same extension number range, for example 11XX. I can successfully dial from one to another, the problem is when I dial from an extension on asterisk1 that is already present in the configuration of asterisk2 to an extension on asterisk2 I get an error.
This isn’t to do with the dialable extensions, I’m going to take it you have the endpoints named after the extensions they are mapped to? So 1111 is both an extension and endpoint? You’re running into it not authing the endpoints right. If 1111 on asterisk1 calls 1115 on asterisk2, asterisk2 is going to challenge 1111 for the INVITE and expect the response to match its 1111 endpoint not asterisk1’s 1111.
We would need to see an actual SIP trace to validate but I’m pretty sure that is what is going on.
he meant the same extension numbers, for unrelated devices, not so much as intentia design, but the de facto implementation, which means that, if you don’t manipulate caller ID, the From user matches the names of devices on the other machine, so, rather than assuming the call is coming from the trunk, it assumes it is coming from one of its local devices and tries to authenticate it as though it came from that device.