Page tree
Skip to end of metadata
Go to start of metadata

About

This example assumes that you have completed the basic installation of FreeSWITCH and some sort of SIP proxy (Sonus PSX, Kamailio, OpenSIPS, etc.) that will be controlling your LCR. This is designed for a wholesale model in mind with limited switch based security and no registrations. (see further down for OpenSIPS example config to use with this.)


 Click here to expand Table of Contents

Configuration

The first thing to realize is that we are not registering or authenticating any calls, so the /conf/directory/default.xml and default/* will be empty except for the default domain setting (which as far as i can tell isn't even needed).

The gateways information in the sip_profiles will also be empty since realistically your vendors would not need any kind of gateway registration from you. Typically in the wholesale model, authentications and rejections are done via firewalling or internal systems sending back certain responses.

Now that we have that set up, we want to set up a baseline rejection that will allow the customers to always route advance, so we're going to overwrite any negative responses back with a 503. Since no calls are registered, there is no differentiation between default and public contexs, so you can put this in both, but I believe it's only required in /conf/dialplan/public.xml at the very end. (You can also put it at the very end of the /conf/dialplan/default.xml as a precaution if you wish).


Now you will need to define your customers. I do this in /conf/dialplan/public/00_customer_list.xml.

Replace the keywords below with your own informations.

  • <condition field="${network_addr}" expression="pu.bl.ic.ip"/>
  • <\!-- <action application="bridge" data="sofia/external/${destination_number}@${distributor(dist_list)}"/> --> 
  • <action application="bridge" data="sofia/external/${destination_number}@127.0.0.1:5062"/>
  • <condition field="${network_addr}" expression="pr.iv.ate.ip"/>
  • <action application="bridge" data="sofia/internal/${destination_number}@127.0.0.1:5062"/>

This will send the request to your proxy LCR engine which will return to you a 30x response that FreeSWITCH automatically dumps into the XML redirected context. This context must be defined in /conf/dialplan/public.xml if you want it to load properly. You can use a single destination, such as a localhost OpenSIPS proxy as I have shown here, or you can use load balancing to distribute the traffic over multiple proxies (see Mod_distributor). Depending on the ingress IP/location, you should set the sip_profile of sofia to the external or internal to keep the call on the same side of FreeSWITCH so you don't have to traverse internally unless you have to.

In your redirected context, you will put as many list checks in as you will be sending from your LCR engine in the 30x.

What this does is check the location of the contact to see if the destination resides on the internal or external side of FreeSWITCH. That way it does not try to send the new INVITEs out of the wrong ethernet interface.

 

OpenSIPS Example

 This is an very minimal example configuration to generate a 300 Multiple Choice to test this FreeSWITCH configuration with if you don't already have some LCR engines in place. (I WILL INSERT THE EXAMPLE HERE)

 


  • No labels