;
; Rinttimes - Länge der Klingelzeiten
;
ring-blindtransfer=40 ; Nachdem ein Transfer iniziert wurde, kann der Mitarbeiter auflegen und verbindet noch
; vor Gesprächsaufbau die Teilnehmer, wie lange soll dann das Telefon läuten?
ring-attentransfer=40 ; Bei einem Attended Transfer, wie lange bis der Mitarbeiter automatisch wieder mit dem
; Anrufer verbunden werden soll?
ring-directcalling=40 ; Wenn ein Anschluss (von intern oder extern) angerufen wird, wie lange solls klingeln?
; Transfering
; ============================================================================
[blindtransfer-ring]
exten => s,1,Answer() ; Wichtig, this gets thrown into conf, caller hears ringing
exten => s,n,SetLanguage(de) ; This is one BIG fake, I did not get the ring-tone from the
exten => s,n,Playtones(ring) ; actual dial, so i put in another member in the conf, which
exten => s,n,Wait(1000) ; gives us dialtone - must be terminated when picked up!
exten => s,n,Hangup()
exten => _XX,1,SetLanguage(de)
exten => _XX,n,Meetme(${EXTEN},Dq1,${EXTEN})
exten => _XX,n,Hangup()
[macro-killring]
exten => s,1,MeetMeAdmin(${ARG1},k,3)
[blindtransfer]
exten => _XX*XX,1,Set(BusyLoop=0) ; Wir brauchen BusyLoop, weil der angetransferrierte in genau dem Moment
exten => _XX*XX,2,SetLanguage(de) ; das Telefon abheben kann, nachdem der ursprüngliche Dial beendet wurde
exten => _XX*XX,3,Set(CloseMe=${EXTEN:3}) ; und bevor der neue Dial gestartet wurde, dann haben wir busy, wir
; wiederholen also bei busy den Anruf
exten => _XX*XX,4,Dial(SIP/${EXTEN:0:2},${ring-blindtransfer},M(killring^${CloseMe})) ; The Makro terminates the ring tone
exten => _XX*XX,5,Macro(killring,${CloseMe})
exten => _XX*XX,n,Playback(vm-theperson) ; Timeout of Blindtransfer, play message
exten => _XX*XX,n,SayNumber(${EXTEN:0:2})
exten => _XX*XX,n,Playback(vm-isunavail)
exten => _XX*XX,n,Goto(500)
exten => _XX*XX,105,Gotoif($[ ${BusyLoop} > 10 ]?itisbusy) ; LoopMax
exten => _XX*XX,n,Wait(5) ; Sleep
exten => _XX*XX,n,Set(BusyLoop=${MATH(${BusyLoop}+1,i)}) ; Inc
exten => _XX*XX,n,Goto(5) ; Dial again
exten => _XX*XX,n(itisbusy),Macro(killring,${CloseMe})
exten => _XX*XX,n,Playback(vm-theperson)
exten => _XX*XX,n,SayNumber(${EXTEN:0:2})
exten => _XX*XX,n,Playback(vm-isonphone)
exten => _XX*XX,n,Goto(500)
exten => _XX*XX,500,MeetMeCount(${CloseMe}|count) ; Timout, kill caller
exten => _XX*XX,n,Gotoif,$["${count}" = "0"}]?Exit ; Check again if is empty, no need to kill it
exten => _XX*XX,n,MeetMeAdmin(${CloseMe},K) ; I hung up, close the new conference and move the new partner into the old conf (by auto fall through)
exten => _XX*XX,n(Exit),Hangup()
[transferring]
exten => _*XX0*XX,1,Set(TransRoom=${EXTEN:5})
exten => _*XX0*XX,2,Set(TransDest=${EXTEN:1:2})
exten => _*XX0*XX,3,Dial(SIP/${TransDest},${ring-attentransfer},gdG(mytransfer^*${TransRoom}*${TransDest}0^1))
exten => _*XX0*XX,4,Playback(vm-theperson)
exten => _*XX0*XX,5,SayNumber(${TransDest})
exten => _*XX0*XX,6,Playback(vm-isunavail)
exten => _*XX0*XX,7,Goto(*,1)
exten => _*XX0*XX,104,Playback(vm-theperson)
exten => _*XX0*XX,105,SayNumber(${TransDest})
exten => _*XX0*XX,106,Playback(vm-isonphone)
exten => _*XX0*XX,107,Goto(*,1)
exten => *,1,Goto(transfer-leg,*${TransRoom}*000,return) ; Abort the dial by pressing *
exten => h,1,DeadAGI(blindtrans.agi|${TransDest}|${TransRoom}) ; Blindtransfer, Call TransDest and send into TransRoom
exten => h,2,Hangup()
[transfer-leg]
exten => _*XXX,1,Set(TransRoom=${EXTEN:1:2})
exten => _*XXX,n,Set(Mode=${EXTEN:3}) ; Mode = transfer alowed true/false
exten => _*XXX,n,SetLanguage(de)
exten => _*XXX,n,Goto(i,meetme) ; Skip the test the first time
exten => _*XX*XX0,1,Set(TransDest=${EXTEN:4:3})
exten => _*XX*XX0,n,Set(CloseMe=${TransDest})
exten => _*XX*XX0,n,Meetme(${TransDest},Dq1,${TransDest}) ; Do not allow multi-transferring
exten => _*XX*XX0,n(return),Noop(return)
exten => _*XX*XX0,n,Set(TransRoom=${EXTEN:1:2})
exten => _*XX*XX0,n,Set(Mode=1) ; Keep the tranfer-status
exten => _*XX*XX0,n,Goto(i,1) ; Return to originating room
exten => *,1,Background(pbx-transfer) ; Single-Exit-Digit der Conf
exten => *,2,Background(custom/dial)
exten => *,3,Goto(i,1) ;
exten => _X,1,Goto(i,1) ; Intercept all DTMF
exten => _XX,1,Goto(transferring,*${EXTEN}0*${TransRoom},1) ; Mode does not need to be passed, case it is clear that we are allowed
exten => i,1,Playback(beeperr)
exten => i,n,MeetMeCount(${TransRoom}|count)
exten => i,n,Gotoif,$["${count}" = "0"}]?userleft ; Sollte unser Gesprächsraum leer sein, hat der ursprüngliche Anrufer aufgelegt
exten => i,n(meetme),Noop(meetme)
exten => i,n,Set(CloseMe=${TransRoom})
exten => i,n,Set(MeetMeMode=${IF($[ ${Mode} = 1]?DMXq1:DMq1)})
exten => i,n,Meetme(${TransRoom},${MeetMeMode},${TransRoom})
exten => i,n,Hangup()
exten => i,n(userleft),Noop(userleft)
exten => i,n,Playback(custom/File-10)
exten => i,n,Hangup()
exten => h,1,MeetMeCount(${CloseMe}|count)
exten => h,2,Gotoif,$["${count}" = "0"}]?4 ; Check again if is empty, no need to kill it
exten => h,3,MeetMeAdmin(${CloseMe},K) ; I hung up, close the new conference and move the new partner into the old conf (by auto fall through)
exten => h,4,Hangup()
[mytransfer]
;*XXXX = *AABB, AA=CallingRoom, BB = transfercode, t = 01, T = 10 additiv
exten => _*XXXX,1,Goto(transfer-leg,${EXTEN:0:3}${EXTEN:3:1},1) ; T
exten => _*XXXX,2,Goto(transfer-leg,${EXTEN:0:3}${EXTEN:4:1},1) ; t
exten => _*XX*XX0,1,Goto(transfer-leg,*${EXTEN:1:2}*${EXTEN:4},1) ; *cr*transferdest
exten => _*XX*XX0,2,Goto(transfer-leg,*${EXTEN:1:2}*${EXTEN:4},1)