[Freeswitch-users] Dynamic Dialplan
Anthony Minessale
anthony.minessale at gmail.com
Mon Feb 9 11:45:38 PST 2009
That's why I chose mod_xml_curl as a demo for the xml_hook api. It's not
only a demo, it's rather functional =D
You have 2 choices other than using the stuff we already have in tree.
1) write a custom dialplan module, this module gets a single callback
function a dialplan_hunt function that has the session and the caller
profile. you can see from mod_enum or mod_dialplan_xml how this can be used
to make your own module that looks in a db and returns instructions to FS on
the fly.
2) write a custom xml_hook and use it with mod_dialplan_xml, this type of
module embeds itself into the xml lookups so when something tries to find
something in the xml registry, your function is called and you can do your
db lookups and generate the xml returned as binary xml obj built from a
result of the query. This is more powerfule because it allows you to
pre-empt any xml lookups so you can deliver directory, config, dialplan,
phrase macros, etc
mod_xml_curl is an example of #2, it turns the xml_req into a url req and
feeds the xml returned over the http socket into an xml object and returns
it as the result in place of the static contents of the xml file.
On Mon, Feb 9, 2009 at 12:03 PM, kokoska rokoska <kokoska.rokoska at post.cz>wrote:
>
>
>
> Raymond Chandler napsal(a):
> > kokoska rokoska wrote:
> >> Just my 2c:
> >>
> >> If you use curl with lighttpd and custom built fastcgi "C" responder (it
> >> is really simple with fcgi libs - even I can do it :-) performance could
> >> be not that bad.
> > hmmm, mod_xml_curl using C, interesting thought..
>
> May be not the best way, but very simple.
> Well, it depends on what you have to do, but "directory" serving based
> on DB queries (this what I'm using it for) is very simple - just few
> lines of code.
>
> > all of the
> > complexities of writing your own module without the nice structured FS
> > API...
>
> I should say I have no idea how hard is to write custom FreeSWITCH
> module (may be I should try it :-), but the FS code is very nice!
>
> > although, as a benefit, i guess you do get a little extra latency ;-)
> > </sarcasm>
>
> :-) Yes, you are right. And as a bonus some CPU utilization...
>
> Like I wrote above, I didn't say it is faster, but IMO it is very simple
> and not as slow as it looks (when using apache + php + apc).
>
> Best regards,
>
> kokoska.rokoska
>
>
> _______________________________________________
> Freeswitch-users mailing list
> Freeswitch-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
--
Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
AIM: anthm
MSN:anthony_minessale at hotmail.com <MSN%3Aanthony_minessale at hotmail.com>
GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com<PAYPAL%3Aanthony.minessale at gmail.com>
IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference
sip:888 at conference.freeswitch.org <sip%3A888 at conference.freeswitch.org>
iax:guest at conference.freeswitch.org/888
googletalk:conf+888 at conference.freeswitch.org<googletalk%3Aconf%2B888 at conference.freeswitch.org>
pstn:213-799-1400
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20090209/e232d7c1/attachment-0002.html
More information about the FreeSWITCH-users
mailing list