[SR-Users] Registering Trunk help please

Daniel Tryba d.tryba at pocos.nl
Tue Nov 22 10:38:16 CET 2016


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.




More information about the sr-users mailing list