<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Hi Francis,<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Many thanks for taking the time to explain this so well for me. I hadn't appreciated the design of FS like this before, and now it make alot more sense.<br>
</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I'll make some adjustments to the way my GUI works now, and see how things pan out. :)<br><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">
Richard<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 8 June 2014 15:29, Francis <span dir="ltr"><<a href="mailto:sms@icefire.qza.net.au" target="_blank">sms@icefire.qza.net.au</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
Ah I see! There is an option somewhere on the wiki (memory fails me
right now) to disable voicemail on a per user basis, set in their
profile. In the case of setting variables per user, it's best to
keep them in the user profile so that they are called when the user
makes a call. In the case of pulling variables when the user is
_being_ called, you can execute actions inline to pull and set those
variables when the call hits the extension in the dialplan. I've
done this on intercom calls, where you can set variables in both the
caller's and callee's profile, then the extension just sets them
when a call is made. The idea is that you only create extensions for
different functions just once, and keep user settings with the
users. There are some exceptions, like when you need some convoluted
ring group strategy and using the groups feature is too limited to
accomodate this, so it's better to list the users in an extension
that does what you want. Another case would be when you have a group
of extensions that you want to behave fundamentally different from
another group, then it might make sense to create a different
extension and match it to a specific range. There are two places
that matter when it comes to users:<br>
<br>
/etc/freeswitch/dialplan/default.xml<br>
/etc/freeswitch/directory/default/<user-profiles-go-here.xml><br>
<br>
The dialplan is for dialling/execution, nothing more or less.
Extensions are not users or endpoints, they are just chunks of code
that do things. The directory is for users/endpoints. You need both
for a call to work, otherwise all those xml extensions are trying to
call users that don't exist, and FS expects them to be there. If you
wanted your gui to use multiple extensions, you'd also have to make
it create a user profile as well for each user. Again, this is going
to add a very large amount of redundency to your system if it is
creating the same core functions over and over, when they could be
just declared once and matched to a group of users. It also opens
your system up to a performance penalty, because FS has to traverse
the dialplan until it finds a match, and if you have 200 users each
with a unique extension, then that's 200 extensions hogging memory
and up to 200 attempts that FS has to try before it finds a match,
whereas having only one extension means that it only has one
extension to load and match. The ideal situation is to build the
functionality into the dialplan that you want, catering for all
scenarios that you are expecting to encounter, then use variables in
the user's profiles to trigger those functions as needed.<br>
<br>
Francis<div><div class="h5"><br>
<br>
<br>
<div>On 8/06/2014 4:04 PM, Richard Mace
wrote:<br>
</div>
</div></div><blockquote type="cite"><div><div class="h5">
<div dir="ltr">
<div style="font-family:arial,helvetica,sans-serif">Hi Francis,</div>
<div style="font-family:arial,helvetica,sans-serif">Thanks for your
detailed email.</div>
<div class="gmail_extra">
<div style="font-family:arial,helvetica,sans-serif">I have
purchased the FS 1.2 book and read it a few times, I think I
might have to go back and read it again :)</div>
<div style="font-family:arial,helvetica,sans-serif">
The reason I wanted to do it in "per extension" files was
because I am creating a FS GUI, and want to give users the
choice, on a per extension basis, as to whether their
extension diverts to voice mail or not, such as 200 and 202
may want to divert to voicemail, whereas 201 and 203 don't
want that. So, I thought that if I had separate .xml files
for each extension in the /etc/freeswitch/dialplan/default/
directory, then I could have any behaviour I wanted on a per
"extension dialled" basis, unless of course I am completely
missing something here? :)</div>
<div style="font-family:arial,helvetica,sans-serif"><br>
</div>
<div style="font-family:arial,helvetica,sans-serif">Richard</div>
<br>
<br>
<div class="gmail_quote">On 8 June 2014 02:27, Francis <span dir="ltr"><<a href="mailto:sms@icefire.qza.net.au" target="_blank">sms@icefire.qza.net.au</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"> This would make
sense in Asterisk, but FS differentiates between
'extensions' and 'users'. An extension is simply a
destination for a number, with a set of conditions and
actions. A user is still necessary if you want to
register a phone or a soft client. Hence, FS vanilla
only declares the extension once, but has multiple users
that reference to it. Declaring the extension multiple
times isn't necessary and has no effect since there is
no user-no.xml to reference to it, so it fails. Simply
changing the destination_number condition to match your
number range and creating normal users (like the 1000 -
1019 that come with vanilla) is enough to do what you
are trying to do.<br>
<br>
The Freeswitch 1.2 book on PaktPub is well worth the
coin if you have it, just to save many hours of
tinkering and being trapped by 'Asterisk logic'. FS has
built in heuristics for detecting guesswork and it
exacts the most terrifying revenge upon the offender.<br>
<br>
Francis<br></div></blockquote></div></div></div></div></div></blockquote></div></blockquote></div><br></div></div>