Hello, I am having a bit of trouble finding information on how to setup a registering trunk with Kamailio. By registering trunk, I mean a trunk between a PBX and Kamailio, of say 15 DID's, where the main DID (Pilot) registers with Kamailio and all the other 14 DID are able to make/receive calls without having to register all DID's individually.
If the pilot DID registration goes away, the trunk is then considered to be unreachable/down.
I have seen this in the past with a Broadsoft setup, but I can't figure out a way to do it with Kamailio. I have my pilot DID setup and registered with Kamailio ok and I can make calls in and out through my PSTN gateway, but I'm unsure how to group all the other DID's so they are matched against the pilot DID.
Is this possible? Any help is appreciated.
Regards, Andrei.
On Mon, Nov 21, 2016 at 07:14:57PM +0000, Andrei Mahalean wrote:
I have my pilot DID setup and registered with Kamailio ok and I can make calls in and out through my PSTN gateway, but I'm unsure how to group all the other DID's so they are matched against the pilot DID.
You can use dbaliases for that, something like this:
if (is_method("INVITE")) { if(!lookup("location")) { if(!alias_db_lookup("dbaliases")) { send_reply("404","Not Found"); } } }
How to communicate the DID with the destination depends on how the destinations want it. Easiest is to store $rU before lookup/alias_db_lookup (which override $rU with the username) and simple set $rU to stored value:
$avp(callednumber)=$rU; lookup/dbaliases logic $rU=$avp(callednumber);
If a destination want the number in the To: header, you probably don't have to do anything.
All this is assuming trunk registers to kamailio.