Setting Account Code on Extensions Causing Outbound Calls to Fail

For some reason, when I set an account code on an extension, outbound calls from that extension begin to fail.

In debugging this, I am seeing:
[2023-03-02 10:14:12] WARNING[26822][C-00001f13]: pbx.c:4504 __ast_pbx_run: Channel ‘SIP/4025-00000b4e’ sent to invalid extension but no invalid handler: context,exten,priority=queuedial,+1214970XXXX,1

Not sure what “queuedial” is, but could someone point me in the right direction?

Thanks.

My wild guess is that you accidentally altered the context of the extension when you changed the account code. It should be from-internal.

Hi Lorne-

I can confirm, the context of the extension is still set to from-internal. The only change I made was from the FreePBX GUI, Extension > Advanced > Account Code

Thanks for your help!

Bump.

The accountcode setting in Extension > Advanced is for the channel driver setting. In this case chan_sip. It has nothing to do with the error you are getting.

sent to invalid extension but no invalid handler: context,exten,priority=queuedial,+1214970XXXX,1

That error above means that there is no match to +121470XXXX in the context queuedial. Has nothing to do with the accountcode being set on a chan_sip peer.

Interesting… however, the moment I remove the account code from the extension, outbound calls from the extension work again.

Just for additional context, I am setting an account code on the extension level to allow Asternic Call Center Stats to track outbound phone calls: https://www.asternic.net/docs/knowledgebase/track_outbound/

Any additional help would be appreciated, I’m stumped…

Then you need to show some actual debugs as you are using a third party application and Asternic is having the issue. It very well could be that if it detects an accountcode then do X and there could be an issue with X. So we’ll need to see what is happening on a failed call in the logs.

Providing Great Debug - Support Services - Documentation (freepbx.org)

Hi Tom,

Does this Asterisk output help?

https://pastebin.com/9aD7hFAi

Yup, I take it the accountcode was set on this? Here’s the issue:

Executing [s@macro-dialout-trunk-predial-hook:13] Goto("SIP/4023-000010d8", "queuedial,+1214970XXXX,1") in new stack
Goto (queuedial,+1214970XXXX,1)

Let’s see the dialplan for the queuedial context and confirm there’s a match for that.

1 Like

Thanks, Tom. Excuse my ignorance here but what is the best way to locate the dialplan for that specific context?

Go into the Asterisk console via SSH and do this:

dialplan show queuedial

What is the account code characters you are putting in the field?

https://pastebin.com/B30njDZg

I’m just using “outbound” for the account code.

Do you have a queue in FreePBX with the name “outbound”? Do you use failover trunks?

So does this accountcode you are using start with a plus (+) as in +1214970XXXX is the accountcode?

Hi @comtech – There is no call queue in the system named “outbound” and we do use failover trunks from an Outbound Routes standpoint.

Hi @BlazeStudios – the account code I am using is just “outbound”, so no + in the account code is present.

Did you account for this in the setup instructions? Based on the code snippet, I don’t think you did the below step.

Also, this context has the limitation of not following failover trunks. If your configuration depends on failover trunks, do not use this macro for tracking outbound calls, but use instead this one: extensions_custom_asternic_outbound_freepbx_failover.conf

How to track outbound calls on a FreePBX/Issabel based system (asternic.net)