Chan_sip instead of chan_jsip is trying to catch the registration attempt of a PJSIP extension

Hi all!

I recently installed FreePBX 13 and Asterisk 13 with support for PJSIP using a bundled version of pjproject as is mentioned here [1]. From what I see, the modules seem to have been built correctly:

[email protected]:/usr/lib/asterisk/modules# ll | grep pjsip
-rwxr-xr-x 1 asterisk asterisk  645576 jul 24 21:20 chan_pjsip.so
-rwxr-xr-x 1 asterisk asterisk  296840 jul 24 21:20 func_pjsip_aor.so
-rwxr-xr-x 1 asterisk asterisk  299200 jul 24 21:20 func_pjsip_contact.so
-rwxr-xr-x 1 asterisk asterisk  287064 jul 24 21:20 func_pjsip_endpoint.so
-rwxr-xr-x 1 asterisk asterisk  319608 jul 24 21:20 res_hep_pjsip.so
-rwxr-xr-x 1 asterisk asterisk  302312 jul 24 21:20 res_pjsip_acl.so
-rwxr-xr-x 1 asterisk asterisk  329432 jul 24 21:20 res_pjsip_authenticator_digest.so
-rwxr-xr-x 1 asterisk asterisk  339744 jul 24 21:20 res_pjsip_caller_id.so
-rwxr-xr-x 1 asterisk asterisk  395504 jul 24 21:20 res_pjsip_config_wizard.so
-rwxr-xr-x 1 asterisk asterisk  288856 jul 24 21:20 res_pjsip_dialog_info_body_generator.so
-rwxr-xr-x 1 asterisk asterisk  331488 jul 24 21:20 res_pjsip_diversion.so
-rwxr-xr-x 1 asterisk asterisk  308904 jul 24 21:20 res_pjsip_dlg_options.so
-rwxr-xr-x 1 asterisk asterisk  314680 jul 24 21:20 res_pjsip_dtmf_info.so
-rwxr-xr-x 1 asterisk asterisk  306264 jul 24 21:20 res_pjsip_empty_info.so
-rwxr-xr-x 1 asterisk asterisk  303552 jul 24 21:20 res_pjsip_endpoint_identifier_anonymous.so
-rwxr-xr-x 1 asterisk asterisk  337736 jul 24 21:20 res_pjsip_endpoint_identifier_ip.so
-rwxr-xr-x 1 asterisk asterisk  311256 jul 24 21:20 res_pjsip_endpoint_identifier_user.so
-rwxr-xr-x 1 asterisk asterisk  320536 jul 24 21:20 res_pjsip_exten_state.so
-rwxr-xr-x 1 asterisk asterisk  345888 jul 24 21:20 res_pjsip_header_funcs.so
-rwxr-xr-x 1 asterisk asterisk  374984 jul 24 21:20 res_pjsip_history.so
-rwxr-xr-x 1 asterisk asterisk  302200 jul 24 21:20 res_pjsip_logger.so
-rwxr-xr-x 1 asterisk asterisk  390776 jul 24 21:20 res_pjsip_messaging.so
-rwxr-xr-x 1 asterisk asterisk  308216 jul 24 21:20 res_pjsip_multihomed.so
-rwxr-xr-x 1 asterisk asterisk  276568 jul 24 21:20 res_pjsip_mwi_body_generator.so
-rwxr-xr-x 1 asterisk asterisk  396024 jul 24 21:20 res_pjsip_mwi.so
-rwxr-xr-x 1 asterisk asterisk  331848 jul 24 21:20 res_pjsip_nat.so
-rwxr-xr-x 1 asterisk asterisk  358736 jul 24 21:20 res_pjsip_notify.so
-rwxr-xr-x 1 asterisk asterisk  313896 jul 24 21:20 res_pjsip_one_touch_record_info.so
-rwxr-xr-x 1 asterisk asterisk  295936 jul 24 21:20 res_pjsip_outbound_authenticator_digest.so
-rwxr-xr-x 1 asterisk asterisk  374048 jul 24 21:20 res_pjsip_outbound_publish.so
-rwxr-xr-x 1 asterisk asterisk  441832 jul 24 21:20 res_pjsip_outbound_registration.so
-rwxr-xr-x 1 asterisk asterisk  322616 jul 24 21:20 res_pjsip_path.so
-rwxr-xr-x 1 asterisk asterisk  311144 jul 24 21:20 res_pjsip_phoneprov_provider.so
-rwxr-xr-x 1 asterisk asterisk  284064 jul 24 21:20 res_pjsip_pidf_body_generator.so
-rwxr-xr-x 1 asterisk asterisk  276528 jul 24 21:20 res_pjsip_pidf_digium_body_supplement.so
-rwxr-xr-x 1 asterisk asterisk  276304 jul 24 21:20 res_pjsip_pidf_eyebeam_body_supplement.so
-rwxr-xr-x 1 asterisk asterisk  350376 jul 24 21:20 res_pjsip_publish_asterisk.so
-rwxr-xr-x 1 asterisk asterisk  548560 jul 24 21:20 res_pjsip_pubsub.so
-rwxr-xr-x 1 asterisk asterisk  398040 jul 24 21:20 res_pjsip_refer.so
-rwxr-xr-x 1 asterisk asterisk  289368 jul 24 21:20 res_pjsip_registrar_expire.so
-rwxr-xr-x 1 asterisk asterisk  372456 jul 24 21:20 res_pjsip_registrar.so
-rwxr-xr-x 1 asterisk asterisk  313976 jul 24 21:20 res_pjsip_rfc3326.so
-rwxr-xr-x 1 asterisk asterisk  456688 jul 24 21:20 res_pjsip_sdp_rtp.so
-rwxr-xr-x 1 asterisk asterisk  315552 jul 24 21:20 res_pjsip_send_to_voicemail.so
-rwxr-xr-x 1 asterisk asterisk  498352 jul 24 21:20 res_pjsip_session.so
-rwxr-xr-x 1 asterisk asterisk  288040 jul 24 21:20 res_pjsip_sips_contact.so
-rwxr-xr-x 1 asterisk asterisk 2079280 jul 24 21:20 res_pjsip.so
-rwxr-xr-x 1 asterisk asterisk  406600 jul 24 21:20 res_pjsip_t38.so
-rwxr-xr-x 1 asterisk asterisk  316880 jul 24 21:20 res_pjsip_transport_management.so
-rwxr-xr-x 1 asterisk asterisk  899728 jul 24 21:20 res_pjsip_transport_websocket.so
-rwxr-xr-x 1 asterisk asterisk  284064 jul 24 21:20 res_pjsip_xpidf_body_generator.so

Moreover, as I read in the dashboard of FreePBX, PJSIP is configured on port 5160:

The default bind ports for FreePBX have changed. Please keep this is mind while configuring your devices. You can change this in SIP Settings. CHAN_PJSIP is: 5160, CHAN_SIP is: 5060

In Settings -> Advanced Settings (Dial Plan and Operational) -> SIP Channel Driver, I set “both”. Then in Settings -> Asterisk SIP Settings -> Chan PJSIP Settings, I can corroborate the “5160” value for Port to Listen On.

Finally I created a PJSIP extension and I have set it in SFLPhone, but I do not understand why chan_sip instead of chan_jsip is who is trying to catch the registration attempt:

[2016-08-02 20:22:34] NOTICE[939]: chan_sip.c:28468 handle_request_register: Registration from '<sip:[email protected]>' failed for '10.1.0.40:5160' - Wrong password

Am I missing something? Any advice is very much appreciated.

Thank you in advance for your time.

Kind regards,
Daniel

[1] https://wiki.asterisk.org/wiki/display/AST/Building+and+Installing+pjproject

You didn’t change the port on your phone to use 5160. It’s still using 5060

Hi, Andrew. Thanks for your reply.

In the log line that I copied in the previous message it says failed for '10.1.0.40:5160' - Wrong password. Although the log says that 5160 is the source port. In that case it is not expected that the destination port is also 5160?

Kind regards,
Daniel

Well, I was doing a capture with Wireshark and it seems that the source port is 5160 but the destination port is 5060. Unfortunately I have not found a way to specify the destination port in SFLPhone.

In Settings -> Asterisk SIP Settings, I changed for Chan SIP the Bind Port to 5160 / TLS Bind Port to 5161, and for Chan PJSIP the Port to Listen On to 5060. In this way there seems no problem.

pbxtest*CLI> pjsip show endpoints

 Endpoint:  <Endpoint/CID.....................................>  <State.....>  <Channels.>
    I/OAuth:  <AuthId/UserName...........................................................>
        Aor:  <Aor............................................>  <MaxContact>
      Contact:  <Aor/ContactUri..........................> <Hash....> <Status> <RTT(ms)..>
  Transport:  <TransportId........>  <Type>  <cos>  <tos>  <BindAddress..................>
   Identify:  <Identify/Endpoint.........................................................>
        Match:  <ip/cidr.........................>
    Channel:  <ChannelId......................................>  <State.....>  <Time.....>
        Exten: <DialedExten...........>  CLCID: <ConnectedLineCID.......>
==========================================================================================

 Endpoint:  2002/2002                                            Not in use    0 of inf
     InAuth:  2002-auth/2002
        Aor:  2002                                               1
      Contact:  2002/sip:[email protected]:5060               df5ca1c758 Avail         0.000
       Identify:  2002-identify/2002


pbxtest*CLI>

I Don’t know if this change will be the best, but I think it is the only alternative if we use a terminal which can not change the destination port.

I wonder if you have also made this change and what has been your experience using chan_pjsip compared to chan_sip. Do you consider it robust enough for use in production environments?

Kind regards,
Daniel

The standard way to specify a port (if a specific field is not provided in your client) is to add it to the host after a colon, i.e:

pbx.hostname.com:5060
1 Like

Hi, Lorne.

Thanks for your reply. I could have sworn that before changing ports as I said in the previous post, I had tried to specify the port with colon and it did not work. But I tried again and this time I had no problem. Maybe I got confused. I’m also testing PJSIP for configuring the trunk.

Do you consider PJSIP robust enough for use in production environments?

Kind regards,
Daniel

Dear All,

It is just a matter of Port just follow the given steps and try:

1)In Chan_Sip Setting set the BIND PORT=5060
2)in Chan PJSIP setting Set the PORT to listen =5160
3)Apply config
4)Reload asterisk
5)Register the Extension and test