[SR-Users] Kamctl reload commands

Daniel-Constantin Mierla miconda at gmail.com
Mon Jan 9 11:18:14 CET 2012


Hello,

On 1/5/12 12:22 PM, 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?
all the fifo commands return on the first line a status code and phrase, 
similar to sip reply. Only in the case of '200 OK', kamctl skips the 
first line and prints the rest. Since most of reload commands don't 
return anything else but the first line, you don't see anything in the 
terminal

You can edit filter_fl in kamctl.base and remove the line:

NR == 1 && /^200 OK/ { next }

then it should print the status code, which can help you detect when the 
command ended.

Cheers,
Daniel

>
> On Thu, Jan 5, 2012 at 12:36 PM, Daniel-Constantin Mierla 
> <miconda at gmail.com <mailto:miconda at 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://www.asipto.com/>
>     http://linkedin.com/in/miconda -- http://twitter.com/miconda
>
>
>
>
> _______________________________________________
> 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://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20120109/be3a8d09/attachment-0001.htm>


More information about the sr-users mailing list