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?

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 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:
1 sip:
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 Asterisk.
I added some standard dialplan in both Asterisk boxes and added following context:

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

The ideia is if ZOIPER dials (in this case) any number (_X.), Asterisk at 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 as I get following error from Asterisk:

Got SIP response 483 "Too Many Hops" back from

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 .