01 / 11
1. Understand the call path
Server A is the sending system. Server B is the receiving system. A SIP trunk carries the call between them, and a DID entry on B chooses which inbound group receives it. This connects calls; leads, users and reports remain in their respective systems.
The destination number and caller ID do different jobs. DID 7002001 tells B where to send the call. Caller ID 12025550101 tells the receiving agent who is calling. Changing caller ID does not change the destination.
02 / 11
2. Check the SIP driver and network
This walkthrough uses chan_sip and SIP/... dial strings. Asterisk removed chan_sip in version 21. If either system uses PJSIP, use a PJSIP endpoint configuration suited to that installation; these Account Entries cannot be pasted into PJSIP.
Allow SIP signaling and the configured RTP audio range only between the two private or VPN addresses. Use the actual SIP port on each server; the examples assume UDP 5060. Read rtp.conf for the actual media range. IP-based peers below do not use a registration string or shared password, so peer matching and network restrictions are essential.
- Before you use it
- Open an authorized shell on each of your test servers. These commands inspect the running configuration.
asterisk -rx 'core show version'asterisk -rx 'module show like chan_sip.so'asterisk -rx 'sip show settings'asterisk -rx 'dialplan show trunkinbound'This example has no recorded result here. Follow its preparation, expected result and stop conditions before using it.
- Success looks like
- chan_sip is loaded, the SIP listening port is known, and the receiving context contains the installed DID-routing logic.
- Stop if
- If chan_sip is missing, a SIP command is unavailable or trunkinbound does not exist, resolve that installation difference before using the examples.
03 / 11
3. On Server B, create the receiving destination
Prepare the receiving side before adding the sending route. Menu wording can vary by VICIdial version.
- Open Inbound → In-Groups. Create or select the test group V2V_TEST and make it active.
- Open Inbound → DIDs and add an active DID whose DID Pattern is exactly 7002001.
- Set DID Route to IN_GROUP and select V2V_TEST in the In-Group field. Keep the remaining call-handling settings appropriate for your existing inbound setup.
- Log a test agent into the receiving group and make the agent available. Confirm that 7002001 has no conflicting DID entry or catch-all rule.
You should seeB now has a destination for the digits 7002001. The SIP trunk will deliver those digits to its inbound routing context.
04 / 11
4. On Server A, add the connection to B
Open Admin → Carriers → Add A New Carrier. Use a unique Carrier ID such as VICI_B, set Protocol to SIP, select the correct local server where your version provides that choice, and set Active to Y. Leave Registration String empty. Paste the following into Account Entry, then add the dialplan from step 6 to this same carrier.
The peer name in square brackets is vici-b. The host is B's address. context=trunkinbound controls calls received from this peer; the outbound destination is chosen by the Dial line later.
- Before you use it
- Replace B's private address and SIP port, and check that vici-b is a unique peer name. Restrict access to this trusted peer.
[vici-b]type=peerhost=192.0.2.20port=5060context=trunkinbounddisallow=allallow=ulawdtmfmode=rfc2833directmedia=noqualify=yessendrpid=paitrustrpid=yesThis sample is a template or reading aid, not a terminal command. There is no output to show.
- Success looks like
- The saved account defines peer vici-b pointing at B, with a codec supported by both systems.
- Stop if
- A duplicate peer name, wrong address, wrong SIP port or unsupported option must be corrected before a call test.
05 / 11
5. On Server B, add the connection to A
Add an active SIP carrier on B with a unique Carrier ID such as VICI_A. Leave Registration String empty and use this Account Entry. No outbound Dialplan Entry is needed on B for the initial A-to-B test.
B matches the sending peer by its network address and passes the received destination to trunkinbound. If your installation has a different inbound context, use the confirmed context instead. This setup assumes each peer appears from the configured private address and SIP port, without NAT rewriting them.
- Before you use it
- Replace A's private address and SIP port. Confirm B's inbound context routes DIDs and is reachable only by trusted peers.
[vici-a]type=peerhost=192.0.2.10port=5060context=trunkinbounddisallow=allallow=ulawdtmfmode=rfc2833directmedia=noqualify=yessendrpid=paitrustrpid=yesThis sample is a template or reading aid, not a terminal command. There is no output to show.
- Success looks like
- Peer vici-a identifies A; a call to 7002001 reaches B's DID routing.
- Stop if
- An unknown-peer or authentication error means peer matching needs correction. Do not open anonymous calling to bypass it.
06 / 11
6. On Server A, add the dialplan with a fixed caller ID
Paste this into the VICI_B carrier's Dialplan Entry. It matches only 887002001, so this example does not introduce a broad outbound route. Confirm that the exact extension is unused in the sending context before saving.
Set caller ID before Dial. The two Set lines choose the displayed number and name. ${EXTEN:2} removes the first two digits, 88, so B receives 7002001. The 45 in Dial is the ringing timeout in seconds.
- Before you use it
- Use your authorized caller ID, confirm vici-b matches A's Account Entry, and ensure 887002001 does not conflict with an existing route.
exten => 887002001,1,NoOp(VICIdial A to B)exten => 887002001,n,Set(CALLERID(num)=12025550101)exten => 887002001,n,Set(CALLERID(name)=VICI A Test)exten => 887002001,n,Dial(SIP/vici-b/${EXTEN:2},45)exten => 887002001,n,Hangup()This sample is a template or reading aid, not a terminal command. There is no output to show.
- Success looks like
- A sends destination 7002001 to B with the chosen number and name set on the outgoing call.
- Stop if
- If B receives 887002001, the prefix was not removed. If A uses another carrier, inspect the actual extension and loaded context.
07 / 11
Optional: preserve the caller ID already on the call
If you want to carry the existing caller ID across the connection, use this version in place of step 6. It leaves out both Set lines. Do not install both examples for the same extension.
This preserves the identity on the channel that reaches this dialplan. A campaign call may already carry the campaign's caller ID; an agent transfer may carry a different identity. Verify that the channel actually contains the customer's number before expecting it on B. A caller ID display is not proof of the caller's identity.
- Before you use it
- Replace the fixed-ID example with this one. Identify the caller ID present on the sending channel for your actual call or transfer workflow.
exten => 887002001,1,NoOp(VICIdial A to B - keep caller ID)exten => 887002001,n,Dial(SIP/vici-b/${EXTEN:2},45)exten => 887002001,n,Hangup()This sample is a template or reading aid, not a terminal command. There is no output to show.
- Success looks like
- B receives the same caller number that A had immediately before Dial.
- Stop if
- If A already has the wrong identity, fix the originating call or transfer settings; removing Set does not recover a missing customer number.
08 / 11
7. Test one call and check the result
After saving, verify what Asterisk has loaded. VICIdial commonly places carrier dialplan entries in the default context; confirm the actual context used by your test phone or campaign. These are inspection commands, not reload commands.
qualify=yes checks SIP reachability. An OK peer status does not prove that DID routing, caller ID or audio works. These IP-based trunks have no registration, so an empty sip show registry is expected.
- From an authorized test phone whose dial context reaches A's carrier route, dial 887002001. Have a test agent available in V2V_TEST on B.
- Confirm that B receives destination 7002001 and sends the call to V2V_TEST. Answer the call.
- For the fixed-ID example, compare the received number with your chosen CALLERID(num). Check the name separately on the receiving interface.
- Speak in both directions, test any required DTMF interaction, then hang up. Confirm that both call legs end.
- If the intended use is an agent transfer or campaign, repeat using that exact workflow. A test-phone success does not prove the campaign's number formatting or transfer caller ID.
- Before you use it
- Run each command on the labeled server. Substitute the verified outbound context if it is not default.
# On Server Aasterisk -rx 'sip show peer vici-b'asterisk -rx 'dialplan show 887002001@default'# On Server Basterisk -rx 'sip show peer vici-a'asterisk -rx 'dialplan show trunkinbound'This example has no recorded result here. Follow its preparation, expected result and stop conditions before using it.
- Success looks like
- The loaded peers have the intended addresses, A has the exact route, and B has the expected inbound DID-routing context.
- Stop if
- If a peer or route is missing, check the carrier's Active setting, server assignment and generated configuration before dialing.
- The call reaches the intended agent group on B.
- The received destination is 7002001 and the displayed caller number is correct.
- Audio works in both directions and the required DTMF works.
- Hangup releases both legs, and the actual transfer or campaign workflow has been checked separately.
09 / 11
Optional: allow calls from B back to A
The peer entries already describe both servers, but reverse call routing needs its own destination and dialplan. On A, create an active DID 7001001 routed to an available test in-group. On B, add the route below to VICI_A's Dialplan Entry. Then test 887001001 from B using the same checks as step 7.
A must receive 7001001 and B must receive 7002001. Keep each destination local to its receiving group; forwarding these DIDs back to the other server can create a call loop.
- Before you use it
- Create A's receiving DID 7001001, confirm the route is unused on B, and replace the fictional caller ID.
exten => 887001001,1,NoOp(VICIdial B to A)exten => 887001001,n,Set(CALLERID(num)=12025550102)exten => 887001001,n,Set(CALLERID(name)=VICI B Test)exten => 887001001,n,Dial(SIP/vici-a/${EXTEN:2},45)exten => 887001001,n,Hangup()This sample is a template or reading aid, not a terminal command. There is no output to show.
- Success looks like
- Dialing 887001001 on B sends 7001001 to A and reaches A's receiving test group.
- Stop if
- If the call returns to B or repeats, remove the reverse route and inspect both DID destinations for a loop.
10 / 11
If something does not work
Check the boundary where the call stops. Compare the actual received digits and identity with the example before changing multiple settings.
11 / 11
How to undo the test setup
Finish the test calls, then remove only the dialplan entries added for this guide and restore any changed campaign prefix. Restore the previous carrier values, or deactivate carriers created solely for this test after checking that nothing else uses them. Deactivate the test DIDs and in-groups only if they have no other users.
Wait for VICIdial's normal configuration update and inspect the loaded peers and dialplan again. Keep your original settings so you can compare the restored configuration.
Checks and sources
What was checked
- Native carrier entries, DID routing and received caller ID have not been captured for this two-server example.
- The SIP peer options were checked against the Asterisk 20 chan_sip sample configuration. The historical VICIdial configuration example documents trunkinbound and its DID-routing AGI; confirm that context on your installed version.
- These are unexecuted configuration examples. No SIP registration, native VICIdial call, caller ID display or audio test was performed for this article.
Primary references
Sources
- Asterisk 20: chan_sip sample configurationAsterisk · accessed November 9, 2026
- chan_sip removal and PJSIP guidanceAsterisk · accessed November 9, 2026
- CALLERID dialplan functionAsterisk · accessed November 9, 2026
- VICIdial historical configuration example: verify against your installed versionVICIdial source mirror (historical) · accessed November 9, 2026