summaryrefslogtreecommitdiffhomepage
path: root/contrib/package
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/package')
-rw-r--r--contrib/package/asterisk-xip/files/macros/lastcall.conf48
-rw-r--r--contrib/package/asterisk-xip/files/macros/tagnumber.conf58
2 files changed, 63 insertions, 43 deletions
diff --git a/contrib/package/asterisk-xip/files/macros/lastcall.conf b/contrib/package/asterisk-xip/files/macros/lastcall.conf
index 90f60b871..dd2c8514f 100644
--- a/contrib/package/asterisk-xip/files/macros/lastcall.conf
+++ b/contrib/package/asterisk-xip/files/macros/lastcall.conf
@@ -5,7 +5,7 @@
; app_sayunixtime app_playback func_db
; format_gsm codec_gsm
[globals]
-LASTCALL_DIR=/etc/asterisk/directory
+LASTCALL_DIR=/opt/etc/asterisk/directory
[macro-lastcallstore] ; (Number , EntryType, BufferSize)
exten => s,1,set(lcsName=lastcall)
@@ -56,12 +56,8 @@ 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,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,Macro(backgroundtagnumber,${lcsLastnum},${LASTCALL_DIR})
+exten => s,n,wait(.5)
exten => s,n,sayunixtime(${ddate},${LASTCALLZONE},QIMp)
exten => s,n(saymenu),background(silence/1)
exten => s,n,GotoIf($[$[${lcsPointer} = ${lcsCount}] | $["${lcsLastDate}" = ""]]?noprev)
@@ -85,42 +81,8 @@ 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 => 7,2,macro(tagnumber,${lcsLastNum},${LASTCALL_DIR})
+exten => 7,3,goto(s|again)
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/macros/tagnumber.conf b/contrib/package/asterisk-xip/files/macros/tagnumber.conf
new file mode 100644
index 000000000..6fc455788
--- /dev/null
+++ b/contrib/package/asterisk-xip/files/macros/tagnumber.conf
@@ -0,0 +1,58 @@
+; Number tagging
+; Author: Michael Geddes aka FrogOnWheels
+
+; Depends: app_stack app_macro app_system
+
+[macro-tagnumber] ; Number / Tag Directory / Return
+exten => s,1,Set(tagNumber=${ARG1})
+exten => s,n,Set(tagDirectory=${ARG2})
+exten => s,n,Set(tagRetContext=${MACRO_CONTEXT})
+exten => s,n,Set(tagRetExtn=${MACRO_EXTEN})
+exten => s,n,Set(tagRetPriority=$[${MACRO_PRIORITY} + 1])
+;exten => s,n,Set(tagReturn=${ARG3})
+;exten => s,n,Gosub(macrobody_tagnumber,s,1)
+exten => s,n,Goto(macrobody_tagnumber,s,1)
+exten => s,n(return),Noop(Returned)
+[macrobody_tagnumber]
+exten => s,1(again),Background(voicetag/recordname)
+exten => s,n,Record(/tmp/tmprectag:gsm|2|5)
+exten => s,n(askagain),Background(voicetag/tagfor)
+exten => s,n,Macro(backgroundphone,${tagNumber})
+exten => s,n,Background(/tmp/tmprectag)
+exten => s,n,Background(voicetag/confirmnumber)
+exten => s,n,Background(voicetag/tryagain)
+exten => s,n,Background(voicetag/cancelrecord)
+exten => s,n,WaitExten(5)
+exten => s,n,Goto(s|askagain)
+exten => 1,1,System(mkdir -p ${tagDirectory})
+exten => 1,2,System(mv /tmp/tmprectag.gsm ${tagDirectory}/${tagNumber}.gsm)
+exten => 1,3,Goto(${tagRetContext}|${tagRetExtn}|${tagRetPriority})
+exten => 2,1,Goto(s|again)
+exten => 3,1,system(rm -f /tmp/tmprectag.gsm)
+exten => 3,2,Goto(${tagRetContext}|${tagRetExtn}|${tagRetPriority})
+exten => h,1,system(rm -f /tmp/tmrectag.gsm)
+
+[macro-backgroundtagnumber] ; Number, directory
+exten => s,1,TrySystem(test -f ${ARG2}/${ARG1}.gsm)
+exten => s,n,GotoIf($[${SYSTEMSTATUS} != SUCCESS]?s-saynum|1)
+exten => s,n,Background(${ARG2}/${ARG1})
+exten => s-saynum,1,Macro(backgroundphone,${ARG1})
+
+; 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
+