|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This class extends the PlayerEvent and RecorderEvent interfaces in order to cover
the Fax based specific events.
AsyncMediaGroup.setFaxLogger(FaxLoggerIf) can be used to process all fax completion events at the platform level,
in order to provide a log file, say.
Code sample:
//either
void onPlayerEvent (PlayerEvent anEvent) {
//or
void onRecorderEvent (RecorderEvent anEvent) {
//common to both callback methods
if (FaxConstants.ev_Fax.equals(anEvent.getEventID())) {
FaxEvent faxEv = (FaxEvent)anEvent;
Symbol qualifier = faxEv.getQualifier();
Symbol error = faxEv.getError();
// error case
if (error == hp.telephony.media.Error.e_Refused) {
System.out.println("Fax error code : "+faxEv.getErrorCode() );
System.out.println("Fax error text : "+faxEv.getErrorText() );
System.out.println(" either p_PageResolution or p_PageWidth or p_PageLength is null, ");
System.out.println(" or NO pages at all, ");
System.out.println(" or NO encodings, ");
System.out.println(" or no more fax slots available, ");
System.out.println(" or bad params, see warnings, ");
System.out.println(" or some low level conditions. ");
// error case
} else if (error == hp.telephony.media.Error.e_BadArg) {
System.out.println("Fax error code : "+faxEv.getErrorCode() );
System.out.println("Fax error text : "+faxEv.getErrorText() );
System.out.println(" either p_StorePath does not exist as a directory, ");
System.out.println(" or p_Role, p_EnablePolling, p_CapabilityToReceive, p_PagesEncoding not suited, ");
System.out.println(" or p_Suffix far from .fax, ");
System.out.println(" or no more fax slots available, ");
System.out.println(" or bad String[] p_PagesPaths. ");
// error case, no qualifier
} else if (error != null && error != hp.telephony.media.Error.e_OK) {
System.out.println("Fax error : "+error);
System.out.println("Fax error code : "+faxEv.getErrorCode() );
System.out.println("Fax error text : "+faxEv.getErrorText() );
// should not happen
} else if (qualifier == null) {
System.out.println("Fax error : "+error);
System.out.println("Fax error code : "+faxEv.getErrorCode() );
System.out.println("Fax error text : "+faxEv.getErrorText() );
// intermediate event
} else if (qualifier == FaxConstants.q_Page) {
System.out.println("Fax result : "+qualifier);
if (faxEv.getIndex() == 0) {
System.out.println("Fax Id code : "+faxEv.getRemoteIdCode() );
System.out.println("Fax Id text : "+faxEv.getRemoteId() );
} else {
System.out.println("Fax page # "+faxEv.getIndex() );
}
}
// final event
} else if (qualifier == FaxConstants.q_Document) {
System.out.println("Fax result : "+qualifier);
}
// unknown event
} else
System.out.println("unexpected fax result : "+qualifier);
}
} // else, we do not have a fax event
see Sending Fax
and
see Receiving Fax
.
| Field Summary |
| Fields inherited from interface hp.telephony.media.MediaEvent |
ev_Disconnected, ev_TerminalIdle |
| Fields inherited from interface hp.telephony.media.ResourceConstants |
e_Disconnected, e_OK, FOREVER, q_Duration, q_RTC, q_Standard, q_Stop, rtcc_Disconnected, rtcc_TriggerRTC, v_Forever |
| Fields inherited from interface hp.telephony.media.CoderConstants |
p_AMR_SDPelement, p_channels, p_crc, p_G723_annexa, p_G723_bitrate, p_G729_annexb, p_interleaving, p_maxptime, p_modechangeneighbor, p_modechangeperiod, p_modeset, p_octetalign, p_ptime, p_robustsorting, v_ADPCM_16kG726, v_ADPCM_24k, v_ADPCM_32k, v_ADPCM_32kG726, v_ADPCM_32kOKI, v_ADPCM_44k, v_ALawPCM_48k, v_ALawPCM_64k, v_ALawPCM_88k, v_AMR, v_AMR_WB, v_G723_1b, v_G723_53, v_G723_63, v_G723_no_vad, v_G723_yes, v_G729_no_vad, v_G729_yes, v_G729a, v_GSM, v_Linear16Bit_64k, v_Linear8Bit_48k, v_Linear8Bit_64k, v_Linear8Bit_88k, v_MuLawPCM_48k, v_MuLawPCM_64k, v_MuLawPCM_88k |
| Fields inherited from interface hp.telephony.media.SpeechDetectorConstants |
p_BargeIn, p_FinalTimeout, p_InitialTimeout, p_InPromptSensitivityPercent, p_Sensitivity, p_Type, q_EndOfSpeechDetected, q_NoSpeechTimeout, q_SpeechDetected, rtca_PromptDone, rtcc_EndOfSpeechDetected, rtcc_NoSpeechTimeout, rtcc_SpeechDetected, v_HP, v_Nvad, v_SwiEp, v_Telisma |
| Method Summary | |
int |
getBadFaxLines()
|
int |
getCleanFaxData()
|
Symbol |
getCommunicationDiagnosticCode()
Fax communication diagnostic code. |
int |
getCompression()
T41, T42 or T6. |
int |
getConsecutiveBadFaxLinesO()
|
Symbol |
getDisconnectionDiagnostic()
Disconnection diagnostic. |
int |
getErrorCode()
|
String |
getErrorText()
|
Symbol |
getFaxProcessingCode()
Processing code. |
int |
getFillOrder()
|
int |
getImageLength()
|
int |
getImageWidth()
|
long |
getLineBitRate()
negotiated line bit rate, in bps |
Symbol |
getLineRate()
negotiated line bit rates |
int |
getOrientation()
|
Symbol |
getPageLength()
negotiated page length |
String[] |
getPageNames()
Received pages as files. |
int |
getPageNumber()
while sending or receving. |
Symbol |
getPageWidth()
negotiated page width |
int |
getPhotometricInterpretation()
|
long |
getReceivedDataCount()
received data count. |
String |
getReceivedPageFileName()
Deprecated. as intermediate page event has been replaced by list of received pages at completion |
long |
getReceivedPageLength()
Received page length. |
byte[] |
getReceivedPagePixels()
Received page as a rectangle of B and W dots, packed 8 per byte. |
long |
getReceivedPageWidth()
Received page width. |
String |
getRemoteId()
|
int |
getRemoteIdCode()
|
int |
getResolutionUnit()
|
int |
getSamplesPerPixel()
|
int |
getT4Options()
|
int |
getT6Options()
|
Date |
getTimeStamp()
start date of fax operation. |
long |
getTotalErrorCount()
total error count. |
int |
getTotalPageCount()
while sending or upon receving completed. |
int |
getUseCase()
one of : FaxConstants#v_SENDING
FaxConstants#v_RECEIVING
FaxConstants#v_POLLING_TO_RECEIVE , although not suppoorted yet
FaxConstants#v_POLLED_TO_SEND , although not suppoorted yet
|
int |
getXResolution()
|
int |
getYResolution()
|
void |
tiffify(String tiffFpath)
Build a TIFF-F container out of the received pages. |
| Methods inherited from interface hp.telephony.media.PlayerEvent |
getChangeType, getIndex, getOffset |
| Methods inherited from interface hp.telephony.media.ResourceEvent |
getError, getQualifier, getRTCTrigger |
| Methods inherited from interface hp.telephony.media.MediaEvent |
getEventID |
| Methods inherited from interface hp.telephony.media.RecorderEvent |
getDuration |
| Method Detail |
public Symbol getLineRate()
negotiated line bit rates
public long getLineBitRate()
public Symbol getDisconnectionDiagnostic()
Symbols :
| v_PH_DEACTIVATION | physical layer deactivation |
| v_CONN_RQ_NOT_ALLOWED | connection request incompatible with answerer role |
| v_PEER_EC_RE_ESTABLISHMENT | peer EC tryed to re-establish connection : release connection |
| v_PEER_EC_RELEASE | peer EC release indication |
| v_DC_FATAL_ERROR | Data Compression entity fatal error |
| v_EC_FALLBACK_HANGUP | EC establishment failure : fallback is hang-up |
public long getReceivedDataCount()
public long getTotalErrorCount()
public String getReceivedPageFileName()
list of received pages at completion
public int getTotalPageCount()
public int getPageNumber()
public int getCompression()
public int getFillOrder()
public int getImageWidth()
public int getImageLength()
public int getOrientation()
public int getPhotometricInterpretation()
public int getResolutionUnit()
public int getSamplesPerPixel()
public int getXResolution()
public int getYResolution()
public int getT4Options()
public int getT6Options()
public int getBadFaxLines()
public int getCleanFaxData()
public int getConsecutiveBadFaxLinesO()
public void tiffify(String tiffFpath)
throws Exception
the received pages.
Exceptionpublic String[] getPageNames()
public int getUseCase()
FaxConstants#v_SENDING |
FaxConstants#v_RECEIVING |
FaxConstants#v_POLLING_TO_RECEIVE , although not suppoorted yet |
FaxConstants#v_POLLED_TO_SEND , although not suppoorted yet |
public int getRemoteIdCode()
public String getRemoteId()
public int getErrorCode()
public String getErrorText()
public byte[] getReceivedPagePixels()
public Symbol getPageLength()
negotiated page length
public long getReceivedPageLength()
public Symbol getPageWidth()
negotiated page width
public long getReceivedPageWidth()
public Date getTimeStamp()
public Symbol getFaxProcessingCode()
| v_NEW_PAGE | another page to follow |
| v_NEGOTIATE | renegotiate |
| v_STOP | end of communication |
public Symbol getCommunicationDiagnosticCode()
| v_LOCAL_OK | disconnection ok, local |
| v_REMOTE_OK | disconnection ok, remote |
| v_UNSPEC_OK | disconnection ok, unspecified |
| v_FORCED_DISC | forced disconnection |
| v_REMOTE_DISC | disconnection nok, remote |
| v_INTERNAL_TIME_OUT | internal time-out |
| v_USER_TIME_OUT | CF user time-out error |
| v_USER_DISCONNECTION | Control Functions user initiated disconnection |
| v_NO_CD | no Carrier Detect |
| v_INTERNAL_ERROR | internal error |
| v_NO_INV_FRAME | No or invalid frame received |
| v_NODIS_R | T1 exp, no DIS received |
| v_NOANS_DIS | T1 timer expired while sending DIS, no peer entity answer |
| v_PROTOCOL_ERROR | incompatible received DCS/DTC, etc |
| v_NO_CFR | no CFR received |
| v_TRIES_EXHAUSTED_X | training (TCF) transmission tries exhausted |
| v_NO_MCF | no MCF/RTN/RTP/PIN/PIP received |
| v_NO_MPS | no "end of page" frame received |
| v_NO_TCF | abnormal received training (TCF) probably too long |
| v_TRIES_EXHAUSTED_R | ECM: too many errors signalled by remote |
| v_REMOTE_TIME_OUT | ECM: T5 (RNR/RR) inactivity timer expired |
| v_NO_RR | ECM: No RR received in time |
| v_NO_ANSWER | receive watchdog timer expiration |
| v_PAGE_TOO_LONG | too many T.4 lines received |
| v_LINE_TOO_LONG | too many bits received for a T.4 line |
| v_NO_MCF_EOP | no MCF/RTN/RTP/PIN/PIP received as answer to our [PPS.][PRI-]EOP |
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||