How to reset "ExtensionState: -1"?


under which circumstances does an extension have ExtensionState: -1 ? how can i reset all extensions to ExtensionState: 0 from the command line ?

kind regards

When there is no hint for it.

e = ast_hint_extension(c, context, exten); /* Do we have a hint for this extension ? */ if (!e) return -1; /* No hint, return -1 */
You probably cannot add a hint from the cli.

hi again,

i am not a coder, no clue what that code means. however, i explain a bit more about my scenario when i have that problem and hope someone can point me in the right direction.

i have 2 servers. one is the normal operational server the 2nd the backup. both are “PBX In A Flash” servers and use freepbx for configuration and a2billing for billing the customers. i have a dump of the relevan mysql databases every 30 minutes. also all relevant config files which are not created by freepbx as well as /var/spool/asterisk are backed up. in this way i can replicate the server to a state of max 30 minutes before an unwanted event. during a test i have noticed that all works well except that all extensions have the “ExtensionState: -1”. calls would go out and all fine but incoming calls would end up on the voicebox. the only way around that problem so far was to click the “submit” button in each extension in freepbx and then “apply” the changes. in that way all extensions would be “ExtensionState: 0” (idle) and all is fine. this solution to the problem is not practical in the long run since the number of extensions will grow much larger. i am wondering how i can solve that without the web-interface or otherwise how i can backup the extensionstate from the operational server.

to get an understanding of “hints”, is this the correct explanation of what hints are for? … Priorities

kind regards

That is the sort of “hint”.

What is the version of asterisk you are running, This was an issue some time ago, Im sure its sorted now, or atleast ive not seen any issues with customers.


hi ian,

its version


hmmm… wondering if anyone has a clue ?! would highly appreciate any help here.


1.4.21 is rather old.

What have you done to eliminate the possibility that you are dealing with a problem that is fixed in

Note that -1 isn’t a real extension state, it is an error return whilst trying to find the state, so, with the current code, it means that the hint for that extension is missing (Asterisk doesn’t know which device corresponds to the extension number). The alternative is to -1 is not specifically 0, but any valid state.

Does the CLI show that the hints are present?

If you read the database directly, are the hints stored in it?

If so, after backup, are they present in the backup database?

Has this feature request ever been implemented - - I see no relationships against it, so it may well be the case that the functionality you want still doesn’t exist.

hi again,

i don’t know any of the “internals” of asterisk as such. i only know that my problem is solved after submitting settings for each extension and applying the changes after. all this is in the web interface of freepbx. if i restart asterisk or do a reload on the command line it does not help. the “hint” is not stored in mysql as far as i can see. i would also conclude to that since the dump would include that and the same dump is used to create the new database tables in the backup server. i assume to wonder about how freepbx is “updating” asterisk config on the fly is not a subject for here. i was simply hoping there is something i can do on the command line to reset all extensions to ExtensionState: 0. if i do asterisk -rx “show hints” on the command line i see “Unavailable” for those extension which show “ExtensionState: -1” in the logs when i try to call them.

regarding the last paragraph you wrote. i am not saying this is a bug, i have far to little experience and knowledge with asterisk to come to such a conclusion, hence using PBX in a Flash. i simply assumed there must be a way to make asterisk aware of an extension being ready to receive calls. freepbx does it somehow in the way explained above. if there is no way i have to approach this entirely different and focus on scripting the automated use of the webinterface. i just liked to avoid that cause i think that is not the ideal solution.

thanks for your time david55