vicigeeksimple guides
Browse
Telephony

Carriers & SIP · Integrations · VICIdial to VICIdial

Connect two VICIdial servers: SIP trunk, dialplan and caller ID

Send a call from one VICIdial server to another. Follow a simple SIP trunk example, route the call to an inbound group, and choose whether to set or preserve caller ID.

Start the guide

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.

Example values used throughout this guideScroll sideways to compare columns
SettingExampleMeaning
Server A192.0.2.10Sending server; documentation placeholder for its private/VPN address
Server B192.0.2.20Receiving server; documentation placeholder for its private/VPN address
Peer on A / peer on Bvici-b / vici-aNames of the two SIP connections
DID on B7002001Internal destination; a purchased telephone number is not required
In-group on BV2V_TESTReceiving queue with an available test agent
Access prefix on A88Two local routing digits removed before sending to B
Number dialed on A88700200188 + 7002001
Example caller ID12025550101Fictional test number; replace for your deployment

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.
Read-only checks — run on both servers
asterisk -rx 'core show version'asterisk -rx 'module show like chan_sip.so'asterisk -rx 'sip show settings'asterisk -rx 'dialplan show trunkinbound'
Reader-run example · not executed for this guide

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.

  1. Open Inbound → In-Groups. Create or select the test group V2V_TEST and make it active.
  2. Open Inbound → DIDs and add an active DID whose DID Pattern is exactly 7002001.
  3. 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.
  4. 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.
Server A — Carrier Account Entry
[vici-b]type=peerhost=192.0.2.20port=5060context=trunkinbounddisallow=allallow=ulawdtmfmode=rfc2833directmedia=noqualify=yessendrpid=paitrustrpid=yes
Not executed · worksheet or reference text

This 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.
Server B — Carrier Account Entry
[vici-a]type=peerhost=192.0.2.10port=5060context=trunkinbounddisallow=allallow=ulawdtmfmode=rfc2833directmedia=noqualify=yessendrpid=paitrustrpid=yes
Not executed · worksheet or reference text

This 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.
Server A — Dialplan Entry, fixed caller ID
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()
Not executed · worksheet or reference text

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.
What the caller ID settings doScroll sideways to compare columns
SettingPurpose
CALLERID(num)Sets the caller's number on the call before dialing B.
CALLERID(name)Sets the caller's name; the receiving phone or agent screen may display it differently.
sendrpid=paiSends identity using a SIP P-Asserted-Identity header.
trustrpid=yesAllows identity supplied by the matched trusted peer to be used.

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.
Alternative Dialplan Entry — preserve existing caller ID
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()
Not executed · worksheet or reference text

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.

  1. 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.
  2. Confirm that B receives destination 7002001 and sends the call to V2V_TEST. Answer the call.
  3. For the fixed-ID example, compare the received number with your chosen CALLERID(num). Check the name separately on the receiving interface.
  4. Speak in both directions, test any required DTMF interaction, then hang up. Confirm that both call legs end.
  5. 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.
Inspect the peers and route before calling
# 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'
Reader-run example · not executed for this guide

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.
Server B — optional reverse Dialplan Entry
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()
Not executed · worksheet or reference text

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.

Common symptoms and the first thing to checkScroll sideways to compare columns
SymptomFirst check
Peer is UNREACHABLEPrivate/VPN reachability, SIP listening port, firewall and the address/port seen by the receiver.
Unknown peer or authentication failureThe matching peer's host/port and chan_sip configuration. Do not enable guest access as a workaround.
No route or extension not found on AThe exact digits 887002001, the phone/campaign context, and whether the carrier route has loaded.
B has no matching DIDB should receive 7002001. Check prefix removal, DID Pattern, Active and inbound context.
B reaches the wrong group or no agentDID Route, selected In-Group, conflicting DID rules and the test agent's availability.
Caller ID is missing or wrongA's channel identity before Dial, later overrides, the SIP From/PAI headers and B's trusted peer settings.
Call answers but audio is one-way or silentRTP routing and firewall rules, advertised media addresses, matching codec and directmedia=no.
Test phone works but campaign/transfer failsThe actual generated extension, duplicate prefixes, country-code additions and identity on that call leg.

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

  1. Asterisk 20: chan_sip sample configurationAsterisk · accessed November 9, 2026
  2. chan_sip removal and PJSIP guidanceAsterisk · accessed November 9, 2026
  3. CALLERID dialplan functionAsterisk · accessed November 9, 2026
  4. VICIdial historical configuration example: verify against your installed versionVICIdial source mirror (historical) · accessed November 9, 2026