baji
Joined: Tue 17 of Apr, 2007
Posted:Fri 27 of Jul, 2007 (13:14 UTC)
; ----------- using asterisk version 1.4.8 ----------------------
;
; Example script to retrieve formatted and unformatted values using CDR
;
exten => s,1,Set(TIMEOUT(absolute)=15)
;
; ------------------------------------------
;
; This returns Caller ID Name & Number, eg. "John Doe" <3305551212>
;
exten => s,n,Set(v_clid=${CDR(clid)})
;
exten => s,n,NoOp(${v_clid})
;
; ------------------------------------------
;
; This returns Caller ID Number Only, eg. <3305551212>
;
exten => s,n,Set(v_src=${CDR(src)})
;
exten => s,n,NoOp(${v_src})
;
; ------------------------------------------
;
; Call start time in different formats
;
exten => s,n,Set(v_start=${CDR(start)})
exten => s,n,Set(r_start=${CDR(start|r)})
exten => s,n,Set(u_start=${CDR(start|u)})
;
exten => s,n,NoOp(${v_start})
exten => s,n,NoOp(${r_start})
exten => s,n,NoOp(${u_start})
;
; ------------------------------------------
;
; Status of call, eg BUSY, ANSWERED
;
exten => s,n,Set(v_disposition=${CDR(disposition)})
exten => s,n,Set(r_disposition=${CDR(disposition|r)})
exten => s,n,Set(u_disposition=${CDR(disposition|u)})
;
exten => s,n,NoOp(${v_disposition})
exten => s,n,NoOp(${r_disposition})
exten => s,n,NoOp(${u_disposition})
;
; ------------------------------------------
;
exten => s,n,Hangup()
;
; Call timeout, broken connection, say goodbye and hangup
;
;
exten => T,1,Playback(im-sorry)
exten => T,n,Playback(vm-goodbye)
exten => T,n,Hangup()
;
; -----------------------------------------------------------------------