[SR-Users] Routing inbound call from carrier to user or voice mail

Daniel Tryba d.tryba at pocos.nl
Wed May 2 14:53:35 CEST 2018


On Wed, May 02, 2018 at 05:26:07AM +0000, KamDev Essa wrote:
> How do I :   
>    - Associate the 10 digit DID to the 201 or 202?

Can be done with (but not limited to)
https://www.kamailio.org/docs/modules/5.1.x/modules/alias_db.html
or a simple hardcoded line:
if($rU=="0123456789")
{
  $rU="201";
}

>    - In the cfg, check if user is registered if??

With lookup():
https://www.kamailio.org/docs/modules/5.1.x/modules/registrar.html#registrar.f.lookup

>    - yes, relay call to user
>    - no relay call to VM server.

The one line you mentioned shows the example, examing the returncode of
lookup. If not 1 you can sent the call to voicemail by changing $ru (or
specific parts like $rd) and relaying the call. So instead of 
sl_send_reply("404", "Not Found");
exit;
you could do something like:
$rd="voicemail.domain.tld";
route(RELAY);
exit;




More information about the sr-users mailing list