Summary:ASTERISK-23178: devicestate.h: device state setting functions are documented with the wrong return values
Reporter:Jonathan Rose (jrose)Labels:
Date Opened:2014-01-22 11:20:26.000-0600Date Closed:2014-02-04 13:50:01.000-0600
Versions:SVN Frequency of
Description:Numerous functions in devicestate.h involving the setting of device state are currently documented with incorrect return values.  The principle culprit is that ast_devstate_changed_literal is documented with the following return codes

-1 = failure
0 = success

In reality, it returns 1 unconditionally. This has a cascading effect because the other ast_devstate_changed/ast_device_state_changed functions are usually just wrappers around ast_devstate_changed_literal.

I haven't checked to see if this is a problem in earlier versions of Asterisk yet.
Comments:By: Richard Mudgett (rmudgett) 2014-02-04 13:37:52.843-0600

ast_devstate_changed_literal() is one of those functions that nothing cares about the return value.  The callers that do use the value just pass it on to their callers and still nothing cares about the return value.