Fortinet white logo
Fortinet white logo

FortiVoice Phone System Administration Guide

Integrating FortiVoice with Twilio

Integrating FortiVoice with Twilio

This section describes how to configure the FortiVoice phone system to provide a telephony service with Twilio’s elastic SIP trunking. The integration enables incoming calls to the FortiVoice phone system to be routed to Twilio for additional services such as interactive voice response (IVR) or speech recognition. After completing the user data collection and responses, the call control can be subsequently transferred to a telephone extension or an agent served by the FortiVoice phone system.

The FortiVoice dial plan provides digit translation and call routing for the system. Use the dial plan to customize the routing of calls to and from the Twilio platform. If Twilio uses a SIP REFER to implement a call back to FortiVoice, you do not have to configure an inbound dial plan.

The following diagram illustrates an example network topology of FortiVoice with Twilio.

Considerations about accessing and using Twilio:

  • A Twilio demo account does not allow you to call from and to numbers that you did not add to the FortiVoice phone system. Therefore, it is a good idea to upgrade your Twilio account to perform your testing.

  • Twilio treats a SIP trunk (in and out) as two separate items.

  • Twilio uses a specific number format (+1xxxyyyyyyy) where xxx is the area code and yyyyyyy is the phone number.

To complete the configuration tasks on Twilio

  1. Sign up for a Twilio paid account. The demo account has too many restrictions.
  2. Create and configure a Twilio elastic SIP trunk. After you complete this task, you will receive a uniform resource identifier (URI). Twilio's elastic SIP trunking uses an fully qualified domain name (FQDN) as a termination URI that is used by the FortiVoice phone system to direct SIP traffic towards Twilio.
  3. Take note of this URI because you will need this URI when you set the SIP server during the configuration of the FortiVoice SIP trunk.

To create a FortiVoice SIP trunk

  1. In the FortiVoice GUI, go to Trunk > VoIP > SIP.
  2. Click New.
  3. Configure the following parameters:

    GUI field

    Description

    SIP

    Name

    Enter the trunk name. For example, Twilio.

    Enable

    Select to activate this SIP trunk.

    Display name

    Enter the caller ID that will appear on the called phone, such as Example Company.

    Main number

    Enter the number that will appear on the called phone.

    SIP setting

    SIP server

    Enter the SIP URI that you have received from Twilio. For example, yourname.pstn.twilio.com.

    SIP port

    Keep the default value (5060).

    Using SRV record

    Keep this setting disabled.

    User name

    Enter the name that you have used during the creation of the Twilio elastic SIP trunk.

    Password

    Enter the password that you have used during the creation of the Twilio elastic SIP trunk.

    Auth. user name

    Enter the same user name that you have used during the creation of the Twilio elastic SIP trunk. The user name and auth. user name are the same.

    Realm/Domain

    Enter the same URL that you have entered in the SIP server field.

    SIP settings

    Keep the default setting (sip_trunk_default).

    Max channel

    Each trunk contains multiple channels. The number of channels you have in a trunk is controlled by your VoIP provider.

    Max outgoing channel

    With the known number of max channels, if you need to reserve incoming channels, you can enter the number of outgoing channels allowed and the remaining channels are for incoming calls.

    User=Phone in SIP URI

    Keep this setting disabled.

    Inband ringtone (Early media)

    Keep this setting disabled.

    Caller ID Option

    Keep the default settings.

    Registration

    Select Standard.

    Outbound Proxy

    Keep this setting disabled.

  4. Click Create.

To create a FortiVoice dial plan for inbound calls

  1. In the FortiVoice GUI, go to Call Routing > Inbound.
  2. Click New.
  3. Configure the following parameters:

    GUI field

    Description

    Name

    Enter a name for this plan.

    Enable

    Select to activate this dial plan.

    From Trunk

    Click +. From the list available entries, select the Twilio SIP trunk.

    Call Handling

    From the Action type list, select Dial Local Number to process incoming calls.

    To route calls to a local extension number, create a match pattern.

  4. Click Create.

To create a FortiVoice dial plan for outbound calls

  1. In the FortiVoice GUI, go to Call Routing > Outbound.
  2. Click New.
  3. Configure the following parameters:

    GUI field

    Description

    Name

    Enter a name for this plan.

    Enable

    Select to activate this dial plan.

    Dialed Number Match

    Create a number pattern to match a number or a range of numbers for how the call handling will be applied to the respective calls.

    Call Handling

    The actions to process the incoming calls with matched dialed numbers and/or caller IDs.

    1. Click New.
    2. In Action, select Allow.
    3. In Outgoing trunk, select the Twilio SIP trunk.
  4. Click Create.

Integrating FortiVoice with Twilio

Integrating FortiVoice with Twilio

This section describes how to configure the FortiVoice phone system to provide a telephony service with Twilio’s elastic SIP trunking. The integration enables incoming calls to the FortiVoice phone system to be routed to Twilio for additional services such as interactive voice response (IVR) or speech recognition. After completing the user data collection and responses, the call control can be subsequently transferred to a telephone extension or an agent served by the FortiVoice phone system.

The FortiVoice dial plan provides digit translation and call routing for the system. Use the dial plan to customize the routing of calls to and from the Twilio platform. If Twilio uses a SIP REFER to implement a call back to FortiVoice, you do not have to configure an inbound dial plan.

The following diagram illustrates an example network topology of FortiVoice with Twilio.

Considerations about accessing and using Twilio:

  • A Twilio demo account does not allow you to call from and to numbers that you did not add to the FortiVoice phone system. Therefore, it is a good idea to upgrade your Twilio account to perform your testing.

  • Twilio treats a SIP trunk (in and out) as two separate items.

  • Twilio uses a specific number format (+1xxxyyyyyyy) where xxx is the area code and yyyyyyy is the phone number.

To complete the configuration tasks on Twilio

  1. Sign up for a Twilio paid account. The demo account has too many restrictions.
  2. Create and configure a Twilio elastic SIP trunk. After you complete this task, you will receive a uniform resource identifier (URI). Twilio's elastic SIP trunking uses an fully qualified domain name (FQDN) as a termination URI that is used by the FortiVoice phone system to direct SIP traffic towards Twilio.
  3. Take note of this URI because you will need this URI when you set the SIP server during the configuration of the FortiVoice SIP trunk.

To create a FortiVoice SIP trunk

  1. In the FortiVoice GUI, go to Trunk > VoIP > SIP.
  2. Click New.
  3. Configure the following parameters:

    GUI field

    Description

    SIP

    Name

    Enter the trunk name. For example, Twilio.

    Enable

    Select to activate this SIP trunk.

    Display name

    Enter the caller ID that will appear on the called phone, such as Example Company.

    Main number

    Enter the number that will appear on the called phone.

    SIP setting

    SIP server

    Enter the SIP URI that you have received from Twilio. For example, yourname.pstn.twilio.com.

    SIP port

    Keep the default value (5060).

    Using SRV record

    Keep this setting disabled.

    User name

    Enter the name that you have used during the creation of the Twilio elastic SIP trunk.

    Password

    Enter the password that you have used during the creation of the Twilio elastic SIP trunk.

    Auth. user name

    Enter the same user name that you have used during the creation of the Twilio elastic SIP trunk. The user name and auth. user name are the same.

    Realm/Domain

    Enter the same URL that you have entered in the SIP server field.

    SIP settings

    Keep the default setting (sip_trunk_default).

    Max channel

    Each trunk contains multiple channels. The number of channels you have in a trunk is controlled by your VoIP provider.

    Max outgoing channel

    With the known number of max channels, if you need to reserve incoming channels, you can enter the number of outgoing channels allowed and the remaining channels are for incoming calls.

    User=Phone in SIP URI

    Keep this setting disabled.

    Inband ringtone (Early media)

    Keep this setting disabled.

    Caller ID Option

    Keep the default settings.

    Registration

    Select Standard.

    Outbound Proxy

    Keep this setting disabled.

  4. Click Create.

To create a FortiVoice dial plan for inbound calls

  1. In the FortiVoice GUI, go to Call Routing > Inbound.
  2. Click New.
  3. Configure the following parameters:

    GUI field

    Description

    Name

    Enter a name for this plan.

    Enable

    Select to activate this dial plan.

    From Trunk

    Click +. From the list available entries, select the Twilio SIP trunk.

    Call Handling

    From the Action type list, select Dial Local Number to process incoming calls.

    To route calls to a local extension number, create a match pattern.

  4. Click Create.

To create a FortiVoice dial plan for outbound calls

  1. In the FortiVoice GUI, go to Call Routing > Outbound.
  2. Click New.
  3. Configure the following parameters:

    GUI field

    Description

    Name

    Enter a name for this plan.

    Enable

    Select to activate this dial plan.

    Dialed Number Match

    Create a number pattern to match a number or a range of numbers for how the call handling will be applied to the respective calls.

    Call Handling

    The actions to process the incoming calls with matched dialed numbers and/or caller IDs.

    1. Click New.
    2. In Action, select Allow.
    3. In Outgoing trunk, select the Twilio SIP trunk.
  4. Click Create.