Hi,

I wanted to achieve the following scenario with Kamailio and Asterisk/FreeSwitch

Kamailio as a trunk for Receiving incoming calls and forward to Asterisk and Make outgoing calls. My current working setup like this


VoIP Provider -> Kamailio -> Asterisk Clusters

Where Kamailio(NAT for public) and Asterisk in the same local network, So I had to do only one thing just create the SIP trunk in Asterisk for authenticating all the Kamailio Incoming calls and making outgoing calls like this

[kamailio]
host=172.18.1.1
type=friend
disallow=all
allow=ulaw
context=trunkinbound

This is IP based authentication, This is working fine since both servers are in the same local network or having the public IP's

What I want is, I want to register the Kamailio Trunk in an asterisk with Username Password authentication, 

My current setup for making that, 

VoIP Provider -> Kamailio(Public) -> Asterisk(Randomly Changing Public IP, Broadband Connection)

I want to register Kamailio SIP in asterisk trunk so that I can forward the incoming calls to asterisk via SIP extension

[kamailio]
host=172.18.1.1
user=user
secret=password
type=friend
disallow=all
allow=ulaw
context=trunkinbound

Let me know if anyone doesn't understand my concern