In this article we will show you how the REFER block can be used in routing. The REFER Block makes it possible to return a call to your PBX, if it has been sent to TENIOS via SIP Trunk. It sends a SIP REFER message with the configured phone number back to the SIP trunk and ends the call.
Â
- The call is incoming on the customer’s PBX via SIP trunk.
- The request “SIP INVITE” is transmitted from the Customer PBX to TENIOS. The RTP / Media transfer is activated now.
- Once the connection to TENIOS is established, the routing plan stored in the customer portal is processed.
- When the “REFER-block” is reached, TENIOS sends the request “SIP REFER” and the RTP / Media transmission between TENIOS and the customer’s PBX is disconnected. From this point on the call is no longer connected to the TENIOS system.
- Now the customer can use internal or external forwardings to connect the call to its destination.
 Â
- a configured and registered SIP Trunk
- Active Dialogflow account with an existing Dialogflow agent
- Existing Voicebot in TENIOS Portal
1. Configure individual routing for the SIP trunk. #

2. Include VoiceBot in Routing #
- Select “VoiceBot” Block within the dropdown menu.
- Select the preconfigured VoiceBot and fill in the mandatory fields.
- Define action parameters (e.g. “REFER to Sales”)
Â
3. Create a routing plan with REFER block #
- In the Settings for action parameters, select the block “Routingplan” from the dropdown menu.
- Now you can choose an existing routing plan or create a new one and add the block “REFER”.
- Afterwards you can enter the phone number to which the call should be routed.

4. Asterisk Configuration #
To send calls via the SIP trunk, you have to add the following entries in the configuration file extensions.conf of your Asterisk server: Configuration file:extensions.conf
[public] exten => _+49.,1,Dial(SIP/${EXTEN}@mySipTrunki,30) [inbound] exten => +4922155400300,1,Log(NOTICE, Call referred from tenios) exten => +4922155400300,n,Playback(support) exten => +4922155400340,1,Log(NOTICE, Call referred from tenios) exten => +4922155400340,n,Playback(sales)
- In the example dial plan, all calls which start with +49 are sent to the SIP trunk which is registered with the username „mySipTrunk“ at TENIOS.
- When calls are transferred back by the REFER block, they are processed in the context Inbound matching the phone number that was specified
