SIP trunk between wazo and freePBX

I’m trying to do it but I get an auth error from freePBX.
Wazo trunk conf:


FreePbx chan sip trunk conf:
03

from wazo I get this error:
WARNING[14181]: res_pjsip_outbound_registration.c:1007 handle_registration_response: 403 Forbidden fatal response received from ‘sip:192.168.2.6:5060’ on registration attempt to ‘sip:sbc_user@192.168.2.6:5060’, retrying in ‘30’ seconds

from freePBX I get this error:
ERROR[2361]: chan_sip.c:17092 register_verify: Peer ‘sbc_user’ is trying to register, but not configured as host=dynamic
NOTICE[2361]: chan_sip.c:28390 handle_request_register: Registration from ‘sip:sbc_user@192.168.2.6’ failed for ‘192.168.2.61:5060’ - Peer is not supposed to register

wazo is chanpjsip and freePBX is chasip.

Thanks in advance.

Hi,

Your username wazo_user and password should be the same on freepbx user details

Hi, thanks for your answer. I did it and eventually, I can register for a few seconds:

**[2020-03-25 22:37:54.9080] VERBOSE[12661] res_pjsip/pjsip_configuration.c: Endpoint TEST-TRUNK is now Reachable**
**[2020-03-25 22:37:54.9080] VERBOSE[12661] res_pjsip/pjsip_options.c: Contact TEST-TRUNK/sip:sbc_user@192.168.2.61:5060 is now Reachable.  RTT: 0.895 msec**
**[2020-03-25 22:37:57.9674] WARNING[12661]: res_pjsip_outbound_registration.c:1007 handle_registration_response: 403 Forbidden fatal response received from 'sip:192.168.2.6:5060' on registration attempt to 'sip:sbc_user@192.168.2.6:5060', retrying in '30' seconds**

But after a few seconds the trunk status is rejected:

wazo*CLI> pjsip show registrations

 <Registration/ServerURI..............................>  <Auth..........>  <Status.......>
==========================================================================================

 reg_sbc_user@192.168.2.6/sip:192.168.2.6:5060           auth_reg_sbc_user@192.168.2.6  Rejected

Objects found: 1

Additionally, pjsip gives this error:

[Mar 25 23:43:49]     -- Reloading module 'res_pjsip.so' (Basic SIP resource)
[2020-03-25 23:43:50.6868] ERROR[22353]: netsock2.c:303 ast_sockaddr_resolve: getaddrinfo("dynamic", "(null)", ...): Name or service not known
[2020-03-25 23:43:50.6868] ERROR[22353]: res_pjsip_endpoint_identifier_ip.c:550 ip_identify_apply: Identify 'TEST-TRUNK' failed when adding resolution results of 'dynamic'
[2020-03-25 23:43:50.6868] ERROR[22353]: res_sorcery_config.c:407 sorcery_config_internal_load: Could not create an object of type 'identify' with id 'TEST-TRUNK' from configuration file 'pjsip.conf'

I see this in your log :

sip:sbc_user@192.168.2.61:5060 is now Reachable.

and this :

reg_sbc_user@192.168.2.6/sip:192.168.2.6:5060

and this :

auth_reg_sbc_user@192.168.2.6

It means your trunks are not using the good credentials. If it’s a first for you i advise you create a really simple configuration with the same login and the same trunk name on both side. If you can don’t even setup registration on wazo and set up some firewall rules instead it’ll be easier until you get confortable with trunks
one more thing is host on dynamic on wazo, can’t you put your freepbx IP ?

Well, I don’t now why wazo is trying to register with other credentials, I really use the same user and pass on both sides, but I have the same error.

Regard with
sip:sbc_user@192.168.2.61:5060
reg_sbc_user@192.168.2.6/sip:192.168.2.6:5060

I realize that wazo puts “reg” and “auth_reg” prefixs.

Strange, i don’t know why, looks like a bug, but that the first time we have this feedback. Are you sure?

Hi, finally I realized that the freePBX had a fail2ban rule who was banning the traffic from my wazo. I’ve just added the IP to the whitelist and it works fine.

my apologies.

Thank you for your feedback!