[Freeswitch-users] Newbie question, FS cli and db (users for user directory)

Gabriel Gunderson gabe at gundy.org
Tue Sep 25 00:48:59 MSD 2012


On Mon, Sep 24, 2012 at 3:19 AM, Gabriel Gunderson <gabe at gundy.org> wrote:
>>> "Another tip is to use cacheable='true' attribute of user xml returned by
>>> web service. This will make FS to maintain a local cache of the account
>>> details. The details will stay in cache until cleared. This means that FS
>>> won't be hitting your web app for every REGISTER request that hoards of SIP
>>> UAs are sending, it will ask only once upon first request. The subsequent
>>> requests will be looked up from cache."
>>
>> Ok, I see what you're talking about. I think what you're looking at
>> isn't mod_xml_curl wide. It seems to be specific to user registration.
>> I'm not sure about this, but I don't see the word 'cacheable' in the
>> mod_xml_curl source, but you do see it on line 1946 of switch_xml.c.
>> And there too, it appears to have something to do with users.
>
> Great... now you've got me thinking about this. I'd like to satisfy my
> curiosity, but naturally, there's nothing in the wiki and no comments
> in the source code :)
>
> I wonder, what does it mean to be 'cached'? And when does that cache
> get cleared? Now I must know ;)

UPDATE: I got a chance to chat with anthm on IRC about this. I'm going
up update the wiki, but only after I play with it for a bit. I'm
posting the chat (cleaned up) here for archival purposes .

******************************************************************************
<gundy> anthm, I try not to bug you as I know you're busy... but I
don't know who else would be involved with this Q.
<gundy> anthm, do you know who might know about an undocumented
"cacheable" parameter when returning directories via mod_xml_curl?
<gundy> anthm, If I can get some clarity on it, I'll update the wiki.

<anthm> gundy, sure

<gundy> anthm, specifically, this is not a mod_xml_curl feature.
Meaning, you can't expect to do that "cacheable" in other responses.
<gundy> anthm, and I guess their isn't any info about when that cache
is cleared.

<anthm> if xml lookup returns a <user> tag with the param
cacheable="true" , it saves it into a in-memory hash table and will
pick it up in place of doing another lookup for the same user later

<gundy> anthm, super, and how long does that cache last and is there a
way to clear it?

<anthm> xml_flush_cache api call
<anthm> xml_flush_cache <id> <key> <val>
<anthm> the less specific you are the more it clears

<gundy> Awesome.

<anthm> so no args is complete clear

<gundy> You have my word, I'll doc it ;) This is only for users, right?

<anthm> yes

<gundy> anthm, thank you for your time.
******************************************************************************

Best,
Gabe



Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list