I am having exactly the same problem here and it’s driving me mad. I think I have figured out what the cause of the problem but have yet to solve it. I am not an expert on Asterisk or FreePBX, so don’t take anything as gospel, but this is what I’ve been able to piece together by looking at the problem for a couple of days.
Basically the problem is that asterisk uses a script called dialparties.agi to determine what you really mean when you enter an extension (i.e. pressing 1000 might be a ring group that rings 10 different phones). This information is stored in an internal asterisk database-like thing (which may or may not be an actual relational SQL database, I haven’t been able to figure that out yet) which is seperate from the freePBX “asterisk” database.
If you debug the call, I’m almost positive you’ll see a line like this…
[code:1]
Executing NoOp(“SIP/101-081e2258”, “Returned from dialparties with no extensions to call”) in new stack
[/code:1]
where SIP/101-081e2258 is the extension you dialed from (101 on my testing setup). This means that Asterisk asked dialparties.agi to interpret the dialed string and it returned nothing. I’ve spent considerable time debugging this and it seems like this line in dialparties.agi…
[code:1]
$device = $agi->database_get(‘AMPUSER’,$device_str);
[/code:1]
is the culprit. The result of this call to asterisk database is blank. Or, more accurately, an array with no values. If you do the same exact thing after doing a save changes to the extension through freePBX, you’d get something more meaningful back (the extension number in the simple case).
The problem is that even though freePBX’s database is right, and Asterisks configs are right (I rsync them off of the live server every half hour in my case, I’m sure you do something comparable), the internal asterisk database is not correct. It does not have entries for the extensions that have not gone through the save/apply routine. And as far as I’ve been able to tell save/apply is the only way to get freePBX to either a) rebuild asterisks internal database, or b) tell asterisk to rebuild its database on its own. I don’t know for sure who is “in charge” during that process, so it could be either asterisk or freePBX that actually performs the update.
The solution that I think both of us require is some way for the failover script to tell the newly live asterisk server to rebuild its database based on the freePBX mysql database, essentially the equivalent of saving and reloading all extensions.
Sadly I haven’t figured out how to do this. Hopefully someone can help.