[Kamailio-Devel] "kamctl fifo wrong_command" should reply Bash error (!= 0)

Henning Westerholt henning.westerholt at 1und1.de
Mon Mar 16 13:22:41 CET 2009


On Monday 16 March 2009, Iñaki Baz Castillo wrote:
> >> 500 command 'blabla' not available
> >>
> >> but $? is 0.
> >>
> >> I think the script returned code should be an error (i.e. 1). Opinions?
> >
> > Hi Iñaki,
> >
> > sure, this would be great. I also thought about this in the past and
> > spent a bit time on it. A problem is that the structure of this control
> > scripts are a bit convoluted. :-) The output is processed by some stages,
> > the kamctl imports some helper, the actual execution happens in
> > kamctl.fifo, the helper .base runs this filter_fl (AWK stuff) on the
> > output..
>
> Basically it the MI reply is [3456]XX then the script should reply !=
> 0. I expect that "kamctl fifo" gets the final reply as a single string
> so parsing the first value of the string to match [3456]XX should be
> feasible. Am I right?

Should be work for most of the cases. It seems that the error code is always 
the first, so it should be even work when some modules output multiple lines.

Cheers,

Henning



More information about the Devel mailing list