[Freeswitch-users] map inbound calls to a gateway based on IP

Andrew Carrega acarrega at vartel.com
Mon Sep 10 15:48:03 MSD 2012



sure. This will work. so if the "sip_contact _host= IP address then bridge



  condition       ${sip_contact_host}     XX.XX.XX.XX           <http://208.75.228.154/app/dialplan/dialplan_details_edit.php?id=134acbb2-75a8-4e8a-89d1-fa32e730e118&id2=43aec539-2cf6-47c9-bb74-587a31a8e69f>  <http://208.75.228.154/app/dialplan/dialplan_details_delete.php?id=134acbb2-75a8-4e8a-89d1-fa32e730e118&id2=43aec539-2cf6-47c9-bb74-587a31a8e69f>
  condition       context         public                <http://208.75.228.154/app/dialplan/dialplan_details_edit.php?id=38e3a52a-7ac7-45bb-a1e6-512afde61cb9&id2=43aec539-2cf6-47c9-bb74-587a31a8e69f>  <http://208.75.228.154/app/dialplan/dialplan_details_delete.php?id=38e3a52a-7ac7-45bb-a1e6-512afde61cb9&id2=43aec539-2cf6-47c9-bb74-587a31a8e69f>
  condition       destination_number      ^(\d{10})$            <http://208.75.228.154/app/dialplan/dialplan_details_edit.php?id=7f154265-0f95-4b6c-be75-e2a932ae7307&id2=43aec539-2cf6-47c9-bb74-587a31a8e69f>  <http://208.75.228.154/app/dialplan/dialplan_details_delete.php?id=7f154265-0f95-4b6c-be75-e2a932ae7307&id2=43aec539-2cf6-47c9-bb74-587a31a8e69f>
  action          set     hangup_after_bridge=true              <http://208.75.228.154/app/dialplan/dialplan_details_edit.php?id=53b85bcc-33e6-4570-b645-6d30585deeee&id2=43aec539-2cf6-47c9-bb74-587a31a8e69f>  <http://208.75.228.154/app/dialplan/dialplan_details_delete.php?id=53b85bcc-33e6-4570-b645-6d30585deeee&id2=43aec539-2cf6-47c9-bb74-587a31a8e69f>
  action          bridge          sofia/gateway/GatewayName/$1

________________________________
From: Richard Zheng [rzheng at gmail.com]
Sent: Sunday, September 09, 2012 3:01 AM
To: freeswitch-users at lists.freeswitch.org
Subject: [Freeswitch-users] map inbound calls to a gateway based on IP

Hi,

I know that this has been discussed many times.  Just want to get a clear answer.  Is it possible to map inbound calls to a particular gateway based on IP address?  Someone seems to claim that it's working.  Others say no way.  I tried to put context param in gateway section and no effect.  This is in sip_profile gateway config.  There were suggestions to just use context public, then send to its own context in dialplan.  But that's not all the same.

In asterisk world, the following section is sufficient in sip.conf.  The system matches IP based SIP traffic first, then look for users with registration based.

[providerA]
type=peer
qualify=yes
context=provider_a
host=1.2.3.4
disallow=all      ; First disallow all codecs
allow=ulaw      ; Allow codecs in order of preference
fromuser=
dtmfmode=rfc2833
fromdomain=provider_a

Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20120910/d3ffdf29/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list