|
Asterisk-Java | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.EventObject
org.asteriskjava.manager.event.ManagerEvent
org.asteriskjava.manager.event.CdrEvent
public class CdrEvent
A CdrEvent is triggered when a call detail record is generated, usually at the end of a call.
To enable CdrEvents you have to add enabled = yes
to the general section in
cdr_manager.conf
.
This event is implemented in cdr/cdr_manager.c
Field Summary | |
---|---|
static java.lang.String |
AMA_FLAG_BILLING
|
static java.lang.String |
AMA_FLAG_DOCUMENTATION
|
static java.lang.String |
AMA_FLAG_OMIT
|
static java.lang.String |
AMA_FLAG_UNKNOWN
|
static java.lang.String |
DISPOSITION_ANSWERED
|
static java.lang.String |
DISPOSITION_BUSY
|
static java.lang.String |
DISPOSITION_FAILED
|
static java.lang.String |
DISPOSITION_NO_ANSWER
|
static java.lang.String |
DISPOSITION_UNKNOWN
|
Fields inherited from class java.util.EventObject |
---|
source |
Constructor Summary | |
---|---|
CdrEvent(java.lang.Object source)
|
Method Summary | |
---|---|
java.lang.String |
getAccountCode()
Returns the account number that is usually used to identify the party to bill for the call. |
java.lang.String |
getAmaFlags()
Returns the AMA (Automated Message Accounting) flags. |
java.lang.String |
getAnswerTime()
Returns when the call was answered. |
java.util.Date |
getAnswerTimeAsDate()
Returns the answer time as Date object. |
java.util.Date |
getAnswerTimeAsDate(java.util.TimeZone tz)
Returns the answer time as Date object. |
java.lang.Integer |
getBillableSeconds()
Returns the total time (in seconds) the call was up from answer to hangup. |
java.lang.String |
getCallerId()
Returns the Caller*ID with text. |
java.lang.String |
getChannel()
Returns the name of the channel, for example "SIP/1310-asfe". |
java.lang.String |
getDestination()
Returns the destination extension. |
java.lang.String |
getDestinationChannel()
Returns the name of the destination channel if appropriate. |
java.lang.String |
getDestinationContext()
Returns the destination context. |
java.lang.String |
getDisposition()
Returns what happened to the call. |
java.lang.Integer |
getDuration()
Returns the total time (in seconds) the caller spent in the system from dial to hangup. |
java.lang.String |
getEndTime()
Returns when the call has ended. |
java.util.Date |
getEndTimeAsDate()
Returns the end time as Date object. |
java.util.Date |
getEndTimeAsDate(java.util.TimeZone tz)
Returns the end time as Date object. |
java.lang.String |
getLastApplication()
Returns the last application if appropriate, for example "VoiceMail". |
java.lang.String |
getLastData()
Returns the last application's data (arguments), for example "s1234". |
java.lang.String |
getSrc()
Returns the Caller*ID number. |
java.lang.String |
getStartTime()
Returns when the call has started. |
java.util.Date |
getStartTimeAsDate()
Returns the start time as Date object. |
java.util.Date |
getStartTimeAsDate(java.util.TimeZone tz)
Returns the start time as Date object. |
java.lang.String |
getUniqueId()
Returns the unique id of the channel. |
java.lang.String |
getUserField()
Returns the user-defined field as set by Set(CDR(userfield)=Value) . |
void |
setAccountCode(java.lang.String accountCode)
Sets the account number. |
void |
setAmaFlags(java.lang.String amaFlags)
Sets the AMA (Automated Message Accounting) flags. |
void |
setAnswerTime(java.lang.String answerTime)
Sets the date/time when the call was answered. |
void |
setBillableSeconds(java.lang.Integer billableSeconds)
Sets the total time in call. |
void |
setCallerId(java.lang.String callerId)
Sets the Caller*ID with text. |
void |
setChannel(java.lang.String channel)
Sets the name of the channel. |
void |
setDestination(java.lang.String destination)
Sets the destination extension. |
void |
setDestinationChannel(java.lang.String destinationChannel)
Sets the name of the destination channel. |
void |
setDestinationContext(java.lang.String destinationContext)
Sets the destination context. |
void |
setDisposition(java.lang.String disposition)
Sets the disposition. |
void |
setDuration(java.lang.Integer duration)
Sets the total time in system. |
void |
setEndTime(java.lang.String endTime)
Sets the date/time when the call has ended. |
void |
setLastApplication(java.lang.String lastApplication)
Sets the last application. |
void |
setLastData(java.lang.String lastData)
Set the last application's data. |
void |
setSrc(java.lang.String source)
Sets the Caller*ID number. |
void |
setStartTime(java.lang.String startTime)
Sets the date/time when the call has started. |
void |
setUniqueId(java.lang.String uniqueId)
Sets the unique id of the channel. |
void |
setUserField(java.lang.String userField)
Sets the user-defined field. |
Methods inherited from class org.asteriskjava.manager.event.ManagerEvent |
---|
getDateReceived, getPrivilege, getServer, getTimestamp, setDateReceived, setPrivilege, setServer, setTimestamp, toString |
Methods inherited from class java.util.EventObject |
---|
getSource |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DISPOSITION_NO_ANSWER
public static final java.lang.String DISPOSITION_FAILED
public static final java.lang.String DISPOSITION_BUSY
public static final java.lang.String DISPOSITION_ANSWERED
public static final java.lang.String DISPOSITION_UNKNOWN
public static final java.lang.String AMA_FLAG_OMIT
public static final java.lang.String AMA_FLAG_BILLING
public static final java.lang.String AMA_FLAG_DOCUMENTATION
public static final java.lang.String AMA_FLAG_UNKNOWN
Constructor Detail |
---|
public CdrEvent(java.lang.Object source)
source
- Method Detail |
---|
public java.lang.String getAccountCode()
Corresponds to CDR field accountcode
.
public void setAccountCode(java.lang.String accountCode)
accountCode
- the account number.public java.lang.String getSrc()
Corresponds to CDR field src
.
public void setSrc(java.lang.String source)
source
- the Caller*ID number.public java.lang.String getDestination()
Corresponds to CDR field dst
.
public void setDestination(java.lang.String destination)
destination
- the destination extension.public java.lang.String getDestinationContext()
Corresponds to CDR field dcontext
.
public void setDestinationContext(java.lang.String destinationContext)
destinationContext
- the destination context.public java.lang.String getCallerId()
Corresponds to CDR field clid
.
public void setCallerId(java.lang.String callerId)
callerId
- the Caller*ID with text.public java.lang.String getChannel()
Corresponds to CDR field channel
.
public void setChannel(java.lang.String channel)
channel
- the name of the channel.public java.lang.String getDestinationChannel()
Corresponds to CDR field dstchannel
.
null
if not available.public void setDestinationChannel(java.lang.String destinationChannel)
destinationChannel
- the name of the destination channel.public java.lang.String getLastApplication()
Corresponds to CDR field lastapp
.
null
if not avaialble.public void setLastApplication(java.lang.String lastApplication)
lastApplication
- the last application.public java.lang.String getLastData()
Corresponds to CDR field lastdata
.
null
if not avaialble.public void setLastData(java.lang.String lastData)
lastData
- the last application's data.public java.lang.String getStartTime()
This corresponds to CDR field start
.
public java.util.Date getStartTimeAsDate()
This method asumes that the Asterisk server's timezone equals the default timezone of your JVM.
public java.util.Date getStartTimeAsDate(java.util.TimeZone tz)
tz
- the timezone of the Asterisk server.
public void setStartTime(java.lang.String startTime)
startTime
- the date/time when the call has started.public java.lang.String getAnswerTime()
This corresponds to CDR field answered
.
public java.util.Date getAnswerTimeAsDate()
This method asumes that the Asterisk server's timezone equals the default timezone of your JVM.
public java.util.Date getAnswerTimeAsDate(java.util.TimeZone tz)
tz
- the timezone of the Asterisk server.
public void setAnswerTime(java.lang.String answerTime)
answerTime
- the date/time when the call was answered.public java.lang.String getEndTime()
This corresponds to CDR field end
.
public java.util.Date getEndTimeAsDate()
This method asumes that the Asterisk server's timezone equals the default timezone of your JVM.
public java.util.Date getEndTimeAsDate(java.util.TimeZone tz)
tz
- the timezone of the Asterisk server.
public void setEndTime(java.lang.String endTime)
endTime
- the date/time when the call has ended.public java.lang.Integer getDuration()
Corresponds to CDR field duration
.
public void setDuration(java.lang.Integer duration)
duration
- total time in system in seconds.public java.lang.Integer getBillableSeconds()
Corresponds to CDR field billsec
.
public void setBillableSeconds(java.lang.Integer billableSeconds)
billableSeconds
- the total time in call in seconds.public java.lang.String getDisposition()
This is one of
Corresponds to CDR fielddisposition
.
public void setDisposition(java.lang.String disposition)
disposition
- the disposition.public java.lang.String getAmaFlags()
This is one of
Corresponds to CDR fieldamaflags
.
public void setAmaFlags(java.lang.String amaFlags)
amaFlags
- the AMA (Automated Message Accounting) flags.public java.lang.String getUniqueId()
public void setUniqueId(java.lang.String uniqueId)
uniqueId
- the unique id of the channel.public java.lang.String getUserField()
Set(CDR(userfield)=Value)
.
Corresponds to CDR field userfield
.
public void setUserField(java.lang.String userField)
userField
- the user-defined field
|
Asterisk-Java | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |