[Freeswitch-users] FreeSwitch setup as a "Dumb" SBC

rod kawarod at laposte.net
Mon Feb 2 22:33:11 PST 2009


Hi Adam,

I'm in the process of using FS as a SBC. For the route lookup, I do it 
using OpenSER carrierroute, without having to flow through 
SBC---Openser---SBC. I'm using carrierroute at this time cause I need 
more than 200 000 routing entries and carrierroute has been tested with 
twice this number.

Here is the setup:

- install openser and carrierroute and make openser listening on 
127.0.0.1:5062 (for example) on your SBC
- populate carrierroute table

What I do to use carrierroute module from FS is to use a specific 
X-header (X-LOOKUP).

In the dialplan, in the default context, I have something like this:
<extension name="LOOKUP_ROUTE">
<condition field="destination_number" expression="(\d+)$">
<action application="set" data="hangup_after_bridge=true"/>
<action application="set" data="continue_on_fail=true"/>
<action application="export" data="sip_h_X-ROUTE=LOOKUP"/>
<action application="bridge" 
data="sofia/internal/${sip_req_user}@127.0.0.1:5062"/>
<action application="export" 
data="sip_h_X-ROUTE=${sip_redirect_contact_host_0}"/>
<action application="transfer" data="${destination_number} XML ROUTING"/>
</condition>
</extension>

The process is simple:
the export "sip_h_X-ROUTE=LOOKUP" had a sip header X-ROUTE=LOOKUP
then I bridge the call to 127.0.0.1:5062 (openser process)

In openser I have a route block that checks the presence of header 
LOOKUP and openser sends a "604: unable to route call" if the prefix is 
not found, or a "302: with the IP of the gateway found"

In FS, you can get the IP using the variable 
"${sip_redirect_contact_host_0}". Then I transfer this to the context 
ROUTING, where the check condition is based on the LOOKUP header that 
has been rewritten with this variable.

I will document all this setup (installation of openser/carrierroute and 
config file of FS and openser) on a wiki page I start writing yesterday, 
so please be indulgent and patient.
The next step is to test the scalability of this.

I'm a very bad programmer, so that's the only way for me to contribute 
to FS, and as I see many people interested for an SBC setup, I think it 
could be great if we share our work/knowlegde.

The wiki page is there:
http://wiki.freeswitch.org/wiki/SBC_Setup

regards,
rod.





Adam Long wrote:
>
> Hi Guys,
>
> I’ve been working at setting up a couple of FreeSwitch nodes as a 
> topology hiding SBCs that handles both ingress traffic from my
>
> providers/peers and pass traffic up to an openser router that then 
> routes call across the cluster of SBCs through which they reach the 
> destination.
>
> I have OpenSIPS/SER setup doing DB route lookups and ENUM with 
> LCR/Serial forking etc.
>
> My question is what would be the best way to send a call out to a 
> destination choosen by the OpenSER router?
>
> For example:
>
> SIP Provider -- > SBC --- > OpenSER ---- ( route lookup returns 
> 123.123.123.4 as dest ) -- > SBC --- > 123.123.123.4
>
> I was thinking something along the lines of adding a “X-Route-To: 
> +1NXXNXXXXXX@ <mailto:+1NXXNXXXXXX@>123.123.123.4” with openser
>
> and then something like this in the SBC…
>
> <context name="from-sipcore">
>
> <extension name="outboundroute">
>
> <action application="bridge" data="sofia/external/${sip_h_X-Route-To}" />
>
> </extension>
>
> </context>
>
> Is this a wise approach, is there anything I could do to do this better?
>
> I’d like to keep the logic in the SBCs as simple as possible.
>
> I am pretty familiar with SIP but my knowledge fades when it gets into 
> the nitty gritty of routing… ie the Contact: and Via: headers
>
> and all that good stuff.
>
> I should also state I have two profiles defined one for the 
> internal/private “core” network and one for the outside “external” 
> network.
>
> Any thoughts on this at all would be greatly appreciated.
>
> Am I missing something in the SIP spec that would allow for this is a 
> standardized way?
>
> Regards,
>
> -Adam
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Freeswitch-users mailing list
> Freeswitch-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>   




More information about the FreeSWITCH-users mailing list