hp.telephony.media
Interface FaxEvent

All Superinterfaces:
CoderConstants, FaxConstants, MediaEvent, PlayerConstants, PlayerEvent, RecorderConstants, RecorderEvent, ResourceConstants, ResourceEvent, SpeechDetectorConstants

public interface FaxEvent
extends PlayerEvent, RecorderEvent, FaxConstants

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 .

Since:
OCMP 2.4 C2

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.PlayerConstants
a_AutomaticGainControl, a_Coder, a_Jump, a_Pause, a_Speed, a_Volume, ev_Pause, ev_Play, ev_Resume, ev_Speed, ev_Volume, p_CoderTypes, p_DisplayName, p_EnabledEvents, p_FileFormat, p_IfBusy, p_JumpMSCIncrement, p_JumpTime, p_MaxDuration, p_SpeedChange, p_StartPaused, p_VolumeChange, q_Duration, q_EndOfData, rtca_JumpBackward, rtca_JumpBackwardMSCs, rtca_JumpEndMSC, rtca_JumpEndMSCList, rtca_JumpForward, rtca_JumpForwardMSCs, rtca_JumpStartMSC, rtca_JumpStartMSCList, rtca_NormalSpeed, rtca_NormalVolume, rtca_Pause, rtca_Resume, rtca_SpeedDown, rtca_SpeedUp, rtca_Stop, rtca_StopAll, rtca_ToggleSpeed, rtca_ToggleVolume, rtca_VolumeDown, rtca_VolumeUp, rtcc_PlayComplete, rtcc_PlayStarted, v_Fail, v_GSMFormat, v_Queue, v_RawFormat, v_Stop, v_WavFormat
 
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.RecorderConstants
a_Beep, a_CoderTypes, a_FixedBeep, a_Pause, a_SilenceTruncation, ev_Pause, ev_Record, ev_Resume, p_Append, p_BeepFrequency, p_BeepLength, p_Coder, p_CoderTypes, p_EnabledEvents, p_FileFormat, p_FinalTimeoutBehaviour, p_MaxDuration, p_MinDuration, p_SignalTruncationOn, p_SilenceEnergyThreshold, p_SilenceTerminationOn, p_SilenceTerminationThreshold, p_SilenceTruncationOn, p_SilenceTruncationThreshold, p_SpeechDetectionMode, p_StartBeep, p_StartPaused, q_Silence, rtca_Pause, rtca_Resume, rtca_Stop, rtcc_RecordComplete, v_DetectAllOccurences, v_DetectFirstOccurence, v_GSMFormat, v_Inactive, v_RawFormat, v_WavFormat
 
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
 
Fields inherited from interface hp.telephony.media.FaxConstants
ev_Fax, p_AnswerCED, p_BitRate, p_ByteAlignedEol, p_CapabilityToReceive, p_DataCompressionFormat, p_DeTiffPrefix, p_DeTiffSuffix, p_EnablePolling, p_ErrorCorrection, p_FaxTimeOut, p_FileType, p_InternetRoutingSupport, p_InternetSelectivePollingSupport, p_KeepDataOrder, p_LegalSupport, p_LetterSupport, p_MaxLineToReceive, p_MaxPageToReceive, p_MaxSpeed, p_MinSpeed, p_PageLength, p_PageResolution, p_PagesEncoding, p_PagesPaths, p_PageWidth, p_PasswordSupport, p_PixelArrays, p_Role, p_ScanTimePerLine, p_SelectivePollingSupport, p_SelectivePollingWithSubaddressingSupport, p_StorePath, p_SubaddressingSupport, p_Suffix, p_T37Support, p_T38Support, p_TiffPath, p_VerticalResolution, q_Count, q_Document, q_Page, rtca_AssumeCNG, rtca_Cancel, v_12000bps, v_1216pixelsIn151mm, v_14400bps, v_1728pixelsIn215mm, v_2048pixelsIn255mm, v_2400bps, v_2432pixelsIn303mm, v_33600bps, v_4800bps, v_7200bps, v_864pixelsIn107mm, v_9600bps, v_A4_297mm, v_AfterCNG, v_Answerer, v_B4_364mm, v_BandWarrays, v_BMP, v_Caller, v_DisableECM, v_EnableECM_256bytes, v_EnableECM_64bytes, v_Encoding_MS_BMP, v_Error_Conversion_To_G3, v_Error_Decomp_Init, v_Error_Disconnect, v_Error_File_Open, v_Error_Illegal_Width, v_Error_Page_Format, v_FilesList, v_Fine_196lpi, v_GIF, v_JPEG, v_Normal_98lpi, v_NotSet, v_Page_File_Name_Size, v_PageResolution_0100_0100, v_PageResolution_0200_0100, v_PageResolution_0200_0200, v_PageResolution_0200_0400, v_PageResolution_0300_0300, v_PageResolution_0300_0600, v_PageResolution_0400_0400, v_PageResolution_0400_0800, v_PageResolution_0600_0600, v_PageResolution_0600_1200, v_PageResolution_1200_1200, v_PNG, v_Prefix, v_Rcv_Qual_Bad, v_Rcv_Qual_Medium, v_Rcv_Qual_OK, v_RightNow, v_ST0000, v_ST0505, v_ST1005, v_ST1010, v_ST2010, v_ST2020, v_ST4020, v_ST4040, v_T4_1D_ModifiedHuffman, v_T4_2D_ModifiedRead, v_T4_Buff_Size, v_T6_ModifiedModifiedRead, v_TIFF, v_UnlimitedLength, v_UponRTC
 
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

getLineRate

public Symbol getLineRate()
negotiated line bit rates

Since:
For future use.

getLineBitRate

public long getLineBitRate()
negotiated line bit rate, in bps

Since:
For future use.

getDisconnectionDiagnostic

public Symbol getDisconnectionDiagnostic()
Disconnection diagnostic.

Returns:
one of the 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
Since:
For future use.

getReceivedDataCount

public long getReceivedDataCount()
received data count.

Since:
For future use.

getTotalErrorCount

public long getTotalErrorCount()
total error count.

Since:
For future use.

getReceivedPageFileName

public String getReceivedPageFileName()
Deprecated. as intermediate page event has been replaced by list of received pages at completion

Received page file name.


getTotalPageCount

public int getTotalPageCount()
while sending or upon receving completed.


getPageNumber

public int getPageNumber()
while sending or receving.


getCompression

public int getCompression()
T41, T42 or T6.


getFillOrder

public int getFillOrder()

getImageWidth

public int getImageWidth()

getImageLength

public int getImageLength()

getOrientation

public int getOrientation()

getPhotometricInterpretation

public int getPhotometricInterpretation()

getResolutionUnit

public int getResolutionUnit()

getSamplesPerPixel

public int getSamplesPerPixel()

getXResolution

public int getXResolution()

getYResolution

public int getYResolution()

getT4Options

public int getT4Options()

getT6Options

public int getT6Options()

getBadFaxLines

public int getBadFaxLines()

getCleanFaxData

public int getCleanFaxData()

getConsecutiveBadFaxLinesO

public int getConsecutiveBadFaxLinesO()

tiffify

public void tiffify(String tiffFpath)
             throws Exception
Build a TIFF-F container out of the received pages.

Throws:
Exception

getPageNames

public String[] getPageNames()
Received pages as files. Paths to T41, T42 or T6 type images.


getUseCase

public 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


getRemoteIdCode

public int getRemoteIdCode()

getRemoteId

public String getRemoteId()

getErrorCode

public int getErrorCode()

getErrorText

public String getErrorText()

getReceivedPagePixels

public byte[] getReceivedPagePixels()
Received page as a rectangle of B and W dots, packed 8 per byte.

Since:
For future use.

getPageLength

public Symbol getPageLength()
negotiated page length

Since:
For future use.

getReceivedPageLength

public long getReceivedPageLength()
Received page length.

Since:
For future use.

getPageWidth

public Symbol getPageWidth()
negotiated page width

Since:
For future use.

getReceivedPageWidth

public long getReceivedPageWidth()
Received page width.

Since:
For future use.

getTimeStamp

public Date getTimeStamp()
start date of fax operation.

Since:
For future use.

getFaxProcessingCode

public Symbol getFaxProcessingCode()
Processing code. one of :
v_NEW_PAGE another page to follow
v_NEGOTIATE renegotiate
v_STOP end of communication

Since:
For future use.

getCommunicationDiagnosticCode

public Symbol getCommunicationDiagnosticCode()
Fax communication diagnostic code. one of :
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

Since:
For future use.