Inbound calls get truncated to 2 digits

My Asterisk box is being set up to connect to a legacy PBX model NEC NEAX2000 IPS via T1 PRI. Dial in and dial out run fine except that the incoming calls get truncated to 4 digits. For example from an extension on the NEC side the dial out prefix code toward the Asterisk is 44, then the Asterisk extension 5120. So the string 44-5120 is dialed, the 44 gets stripped and 5120 gets sent toward the Asterisk, which only receives 51 with the ending 20 missing.

If on the Asterisk side a 2-digit extension is defined, for example 19, then dialing 44-19 from the NEC side reaches that extension fine.

The NEC side was known to have a correct dial plan because it could dial to the previous version of this Asterisk box, which was just being rebuilt from scratch.

“Pri intense debug span 1” also showed that only 2 incoming digits were received. So my question is: how can I trace which dial plan and commands are being used by Asterisk when receiving the inbound string?

So far testing had been done only on internal extensions, no attempt made yet to receive incoming calls from outside. Initially no inbound route was defined on the Asterisk side, this was left to default settings.

It’s Asterisk 1.4.24, FreePBX 2.5.1.2 running on CentOS 5.3 linux kernel 2.6.18.

Thanks in advance for reviewing my setup!

Below is the chan_dahdi.conf

and the relevant contexts from extensions.conf

Try with overlapdial=yes in chan_dahdi.conf

Dear shmaize,

Thank you for your reply. This was tried too with no change.

But in the meantime further testing was done and it is very likely that the problem comes from the setup on the NEC side. So we are checking into that too because the data gathered so far have been contradictory. I am getting help from a colleague who knows how to navigate in the NEC maze.

The problem does sound like its on the other PBX’s side. On our Avaya PBX there are some settings for adding and removing digits through the routing process.

Basically, you call ext 6666 it adds the Routing Pattern number defined in the Uniform Dialplan on the Avaya. Now the number is 1236666 which tells the Avaya to use Routing Pattern 123. Routing Pattern 123 is setup to remove 3 digits before sending it out the trunk to Asterisk. Asterisk sees the number as 6666.