<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle">P {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
</style>
</head>
<body fPStyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<p> </p>
<p>sure. This will work. so if the "sip_contact<a></a> _host= IP address then bridge</p>
<p> </p>
<p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td class="row_style0" valign="top"> <font style="BACKGROUND-COLOR: #ffff99">condition</font></td>
<td class="row_style0" valign="top"><font style="BACKGROUND-COLOR: #ffff99"> ${sip_contact_host}</font></td>
<td class="row_style0" valign="top"><font style="BACKGROUND-COLOR: #ffff99"> </font>XX.XX.XX.XX</td>
<td class="row_style0" valign="top"></td>
<td valign="top" nowrap="" align="right"><a href="http://208.75.228.154/app/dialplan/dialplan_details_edit.php?id=134acbb2-75a8-4e8a-89d1-fa32e730e118&id2=43aec539-2cf6-47c9-bb74-587a31a8e69f" alt="edit"></a> <a onclick="return confirm('Do you really want to delete this?')" href="http://208.75.228.154/app/dialplan/dialplan_details_delete.php?id=134acbb2-75a8-4e8a-89d1-fa32e730e118&id2=43aec539-2cf6-47c9-bb74-587a31a8e69f" alt="delete"></a>
</td>
</tr>
<tr>
<td class="row_style0" valign="top"> condition</td>
<td class="row_style0" valign="top"> context</td>
<td class="row_style0" valign="top"> public</td>
<td class="row_style0" valign="top"> </td>
<td valign="top" nowrap="" align="right"><a href="http://208.75.228.154/app/dialplan/dialplan_details_edit.php?id=38e3a52a-7ac7-45bb-a1e6-512afde61cb9&id2=43aec539-2cf6-47c9-bb74-587a31a8e69f" alt="edit"></a> <a onclick="return confirm('Do you really want to delete this?')" href="http://208.75.228.154/app/dialplan/dialplan_details_delete.php?id=38e3a52a-7ac7-45bb-a1e6-512afde61cb9&id2=43aec539-2cf6-47c9-bb74-587a31a8e69f" alt="delete"></a>
</td>
</tr>
<tr>
<td class="row_style0" valign="top"> condition</td>
<td class="row_style0" valign="top"> destination_number</td>
<td class="row_style0" valign="top"> ^(\d{10})$</td>
<td class="row_style0" valign="top"></td>
<td valign="top" nowrap="" align="right"><a href="http://208.75.228.154/app/dialplan/dialplan_details_edit.php?id=7f154265-0f95-4b6c-be75-e2a932ae7307&id2=43aec539-2cf6-47c9-bb74-587a31a8e69f" alt="edit"></a> <a onclick="return confirm('Do you really want to delete this?')" href="http://208.75.228.154/app/dialplan/dialplan_details_delete.php?id=7f154265-0f95-4b6c-be75-e2a932ae7307&id2=43aec539-2cf6-47c9-bb74-587a31a8e69f" alt="delete"></a>
</td>
</tr>
<tr>
<td class="row_style0" valign="top"> action</td>
<td class="row_style0" valign="top"> set</td>
<td class="row_style0" valign="top"> hangup_after_bridge=true</td>
<td class="row_style0" valign="top"> </td>
<td valign="top" nowrap="" align="right"><a href="http://208.75.228.154/app/dialplan/dialplan_details_edit.php?id=53b85bcc-33e6-4570-b645-6d30585deeee&id2=43aec539-2cf6-47c9-bb74-587a31a8e69f" alt="edit"></a> <a onclick="return confirm('Do you really want to delete this?')" href="http://208.75.228.154/app/dialplan/dialplan_details_delete.php?id=53b85bcc-33e6-4570-b645-6d30585deeee&id2=43aec539-2cf6-47c9-bb74-587a31a8e69f" alt="delete"></a>
</td>
</tr>
<tr>
<td class="row_style0" valign="top"> action</td>
<td class="row_style0" valign="top"> bridge</td>
<td class="row_style0" valign="top"> sofia/gateway/GatewayName/$1</td>
</tr>
</tbody>
</table>
</p>
<div style="FONT-FAMILY: Times New Roman; COLOR: #000000; FONT-SIZE: 16px">
<hr tabindex="-1">
<div style="DIRECTION: ltr" id="divRpF28481"><font color="#000000" size="2" face="Tahoma"><b>From:</b> Richard Zheng [rzheng@gmail.com]<br>
<b>Sent:</b> Sunday, September 09, 2012 3:01 AM<br>
<b>To:</b> freeswitch-users@lists.freeswitch.org<br>
<b>Subject:</b> [Freeswitch-users] map inbound calls to a gateway based on IP<br>
</font><br>
</div>
<div></div>
<div>Hi,
<div><br>
</div>
<div>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. </div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>
<div>[providerA]</div>
<div>type=peer</div>
<div>qualify=yes</div>
<div>context=provider_a</div>
<div>host=1.2.3.4</div>
<div>disallow=all ; First disallow all codecs</div>
<div>allow=ulaw ; Allow codecs in order of preference</div>
<div>fromuser=</div>
<div>dtmfmode=rfc2833</div>
<div>fromdomain=provider_a</div>
</div>
<div><br>
</div>
<div>Richard</div>
</div>
</div>
</div>
</body>
</html>