Call to the outside via a Cisco Call Manager trunk

Hello everyone,
I have created a trunk between a FreePBX IPBX and a Cisco Call Manager. Apparently everything is fine but my concern is that my FreePBX users can’t call outside via the Call Manager. When I initiate a call, the error message is: “Service unavailable / Your call cannot be completed as dialed”.
Thank you for your assistance.

That’s a very generic error. You need the sip protocol logs (“pjsip set logger on” or the equivalent for chan_sip), and possibly also logs from the Cisco Call Manager.

Hello to all,
Thanks David for your answer.
I checked but I don’t see anything special in the logs. But I wonder if there is not a rule to configure that allows the Cisco call manager to route calls from the FreePBX to the outside.

This likely falls on the Call Manager end regarding security. Check the PSTN trunk configuration to see if it allows the FreePBX trunk to tandem to it through the call manager. Trunking in Call Manager is extensively covered in their administration guide: Cisco Unified Communications Manager System Guide, Release 10.0(1) - Cisco Unified Communications Manager Trunk Types [Cisco Unified Communications Manager (CallManager)] - Cisco

Thank you for your contributions.
I’ve read the documentation but I really can’t get it right.
I also set up a trunk to a Yeastar GSM gateway but it’s the same result. It seems to me that the problem is on the FreePBX side. Here is the error message when I want to call outside whether it is via the Cisco Call manager trunk or the Yeastar GSM gateway:
ERROR[87804] res_pjsip_header_funcs.c: No headers had been previously added to this session.

FreePBX is lazy and calls the SIP and PJSIP header functions without even checking whether the channel is of one of those types. I believe this is not a real errors message for FreePBX.

In the GSM Gateway logs, I have the following error:
NOTICE[1723] chan_sip.c: Call from ‘’ to extension ‘0102xxxxxx’ rejected because extension not found.

Where did a GSM gateway come into this?

chan_sip is deprecated.

Extension not found is a fairly straightforward error, as long a you understand that FrePBX DIDs are considered, by Asterisk, to be extensions.

There is not enough context here for me to be sure whether this is trunk or extension originated, and I thought the message named a context, and other things, not just the extension.

				ast_log(LOG_NOTICE, "Call from '%s' (%s) to extension"
						" '%s' rejected because extension not found in context '%s'.\n",
						S_OR(p->username, p->peername), ast_sockaddr_stringify(&p->recv), decoded_exten, p->context);
					sip_report_failed_acl(p, "no_extension_match");

Which version of Asterisk are you using?

I use FreePBX with asterisk-18.13.0

That also has the context in that message.

In fact, the error message is on the GSM gateway side. As a reminder, I have created a trunk with a GSM gateway to send and receive calls to and from the outside. I think that the calls sent from the FreePBX IPBX reach the gateway but it is the gateway that cannot route these calls to the outside. The GSM gateway is looking for the number internally when it should be routing the call to the outside (the telephone operator).

The message you quoted pretty much has to have been produced by Asterisk. Is the gateway running an ancient version of Asterisk? It presumably means you either sent an invalid number to the gateway, or the gateway is misconfigured.

As I hinted earlier, Asterisk, which is what the gateway is clearly running, uses “extension” differently from FreePBX. All incoming call legs go to an extension, in Asterisk terms, FreePBX may call them extension, virtual extensions, DIDs or outgoing routes, but to Asterisk they are all extensions.

As such the error message basically just means the number isn’t in an acceptable format. As it appears to be running Asterisk, you should be able to look at its extensions.conf to see what formats it is expecting. Hopefully it is a lot smaller than FreePBX’s.

Hello to all,
Thank you for your various contributions. I found the solution concerning the communication to the outside via the GSM gateway. In fact, I had made a mistake in entering the IP address of the gateway in the SIP trunk settings. I corrected the error and it works. However, the problem remains with the Call Manager.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.