diff options
-rw-r--r-- | contrib/package/asterisk-xip/files/macros/lastcall.conf | 54 | ||||
-rwxr-xr-x | contrib/package/asterisk-xip/files/uci/lastcall | 2 |
2 files changed, 53 insertions, 3 deletions
diff --git a/contrib/package/asterisk-xip/files/macros/lastcall.conf b/contrib/package/asterisk-xip/files/macros/lastcall.conf index 5d178617fe..90f60b871b 100644 --- a/contrib/package/asterisk-xip/files/macros/lastcall.conf +++ b/contrib/package/asterisk-xip/files/macros/lastcall.conf @@ -1,6 +1,12 @@ ; Last-Called number storage and calling. ; Author: Michael Geddes aka FrogOnWheels +; depends: app_macro app_system app_record func_callerid +; app_sayunixtime app_playback func_db +; format_gsm codec_gsm +[globals] +LASTCALL_DIR=/etc/asterisk/directory + [macro-lastcallstore] ; (Number , EntryType, BufferSize) exten => s,1,set(lcsName=lastcall) exten => s,n,set(lcsCount=10) @@ -42,22 +48,27 @@ exten => s,n(hasTag),Set(lcsPointer=1) exten => s,n,GotoIf($["${DB(${lcsName}/ddate1)}" != ""]?macrobody_lastcallapp|s|1) exten => s,n,playback(${lcsTag}&lastcall/none-available) [macrobody_lastcallapp] -exten => s,1(repeat),background(${lcsTag}) +exten => s,1(repeat),Background(${lcsTag}) exten => s,n(again),wait(1) exten => s,n,Set(lcsLastnum=${DB(${lcsName}/number${lcsPointer})}) exten => s,n,Set(ddate=${DB(${lcsName}/ddate${lcsPointer})}) +exten => s,n,Set(lcsLastDate=${DB(${lcsName}/ddate$[ ${lcsPointer} + 1])}) exten => s,n,GotoIf($["${lcsLastnum}" != "anonymous"]?checkblank) exten => s,n,Set(lcsLastnum="") exten => s,n(checkblank),GotoIf($["${lcsLastnum}" = ""]?noinfo) -exten => s,n,saydigits(${lcsLastnum}) +exten => s,n,TrySystem(test -f ${LASTCALL_DIR}/${lcsLastnum}.gsm) +exten => s,n,GotoIf($[${SYSTEMSTATUS} != SUCCESS]?saydigitver) +exten => s,n,Background(${LASTCALL_DIR}/${lcsLastnum}) +exten => s,n,Goto(saycalltime) +exten => s,n(saydigitver),Macro(backgroundphone,${lcsLastNum}) exten => s,n(saycalltime),wait(.5) exten => s,n,sayunixtime(${ddate},${LASTCALLZONE},QIMp) exten => s,n(saymenu),background(silence/1) -exten => s,n,Set(lcsLastDate=${DB(${lcsName}/ddate$[ ${lcsPointer} + 1])}) exten => s,n,GotoIf($[$[${lcsPointer} = ${lcsCount}] | $["${lcsLastDate}" = ""]]?noprev) exten => s,n,background(lastcall/next) exten => s,n(noprev),GotoIf($["${lcsLastnum}" = ""]?nocall) exten => s,n,background(lastcall/call-number) +exten => s,n,background(lastcall/tag-number) exten => s,n(nocall),GotoIf($[${lcsPointer} = 1]?nonext) exten => s,n,background(lastcall/previous) exten => s,n(nonext),background(silence/10) @@ -73,6 +84,43 @@ exten => 4,1,GotoIf($[${lcsPointer}=1]?sayn) exten => 4,n,Set(lcsPointer=$[${lcsPointer} - 1]) exten => _[46],n(sayn),saynumber(${lcsPointer}) exten => _[46],n,goto(s|again) +exten => 7,1,GotoIf($["${lcsLastNum}" = ""]?noinfo]) +exten => 7,2,Goto(macrobody_lastcallrecord|s|1) exten => i,1,Goto(s|again) exten => t,1,playback(goodbye) exten => t,n,Hangup +[macrobody_lastcallrecord] +exten => s,1(again),Background(lastcall/recordname) +exten => s,n,Record(/tmp/tmprec:gsm|2|5) +exten => s,n,Background(lastcall/tagfor) +exten => s,n,Macro(backgroundphone,${lcsLastNum}) +exten => s,n,Background(/tmp/tmprec) +exten => s,n,Background(lastcall/confirmnumber) +exten => s,n,Background(lastcall/tryagain) +exten => s,n,Background(lastcall/cancelrecord) +exten => s,n,Background(silence/5) +exten => s,n,Goto(s|again) +exten => 1,1,System(mkdir -p ${LASTCALL_DIR}) +exten => 1,2,System(mv /tmp/tmprec.gsm ${LASTCALL_DIR}/${lcsLastNum}.gsm) +exten => 1,3,Goto(macrobody_lastcallapp,s,again) +exten => 2,1,Goto(s|again) +exten => 3,1,system(rm -f /tmp/tmprec.gsm) +exten => 3,2,Goto(macrobody_lastcallapp,s,again) +; Say Phone number in the background +[macro-backgroundphone] +exten => s,1,Set(bgDigits=${ARG1}) +exten => s,n(loop),Set(bgDigit=${bgDigits:0:1}) +exten => s,n,GotoIf($["${bgDigits:0:3}" = "000"]?saythousand) +exten => s,n,GotoIf($["${bgDigits:0:2}" = "00"]?sayhundred) +exten => s,n,GotoIf($["${bgDigits}" = ""]?exitloop) +exten => s,n,Set(bgDigits=${bgDigits:1}) +exten => s,n,Background(digits/${bgDigit}) +exten => s,n,Goto(loop) +exten => s,n(saythousand),Background(digits/thousand) +exten => s,n,Set(bgDigits=${bgDigits:3}) +exten => s,n,Goto(loop) +exten => s,n(sayhundred),Background(digits/hundred) +exten => s,n,Set(bgDigits=${bgDigits:2}) +exten => s,n,Goto(loop) +exten => s,n(exitloop),NOOP + diff --git a/contrib/package/asterisk-xip/files/uci/lastcall b/contrib/package/asterisk-xip/files/uci/lastcall index c5ec6e1c48..f101bfedf6 100755 --- a/contrib/package/asterisk-xip/files/uci/lastcall +++ b/contrib/package/asterisk-xip/files/uci/lastcall @@ -113,6 +113,8 @@ enable_lastcall() { enable_module app_sayunixtime enable_module app_playback enable_module func_db + enable_module app_record + enable_module app_system enable_format gsm fi } |