<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
Hello Freeswitch Users List,<br>
<br>
I am trying to emulate asterisk behavior for user / gateway context
under FreeSWITCH.<br>
<br>
For users inside the 'directory' directory I can set up different
contexts using the 'user_context' variable, solved.<br>
<br>
But when i have to deal with external gateways sip_profiles seems to be
the best place to put the configuration, and if i want to use just one
sip profile due to firewall restricctions i am limited to just one
context.<br>
<br>
According to FreeSWITCH FAQ:<br>
<h3><a
href="http://wiki.freeswitch.org/wiki/FreeSwitch_FAQ#Q:_How_do_I_assign_endpoints_to_contexts_with_different_sets_of_extensions"><span
class="mw-headline">Q: How do I assign endpoints to contexts with
different sets of extensions</span></a><br>
</h3>
<p>Here are the different possible approaches:
</p>
<ol>
<li> use 1 profile per context you want to route to (each one needs a
distinct ip:port)
</li>
<li> use different domains in the registration data and use the auto
context thing
</li>
<li> send them all to a common context and execute_exten or transfer
to somewhere else
</li>
<li> send them to an IVR to decide where they go
</li>
<li> use xml_curl to make it dish out a different dialplan based on
who they are in the list of data you are fed
</li>
</ol>
I don't want to use 1 profile per context, so option 1 discarded.<br>
I don't want to use different domains in the registration data, since
it have no semantic for a one company, so option 2 discarded, but for
gateways it makes sense.<br>
I don't want to use an IVR for every user call, so option 4 discarded.<br>
So that gives me two choices, use xml_curl, which means i have to set
up a webserver but that seems overkill, it seems to be an superset of
option 3, so that left me with option 3 using just static XML files.<br>
<br>
I found this example on the dialplan XML:<br>
<pre> <extension name="Inbound_external">
<condition regex="any">
<regex field="${sip_from_host}" expression="domainA"/>
<regex field="${sip_from_uri}" expression="1234567890@domainB"/>
<regex field="${sip_from_uri}" expression="user@domainC"/>
<regex field="caller_id_name" expression="^(John Smith)$"/>
<regex field="caller_id_number" expression="^(55512341)|(55512342)|(55512343)$"/>
<action application="set" data="domain_name=domainZ"/>
<action application="transfer" data="${destination_number} XML domainZ"/>
</condition>
</extension>
</pre>
It seems to be the first place to start adapting to internal extension
and transfering to the correct dialplan, anybody have a more refined
example ? which variables can i trust / use in order to validate a call
from a particular gateway and then set up a context transfer according
to them.<br>
<br>
p.d. anybody knows about a good cdr web stats software for freeswitch ?
i have used cdr-stats for asterisk in the past, newer version seems to
have freeswitch support on the way, but stable ? any suggestions will
be apreciated .<br>
<br>
Thank you !!<br>
<br>
<br>
<pre class="moz-signature" cols="72">--
Nestor A. Diaz
Ingeniero de Sistemas
Tel. +57 1-485-3020 x 211
Cel. +57 316-227-3593
Tel. SIP: <a class="moz-txt-link-freetext" href="sip:211@tiendalinux.com">sip:211@tiendalinux.com</a>
Email/MSN: <a class="moz-txt-link-abbreviated" href="mailto:nestor@tiendalinux.com">nestor@tiendalinux.com</a>
<a class="moz-txt-link-freetext" href="http://www.tiendalinux.com/">http://www.tiendalinux.com/</a>
Bogota, Colombia
</pre>
</body>
</html>