Multiple Outgoing Phone Numbers


I’m trying to use this phone number on my FreePBX installation. I can receive calls but I have issues with outgoing calls.

I currently have two phone numbers on this system. I have one UK number with one provider and a US number with another.

I can make outgoing calls via the UK number but I am unable to make outgoing calls with the US number. I receive the following message from FreePBX: “All circuits are busy now. Please try again later”.

I only want it so by default, all extensions on the system will call via the UK number but specific extensions will call via the US number. I have tried setting the callerID for the extension I want to use the US number but to no avail.

Any help would be greatly appreciated. Thank you all!

1 Like

It is also worth noting that in in Asterisk Info > Channels the trunk shows as online.

I assume you are using VoIP, as I don’t think it is possible to get a UK analogue line in the USA or v.v. If so which channel driver are you using.

You will need to provide an extract of /var/log/asterisk/full covering the failed call. Be careful in redacting it that it is still possible to distinguish between different addresses, and between types of address.

It is almost certain, in this case, that you will need to capture detailed SIP protocol logging, which means using the CLI command “pjsip set logger on”, before capturing the logs. If using the deprecated driver, this is “sip set debug on”.

The voice announcement doesn’t provide enough information to be useful for debugging.

US providers are particularly likely to insist on your using the correct caller ID.

Thanks for your reply. Yes, this is using VoIP.

The pastebin link below contains the log for that call which errors.


177. [2023-03-09 14:25:54] VERBOSE[13770][C-00001568] app_dial.c: Called PJSIP/@Voxtelesys
178. [2023-03-09 14:25:55] VERBOSE[13770][C-00001568] app_dial.c: Everyone is busy/congested at this time (1:0/0/1)
179. [2023-03-09 14:25:55] VERBOSE[13770][C-00001568] pbx.c: Executing [[email protected]:35] NoOp("PJSIP/2002-00000f74", "Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 38") in new stack

Cause 38 is “network out of order, likely to be long term”. I’m not sure if that includes no route to host and DNS lookup failures, but you definitely need to use “pjsip set logger on”, to see if this indication is coming from the remote end.

Although it could have failed exactly on the second, the time stamp difference suggests a DNS lookup failure, or a remote rejection.

However it is already broken here:

137. [2023-03-09 14:25:54] VERBOSE[13770][C-00001568] pbx.c: Executing [[email protected]:15] Set("PJSIP/2002-00000f74", "OUTNUM=") in new stack

OUTNUM should not be empty. I suspect there is an error in your outbound route that is replacing the number with nothing.

I use Sangoma’s own one, as the adverts get in the way of quickly looking up things in the Ring of Saturn one.

Thank you all for your replies. I appreciate it a lot.

I did run that command. Would it be hidden since I followed Asterisk Logs - Part II not just copying the whole log?

That’s strange as I do have the caller ID field set with the phone number in both the trunk and outbound route.

Maybe this is due to how I’ve setup my extensions to use the US number. The way I did this for my US extension was to change Outbound CID to just be the US number. Would you recommend another way to do this?
Currently this is on extension 2003. However, Would it be easier if I was to have for example every extension which is 12xxx (for example 12003) was configured to use the US number outbound and everything which isn’t that is served by the UK number (for example 2000)?

OUTNUM is the number being called, after processing the outbound route definition, not the caller ID.

Ah, that’s strange.

I don’t think I am stripping it anywhere. I’ll have a look though.

Do you have any ideas where this could be occurring?

@david55 - I think I’ve solved that issue. However, when making calls via the US number, it seems to be calling the main line (as if anyone was calling that number) not the number I tried to call.

I think one would need to see your route definitions to understand what is going on.

Further, I think one would need to see your full logs to understand what is going on.

What do you mean by this, sorry.

Sure, here is the whole logfile.

I’m calling from extension 12000

Line 1005 says it all, i.e. that route on that connected trunk says it is broken., double check you trunk and if you need to, also check with your provider.


I think I’m having a issue with extension 12000 not using the correct outbound route.


You have no prepend and no match pattern, so nothing will end up in the destination number. I think all your patterns should be in the third column, not the second.


I think you think this is a pattern match when it is actually an output value. You need 12000 in the caller ID field for all the dial patterns, not just the second one.

Incidentally, it seems to me that the GUI should reject a match rule that can never produce any output, as I cannot think of a legitimate use.


Thank you all for your help!

Thanks to @dicko, I’ve managed to get all outbound calls who are within the US to go out via the US number.

I’m wondering at the moment if it is possible for an extension to always use the US number, since at the moment. all calls who are outside of the US are handled by the UK number.
I’d like to have for all extensions which start with 12XXX (for example extensions, 12000 or 12028) to make outbound calls using the US number whereas all extensions which do not start with a 1 (for example extensions, 2000 or 2082) is handled by the UK number by default but if US then it’ll use the US number (as already configured).

Here’s my current outbound route for the US number.

Thanks everyone!

The reason why I want this is so that users have the ability to use the US number if they want to for any just by using a different extension.