ivozprovider icon indicating copy to clipboard operation
ivozprovider copied to clipboard

[standalone] vPBX can not do external/internal calls

Open gmoreno90 opened this issue 1 year ago • 15 comments

Description

I'm trying to create a vPbx Client and this client cal recieve call but not sent (internal or external) We configured:

  • 2 Users (with the correct setup of extension and terminal)
  • 2 Terminals (both registered OK)
  • 2 Extensions (1001 and 1002)
  • 1 DID (inbound and outbond)
  • 1 Hung Groups (We use to recieve calls and thats works)

When try to call between 1001 to 1002 return 603 Decline searching the asterisk debug we can see the following error > [2dec43c3] Executing [1002@trunks:1] NoOp("PJSIP/proxytrunks-0000001c", "Incoming external call from "" <gonzalo> to 1002") in new stack > [2dec43c3] Executing [1002@trunks:2] AGI("PJSIP/proxytrunks-0000001c", "agi://127.0.0.1:4573/fastagi-runner.php?command=Dialplan/Trunks") in new stack > [2dec43c3] [Kernel.php:60 ] AGI Error ("PJSIP/proxytrunks-0000001c", "DDI 1002 not found in database.") -- <PJSIP/proxytrunks-0000001c>AGI Script agi://127.0.0.1:4573/fastagi-runner.php?command=Dialplan/Trunks completed, returning 0 -- Auto fallthrough, channel 'PJSIP/proxytrunks-0000001c' status is 'UNKNOWN'

How we can configure a vpbx on that version? or is samething missing on configuration side?

Thanks


  • IvozProvider version: 4.0~4.0.5~20240430.1111~34aa327+tempest

  • Related sections:

    • [ ] SIP & Telephony
    • [X] vPBX Functionalities
    • [ ] Billing & Invoicing
    • [ ] Web Interface
    • [ ] API
    • [ ] Other

Troubleshooting

Create the following data on vpbx client

  • 2 Users (with the correct setup of extension and terminal)
  • 2 Terminals (both registered OK)
  • 2 Extensions (1001 and 1002)
  • 1 DID (inbound and outbond)
  • 1 Hung Groups (We use to recieve calls and thats works)

Additional Information

N/A

gmoreno90 avatar Aug 13 '24 12:08 gmoreno90

Hello! I make the same test using the stable version and have the same result.

image

IvozProvider version: 3.4~3.4.1~20240212.929~ee6564e+halliday

That test was made with the Demo Brand and vpbx demo client

gmoreno90 avatar Aug 14 '24 09:08 gmoreno90

Hello! I make the same on 4.1 version and have the same result.

image

IvozProvider version: 4.1~4.1.0~20240805.1214~83ffdec+tempest That test was made with the Demo Brand and vpbx demo client

gmoreno90 avatar Aug 14 '24 10:08 gmoreno90

Hi @gmoreno90

Are you using different IP address for Trunks and Users kamailio proxies? It looks like asterisk is identifing your user calls as trunks (external) calls

Also, I would also try updating to 4.2.0 version (It will be released next week) that have some fixed on how proxies are identified by asterisk on standalone installations.

Best regards

Kaian avatar Sep 13 '24 07:09 Kaian

Hi @Kaian I'm using the same IP for both proxies. I intall a the new version, and now the proxytrunks not start with the following error. need to open a new ticket? with that issue?

root@ivoz42:/etc/apt/sources.list.d# systemctl -l status [email protected] --no-pager × [email protected] - Kamailio - the Open Source SIP Server Loaded: loaded (/lib/systemd/system/[email protected]; enabled; preset: enabled) Active: failed (Result: exit-code) since Thu 2024-09-26 14:49:16 CEST; 6min ago CPU: 137ms

Sep 26 14:49:16 ivoz42 kamailio[25997]: tcp: trunks.ivozprovider.local [46.183.118.130]:8002 Sep 26 14:49:16 ivoz42 kamailio[25997]: tcp: trunks.ivozprovider.local [46.183.118.130]:8001 Sep 26 14:49:16 ivoz42 kamailio[25997]: tls: trunks.ivozprovider.local [46.183.118.130]:5061 Sep 26 14:49:16 ivoz42 kamailio[25997]: Aliases: Sep 26 14:49:16 ivoz42 /usr/sbin/kamailio[25999]: WARNING: db_mysql [km_my_con.c:187]: db_mysql_new_connection(): opt_ssl_ca option not supported by mysql version (value (null)) - ignoring Sep 26 14:49:16 ivoz42 /usr/sbin/kamailio[25999]: ERROR: dmq [dmq.c:241]: mod_init(): server_uri is not a socket the proxy is listening on Sep 26 14:49:16 ivoz42 /usr/sbin/kamailio[25999]: ERROR: [core/sr_module.c:1039]: init_mod(): Error while initializing module dmq (/usr/lib/x86_64-linux-gnu/kamailio/modules/dmq.so) Sep 26 14:49:16 ivoz42 systemd[1]: [email protected]: Control process exited, code=exited, status=255/EXCEPTION Sep 26 14:49:16 ivoz42 systemd[1]: [email protected]: Failed with result 'exit-code'. Sep 26 14:49:16 ivoz42 systemd[1]: Failed to start [email protected] - Kamailio - the Open Source SIP Server.

Best Regards

gmoreno90 avatar Sep 26 '24 12:09 gmoreno90

Hi,

Sorry for the late response, I was on holidays.

Can you provide the contents of /etc/kamailio/proxytrunks/listeners.cfg and /etc/kamailio/proxytrunks/ports.cfg ?

Best Regards,

Kaian avatar Oct 16 '24 11:10 Kaian

Hi,

Could you check if this can be reproduced in 4.2.0?

Best regards,

Kaian avatar Nov 12 '24 07:11 Kaian

Mine is: # proxytrunks (id: 1) listen=udp:trunks:SIP_PORT listen=tcp:trunks:SIP_PORT listen=tls:trunks:SIPS_PORT listen=tcp:trunks:XMLRPC_PORT listen=tcp:trunks:RPC_PORT

`#!define TRUNKS_DMQ_SERVER "sip:trunks.ivozprovider.local:5060" #!define USERS_DMQ_SERVER "sip:users.ivozprovider.local:5060"

#!define SIP_PORT 5060 #!define SIPS_PORT 5061 #!define RPC_PORT 8001 #!define XMLRPC_PORT 8002 `

insxa avatar Dec 05 '24 02:12 insxa

I have latest installed, with 2 public IPs, set sip domain and registered both sips to different linphone android and desktop apps. user alice and bob. cant call extensions 101/102 i get 407 / Proxy Authentification Required

insxa avatar Dec 05 '24 02:12 insxa

Hi!

I have latest installed, with 2 public IPs, set sip domain and registered both sips to different linphone android and desktop apps. user alice and bob. cant call extensions 101/102 i get 407 / Proxy Authentification Required

All calls from users are initially sent without credentials, resulting in a 407 response. This is followed by a new INVITE with the Authorization header. If the second INVITE also receives a 407, it likely means one of the Authorization headers is incorrect. Please check the realm and password for those terminals.

--

However, this isn't the problem described here. The issue is related to how Asterisk (the application server in IvozProvider) identifies the caller. Before version 4.2.0, identification was based on the source IP, which caused issues in scenarios where both kamailio@trunks and kamailio@users shared the same IP. This led to the error shown in the red log (DDI 101 not found in the database). The issue occurred because dani was detected as kamailio@trunks (a ddiprovider/carrier instead of a user), and 101 was mistakenly identified as a DDI (a public number) instead of an extension.

This problem was fixed in PR #2756, where we introduced a new method for identifying kamailio@users calls using a SIP header. As a result, both proxies can now share the same IP address, and Asterisk can correctly distinguish between user and provider calls.

Note that this bug only occurred in standalone installations where both proxies shared the same IP address. Although this fix resolves that specific issue, additional configuration may be required for proper operation (e.g., configuring different ports for each Kamailio instance).

Best regards,

Kaian avatar Dec 05 '24 11:12 Kaian

How to check realm and passwords?

insxa avatar Dec 05 '24 12:12 insxa

Hi @Kaian I tested again with v 4.2.0 and the result is the same.

the cat of the files are the following

root@testivoz:~# cat /etc/kamailio/proxytrunks/listeners.cfg

proxytrunks (id: 1)

listen=udp:trunks:SIP_PORT listen=tcp:trunks:SIP_PORT listen=tls:trunks:SIPS_PORT listen=tcp:trunks:XMLRPC_PORT listen=tcp:trunks:RPC_PORT

root@testivoz:~# cat /etc/kamailio/proxytrunks/ports.cfg #!define TRUNKS_DMQ_SERVER "sip:trunks.ivozprovider.local:5060" #!define USERS_DMQ_SERVER "sip:users.ivozprovider.local:5060"

#!define SIP_PORT 5060 #!define SIPS_PORT 5061 #!define RPC_PORT 8001 #!define XMLRPC_PORT 8002

maybe need to do a manual adjust?

gmoreno90 avatar Dec 10 '24 12:12 gmoreno90

hi @Kaian could you help with that? Many thanks

gmoreno90 avatar Jan 02 '25 16:01 gmoreno90

Hi,

No manual configuration should be required. There is a script (/etc/kamailio/autoconf) specified in the systemd unit file that runs before starting Kamailio. This script updates all configuration files with the information from the database configured through the platform portal.

Additionally, ensure the local DNS server is working and that you can ping both users.ivozprovider.local and trunks.ivozprovider.local

Regards

Kaian avatar Jan 07 '25 08:01 Kaian

Hi @Kaian I tested with the last version and the error is the same, The local DNS server is working and can ping to both endpoints. If I tested the version using 2 different ips, works fine, but with 1 Ip fail

Thanks for review

gmoreno90 avatar Jan 30 '25 06:01 gmoreno90

Hi!

Can you provider a PCAP file and Asterisk dialplan log for a Alice to Bob call?

User calls should have a X-Info-Endpoint header to proprely identify the dialog as user call no matter message source IP address and the dialplan log should be different that the one provided in the screenshots above.

Since #2756 user endpoints identifies should look like this:

*CLI> pjsip show identify b1c1t1_alice 

 Identify:  <Identify/Endpoint...........................................................>
      Match:  <criteria...........................>
==========================================================================================

 Identify:  b1c1t1_alice/b1c1t1_alice
     Header: X-Info-Endpoint: b1c1t1_alice


 ParameterName     : ParameterValue
 =================================================
 endpoint          : b1c1t1_alice
 match             : 
 match_header      : X-Info-Endpoint: b1c1t1_alice
 match_request_uri : 
 srv_lookups       : false

Best Regards,

Kaian avatar Jan 31 '25 08:01 Kaian

For anyone running into this, I find that creating new terminals, assigning those terminals to Alice and Bob users, and then registering with the credentials of these new terminals fixed the problem for me

airsay avatar Sep 21 '25 17:09 airsay

I will close becouse in new versions works. Thanks

gmoreno90 avatar Sep 21 '25 18:09 gmoreno90

In a brand new install even on tempest 4.4, using the default Alice and Bob terminals, calls to either user does not work. I still ran in to this yesterday Sep 21 2025. The only way I got calls working was by creating new terminals and assigning them to Alice and Bob

airsay avatar Sep 22 '25 09:09 airsay