[SR-Users] Psuedo Variable.

David J. david at styleflare.com
Tue Oct 26 03:03:00 CEST 2010


Hello List;

I was following along the Kamailio Asterisk Realtime Integration; I 
modified the script to get it working on Kamailio v 3.1.

One area I had a question about was here...

We have the following block;

# Forward REGISTER to Asterisk
route[REGFWD] {
         if(!is_method("REGISTER"))
         {
                 return;
         }
         $var(rip) = $sel(cfg_get.asterisk.bindip);
         $uac_req(method)="REGISTER";
         $uac_req(ruri)="sip:" + $var(rip) + ":" + 
$sel(cfg_get.asterisk.bindport);
         $uac_req(furi)="sip:" + $au + "@" + $var(rip);
         $uac_req(turi)="sip:" + $au + "@" + $var(rip);
         $uac_req(hdrs)="Contact: <sip:" + $au + "@" + $ad
                                 + ":" + $sel(cfg_get.kamailio.bindport) 
+ ">\r\n";
         if($sel(contact.expires) != $null)
                 $uac_req(hdrs)= $uac_req(hdrs) + "Expires: " + 
$sel(contact.expires) + "\r\n";
         else
                 $uac_req(hdrs)= $uac_req(hdrs) + "Expires: " + 
$hdr(Expires) + "\r\n";
         uac_req_send();
}

If I change the line to read : $uac_req(hdrs)="Contact: <sip:" + $au + 
"@" + $ad
from : $uac_req(hdrs)="Contact: <sip:" + $au + "@" + 
$sel(cfg_get.kamailio.bindip)

I get the following error;

loading modules under 
/usr/local/kamailio-3.1-proxy/lib/kamailio/modules_k/:/usr/local/kamailio-3.1-proxy/lib/kamailio/modules/
$ad
  0(13715) ERROR: <core> [pvapi.c:445]: bad parameters
  0(13715) : <core> [cfg.y:3409]: parse error in config file 
/usr/local/kamailio-3.1-proxy/etc/kamailio/kamailio.cfg, line 717, 
column 48-47: unknown script pseudo variable
ERROR: bad config file (1 errors)


I would imagine that if the "$au" pseudo variable is available the "$ad" 
variable would be available as well.

Please help point out my mistake.

Thanks.

David.





More information about the sr-users mailing list