Hello All,<div><br></div><div><br></div><div>I&#39;m receiving calls on, say IP 1.2.3.4 and i want to send them out on IP 1.2.3.4 or IP 5.6.7.8 depending on the gateway I want to use.</div><div>For this, i created TWO profiles, one binding to IP1, the other to IP2.</div>

<div>Then I created one gateway on each profile.</div><div><br></div><div>BUT, FS is loading both GWs on BOTH PROFILES!</div><div><br></div><div>Is this normal? Can anyone give me a hand with this?</div><div><br></div><div>

Thanks!</div><div><br></div><div>David</div><div><br></div><div>my fs-cli output:</div><div><br></div><div>freeswitch@127.0.0.1@internal&gt; sofia xmlstatus</div><div><br></div><div><div>&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;</div>

<div>&lt;profiles&gt;</div><div>&lt;profile&gt;</div><div>&lt;name&gt;IP_REAL&lt;/name&gt;</div><div>&lt;type&gt;profile&lt;/type&gt;</div><div>&lt;data&gt;<a href="http://sip:mod_sofia@1.2.3.4:5060">sip:mod_sofia@1.2.3.4:5060</a>&lt;/data&gt;</div>

<div>&lt;state&gt;RUNNING (0)&lt;/state&gt;</div><div>&lt;/profile&gt;</div><div>&lt;gateway&gt;</div><div>&lt;name&gt;<a href="http://example.com">example.com</a>&lt;/name&gt;</div><div>&lt;type&gt;gateway&lt;/type&gt;</div>

<div>&lt;data&gt;<a href="mailto:sip%3A@example.com">sip:@example.com</a>&lt;/data&gt;</div><div>&lt;state&gt;NOREG&lt;/state&gt;</div><div>&lt;/gateway&gt;</div><div><br></div><div>&lt;gateway&gt;</div><div>&lt;name&gt;test&lt;/name&gt;</div>

<div>&lt;type&gt;gateway&lt;/type&gt;</div><div>&lt;data&gt;sip:@Y.Y.Y.Y&lt;/data&gt;</div><div>&lt;state&gt;NOREG&lt;/state&gt;</div><div>&lt;/gateway&gt;</div><div><br></div><div>&lt;gateway&gt;</div><div>&lt;name&gt;GREAT&lt;/name&gt;</div>

<div>&lt;type&gt;gateway&lt;/type&gt;</div><div>&lt;data&gt;sip:@X.X.X.X&lt;/data&gt;</div><div>&lt;state&gt;NOREG&lt;/state&gt;</div><div>&lt;/gateway&gt;</div><div><br></div><div>&lt;profile&gt;</div><div>&lt;name&gt;IP_SPAIN_1&lt;/name&gt;</div>

<div>&lt;type&gt;profile&lt;/type&gt;</div><div>&lt;data&gt;<a href="http://sip:mod_sofia@5.6.7.8:5060">sip:mod_sofia@5.6.7.8:5060</a>&lt;/data&gt;</div><div>&lt;state&gt;RUNNING (0)&lt;/state&gt;</div><div>&lt;/profile&gt;</div>

<div>&lt;gateway&gt;</div><div>&lt;name&gt;<a href="http://example.com">example.com</a>&lt;/name&gt;</div><div>&lt;type&gt;gateway&lt;/type&gt;</div><div>&lt;data&gt;<a href="mailto:sip%3A@example.com">sip:@example.com</a>&lt;/data&gt;</div>

<div>&lt;state&gt;NOREG&lt;/state&gt;</div><div>&lt;/gateway&gt;</div><div><br></div><div>&lt;gateway&gt;</div><div>&lt;name&gt;test&lt;/name&gt;</div><div>&lt;type&gt;gateway&lt;/type&gt;</div><div>&lt;data&gt;sip:@Y.Y.Y.Y&lt;/data&gt;</div>

<div>&lt;state&gt;NOREG&lt;/state&gt;</div><div>&lt;/gateway&gt;</div><div><br></div><div>&lt;gateway&gt;</div><div>&lt;name&gt;GREAT&lt;/name&gt;</div><div>&lt;type&gt;gateway&lt;/type&gt;</div><div>&lt;data&gt;sip:@X.X.X.X&lt;/data&gt;</div>

<div>&lt;state&gt;NOREG&lt;/state&gt;</div><div>&lt;/gateway&gt;</div><div><br></div><div>&lt;/profiles&gt;</div></div><div><br></div><div>My sofia:</div><div><br></div><div><div>     &lt;configuration name=&quot;sofia.conf&quot; description=&quot;sofia Endpoint&quot;&gt;</div>

<div>     </div><div>       &lt;global_settings&gt;</div><div>         &lt;param name=&quot;log-level&quot; value=&quot;0&quot;/&gt;</div><div>         &lt;!-- &lt;param name=&quot;auto-restart&quot; value=&quot;false&quot;/&gt; --&gt;</div>

<div>         &lt;param name=&quot;debug-presence&quot; value=&quot;0&quot;/&gt;</div><div>       &lt;/global_settings&gt;</div><div><br></div><div><br></div><div>            &lt;profiles&gt;</div><div>     </div><div>                 &lt;profile name=&quot;IP_REAL&quot;&gt;</div>

<div>                      &lt;!-- <a href="http://wiki.freeswitch.org/wiki/Sofia_Configuration_Files">http://wiki.freeswitch.org/wiki/Sofia_Configuration_Files</a> --&gt; </div><div>                      &lt;!-- This profile is only for outbound registrations to providers --&gt;</div>

<div>                      &lt;gateways&gt;</div><div>                    </div><div>          </div><div>                         &lt;gateway name=&quot;test&quot;&gt;</div><div>                              &lt;param name=&quot;realm&quot; value=&quot;Y.Y.Y.Y&quot;/&gt;</div>

<div>                              &lt;param name=&quot;username&quot; value=&quot;&quot;/&gt;</div><div>                              &lt;param name=&quot;password&quot; value=&quot;&quot;/&gt;</div><div>                              &lt;param name=&quot;register&quot; value=&quot;false&quot;/&gt;</div>

<div>                              &lt;param name=&quot;retry-seconds&quot; value=&quot;30&quot;/&gt;</div><div>                              &lt;param name=&quot;caller-id-in-from&quot; value=&quot;true&quot;/&gt;</div>
<div>
                         &lt;/gateway&gt;</div><div>                              </div><div>                      &lt;/gateways&gt;</div><div>                    </div><div>                      &lt;aliases&gt;</div><div>

                        &lt;!-- </div><div>                        &lt;alias name=&quot;outbound&quot;/&gt;</div><div>                        &lt;alias name=&quot;nat&quot;/&gt;</div><div>                        --&gt;</div>

<div>                      &lt;/aliases&gt;</div><div>                    </div><div>                      &lt;domains&gt;</div><div>                        &lt;domain name=&quot;all&quot; alias=&quot;false&quot; parse=&quot;true&quot;/&gt;</div>

<div>                      &lt;/domains&gt;</div><div>                    </div><div>                      &lt;settings&gt;</div><div>                        &lt;param name=&quot;debug&quot; value=&quot;0&quot;/&gt;</div>

<div>                    <span class="Apple-tab-span" style="white-space:pre">        </span>&lt;!-- If you want FreeSWITCH to shutdown if this profile fails to load, uncomment the next line. --&gt;</div><div>                    <span class="Apple-tab-span" style="white-space:pre">        </span>&lt;!-- &lt;param name=&quot;shutdown-on-fail&quot; value=&quot;true&quot;/&gt; --&gt;</div>

<div>                        &lt;param name=&quot;sip-trace&quot; value=&quot;no&quot;/&gt;</div><div>                        &lt;param name=&quot;rfc2833-pt&quot; value=&quot;101&quot;/&gt;</div><div>                        &lt;param name=&quot;sip-port&quot; value=&quot;5060&quot;/&gt;</div>

<div>                    &lt;!--    &lt;param name=&quot;sip-port&quot; value=&quot;5061&quot;/&gt;                         --&gt;</div><div>                        &lt;param name=&quot;dialplan&quot; value=&quot;XML&quot;/&gt; </div>

<div>                        &lt;param name=&quot;context&quot; value=&quot;IP_REAL&quot;/&gt;</div><div>                        &lt;param name=&quot;dtmf-duration&quot; value=&quot;2000&quot;/&gt;</div><div>                        &lt;param name=&quot;inbound-codec-prefs&quot; value=&quot;$${global_codec_prefs}&quot;/&gt;</div>

<div>                        &lt;param name=&quot;outbound-codec-prefs&quot; value=&quot;$${outbound_codec_prefs}&quot;/&gt;</div><div>                        &lt;param name=&quot;hold-music&quot; value=&quot;$${hold_music}&quot;/&gt;</div>

<div>                        &lt;param name=&quot;rtp-timer-name&quot; value=&quot;soft&quot;/&gt;</div><div>                        &lt;!--&lt;param name=&quot;enable-100rel&quot; value=&quot;true&quot;/&gt;--&gt;</div>
<div>
                        &lt;!-- This could be set to &quot;passive&quot; --&gt;</div><div>                        &lt;param name=&quot;local-network-acl&quot; value=&quot;localnet.auto&quot;/&gt;</div><div>                        &lt;param name=&quot;manage-presence&quot; value=&quot;false&quot;/&gt;</div>

<div>                    </div><div>                        &lt;!-- used to share presence info across sofia profiles </div><div>                    <span class="Apple-tab-span" style="white-space:pre">        </span> manage-presence needs to be set to passive on this profile</div>

<div>                    <span class="Apple-tab-span" style="white-space:pre">        </span> if you want it to behave as if it were the internal profile </div><div>                    <span class="Apple-tab-span" style="white-space:pre">        </span> for presence.</div>

<div>                        --&gt;</div><div>                        &lt;!-- Name of the db to use for this profile --&gt;</div><div>                        &lt;!--&lt;param name=&quot;dbname&quot; value=&quot;share_presence&quot;/&gt;--&gt;</div>

<div>                        &lt;!--&lt;param name=&quot;presence-hosts&quot; value=&quot;$${domain}&quot;/&gt;--&gt;</div><div>                        &lt;!--&lt;param name=&quot;force-register-domain&quot; value=&quot;$${domain}&quot;/&gt;--&gt;</div>

<div>                        &lt;!--all inbound reg will stored in the db using this domain --&gt;</div><div>                        &lt;!--&lt;param name=&quot;force-register-db-domain&quot; value=&quot;$${domain}&quot;/&gt;--&gt;</div>

<div>                        &lt;!-- ************************************************* --&gt;</div><div>                    </div><div>                        &lt;param name=&quot;apply-nat-acl&quot; value=&quot;rfc1918&quot;/&gt;</div>

<div>                        &lt;param name=&quot;aggressive-nat-detection&quot; value=&quot;true&quot;/&gt;</div><div>                        &lt;param name=&quot;inbound-codec-negotiation&quot; value=&quot;generous&quot;/&gt;</div>

<div>                        &lt;param name=&quot;nonce-ttl&quot; value=&quot;60&quot;/&gt;</div><div>                        &lt;param name=&quot;auth-calls&quot; value=&quot;false&quot;/&gt;</div><div>                        &lt;!--</div>

<div>                    <span class="Apple-tab-span" style="white-space:pre">        </span>DO NOT USE HOSTNAMES, ONLY IP ADDRESSES IN THESE SETTINGS!</div><div>                        --&gt;</div><div>                        &lt;param name=&quot;rtp-ip&quot; value=&quot;1.2.3.4&quot;/&gt;</div>

<div>                        &lt;param name=&quot;sip-ip&quot; value=&quot;1.2.3.4&quot;/&gt;</div><div>                        &lt;param name=&quot;ext-rtp-ip&quot; value=&quot;auto-nat&quot;/&gt;</div><div>                        &lt;param name=&quot;ext-sip-ip&quot; value=&quot;auto-nat&quot;/&gt;</div>

<div>                        &lt;param name=&quot;rtp-timeout-sec&quot; value=&quot;3600&quot;/&gt;</div><div>                        &lt;param name=&quot;rtp-hold-timeout-sec&quot; value=&quot;1800&quot;/&gt;</div><div>
                        &lt;!--&lt;param name=&quot;enable-3pcc&quot; value=&quot;true&quot;/&gt;--&gt;</div>
<div>                    </div><div>                        &lt;!-- TLS: disabled by default, set to &quot;true&quot; to enable --&gt;</div><div>                        &lt;param name=&quot;tls&quot; value=&quot;$${external_ssl_enable}&quot;/&gt;</div>

<div>                        &lt;!-- additional bind parameters for TLS --&gt;</div><div>                        &lt;param name=&quot;tls-bind-params&quot; value=&quot;transport=tls&quot;/&gt;</div><div>                        &lt;!-- Port to listen on for TLS requests. (5081 will be used if unspecified) --&gt;</div>

<div>                        &lt;param name=&quot;tls-sip-port&quot; value=&quot;$${external_tls_port}&quot;/&gt;</div><div>                        &lt;!-- Location of the agent.pem and cafile.pem ssl certificates (needed for TLS server) --&gt;</div>

<div>                        &lt;param name=&quot;tls-cert-dir&quot; value=&quot;$${external_ssl_dir}&quot;/&gt;</div><div>                        &lt;!-- TLS version (&quot;sslv23&quot; (default), &quot;tlsv1&quot;). NOTE: Phones may not work with TLSv1 --&gt;</div>

<div>                        &lt;param name=&quot;tls-version&quot; value=&quot;$${sip_tls_version}&quot;/&gt;</div><div>                    </div><div>                      &lt;/settings&gt;</div><div>                    &lt;/profile&gt;</div>

<div>     </div><div>                 &lt;profile name=&quot;IP_SPAIN_1&quot;&gt;</div><div>                      &lt;!-- <a href="http://wiki.freeswitch.org/wiki/Sofia_Configuration_Files">http://wiki.freeswitch.org/wiki/Sofia_Configuration_Files</a> --&gt; </div>

<div>                      &lt;!-- This profile is only for outbound registrations to providers --&gt;</div><div>                      &lt;gateways&gt;</div><div>                    </div><div>          </div><div>                         &lt;gateway name=&quot;GREAT&quot;&gt;</div>

<div>                              &lt;param name=&quot;realm&quot; value=&quot;X.X.X.X&quot;/&gt;</div><div>                              &lt;param name=&quot;username&quot; value=&quot;&quot;/&gt;</div><div>                              &lt;param name=&quot;password&quot; value=&quot;&quot;/&gt;</div>

<div>                              &lt;param name=&quot;register&quot; value=&quot;false&quot;/&gt;</div><div>                              &lt;param name=&quot;retry-seconds&quot; value=&quot;30&quot;/&gt;</div><div>                              &lt;param name=&quot;caller-id-in-from&quot; value=&quot;true&quot;/&gt;</div>

<div>                         &lt;/gateway&gt;</div><div>                              </div><div>                      &lt;/gateways&gt;</div><div>                    </div><div>                      &lt;aliases&gt;</div>

<div>                        &lt;!-- </div><div>                        &lt;alias name=&quot;outbound&quot;/&gt;</div><div>                        &lt;alias name=&quot;nat&quot;/&gt;</div><div>                        --&gt;</div>

<div>                      &lt;/aliases&gt;</div><div>                    </div><div>                      &lt;domains&gt;</div><div>                        &lt;domain name=&quot;all&quot; alias=&quot;false&quot; parse=&quot;true&quot;/&gt;</div>

<div>                      &lt;/domains&gt;</div><div>                    </div><div>                      &lt;settings&gt;</div><div>                        &lt;param name=&quot;debug&quot; value=&quot;0&quot;/&gt;</div>

<div>                    <span class="Apple-tab-span" style="white-space:pre">        </span>&lt;!-- If you want FreeSWITCH to shutdown if this profile fails to load, uncomment the next line. --&gt;</div><div>                    <span class="Apple-tab-span" style="white-space:pre">        </span>&lt;!-- &lt;param name=&quot;shutdown-on-fail&quot; value=&quot;true&quot;/&gt; --&gt;</div>

<div>                        &lt;param name=&quot;sip-trace&quot; value=&quot;no&quot;/&gt;</div><div>                        &lt;param name=&quot;rfc2833-pt&quot; value=&quot;101&quot;/&gt;</div><div>                        &lt;param name=&quot;sip-port&quot; value=&quot;5060&quot;/&gt;</div>

<div>                    &lt;!--    &lt;param name=&quot;sip-port&quot; value=&quot;5061&quot;/&gt;                         --&gt;</div><div>                        &lt;param name=&quot;dialplan&quot; value=&quot;XML&quot;/&gt; </div>

<div>                        &lt;param name=&quot;context&quot; value=&quot;IP_SPAIN_1&quot;/&gt;</div><div>                        &lt;param name=&quot;dtmf-duration&quot; value=&quot;2000&quot;/&gt;</div><div>                        &lt;param name=&quot;inbound-codec-prefs&quot; value=&quot;$${global_codec_prefs}&quot;/&gt;</div>

<div>                        &lt;param name=&quot;outbound-codec-prefs&quot; value=&quot;$${outbound_codec_prefs}&quot;/&gt;</div><div>                        &lt;param name=&quot;hold-music&quot; value=&quot;$${hold_music}&quot;/&gt;</div>

<div>                        &lt;param name=&quot;rtp-timer-name&quot; value=&quot;soft&quot;/&gt;</div><div>                        &lt;!--&lt;param name=&quot;enable-100rel&quot; value=&quot;true&quot;/&gt;--&gt;</div>
<div>
                        &lt;!-- This could be set to &quot;passive&quot; --&gt;</div><div>                        &lt;param name=&quot;local-network-acl&quot; value=&quot;localnet.auto&quot;/&gt;</div><div>                        &lt;param name=&quot;manage-presence&quot; value=&quot;false&quot;/&gt;</div>

<div>                    </div><div>                        &lt;!-- used to share presence info across sofia profiles </div><div>                    <span class="Apple-tab-span" style="white-space:pre">        </span> manage-presence needs to be set to passive on this profile</div>

<div>                    <span class="Apple-tab-span" style="white-space:pre">        </span> if you want it to behave as if it were the internal profile </div><div>                    <span class="Apple-tab-span" style="white-space:pre">        </span> for presence.</div>

<div>                        --&gt;</div><div>                        &lt;!-- Name of the db to use for this profile --&gt;</div><div>                        &lt;!--&lt;param name=&quot;dbname&quot; value=&quot;share_presence&quot;/&gt;--&gt;</div>

<div>                        &lt;!--&lt;param name=&quot;presence-hosts&quot; value=&quot;$${domain}&quot;/&gt;--&gt;</div><div>                        &lt;!--&lt;param name=&quot;force-register-domain&quot; value=&quot;$${domain}&quot;/&gt;--&gt;</div>

<div>                        &lt;!--all inbound reg will stored in the db using this domain --&gt;</div><div>                        &lt;!--&lt;param name=&quot;force-register-db-domain&quot; value=&quot;$${domain}&quot;/&gt;--&gt;</div>

<div>                        &lt;!-- ************************************************* --&gt;</div><div>                    </div><div>                        &lt;param name=&quot;apply-nat-acl&quot; value=&quot;rfc1918&quot;/&gt;</div>

<div>                        &lt;param name=&quot;aggressive-nat-detection&quot; value=&quot;true&quot;/&gt;</div><div>                        &lt;param name=&quot;inbound-codec-negotiation&quot; value=&quot;generous&quot;/&gt;</div>

<div>                        &lt;param name=&quot;nonce-ttl&quot; value=&quot;60&quot;/&gt;</div><div>                        &lt;param name=&quot;auth-calls&quot; value=&quot;false&quot;/&gt;</div><div>                        &lt;!--</div>

<div>                    <span class="Apple-tab-span" style="white-space:pre">        </span>DO NOT USE HOSTNAMES, ONLY IP ADDRESSES IN THESE SETTINGS!</div><div>                        --&gt;</div><div>                        &lt;param name=&quot;rtp-ip&quot; value=&quot;5.6.7.8&quot;/&gt;</div>

<div>                        &lt;param name=&quot;sip-ip&quot; value=&quot;5.6.7.8&quot;/&gt;</div><div>                        &lt;param name=&quot;ext-rtp-ip&quot; value=&quot;auto-nat&quot;/&gt;</div><div>                        &lt;param name=&quot;ext-sip-ip&quot; value=&quot;auto-nat&quot;/&gt;</div>

<div>                        &lt;param name=&quot;rtp-timeout-sec&quot; value=&quot;3600&quot;/&gt;</div><div>                        &lt;param name=&quot;rtp-hold-timeout-sec&quot; value=&quot;1800&quot;/&gt;</div><div>
                        &lt;!--&lt;param name=&quot;enable-3pcc&quot; value=&quot;true&quot;/&gt;--&gt;</div>
<div>                    </div><div>                        &lt;!-- TLS: disabled by default, set to &quot;true&quot; to enable --&gt;</div><div>                        &lt;param name=&quot;tls&quot; value=&quot;$${external_ssl_enable}&quot;/&gt;</div>

<div>                        &lt;!-- additional bind parameters for TLS --&gt;</div><div>                        &lt;param name=&quot;tls-bind-params&quot; value=&quot;transport=tls&quot;/&gt;</div><div>                        &lt;!-- Port to listen on for TLS requests. (5081 will be used if unspecified) --&gt;</div>

<div>                        &lt;param name=&quot;tls-sip-port&quot; value=&quot;$${external_tls_port}&quot;/&gt;</div><div>                        &lt;!-- Location of the agent.pem and cafile.pem ssl certificates (needed for TLS server) --&gt;</div>

<div>                        &lt;param name=&quot;tls-cert-dir&quot; value=&quot;$${external_ssl_dir}&quot;/&gt;</div><div>                        &lt;!-- TLS version (&quot;sslv23&quot; (default), &quot;tlsv1&quot;). NOTE: Phones may not work with TLSv1 --&gt;</div>

<div>                        &lt;param name=&quot;tls-version&quot; value=&quot;$${sip_tls_version}&quot;/&gt;</div><div>                    </div><div>                      &lt;/settings&gt;</div><div>                    &lt;/profile&gt;</div>

<div>     </div><div>       &lt;/profiles&gt;</div><div>     </div><div>     &lt;/configuration&gt;</div></div><div><br></div><br class="Apple-interchange-newline">