Dear Kamailio Expert,

I already add module lcr, but found error when searching pvar "ddn" inside source code core/pvapi.c at line 923, as shown error log captured below :

Apr  6 10:26:50 kamal /usr/sbin/kamailio[180954]: ERROR: <core> [core/pvapi.c:923]: pv_parse_spec2(): error searching pvar "ddn"

Apr  6 10:26:50 kamal /usr/sbin/kamailio[180954]: ERROR: <core> [core/pvapi.c:1126]: pv_parse_spec2(): wrong char [n/110] in [$ddn] at [3 (0)]

Apr  6 10:26:50 kamal /usr/sbin/kamailio[180954]: ERROR: xlog [xlog.c:511]: xdbg_fixup_helper(): wrong format[Domain of destination: $ddn]

Apr  6 10:26:50 kamal /usr/sbin/kamailio[180954]: ERROR: <core> [core/route.c:1166]: fix_actions(): fixing failed (code=-1) at cfg:/etc/kamailio/kamailio.cfg:901

Apr  6 10:26:50 kamal /usr/sbin/kamailio[180954]: ERROR: <core> [core/route.c:1166]: fix_actions(): fixing failed (code=-1) at cfg:/etc/kamailio/kamailio.cfg:903

Apr  6 10:26:50 kamal /usr/sbin/kamailio[180954]: ERROR: <core> [core/route.c:1166]: fix_actions(): fixing failed (code=-1) at cfg:/etc/kamailio/kamailio.cfg:918


The question are, how to define correct "INVITE" methode (or correct format) inside route[LCR] which is already defined inside kamailio.cfg:

route[LCR] {

if (status=="200")

{

  xlog("LCR: Inside the LCR routen");

}


if(method=="INVITE")

{

  xlog("We got an invite");

  if(!load_gws(1, $rU, $var(caller_uri))) {

    xlog("Couldn't load gateways");

    sl_send_reply("500", "Server Internal Error - Cannot load gateways");

    exit;

  } else {

        xlog("GW Selected '$avp(i:709)'n");

        xlog("Domain of destination: $ddn");

        xlog("To URI: $tun");

  }


  if(!next_gw()) {

    xlog("Couldn't proceed to next gateway");

    sl_send_reply("503", "Service not available, no gateways found");

    exit;

  } else {

        xlog("Calling the first matched gatewayn");

        xlog("ruri_user_avp: '$avp(i:500)'n");

        xlog("To URI after next_gw: $tun");

        xlog("Request URI: $rUn");


  }


}

}


Kind Regards