Select inbound call routes
Inbound route selection methods
Call Routing determines which route applies to an inbound call in two ways:
- Static Direct Inward Dialing (DID) route selection: Call Routing always applies the same designated route for incoming traffic on a designated Infobip DID number.
- 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:
- Log in to your account.
- Go to Channels and Numbers > Channels > Voice and WebRTC.
- 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
ForwardtoCall 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
numberKeyof your purchased number. You can use the List resource method to retrieve this reference.
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
routeIdof the route you want to assign to this number.
- The retrieved
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
PHONEfilter with13124567890as thefromvalue will only trigger if a call is received from this exact number. - A route with a
PHONEfilter with^1(312|773|872)\d{5}90$as thefromvalue 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:
- Create a route with a
Fromfilter:^1(312|773|872).*and set your desired destination(s) in the route. - Create a second route with a
Fromfilter:^1(630).*and set your desired destination(s) in the route. - Assign Forward to Call Routing to
13124567890without 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:
| Objective | Regular expression | Regular 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}$ |
|
| 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}$ |
|
| I want this route to be triggered for an inbound call reaching my Infobip USA toll-free numbers | Set 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 place | Set the following regex on the "from" number: ^\d*1234\d*$ |
|
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
fromfield. - The value of the
tofield. - The value of designated custom headers.
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 | |
Header value - I want to activate this route if a header X-IB-AGENTCONTEXT includes sales. | Set header value filter to .*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$. |
|
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.
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).