Hi,
You can check a "result" string when running the "kamctl cr reload".
Example:
1. db reload ok
# sh /tmp/kamctl_cr_reload.sh
Reloading carrierroute db...
Ready, with error code: 0
Return result:
2. failure on reload
# sh /tmp/kamctl_cr_reload.sh
Reloading carrierroute db...
Ready, with error code: 0
Return result: 500 failed to re-built tree, see log
As you see error code is always 0, but the result string returned is empty when
it reloads ok.
Just an idea.
Caio
ps: bash script embedded:
RETVAL=-1
echo "Reloading carrierroute db..."
RES=`kamctl cr reload`
RETVAL=$?
echo "Ready, with error code: $RETVAL"
echo "Return result: $RES"
On Thu, 5 Jan 2012, Uri Shacked wrote:
Hi,
i ask this not for sip affected problems. i what to load the information
from the DB.
while loading, i want the DB table to be locked for changes... i need to
know when did the loading proccess ended in order to unlock the table.....
how do i set an application to run the kamctl command and make sure the
reload ended? i understand it depends on the amount of data. that is why i
need a "return code" from the kamctl to let me know the reload ends....
any ideas?
On Thu, Jan 5, 2012 at 12:36 PM, Daniel-Constantin Mierla <miconda(a)gmail.com
wrote:
Hello,
On 1/5/12 11:03 AM, Uri Shacked wrote:
Hi,
i am using different modules like "mtree", "carrierroute",
"drouting" and
so.
how can i tell how long did the reload takes?
this is a matter of how many records are in database. Perhaps you can
count the duration of executing the reload command.
how do i know if it fails?
is there a way to get a return code from kamailio
that confirms that the
reload ended and successfuly?
It returns failure code if something does not go right while reloading.
Note that reload operations are done in a dedicated process when using
kamctl commands, so sip traffic processing is not affected.
Cheers,
Daniel
--
Daniel-Constantin Mierla --
http://www.asipto.com
http://linkedin.com/in/miconda --
http://twitter.com/miconda