nethesis / ns8-nethvoice

NethVoice: an Asterisk based PBX
GNU General Public License v3.0
0 stars 3 forks source link

GNR Trunks not recognized and calls arrive as "anonymous" #119

Open Stell0 opened 7 months ago

Stell0 commented 7 months ago

PBX Reports are working correctly, but there's an issue where calls from GNR trunks are showing up as "anonymous" in the records. This happens because of how calls are passed from Kamailio to Asterisk. Calls from GNR trunks first go to Kamailio, which then sends them to Asterisk. Asterisk sees these calls as coming from its own system (127.0.0.1) and not from the actual GNR trunk, because it expects calls to have a specific provider's IP. So, it marks them as anonymous.

Main Problem:

The main problem is that Asterisk can't tell that these calls are coming from GNR trunks because of the way they're routed. It's expecting an IP address that shows the call is from a specific provider, but instead, it gets an internal IP address, leading it to treat these calls as anonymous.

Possible Solutions:

Change Kamailio's Settings: We could adjust Kamailio so it makes Asterisk think the calls are coming from the correct IP address. This needs some checking to make sure it's possible and that it works right.

Update PBX Reports: Another easier fix is to just change the PBX Reports system to treat anonymous calls as "IN". This doesn't require any complex changes, but it means we won't be able to see which trunk a call came from, which could be important for tracking and analyzing call data.

Stell0 commented 7 months ago

Workaround: It is possible to identify as our GNR trunks the calls coming from 127.0.0.1 adding ot trunk in /etc/asterisk/pjsip.identify_custom_post.conf

[TRUNK_NAME]
type=identify
endpoint=TRUNK_NAME
match=127.0.0.1

in this case isn't possible to distinguish between different trunks.

For the future, it should be possible to use the match_header to identify using an header instead of the ip, but I wasn't able to get it to work. If we are able to get it to work, it would be possible to set an identifier from kamailio.