Asterisk Ideas and Wishlist Repository » dialplan

Tag Archive

Memcached dialplan function

Creation of an func_memcached dialplan Function. This has it’s advantages over the built in DB structure in that it’s all in memory and it can be hit by other servers as well to retrieve the same information (”network ready”).Memcached Libraries are at: http://www.danga.com/memcached/(pardon my syntax.. from memory here..)For example:

exten => s,1,Set(VMBOX=${MEMCACHEGET('vmbox-5125551212') })
exten => s,n,VoiceMail(${VMBOX})

Or perhaps more useful (although check with your local provider before doing this to determine if you are allowed):

exten => s,1,Set(CALLERNAME=${MEMCACHEGET('CNAME-5125551212')})
exten => s,n,GotoIf($["${CALLERNAME}x" = "x"]?getname)
exten => s,n(setname),Set(CALLERID(name)=${CALLERNAME})
exten => s,n,Goto(performdial)
exten => s,n(getname),Set(CALLERNAME=${CURL(http://myNameServer/someapp.php?number=${EXTEN})})
exten => s,n,MEMCACHESET('CNAME-${EXTEN}' ,${CALLERNAME})
exten => s,n, Goto(setname)
exten => s,n(performdial),Dial(..........)

……IE: Check the cache. If it exists, use it.. If not, retrieve it, set it, use it.. Next time it exists. Oops, forgot to mention, memcached has a mechanism to auto expire stale items as well.. Which is really nice..-Brett

Dial by profile

With the number of options to dial() growing by leaps and bounds, I would like to be able to configure a few dial profiles in a configuration file, dial.conf, and use these for dialling. Example:

[sip-outbound]
macro=dumptest
timeout=20
absolutetimeout=360
musicclass=abba
transfer=caller
hangup=none

I think this would make it easier to handle the dialplan. What do you think?

Asterisk Ideas and Wishlist Repository is proudly powered by WordPress. Entries (RSS 2 - RSS 1) and Comments (RSS). Asterisk is a trademark registered by Digium Inc. Designed by Bob