Calls Routing – VitalPBX Wiki https://wiki.vitalpbx.org Learn how our latest VitalPBX version will enhance your business communication Sat, 16 Dec 2023 15:58:32 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.3 https://wiki.vitalpbx.org/wp-content/uploads/2023/11/cropped-vitalbpxwikiicon-8-32x32.png Calls Routing – VitalPBX Wiki https://wiki.vitalpbx.org 32 32 Trunks https://wiki.vitalpbx.org/wiki/calls-routing/trunks/ https://wiki.vitalpbx.org/wiki/calls-routing/trunks/#respond Wed, 08 Nov 2023 14:27:31 +0000 https://wiki.vitalpbx.org/?post_type=docs&p=417 You now have internal communication between extensions, and with NAT Settings and your firewall configurations, you can connect from anywhere. Now, we will need to connect with the outside world. This can be done by configuring Trunks. Trunks are connections between VitalPBX and VoIP providers or other PBX/VoIP systems.

We must go to PBX > Calls Routing > Trunks to start your trunk configurations.

Here, you can create as many trunks as you need. We will not go through all the fields that the trunk configurations have, as you can leave most of them by default unless it is required by the other PBX or VoIP operator.

First, we will go through the most basic requirements to connect with another PBX/VoIP system.

Note: Remember, with VitalPBX 4 and onward, we have deprecated the SIP
protocol. This is due to SIP no longer being supported. PJSIP is now the main
protocol used. PJSIP is completely backward compatible with SIP trunks. Even if
your VoIP Provider uses a SIP trunk, you can easily connect that SIP trunk with a
PJSIP trunk.

The first step we need to do is to select the technology for this trunk. This can be found in the first section at the top. With VitalPBX 4, we can choose between PJSIP, IAX2, or Custom. Most of the trunks you will create will be using PJSIP. IAX2 trunks can be used when connecting two Asterisk-based systems, and Custom can be used to connect with other protocols, like H323, for legacy PBX systems. For now, select PJSIP.

Next, you will need to enter a Description. This can be anything to identify the trunk. The other field you can configure from here is the Caller ID Name and Number used for this trunk, under Trunk CID. You can use this to Overwrite the External CID from an extension when dialing out through this trunk. Under Overwrite CID, you can choose between Yes, to overwrite the CID always, No, so the CID is not overwritten, or If Not Provided, when an extension or module does not have an External CID.

Trunks can also be enabled or disabled at any time. This way if you want to turn off a trunk without deleting it.

You can leave the rest of the fields for this first section with their default values. For the time being.

Optionally, some additional options you can configure are as follows.

  • Class of Service – We will look more in-depth about this later, but this is used to
    control the outgoing calls through this trunk.
  • Simultaneous Calls – The number of simultaneous calls that can go through this
    trunk.
  • Get DID and Get CID From – The header from where you will retrieve the DID or CID
    information.
  • Dial Prefix – A prefix number that is automatically added if needed at the beginning of
    the number you are calling through this trunk.
  • Calls Recording – This will record all the calls going through this trunk. Please note
    that enabling call recording in multiple stages of the call, i.e. Extensions, Routes, and
    Trunks, will generate duplicates of recording

Most of these can be left with their default values, and are changed only if the remote system requires it.

With everything set in the first section, we can go to the General Section. Here, is where all of our connection configurations will go. From here, we first enter a Local Username. This username is mostly for identification, but keep in mind that if you are connecting to another PBX system that requires authentication, this will be the username you need to enter in that system. If you are using User Authentication in the remote system, you will also need to enter a Local Secret as well.

Next, we enter the Remote Host. This is the IP Address or FQDN for the system we wish to connect with. The Remote Port is optional and is used only if the port for the connection is different in the remote system. When left blank, the default port will be used, i.e. 5060 for PJSIP.

Then we have Contacts and Match. These are the PJSIP configurations needed to have a successful connection. Contact is how the remote system connects with your VitalPBX. This can be set in SIP URI format, sip:REMOTE_IP_ADDR:5060. This setting is not always needed for the connection. Match allows us to match the connection from a specific FQDN or IP Address.

This is everything you need to create a Trunk with User Authentication. You can now Save and Apply Changes.

Additional features that exist for the General Configurations and Outbound Registration are optional and are only modified if required by the remote system.

If you require entering a header that is unavailable via the GUI, you can head over to the Advanced Tab and enter any custom header with their respective values.

Once again, explaining all the options for PJSIP would go out of scope with this manual and guide, but they are here if you understand what is required by the remote system you want to connect with.

Finally, we have the Dialing Manipulation Rules. This is not required for outbound calling but allows you to manipulate the dialed number depending on the trunk. So you can use this to manipulate the dialed numbers going through this trunk.

Now you have a fully functioning trunk connecting you with another PBX system or VoIP Provider.

There is a sleuth of VoIP providers nowadays, so covering them all in a single guide would be impossible, so we created multiple blogs on our website that cover many VoIP providers we have worked with. You can check them out at the following URL, https://vitalpbx.com/?s=PJSIP.

Note: you may have noticed a lack of DAHDI, or telephony interface options for
telephony interface cards. With VitalPBX 3 and onward support for DAHDI has
been deprecated, and is no longer supported. In case you need to connect
VitalPBX with an E1, T1, FXO, or FXS interface, we recommend using a
Telephony Gateway appliance that will accept the telephony connection and
connect with VitalPBX via PJSIP trunk.

To verify the connection status of your newly created trunk, you can head over to Reports > PBX Reports > PJSIP Endpoints. Here, you can go to the Trunks tab and see the status of your trunk.

]]>
https://wiki.vitalpbx.org/wiki/calls-routing/trunks/feed/ 0
Outbound Routes https://wiki.vitalpbx.org/wiki/calls-routing/outbound-route/ https://wiki.vitalpbx.org/wiki/calls-routing/outbound-route/#respond Wed, 08 Nov 2023 14:52:35 +0000 https://wiki.vitalpbx.org/?post_type=docs&p=421 Now that you have the incoming calls dealt with, let’s move on to outgoing calls. For this, we can go to PBX > Calls Routing > Outbound Routes. Outbound Routes will allow you to place outgoing calls through a trunk.

To create your outbound route, you must add a Description to identify this outbound route. Next, we select a trunk. This can be the trunk we have created previously.

Afterward, we have the Dial Patterns. This is the heart of outbound routes. Outbound routes will identify the number you dial using these patterns, and route them through the trunk. There are three components for a dial pattern: Prepend, Prefix, Pattern, and CID Pattern.

Prepend adds the value entered to the beginning of the number you dial. So, if we add a 1 here, for example, whenever you dial a number that matches this pattern, 1 is added automatically at the beginning.

Prefix, is a number that is removed from the beginning of the number you dial. Say you want to use the number 9 to always use this specific outbound route. You establish 9 as a prefix, and dial the number with the 9 at the beginning, i.e. 913055605776. The 9 is removed and you will be sending 13055605776, which is accepted by the PBX or VoIP system the trunk is connected to.

The Pattern is the base for the Dial Patterns. With this, you establish the numbers that can be dialed. Patterns become powerful with the available variables. This way, you don’t have to configure every existing number possibility.

Here is an explanation of the available patterns and some examples of how they work.

  • X – This is any number between 0 and 9.
  • Z – This is any number between 1 and 9.
  • N – This is any number between 2 and 9.
  • . – The dot is a Wild Card that matches 1 or more digits immediately. This means that
    from the dot onward, you can have as many digits as you need.
  • ! – The exclamation mark or bang is a Wild Card that matches 0 or more digits
    immediately. This means that from the bang onward, you can have no more digits or
    as many as you need.
  • [1,2,3-9 ] – Whenever you encapsulate digits in square brackets, you establish the
    numbers that can be used in this character space. You can establish individual digits
    separated by a comma or a range of digits separated by a dash (-).
  • [a-z] – Matches the characters in lowercase. Remember, in telephony, letters are also
    valid destinations to dial.
  • [A-Z] – Matches the characters in uppercase. Again, in telephony, letters are also valid
    destinations to dial.

With these variables, let’s say we want to match all numbers that are valid in the USA. For this, we can type down the following pattern.

This pattern can be interpreted as follows. The area code (first three digits), NXX, means that the first digit can be any number from 1 to 9, and the second and third digits are any number from 0 to 9. Then, the telephone prefix (middle three digits) acts the same way with NXX. Finally, the Line Number, XXXX, makes the last four digits any number from 0000 to 9999.

This way, you now support all valid US numbers, with a single dial pattern. Now, sometimes, you need to add the country code at the beginning and the end-user might dial it or not. For this, you can support this by adding the 1 at the beginning of the pattern, i.e. 1NXXNXXXXXX. As well as adding the 1 on the prepend field so it is added automatically to the pattern without the 1 at the beginning.

Next, let’s tackle international numbers. International numbers may vary in length. So here, wild cards are of great use. We can create the following pattern to support international dialing from the USA.

In the USA we use 011 followed by the international number, including the country code, to dial internationally. So, we can use the dot wild card to support any phone number of any length. Whenever an end-user dials 011+International Number, no matter how long the international number is, the call will be routed correctly.

In the end, the Outbound Route will look like the following image.

These three specific patterns will allow users in the USA to dial Locally and Long Distance, as well as Internationally. Number patterns will vary depending on your country or where you are routing the calls, so hopefully these examples help you understand how patterns work so you can create Dial Patterns that match your numbering patterns. Remember to Save and Apply Changes.

If you have multiple patterns you can import a CSV file with the patterns. The CSV Format can be downloaded from the Download CSV Format button in the lower left-hand corner. Additionally, you can set a CID Name and Number and Overwrite the Caller ID at the outbound route level. This way, anytime a call goes through this outbound route, the CID is modified. If you enable the Intra-Company option, your extension’s Internal Caller ID is used instead of the External Caller ID. This is useful if the connection is with another PBX system, where you would like to show the Extension Number instead of a long number. Finally, you can enable Call Recording at the outbound route level. Just remember that if you enable call recording in multiple stages of a call, duplicate recordings will be created.

]]>
https://wiki.vitalpbx.org/wiki/calls-routing/outbound-route/feed/ 0
Inbound Routes https://wiki.vitalpbx.org/wiki/calls-routing/inbound-routes/ https://wiki.vitalpbx.org/wiki/calls-routing/inbound-routes/#respond Wed, 08 Nov 2023 14:41:05 +0000 https://wiki.vitalpbx.org/?post_type=docs&p=419 Now that you have a trunk created we need to be able to place incoming and outgoing calls through it, these are called routes. First, let’s deal with incoming calls using Inbound Routes.
For this, we need to go to PBX > Calls Routing > Inbound Routes.

The first thing we need to do is choose our Routing Method. There are two types of routing methods, Default and DID Range. Let’s begin with the default routing method. Next, we need to add a Description to identify this inbound route.

The default routing method identifies the DID or phone number the calling party is dialing and routes it to a destination.

You can enter a specific DID Pattern so whenever someone dials that pattern calls get routed. Adding a CID (Caller ID) Pattern will make it so only when someone with this specific Caller ID calls this DID pattern, will get routed with this inbound route. If you leave both the DID and CID pattern fields empty, this means that anyone calling any DID pattern with any CID pattern will get routed by this inbound route. This is what we usually call an Any/Any route.

The last thing we need to configure an inbound route is the Inbound Destination. This is an extension or module that can take an incoming call in VitalPBX. This can be an IVR, a Queue, a Ring Group, etc. For the example, I set it to the Boss Extension, but you can use anything of your choosing.

You can now Save and Apply Changes. If you followed the Extension creation section for this guide, you might remember that we assigned an Incoming Route to the Boss extension. You can find the list of all incoming routes in the list located in the upper right-hand corner.

We have more tools that you can use for incoming calls. We will see more of them later, but for
now, these are other configurations you can have with inbound routes.

  • Language – Voice prompt language will be changed when calling through this
    inbound route.
  • Music on Hold – You can set the MOH that plays back when calling through this
    inbound route.
  • Alert Info – This is a header that will be added to calls going through this inbound
    route. The Alert-Info header can be used for custom ringtones with endpoint devices.
  • Drop Anonymous Calls – Any call without a caller ID is identified as Anonymous.
    With this option, you can drop any call that comes without a CID.
  • Enable Recording – This will enable call recording of calls going through this inbound
    route. Again, remember if you enable call recording in multiple stages of an incoming
    call, duplicates of that call recording will be generated.
  • Privacy Manager – This feature will prompt the calling party to enter their caller ID
    information if they don’t have one.
  • Fax Detection – This will detect if the incoming call is a fax message. With this
    enabled, you can change the Detection Time in seconds and set a Fax Destination.
    Keep in mind this will add a delay to incoming calls as it will need to detect the Fax
    tones

So now, you will have an inbound route. If you connected your VitalPBX installation using a trunk with your VoIP Provider, you can try calling any number associated with that trunk to test the incoming call.

If everything matches, the call will now be redirected to the Inbound Destination.

Optionally, you can also create an inbound route with the DID Range routing method. What this method allows you to do, is to have multiple routes with a range of DIDs.

Let’s say, you have a range of DIDs that goes from 13055601000-13055601100. You want to associate the last three digits of the DIDs with extensions you have created. So, what we can do in this case is change the routing method from Default to DID Range. And for the DID Pattern, we can enter 13055601XXX. The Xs in this case means any number between 0 and 9.
We will see more about how variables work in patterns in the Outbound Routes lesson.

You will notice that instead of a single destination, we now have the Range Parameters. Here we will establish the Digits to Take. So for our example, we will take the last 3 digits from our range. Then we have Prepend and Append. Prepend will add digits before the digits we took, and Append will add them after. Let’s say our extensions go from 2000 to 2100. Since we took the last three digits from our range which goes from 000 to 100, we can prepend a 2, so the numbering matches with our extensions.

For Class of Service, we can leave the default All Permissions CoS. We will see more about Class of Service later.

With these configurations, whenever someone calls any DID from our Range, calls will be routed to the matching extension. This way, we don’t need to create an incoming route for every extension. Remember to Save and Apply Changes.

]]>
https://wiki.vitalpbx.org/wiki/calls-routing/inbound-routes/feed/ 0
Dynamic Routing https://wiki.vitalpbx.org/wiki/calls-routing/dynamic-routing/ https://wiki.vitalpbx.org/wiki/calls-routing/dynamic-routing/#respond Thu, 09 Nov 2023 13:22:42 +0000 https://wiki.vitalpbx.org/?post_type=docs&p=485 As we saw in the Extensions section, you can enable a feature called Dynamic Routing. With dynamic routing, you can create dynamic routes to connect the calling party with the extension they were speaking with. This way, if you have a caller speaking with an extension, and they hangup or the call is dropped, the next time the caller calls your business, the Dynamic Routing module will check their Caller ID information and connect them with the extension, independently if there is another route for that DID.

To use this feature, you must first enable it on the extensions under the PBX > Extensions > Extensions > Advanced. Remember to Save/Update and Apply Changes.

Once this is enabled, you can modify how the feature behaves by going to PBX > Calls Routing > Dynamic Routing.

In the General Tab, you can change the Expiration Time for how long you will keep the Dynamic Route. You can then establish the number of Digits to Match for the caller’s Caller ID number. You can then enable the ability to Delete Used Records, which will delete the dynamic route once it is used. This means that when the callers call again and are routed to the extension they were talking to the record will be deleted, and the next time they call, they will go through the normal routing. Finally, you can choose to Only Keep Missed Calls. This means that only outgoing calls that are missed by the extension will be saved to the Dynamic Routing List.

Next, we have the Dynamic Routing List. This is a table that will show you all the current dynamic routes with the caller information. You can also delete records from the Actions column.

If you made any changes here, you can Save and Apply Changes.

]]>
https://wiki.vitalpbx.org/wiki/calls-routing/dynamic-routing/feed/ 0