hello all,
Can you define an array and a loop in kamailio.cfg
not work !!!!
$var(i) = 0;
tab[0]="192.168.0.2";
tab[1]="192.168.0.3 »;
while($var(i)<2)
{
$var(rip) = $tab[$var(i)];
$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 + "@"
+ $sel(cfg_get.kamailio.bindip)
+ ":" + $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();
}