<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>&nbsp;</p>
<p>sure. This will work. so if the &quot;sip_contact<a></a> _host= IP address then bridge</p>
<p>&nbsp;</p>
<p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td class="row_style0" valign="top">&nbsp;&nbsp;<font style="BACKGROUND-COLOR: #ffff99">condition</font></td>
<td class="row_style0" valign="top"><font style="BACKGROUND-COLOR: #ffff99">&nbsp;&nbsp;${sip_contact_host}</font></td>
<td class="row_style0" valign="top"><font style="BACKGROUND-COLOR: #ffff99">&nbsp;&nbsp;</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&amp;id2=43aec539-2cf6-47c9-bb74-587a31a8e69f" alt="edit"></a>&nbsp;<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&amp;id2=43aec539-2cf6-47c9-bb74-587a31a8e69f" alt="delete"></a>
</td>
</tr>
<tr>
<td class="row_style0" valign="top">&nbsp;&nbsp;condition</td>
<td class="row_style0" valign="top">&nbsp;&nbsp;context</td>
<td class="row_style0" valign="top">&nbsp;&nbsp;public</td>
<td class="row_style0" valign="top">&nbsp;</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&amp;id2=43aec539-2cf6-47c9-bb74-587a31a8e69f" alt="edit"></a>&nbsp;<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&amp;id2=43aec539-2cf6-47c9-bb74-587a31a8e69f" alt="delete"></a>
</td>
</tr>
<tr>
<td class="row_style0" valign="top">&nbsp;&nbsp;condition</td>
<td class="row_style0" valign="top">&nbsp;&nbsp;destination_number</td>
<td class="row_style0" valign="top">&nbsp;&nbsp;^(\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&amp;id2=43aec539-2cf6-47c9-bb74-587a31a8e69f" alt="edit"></a>&nbsp;<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&amp;id2=43aec539-2cf6-47c9-bb74-587a31a8e69f" alt="delete"></a>
</td>
</tr>
<tr>
<td class="row_style0" valign="top">&nbsp;&nbsp;action</td>
<td class="row_style0" valign="top">&nbsp;&nbsp;set</td>
<td class="row_style0" valign="top">&nbsp;&nbsp;hangup_after_bridge=true</td>
<td class="row_style0" valign="top">&nbsp;&nbsp;</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&amp;id2=43aec539-2cf6-47c9-bb74-587a31a8e69f" alt="edit"></a>&nbsp;<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&amp;id2=43aec539-2cf6-47c9-bb74-587a31a8e69f" alt="delete"></a>
</td>
</tr>
<tr>
<td class="row_style0" valign="top">&nbsp;&nbsp;action</td>
<td class="row_style0" valign="top">&nbsp;&nbsp;bridge</td>
<td class="row_style0" valign="top">&nbsp;&nbsp;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. &nbsp;Just want to get a clear answer. &nbsp;Is it possible to map inbound calls to a particular gateway based on IP address? &nbsp;Someone seems to claim that it's working. &nbsp;Others say no way. &nbsp;I tried to put context param
 in gateway section and no effect. &nbsp;This is in sip_profile gateway config. &nbsp;There were suggestions to just use context public, then send to its own context in dialplan. &nbsp;But that's not all the same. &nbsp;</div>
<div><br>
</div>
<div>In asterisk world, the following section is sufficient in sip.conf. &nbsp;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 &nbsp; &nbsp; &nbsp;; First disallow all codecs</div>
<div>allow=ulaw &nbsp; &nbsp; &nbsp;; 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>