Hello Freeswitch Users List,
I am trying to emulate asterisk behavior for user / gateway context
under FreeSWITCH.
For users inside the 'directory' directory I can set up different
contexts using the 'user_context' variable, solved.
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.
According to FreeSWITCH FAQ:
Here are the different possible approaches:
- use 1 profile per context you want to route to (each one needs a
distinct ip:port)
- use different domains in the registration data and use the auto
context thing
- send them all to a common context and execute_exten or transfer
to somewhere else
- send them to an IVR to decide where they go
- use xml_curl to make it dish out a different dialplan based on
who they are in the list of data you are fed
I don't want to use 1 profile per context, so option 1 discarded.
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.
I don't want to use an IVR for every user call, so option 4 discarded.
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.
I found this example on the dialplan XML:
<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>
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.
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 .
Thank you !!
--
Nestor A. Diaz
Ingeniero de Sistemas
Tel. +57 1-485-3020 x 211
Cel. +57 316-227-3593
Tel. SIP: sip:211@tiendalinux.com
Email/MSN: nestor@tiendalinux.com
http://www.tiendalinux.com/
Bogota, Colombia