[SR-Users] Startup Route in Kamailio
Daniel-Constantin Mierla
miconda at gmail.com
Mon Oct 12 15:05:31 CEST 2015
Hello,
see the discussion started by:
http://lists.sip-router.org/pipermail/sr-users/2015-October/date.html
With old versions, you can try with next example at the top of request
route:
if($var(do) == 0) {
lock("start");
if($sht(do)==0) {
$sht(do) = 1;
$var(do) = 1;
} else {
$var(do) = 2;
}
unlock("start");
}
if($var(do)==1) {
$var(do) = 2;
# do here the one time operations
}
Cheers,
Daniel
On 08/10/15 10:00, Sunil More wrote:
> Hi All,
>
> I am new to Kamailio world. I am trying to initialize some details at
> Kamailio startup, this requires some database queries from a few tables.
>
> I have read about the htable event, however sql queries are not
> working in this route.
> I have come upon following errors. Please suggest a solution for this.
>
> Route used:
>
> event_route[htable:mod-init] {
> xlog("L_INFO", "********Initailising the startup route ******\n");
> sql_xquery("cb","SELECT id, media_server_port, name FROM domains","ra");
> }
>
> error :
>
> Oct 8 13:28:32 P172 /usr/local/kamailio/sbin/kamailio[28735]: INFO:
> <script>: ********Initailising the startup route ******
> Oct 8 13:28:32 P172 kamailio: ERROR: <core> [daemonize.c:303]:
> daemonize(): Main process exited before writing to pipe
>
>
>
>
>
> Thanking You,
> Sunil More
> Ph : 9503338275
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Book: SIP Routing With Kamailio - http://www.asipto.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20151012/36323d21/attachment.html>
More information about the sr-users
mailing list