CTRLK

Shared components

Select inbound call routes

|

View as Markdown

Inbound route selection methods

Call Routing determines which route applies to an inbound call in two ways:

  1. Static Direct Inward Dialing (DID) route selection: Call Routing always applies the same designated route for incoming traffic on a designated Infobip DID number.
  2. Filter-based route selection: Call Routing selects the route applied to inbound traffic based on filter criteria.

Static DID route selection [#static-did-route-selection-inbound-traffic-route-selection]

A route is statically assigned to an Infobip DID route. Every single call that reaches this DID will always result in the selection of the same designated route.

Supported DID or number types are:

  • Infobip VLN or TFN that are voice-enabled.
  • WhatsApp senders with the WhatsApp Business Calling capability enabled.
  • Viber voice numbers.

This configuration can be done either on the web interface or through the voice number setup API.

To set up DID using the web interface:

  1. Log in to your account.
  2. Go to Channels and Numbers > Channels > Voice and WebRTC.
  3. Select any of your acquired voice numbers and a new tab opens the voice configuration settings for that number.

Edit the inbound configuration as follows:

  • Select the action type Forward to Call Routing.
  • Choose the route from the drop-down list to assign to this number.

To set up the routing action for inbound calls over API, use the following API methods:

  • Retrieve the numberKey of your purchased number. You can use the List resource method to retrieve this reference.
NOTE

You must list resources of the NUMBER type and retrieve the numberKey from the results.

  • Create a voice setup, specifying:
    • The retrieved numberKey.
    • The action type FORWARD_TO_CALL_ROUTING.
    • The routeId of the route you want to assign to this number.
NOTE

API methods do not work for Viber voice numbers or WhatsApp Business Calling-enabled senders.

Filter-based route selection [#filter-based-route-selection-inbound-traffic-route-selection]

Filters allow for assigned routes to become even more granular by only evaluating calls matching with these criteria. Filter criteria are optionally defined when creating a route.

Different types of incoming traffic can be managed using specific filters. When you define multiple filters on the same route, they are linked by a logical OR operation, meaning the route will be triggered if any one of the filters' conditions are met.

PHONE filters

Filters can be designated using either a from or to number, or both. If both from and to numbers are specified, they will be combined using a logical AND operation.

Values specified for both from and to numbers can be fully defined numbers or a regular expression. For instance:

  • A route with a PHONE filter with 13124567890 as the from value will only trigger if a call is received from this exact number.
  • A route with a PHONE filter with ^1(312|773|872)\d{5}90$ as the from value will only trigger for any inbound call coming from a number in the USA having a Chicago prefix and ending with the digits 90.

When using filters in Call Routing, you do not need to assign a specific route to your Infobip DID. You can assign the Forward to Call Routing action on the number, and the system will evaluate all route definitions. The first route with a matching filter is triggered.

For example, suppose you have the Infobip number 13124567890. You want calls from Chicago area codes (312, 773, and 872) routed to one destination, and calls from Naperville's area code (630) routed to a different destination. Follow these steps:

  1. Create a route with a From filter: ^1(312|773|872).* and set your desired destination(s) in the route.
  2. Create a second route with a From filter: ^1(630).* and set your desired destination(s) in the route.
  3. Assign Forward to Call Routing to 13124567890 without specifying any route.

When an inbound call arrives, Call Routing automatically applies the first route filter that matches the caller's number.

The following table illustrates a few examples of PHONE filter definitions using regular expressions:

ObjectiveRegular expressionRegular expression explained
I want the route to be triggered for any call coming from UK numbers.Set the following regex on the from number: ^44\d{10}$
  • ^: Asserts position at start of a line.
  • 44: Matches the characters 44 literally.
  • \d: Matches a digit (equivalent to [0-9]).
  • $: Asserts position at the end of a line.
I want this route to be triggered for incoming calls coming from callers in Chicago.Set the following regex on the from number: ^1(312|773|872)\d{7}$
  • ^: Asserts position at start of a line.
  • 1: Matches the character 1 literally.
  • 1st Capturing Group (312|773|872):
    • 1st Alternative 312: matches 312 literally.
    • 2nd Alternative 773: matches 773 literally.
    • 3rd Alternative 872: matches 872 literally.
  • \d: Matches a digit (equivalent to [0-9]).
  • {7}: Matches the previous token exactly 7 times.
  • $: Asserts position at the end of a line.
I want this route to be triggered for an inbound call reaching my Infobip USA toll-free numbersSet the following regex on the to number: ^1(800|888|877|866|855|844|833)\d{7}$Uses the same structure explanation as above.
I want this route to be triggered for any inbound call that has the sequence of number "1234" in it, at any placeSet the following regex on the "from" number: ^\d*1234\d*$
  • ^: Asserts position at start of a line.
  • \d*: Matches any number of digits (including zero digits) before the sequence "1234".
  • 1234: Matches the specific sequence "1234".
  • \d*: Matches any number of digits (including zero digits) after the sequence "1234".
  • $: Anchors the match to the end of the string.

SIP filters

This filter type enables route activation based on incoming Session Initiation Protocol (SIP) traffic. SIP filters can be defined based on:

  • The reference of the trunk from which traffic is coming: You want all traffic coming from a designated trunk to trigger this exact route. If no specific SIP trunk is designated, the filter will be activated for inbound SIP traffic coming from any of your active SIP trunks.
  • The value of the from field.
  • The value of the to field.
  • The value of designated custom headers.
NOTE

The header name must be fully specified and the header value can include regular expressions.

The table below depicts some examples of SIP filters using regular expressions:

Regular expression

Objective

Regular expression explained

To / From filter criteria

Similar to phone filter examples above.

NOTE

Some of these values are non-numerical, such as a specific username, for example, a string like oliverjones.

Header value - I want to activate this route if a header X-IB-AGENTCONTEXT includes sales.Set header value filter to .*sales.*
  • .*: Matches any number of any characters (including none) before the substring sales.
  • sales: Matches the exact substring sales.
  • .*: Matches any number of any characters (including none) after the substring sales.
Header value - I want to activate this route if a header X-IB-WHATEVER starts with xyz and ends with 001.Set the header value to ^xyz.*001$.
  • ^: Anchors the match to the start of the string.
  • xyz: Matches the exact substring xyz at the beginning.
  • .*: Matches any number of any characters (including none) in between.
  • 001: Matches the exact substring 001 at the end.
  • $: Anchors the match to the end of the string.

The SIP filter triggers on both incoming SIP INVITE and SIP REFER messages, provided the defined filter criteria match. If you need a route to be considered for execution only on an incoming SIP REFER, flag the route as a Transfer Only Route together with the appropriate SIP filter criteria. For more information, see Reroute calls with SIP REFER.

WEBRTC filters

This filter triggers route execution for traffic originating from Web Real-Time Communication (WebRTC). In your WebRTC client application, an applicationCall must be made towards the CALL_ROUTING application. You can optionally set a value (full or regular expression) for the from parameter (identity if using Call Routing API), which means the route will only be triggered for calls from that specific WebRTC identity.

IMPORTANT

Route priority impact

When multiple routes have matching filters to the inbound traffic, Call Routing will select the route with the lowest priority number (1 is the highest selection priority).

Was this page helpful?