Browse the documentation

Documentation

Connect FreeSWITCH to Open Voice Shield

Updated 4 min read

Ask AI about this page

Add a sofia gateway for sip.ovs.telecomsxchange.com with register false, whitelist your server's public IP on the Network page, and bridge the calls you want analyzed to sofia/gateway/ovs: no credentials, G.711 in the INVITE. The verdict appears after hang-up.

Before you start#

  • An Open Voice Shield account. Signup is self-serve and starts you with US$5 of credit.
  • The public IP address your FreeSWITCH sends SIP from, the address after NAT, not the one on its interface.
  • A destination, the carrier or SBC the calls were already going to. We relay each accepted call on to it.
  • Firewall: UDP or TCP 5060 to the ingress, and UDP 30000–40000 open in both directions for RTP. See the firewall rules.

Step 1: whitelist your server's IP#

Open the Network page in the portal and add the public address your FreeSWITCH sends from as a CIDR entry, a single host is a /32. The whitelist is the authentication: there are no credentials, and an INVITE from any other address is answered 403.

Step 2: add the gateway#

The connection is a standard sofia gateway on your external profile with registration switched off, the same shape as any IP-authenticated carrier you already configure.

conf/sip_profiles/external/ovs.xml

<include>
  <gateway name="ovs">
    <param name="proxy" value="sip.ovs.telecomsxchange.com:5060"/>
    <param name="register" value="false"/>
  </gateway>
</include>

Verified against the FreeSWITCH 1.10 sofia gateway documentation. Adapt the profile and file layout to your build, then run sofia profile external rescan.

  • register=false matters: nothing registers in either direction, and a REGISTER sent to the ingress is answered 403.
  • Offer G.711 first on this leg. absolute_codec_string=PCMU,PCMA in the bridge below pins it. Anything else is relayed but produces no transcript and no verdict.
  • Your FreeSWITCH offers SDP in the initial INVITE by default. Keep it that way. An INVITE without SDP is answered 488.

Step 3: bridge every call through the gateway#

Bridge your outbound pattern to the new gateway. The dialled number and caller ID pass through unchanged, and the call leaves us to your configured destination.

dialplan: everything via the gateway

<extension name="all-via-ovs">
  <condition field="destination_number" expression="^(\d+)$">
    <action application="bridge" data="{absolute_codec_string=PCMU,PCMA}sofia/gateway/ovs/$1"/>
  </condition>
</extension>

Or bridge one call in ten#

You do not have to move all your traffic, sampling is a supported pattern. A mod_distributor list picks a gateway by weight: one node in ten is the analyzed hop, the other nine are your direct carrier gateway.

conf/autoload_configs/distributor.conf.xml

<configuration name="distributor.conf" description="Weighted sampling">
  <lists>
    <list name="ovs_sample" total-weight="10">
      <node name="ovs" weight="1"/>
      <node name="carrier" weight="9"/>
    </list>
  </lists>
</configuration>

dialplan: bridge to the node the list returns

<extension name="sampled-via-ovs">
  <condition field="destination_number" expression="^(\d+)$">
    <action application="set" data="ovs_gw=${distributor(ovs_sample)}"/>
    <action application="bridge" data="{absolute_codec_string=PCMU,PCMA}sofia/gateway/${ovs_gw}/$1"/>
  </condition>
</extension>

Verified against the FreeSWITCH 1.10 mod_distributor documentation. Configure the node names to match your gateway names, and enable the module in modules.conf.xml.

Step 4: place a test call#

Dial a real number over the new route and talk on both legs for at least 30 seconds. A leg that never speaks produces a one-sided transcript. After hang-up the call appears in Calls in the console with its recording, per-channel transcript and verdict, usually within a minute.

  • Rejected 403? The source address is not whitelisted. Compare your own SIP trace with the CIDR entries on the Network page.
  • One-way audio? A firewall rule on UDP 30000–40000, not a signalling problem.
  • A recording but no verdict? The call negotiated a codec we do not decode (G.711, G.722, G.729 and G.723.1 are supported): pin absolute_codec_string on the bridge.

Anything else: Troubleshooting lists every rejection code and the check that clears it.

Frequently asked questions#

Does FreeSWITCH need a special module to work with Open Voice Shield?

No. The connection is a standard sofia gateway with register false, the same external-profile gateway you would configure for any IP-authenticated carrier. mod_distributor is only needed if you want weighted sampling.

Does Open Voice Shield register to my FreeSWITCH?

No. Nothing registers in either direction: the sofia gateway is defined with register false, a REGISTER sent to the ingress is answered 403, and calls are authorized by the source IP you whitelist on the Network page.

Can I send only some of my FreeSWITCH calls through it?

Yes. Configure a mod_distributor list with the analyzed gateway weighted one against nine for your direct carrier gateway, and bridge to the node the list returns. Sampled calls still reach the same destination through one extra hop.

Ready to try it? Create an account. Signup is self-serve and comes with US$5 of credit, enough to analyze your first test calls.