[Freeswitch-users] multiple sip gateway configuration

Robert Hadley robert.hadley at teotech.com
Thu Jul 24 20:33:06 MSD 2014


Hi Louie,

One SIP provider profile (ie. port) may have multiple gateways like we have for our Vitelity SIP trunk.

https://wiki.freeswitch.org/wiki/Provider_Configuration:_Vitelity

Regards,
Robert


From: Louie Liu [mailto:lliu at multinet.net.au]
Sent: Thursday, July 24, 2014 6:02 AM
To: 'FreeSWITCH Users Help'
Subject: Re: [Freeswitch-users] multiple sip gateway configuration

Thanks your prompt response, maybe I haven’t explain my scenario clearly, Iet me explain:
My company would like to setup a voip service to be host in the data centre where Sip_Provider_A and B both have a presence, so avoid voip traffic route across the Internet, but each would need to go through different network interface and gateway to reach the sip providers (see diagram below for illustration).


        PHONE -> FS(192.168.0.1) -> NAT1(Public IP 1.2.3.4) -> Sip_Provider_A
                                               I--> NAT2 (Public IP 5.6.7.8) -> Sip_Provider_B

To complicate this even more, Sip_Provider_B offers multiple accounts to cover the existing ISDN connections we’ve got.   To me it makes sense to setup two external sip profiles with different external port each to handle traffic route to each sip provider. What is not clear is how handle multiple accounts with same sip provider? Can all the accounts share the same sip profile? Can Freeswitch register multiple accounts at once on the same sip profile? How is the dialplan gonna to work in this case? Examples to illustrate would be good.


Cheers,
Louie

From: Steven Ayre [mailto:steveayre at gmail.com]
Sent: Thursday, 24 July 2014 1:06 AM
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] multiple sip gateway configuration

A single profile can send to any number of gateways.

You only need multiple profiles if you need to listen in multiple places, usually to handle either multiple IP addresses or different configurations on different ports.

sip-ip and rtp-ip are the local IP of the server where you're receiving packets. It must be a real address, 0.0.0.0 (ie any address) isn't valid. If you're behind NAT they should be the internal IP, there are settings such as ext-sip-ip and ext-rtp-ip for handling NAT traversal.

How to select the gateway to use will be very dependant on your use-case. However in general, you pick the destination gateway in the dialstring you bridge with, eg
<action application="bridge" data="sofia/gateway/Sip_Provider_A/12345"/>
<action application="bridge" data="sofia/gateway/Sip_Provider_B/12345"/>

How you pick it is up to you, but as some examples you could set it as a variable in the user directory or based on conditions in the dialstring, you could use mod_distributor, mod_lcr etc, or try each in sequence as above.

Steve

On 23 July 2014 14:48, Louie Liu <lliu at multinet.net.au<mailto:lliu at multinet.net.au>> wrote:
Hi,

There is requirement for me to add multiple sip gateways to Freeswitch, the first sip gateway uses the external.xml in sip profile to route traffic to Sip provider A.  The second sip gateway will use a different UA to route traffic to Sip provider B. Here are my questions:


1.       Do I need to create another external.xml  with its own ip and port which point to the Sip Provider B? if that’s case, what do I need to change in the sip profile external.xml file?

2.       What is the rtp-ip and sip-ip in the external.xml file? Should that be the local IP of my sip server?

3.       What do I need to change in my dialplan so that I can reference the Sip_Provider_B? an example would be good.

External.xml
    <param name="sip-port" value="$${external_sip_port}"/>
    <param name="dialplan" value="XML"/>
    <param name="context" value="public"/>

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

External/sip_provider_A.xml
  <gateway name="Sip_Provider_A">
    <param name="username" value="xxx"/>
    <param name="password" value="xxx"/>
    <param name="from-user" value="03xxxxxxx"/>
    <param name="from-domain" value="x.y.z"/>
    <param name="auth-username" value="yyyyy"/>
    <param name="realm" value="bwas02.voip.izzz.zz.au<http://bwas02.voip.izzz.zz.au>"/>
    <param name="proxy" value="sipconnect.voip.zzzz.zz.au<http://sipconnect.voip.zzzz.zz.au>"/>
    <param name="register" value="true"/>
    <param name="register-transport" value="udp"/>
    <param name="context" value="public"/>
  </gateway>

External/sip_provider_B.xml
  <gateway name="Sip_Provider_B">
    <param name="username" value="aaa"/>
    <param name="password" value="bbb"/>
    <param name="from-user" value="03xxxxxxx"/>
    <param name="from-domain" value="x.y.z"/>
    <param name="auth-username" value="yyyyy"/>
    <param name="realm" value="bwas02.voip.izzz.zz.au<http://bwas02.voip.izzz.zz.au>"/>
    <param name="proxy" value="sipconnect.voip.zzzz.zz.au<http://sipconnect.voip.zzzz.zz.au>"/>
    <param name="register" value="true"/>
    <param name="register-transport" value="udp"/>
    <param name="context" value="public"/>
  </gateway>

Cheers,
Louie

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org<mailto:consulting at freeswitch.org>
http://www.freeswitchsolutions.com




Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org<mailto: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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20140724/c4335de0/attachment-0001.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list