How to "connect" a trunk to a specific inbound route?

I’m quite new to VOIP.

I first was under the impression that connecting a specific trunk to a specific inbound route would be something easy to do, but it seems that it is not the case…

I just want that all calls coming from a specific trunk (Trunk A) to be processed by a specific Inbound Route (IB-1).

There is a lot of theads about similar things, some explaining how to change the CID, but I still believe that there is a simple solution ?

Advices from more advances users would really be appreciated.



Use Tools / Config Edit to change zapata.conf and zapata-channels from context=from-pstn to context=from-zaptel

Set up the Zap Channel DIDs to the extension used by outside the PBX.

Then set up your Inbound Routes to that DID Number with the check in CID Priority Route.

You can set the CID name prefix.

Set the Destination - Extension.

The system must be restarted for this to work. amportal restart

When we register a trunk, the register String syntax is supposed to be:

login:[email protected]:5080/DIDnumber.

where DIDnumber is an optional field usefull to forward incoming calls to the right extension.

If it works well, it should be the answer to my need.

He you ever worked with this ?

Thanks for helping,


when I first hooked up the FreePBX, I used it that way. I had two zap lines and just two extensions. My FreePBX system was (and still is) inside another older PBX. By default it worked in catchall mode, I had to get help to change it.

I don’t know if that is the syntax, but if you say so. I will look for that log.

What should I look at in order to debug (or to see what is going on “inside” ?

I thought it would be simpler that way (using the register string), but if not, could you explain to me what are ZAP channels ?

Thanks again,


I use:

tail -f --lines=500/var/log/asterisk/full


Asterisk –rvvvv (the “v” depends on the level of verbosity you need)

Take a look at Troubleshooting Tools on page 175:

Perhaps you should explain what parts and software are in your system.

ZAP channels – The Asterisk Zap Channel Module provides an interface layer between Asterisk on the one side, and the Zaptel interface drivers on the other side. These drivers, in turn, provide the ability to use interface cards to connect your PBX to traditional digital and analog telephone equipment:

Asterisk <–> <-> zaptel.ko (kernel) <-> device driver <-> Zaptel device <-> Phone/switch/PSTN
ZapBarge – ZapBarge(channel) Lets you listens to the conversation on a specified Zap channel. Multiple people can all use ZapBarge to listen in on the same channel.

Zaptel – This is the hardware driver for the interface card that connects telephone lines and/or telephone handsets to your PBX. The Ringdale PBX uses the Digium Digital Interface Cards. The Zaptel project has been renamed ‘DAHDI’.

I’m using a Elastix 2.6.18, FreePBX, I need to recive Call from a
SIP Trunk(4006312889 ), when call in it will transfer to extension No. 801.
My setting as follow:

Trunk setting:
Trunk Description:4006312889
Outbound Caller ID:4006312889
CID Options: Allow Any CID
Maximum Channels:10
Disable Trunk: —
Monitor Trunk Failures: ----

Outgoing Dial Rules
Dial Rules:----
Dial Rules Wizards:----
Outbound Dial Prefix:----

Outgoing Settings
Trunk Name:4006312889
PEER Details:

Incoming Settings
USER : ----
USER Details: ----

Register String:

Incoming Route setting:

DID Number:4006312889
Caller ID Number:----
CID Priority Route: check

Alert Info:----
CID name prefix:Agency
Music On Hold:acc_1
Signal RINGING:----
Pause Before Answer:----

Privacy Manager:No

Fax Detect
Detect Faxes:No

CID Lookup Source


Set Destination
Extensions: <801> 801

I believe there are somthing mistake, because incoming call from 4006312889 trunk,still go to the IVR as any other incoming call.
Please show me how can I fix this problem.

Many Thank’s