Kamailio script to front standard FusionPBX cluster v2.0

In this configuration, you are using public ip addressing for all of the freeswitch instances but you mentioned on digital ocean that they were sharing an ip address. With instance hosting like AWS, GCP or DO, is the preferred way to expose each freeswitch instance on a public ip addresses or should you nat them to an internal ip address?
 
Hello,

just got on this old thread at https://www.pbxforums.com/threads/kamailio-script-to-front-standard-fusionpbx-cluster-v2-0.17/ , and tried your script.
I have some questions regarding the code:
1 - around line 148, there is an IP address 149.202.190.100. What is it? a Carrier? A SIP Trunk to a PBX?
(solved, found the answer in this thread).

2- I'm using the following dispatcher list:
1 sip:192.168.1.102:5060
1 sip:192.168.1.108:5060
20 sip:sip.someprovider.pt:5060 4



From what I understood, in setID 1 are some Asterisk box in the local cluster and used to register SIP clients (phones or other IP PBX).

I tried to register a sofphone and it worked, the ZoIPER is registered in the 192.168.1.102 Asterisk.
I added some standard dialplan in both Asterisk boxes and added following context:

[TEST]
exten => _X.,1,Dial(SIP/${EXTEN}@kamailio)

The ideia is if ZOIPER dials (in this case) any number (_X.), Asterisk at 192.168.1.102 forwards the request to KAMAILIO which would, I assume, dispatch to Carrier on setID 20 (sip.someprovider.pt). But instead it seems to be dispatching to 192.168.1.102 as I get following error from Asterisk:

Got SIP response 483 "Too Many Hops" back from 192.168.1.1:5060

Any clue why? am I missing something?

The ideia is to have Kamailio load balance calls both from and to any SIP Trunk (inbound or outbound calls)


Thanks in advance .

Cheers

Sérgio