Skip to main content

Outbound_profile

About

This document covers information about External Profile.

Click here to expand Table of Contents

Overview

By default FreeSWITCH supplies an external profile that runs on port 5080. The external profile handles external or outbound registrations to a SIP provider.

The SIP provider sends calls to you, and you send calls to your provider, through the external profile. The external profile allows anonymous calling, which is required as your provider will never authenticate with you to send you a call.

The external profile (conf/sip_profiles/external.xml) supplied with FreeSWITCH is a great starting place for learning about two very important variables that aid in NAT traversal. These are:

<param name="ext-rtp-ip" value="$${external_rtp_ip}"/>
<param name="ext-sip-ip" value="$${external_sip_ip}"/>

The external_ variables are configured in conf/vars.xml. The external profile is important because if port forwarding were to be setup, you would be able to cleanly send and receive information from the port in a fashion that would allow you to have other devices registering with this instance of FreeSWITCH. This allows you to cleanly break through NAT.

If you would like to have communication of this nature then you should consider copying the external profile and creating a dedicated profile specific to your purpose and setup port forwarding such that that profile can send and receive with external entities. The copied version of the external profile will require very little modification other than changing the port that is used. See General NAT example scenarios. Remember, when you change this reference all devices wishing to use this context must reference it accordingly. So if you create a profile called external5090 and want to make a call from it then you should reference it as:

/sofia/external5090/1234@blah.com

A good sign that you need to make sure your external profile has access to the internet (port forwarding rules need to be setup or creating a dedicated profile by copying and pasting) is if you are receiving the following errors:

[DEBUG] switch_ivr_bridge.c:275 audio_bridge_thread() read: sofia/default/6191231234@sip.mySweetDomain.com Bad Frame.... Bubye!

event [nua_i_error] status [408][ACK Timeout] session: sofia/default/5551231234@x.x.x.x:5060
event [nua_i_state] status [0][ACK Timeout] session: sofia/default/5551231234@x.x.x.x:5060

Please note: in some instances you may want to just copy the external profile and create a new profile that will be used exclusively for the associated gateways. Don't forget that doing this will require you to change the port from say 5080 to 5090, or whatever is available on your systems. Also, you will have to setup port-forwarding rules. You can create as many dedicated profiles as you have resources for.

You will need to setup port forwarding on your firewall/NAT devices (yes, this includes iptables) if you are doing any of the following: See General NAT example scenarios.

Switch to Switch Communication

Attempting to get two switching systems communicating over the internet is really easy, but for many newer users a daunting task. Here is a general layout of what we are talking about.

FreeSWITCH (192.168.0.4) -> NAT (Public IP 1.2.3.4) -> INTERNET -> NAT (Public IP 5.6.7.8) -> FreeSWITCH (192.168.0.5)

Here are the steps to resolve this problem.

  1. Setup port forwarding on port 5080 (or whichever port your are using this dedicated profile on) allowing both TCP and UDP traffic through.
    1. Do this to both FreeSWITCH instances.
  2. Within the conf/sip_profiles/outbound.xml modify the ext-sip-ip and ext-rtp-ip variables to reflect your public IP address.
  3. Restart FreeSWITCH.
  4. Test communication by originating a call from 192.168.0.4 above:

Switch with External SoftPhone

FreeSWITCH (192.168.0.4) -> NAT (Public IP 1.2.3.4) -> INTERNET -> Softphone Registering to FreeSWITCH
  1. Copy the external.xml profile and create a new profile named external5090.xml. This will be a dedicated profile, for exclusive use to these softphones that are registering to FreeSWITCH.
  2. Change the profile name to something unique, like <profile name="external5090">
  3. Change the SIP port the profile is listening on to <param name="sip-port" value="5090"/>
    • Make sure to setup port forwarding on your Firewall/NAT device for TCP/UDP on 5090.
  4. Within the conf/sip_profiles/external5090.xml modify the ext-sip-ip and ext-rtp-ip variables to reflect your public IP address.
  5. Restart FreeSWITCH.
  6. Reference the caller from your FreeSWITCH system as: sofia/external5090/<caller extension>@x.x.x.x:5090 <-- What goes in x.x.x.x? external UA IP? Domain?

Switch with Internal Phone

  1. Register your phone on the default port 5060 profile. As you may have noted, this profile does not use ext-sip-ip and ext-rtp-ip.
  2. Make sure that your outbound calls reference the external profile which will allow you to break through the NAT/Firewall and communicate accordingly.