quick question for the guru’s
im busy toying with freepbx using sip trunks for inbound and outbound calls, but i seem to be having a issue with adding multiple sip trunks, the moment i activate the second sip trunk i cannot receive calls at all,
[2019-01-18 09:58:27] NOTICE chan_sip.c: Peer ‘Number b’ is now Reachable. (24ms / 2000ms)
[2019-01-18 09:59:01] WARNING[C-00000028] chan_sip.c: username mismatch, have <Number a>, digest has <Number b>
i’ve tried googling, and going through this forum, but im not getting any solid answers, both channels are set up identically
Asterisk doesn’t have SIP trunks, they are a FreePBX concept
We can only analyse your system from a pure Asterisk point of view, and for that we will need to see the actual content of sip.conf and its included files.
However, I would point out that Asterisk identifies peers by IP address, so, for example, having multiple accounts on one ITSP can be a problem. If that is the case, we will also need to see an incoming INVITE, although there is no guarantee that a solution we come up with will work within the limitations of FreePBX.
Understood, i’ve linked 2 files, hope they will be of use
I’m not sure how that configuration would work reliably, even if you only had one account, but that is a core FreePBX design issue.
However, unless the ITSP sends the account phone number in the From header, and you add insecure=invite, Asterisk will not be able to tell the two accounts apart.
Although I have never used it, there is also a sip.conf option that causes user matches to based on the authentication ID, but I’m not sure how you would convince the ITSP to send a password. In fact, the error message you are getting is strange, as, to have a wrong authentication user, the ITSP would have to attempt authentication, which is not something they normally do. Maybe my first paragraph applies and the configuration is broken by design, and the call is being matched against the entry with a secret but no insecure=invite.
Are you trying to simulate a trunk by using multiple single call accounts with one ITSP, or are you trying to have the ITSP bill different users based on different ITSP accounts. In the first case, get a proper, business, PABX, account. In the second case, the only way I know of doing it with chan_sip is with multiple instances of Asterisk.