Hi I am using slqops to get some user related info from location table, I want to use that info in rewritehost, however when I do use a variable in rewritehost I get an error "Unable to resolve variable". Is it possible to use a variable in rewritehost ? If not what is the workaround ? Thanks
rewritehost doesn't accept PVs. It's a rather legacy function. Just modify the RURI directly, instead using $ru (and $rU, $rd, and $rp).
For more information, see:
http://www.kamailio.org/wiki/cookbooks/3.3.x/pseudovariables
On 12/17/2012 04:51 AM, Ali Jawad wrote:
Hi I am using slqops to get some user related info from location table, I want to use that info in rewritehost, however when I do use a variable in rewritehost I get an error "Unable to resolve variable". Is it possible to use a variable in rewritehost ? If not what is the workaround ? Thanks
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Thanks Alex, I did try the following :
$du = "sip:support1@ip.of.second.server:5060"; route(1);
I am getting too many hops though, the alias on both servers is different and the hosts file includes the alias for each server.
Regards
On Mon, Dec 17, 2012 at 12:45 PM, Alex Balashov abalashov@evaristesys.comwrote:
rewritehost doesn't accept PVs. It's a rather legacy function. Just modify the RURI directly, instead using $ru (and $rU, $rd, and $rp).
For more information, see:
http://www.kamailio.org/wiki/**cookbooks/3.3.x/**pseudovariableshttp://www.kamailio.org/wiki/cookbooks/3.3.x/pseudovariables
On 12/17/2012 04:51 AM, Ali Jawad wrote:
Hi
I am using slqops to get some user related info from location table, I want to use that info in rewritehost, however when I do use a variable in rewritehost I get an error "Unable to resolve variable". Is it possible to use a variable in rewritehost ? If not what is the workaround ? Thanks
______________________________**_________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/**cgi-bin/mailman/listinfo/sr-**usershttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Alex Balashov - Principal Evariste Systems LLC 235 E Ponce de Leon Ave Suite 106 Decatur, GA 30030 United States Tel: +1-678-954-0670 Web: http://www.evaristesys.com/, http://www.alexbalashov.com/
______________________________**_________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/**cgi-bin/mailman/listinfo/sr-**usershttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Note: I was speaking of $ru, not $du.
On 12/17/2012 06:06 AM, Ali Jawad wrote:
Thanks Alex, I did try the following :
$du = "sip:support1@ip.of.second.server:5060"; route(1);
I am getting too many hops though, the alias on both servers is different and the hosts file includes the alias for each server.
Regards
On Mon, Dec 17, 2012 at 12:45 PM, Alex Balashov <abalashov@evaristesys.com mailto:abalashov@evaristesys.com> wrote:
rewritehost doesn't accept PVs. It's a rather legacy function. Just modify the RURI directly, instead using $ru (and $rU, $rd, and $rp). For more information, see: http://www.kamailio.org/wiki/__cookbooks/3.3.x/__pseudovariables <http://www.kamailio.org/wiki/cookbooks/3.3.x/pseudovariables> On 12/17/2012 04:51 AM, Ali Jawad wrote: Hi I am using slqops to get some user related info from location table, I want to use that info in rewritehost, however when I do use a variable in rewritehost I get an error "Unable to resolve variable". Is it possible to use a variable in rewritehost ? If not what is the workaround ? Thanks _________________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org> http://lists.sip-router.org/__cgi-bin/mailman/listinfo/sr-__users <http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users> -- Alex Balashov - Principal Evariste Systems LLC 235 E Ponce de Leon Ave Suite 106 Decatur, GA 30030 United States Tel: +1-678-954-0670 Web: http://www.evaristesys.com/, http://www.alexbalashov.com/ _________________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org> http://lists.sip-router.org/__cgi-bin/mailman/listinfo/sr-__users <http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users>
-- *Ali Jawad
*Information Systems Manager CISSP - PMP - ITIL V3 - RHCE - VCP - C|EH - CCNA - MCSA
*Splendor Telecom (www.splendor.net http://www.splendor.net/) Beirut, Lebanon Phone: +9611373725/ext 116 FAX: +9611375554
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Thanks Alex, now it works if I do set the $ru manually, however if I do set it dynamically it still gives destination unresolvable, I do fetch a SQL statement and row 1,1 is hostname
while($var(i)<$dbr(ra=>rows))
{
$var(j) = 0;
while($var(j)<$dbr(ra=>cols))
{
xlog("[$var(i),$var(j)] = $dbr(ra=>[$var(i),$var(j)])\n");
$var(j) = $var(j) + 1;
}
$var(i) = $var(i) + 1;
}
}
$ru = "sip:support1@ra=>[$var(1),$var(1)]:5060";
On Mon, Dec 17, 2012 at 2:22 PM, Alex Balashov abalashov@evaristesys.comwrote:
$ru
I did make it simpler as follows :
sql_xquery("cb", "select username,domain from location where username like 'support1' " , "ra"); $ru = "sip:support1@$xavp(ra=>domain):5060"; xlog ("Pseudo destiantion is $xavp(ra=>domain)");
xlog actually does reply correctly with the value of domain, but $ru is not recognizing it as the log shows :
ERROR: <core> [resolve.c:1540]: ERROR: sip_hostport2su: could not resolve hostname: "$xavp(ra=>domain)"
On Mon, Dec 17, 2012 at 2:55 PM, Ali Jawad ali.jawad@splendor.net wrote:
Thanks Alex, now it works if I do set the $ru manually, however if I do set it dynamically it still gives destination unresolvable, I do fetch a SQL statement and row 1,1 is hostname
while($var(i)<$dbr(ra=>rows)) { $var(j) = 0; while($var(j)<$dbr(ra=>cols)) { xlog("[$var(i),$var(j)] =
$dbr(ra=>[$var(i),$var(j)])\n");
$var(j) = $var(j) + 1; } $var(i) = $var(i) + 1; } } $ru = "sip:support1@ra=>[$var(1),$var(1)]:5060";
On Mon, Dec 17, 2012 at 2:22 PM, Alex Balashov abalashov@evaristesys.comwrote:
$ru
-- *Ali Jawad
*Information Systems Manager CISSP - PMP - ITIL V3 - RHCE - VCP - C|EH - CCNA - MCSA
*Splendor Telecom (www.splendor.net)
Beirut, Lebanon Phone: +9611373725/ext 116 FAX: +9611375554
Thanks Alex, got it to work as follows :
$ru = "sip:"+$xavp(ra=>username)+"@"+$xavp(ra=>domain);
On Mon, Dec 17, 2012 at 3:33 PM, Ali Jawad ali.jawad@splendor.net wrote:
I did make it simpler as follows :
sql_xquery("cb", "select username,domain from location where
username like 'support1' " , "ra"); $ru = "sip:support1@$xavp(ra=>domain):5060"; xlog ("Pseudo destiantion is $xavp(ra=>domain)");
xlog actually does reply correctly with the value of domain, but $ru is not recognizing it as the log shows :
ERROR: <core> [resolve.c:1540]: ERROR: sip_hostport2su: could not resolve hostname: "$xavp(ra=>domain)"
On Mon, Dec 17, 2012 at 2:55 PM, Ali Jawad ali.jawad@splendor.net wrote:
Thanks Alex, now it works if I do set the $ru manually, however if I do set it dynamically it still gives destination unresolvable, I do fetch a SQL statement and row 1,1 is hostname
while($var(i)<$dbr(ra=>rows)) { $var(j) = 0; while($var(j)<$dbr(ra=>cols)) { xlog("[$var(i),$var(j)] =
$dbr(ra=>[$var(i),$var(j)])\n");
$var(j) = $var(j) + 1; } $var(i) = $var(i) + 1; } } $ru = "sip:support1@ra=>[$var(1),$var(1)]:5060";
On Mon, Dec 17, 2012 at 2:22 PM, Alex Balashov <abalashov@evaristesys.com
wrote:
$ru
-- *Ali Jawad
*Information Systems Manager CISSP - PMP - ITIL V3 - RHCE - VCP - C|EH - CCNA - MCSA
*Splendor Telecom (www.splendor.net)
Beirut, Lebanon Phone: +9611373725/ext 116 FAX: +9611375554
-- *Ali Jawad
*Information Systems Manager CISSP - PMP - ITIL V3 - RHCE - VCP - C|EH - CCNA - MCSA
*Splendor Telecom (www.splendor.net) Beirut, Lebanon Phone: +9611373725/ext 116 FAX: +9611375554
Your reference to the row, column lacks $dbr() PV encapsulation.
Ali Jawad ali.jawad@splendor.net wrote:
Thanks Alex, now it works if I do set the $ru manually, however if I do set it dynamically it still gives destination unresolvable, I do fetch a SQL statement and row 1,1 is hostname
while($var(i)<$dbr(ra=>rows)) { $var(j) = 0; while($var(j)<$dbr(ra=>cols)) { xlog("[$var(i),$var(j)] =
$dbr(ra=>[$var(i),$var(j)])\n");
$var(j) = $var(j) + 1; } $var(i) = $var(i) + 1; } } $ru = "sip:support1@ra=>[$var(1),$var(1)]:5060";
On Mon, Dec 17, 2012 at 2:22 PM, Alex Balashov abalashov@evaristesys.comwrote:
$ru
Seems the logic I used is flawed, problem is not all of the sip clients register their domain in the location table, alot of them have NULL as domain, so I need to rely on the socket column in location table to determine where to send the incoming call. Problem is I need to extract only the IP from udp:xx.xx.xx.xx:5060 , any idea on how to achieve that ? Regards
On Mon, Dec 17, 2012 at 4:13 PM, Alex Balashov abalashov@evaristesys.comwrote:
Your reference to the row, column lacks $dbr() PV encapsulation.
Ali Jawad ali.jawad@splendor.net wrote:
Thanks Alex, now it works if I do set the $ru manually, however if I do set it dynamically it still gives destination unresolvable, I do fetch a SQL statement and row 1,1 is hostname
while($var(i)<$dbr(ra=>rows)) { $var(j) = 0; while($var(j)<$dbr(ra=>cols)) { xlog("[$var(i),$var(j)] =
$dbr(ra=>[$var(i),$var(j)])\n");
$var(j) = $var(j) + 1; } $var(i) = $var(i) + 1; } } $ru = "sip:support1@ra=>[$var(1),$var(1)]:5060";
On Mon, Dec 17, 2012 at 2:22 PM, Alex Balashov abalashov@evaristesys.comwrote:
$ru
-- Sent from my mobile, and thus lacking in the refinement one might expect from a fully-fledged keyboard.
Alex Balashov - Principal Evariste Systems LLC 235 E Ponce de Leon Ave Suite 106 Decatur, GA 30030 Tel: +1-678-954-0670 Web: http://www.evaristesys.com/, http://www.alexbalashov.com/
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hi,
This might sound like a silly question, but why don't you use lookup() instead? You can pass a PV also instead of just using $ru.
Andreas
On 12/17/2012 04:40 PM, Ali Jawad wrote:
Seems the logic I used is flawed, problem is not all of the sip clients register their domain in the location table, alot of them have NULL as domain, so I need to rely on the socket column in location table to determine where to send the incoming call. Problem is I need to extract only the IP from udp:xx.xx.xx.xx:5060 , any idea on how to achieve that ? Regards
On Mon, Dec 17, 2012 at 4:13 PM, Alex Balashov <abalashov@evaristesys.com mailto:abalashov@evaristesys.com> wrote:
Your reference to the row, column lacks $dbr() PV encapsulation. Ali Jawad <ali.jawad@splendor.net <mailto:ali.jawad@splendor.net>> wrote: >Thanks Alex, now it works if I do set the $ru manually, however if I do >set >it dynamically it still gives destination unresolvable, I do fetch a >SQL >statement and row 1,1 is hostname > > > while($var(i)<$dbr(ra=>rows)) > > { > > $var(j) = 0; > > while($var(j)<$dbr(ra=>cols)) > > { > > xlog("[$var(i),$var(j)] = >$dbr(ra=>[$var(i),$var(j)])\n"); > > $var(j) = $var(j) + 1; > > } > > $var(i) = $var(i) + 1; > > } > > } > > > > $ru = "sip:support1@ra=>[$var(1),$var(1)]:5060"; > > >On Mon, Dec 17, 2012 at 2:22 PM, Alex Balashov ><abalashov@evaristesys.com <mailto:abalashov@evaristesys.com>>wrote: > >> $ru -- Sent from my mobile, and thus lacking in the refinement one might expect from a fully-fledged keyboard. Alex Balashov - Principal Evariste Systems LLC 235 E Ponce de Leon Ave Suite 106 Decatur, GA 30030 Tel: +1-678-954-0670 Web: http://www.evaristesys.com/, http://www.alexbalashov.com/ _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- *Ali Jawad
*Information Systems Manager CISSP - PMP - ITIL V3 - RHCE - VCP - C|EH - CCNA - MCSA
*Splendor Telecom (www.splendor.net http://www.splendor.net/) Beirut, Lebanon Phone: +9611373725/ext 116 FAX: +9611375554
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users