|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Defines a method for recording a media stream into a data file. A Recorder transcodes the media stream data from the telephony network, and stores the result in a Data Stream Container (MSC).
The Recorder interface is also used to send recognize requests to an ASR server (see below).
It can also be used to receive SMS-TL messages (see below).
This resource will be able to receive faxes (see below).
A variety a coder types are defined, depending on the particular Recorder.
Run Time Controls can be used to stop recording.
A Recorder may optionally support additional processing features.
These features define parameters and runtime controls that affect
operation of an ongoing play operation.
The presence of these features is indicated by a true
value for the following attributes:
| Attribute: | indicates the ability to: |
|
NOT SUPPORTED BY OC MP. play a beep before recording. parameters
are supported |
|
do limited beep. In OC MP, considered always true. parameter is supported |
|
NOT SUPPORTED BY OC MP AS SUCH. Instead, p_CoderTypes can be set for each operation, specifying the one coder used. use the listed coders. see CoderConstants for defined coder types |
|
pause and resume while recording. In OC MP, considered always true. RTC actions and
are supported |
|
did indicate to allocate silence truncation resources
NOT SUPPORTED BY OC MP AS SUCH. Instead, a Voice Activity Detector type "n" should be available in the ConfigSpec. |
recorder.
The recorder is either Idle, Active, or Paused.
fails unless the state is Idle.
and then the state becomes Active or Paused.
The state of the Recorder after record()play() starts is determined
by the Boolean value of the parameter .
The state transitions to Active if p_StartPaused is false.
The state transitions to Paused if p_StartPaused is true.
p_StartPaused
When recording stops, the state becomes Idle. Recording stops for a variety of reasons.
has no effect unless state is Recording,
and then the state becomes Paused, and rtca_Pause
is sent to ev_Pause.
onRecorderEvent()
has no effect unless state is Paused,
and then the state becomes Recording, and rtca_Resume
is sent to ev_Resume.
onRecorderEvent()
Note: The format of the String that identifies an MSC is not defined by this release of specification. The vendor-specific implementation of the MediaService (for example, the vendor of the server or resource) shall define the supported String formats.
For example, an implementation may support URLs or File pathnames;
in which case an application could use Strings of the form:
file://node/dir/name or dir/dir/name
If the MSC identifier is a file pathname, it is interpreted in the logical filename-space of the server. THIS IS OC MP's CASE. Applications and their prompts need to be installed with correct pathnames.
RTPRecorder
associated with a speech detector
(cf. speechEnabled configSpecs).
In that ConfigSpec case, both state diagrams should be taken into account.
The result of the SpeechDetector
.
operation is delivered through
record() callbackonRecorderEvent()
SpeechDetector parameters, specific RecorderEvent qualifiers & supported RTC
triggers are defined in the SpeechDetectorConstants interface.
streamID parameter is the Audio Service in form
rtsp://audioservice
optArgs:
String with the key p_LoadGrammar.
In this case the default type is "application/grammar+xml".
This can be overridden with the p_GrammarType argument if
the server associated with the Audio Service supports other types of grammar.
p_GrammarId (see later for
how to pre-define grammars), in which case the grammar type must be set:
p_GrammarType set to "text/uri-list"
record() operation is delivered in an
ASRRecorderEvent to the onRecorderEvent() callback
of the ResourceEventListener.
If the recognition was successful, then an equal to
eventIdASRConstants.ev_(Non)Final(Rule|Word)Result is received.
Currently only events are supported (grammar based recognizers)
ev_FinalRuleResult
If the recognition failed, then an is received. This may have
an error set (e.g. ev_Record, e_BadGrammar) or if
e_ServerFailed, a qualifier such as
e_OK for a no-match recognition
or q_Standard for a recognition timeout
or q_Duration for a noinput timeout.
q_Silence
Refer to ASRConstants for full details on these symbols and their meaning.
// ASR AudioService
String asrAudioService="rtsp://AsrAudioService";
// Load grxml grammar as a string from a file or whatever (not OCMP method)
String grammar = getGrammarFromFile("/opt/services/grammar.xml");
// empty arg dictionary
optArgs.clear();
// pass parameters
optArgs.put(p_LoadGrammar, grammar);
try {
// start recording
mediagroup.record(asrAudioService,myRtcs,optArgs);
} catch (Exception e) {
// exception processing etc;
}
streamID parameter is the SMS mode in form
sms-tl://
optArgs hashtable.
record() operation is delivered in an
SMSRecorderEvent to the onRecorderEvent() callback
of the ResourceEventListener.
If the SMS record was successful, then an eventId equal to
is received.
ev_SMS
Refer to SMSRecorderConstants for full details on these symbols and their meaning.
// SMS
String smsService="sms-tl://";
// empty arg dictionary
optArgs.clear();
try {
// start recording
mediagroup.record(smsService,myRtcs,optArgs);
} catch (Exception e) {
// exception processing etc;
}
AsyncMediaGroup should be brought by loopCP with ConfigSpec.basicFaxConfig.
streamID parameter is the 20 printable characters fax ID, prefixed by
fax://
parameters are passed in the params hashtable to setup the local fax characteritics.
params.put(FaxConstants.p_PagesEncoding ,FaxConstants.v_TIFF); params.put(FaxConstants.p_StorePath ,"/home/facsimile/"+uniqueSessionId+"/"); params.put(FaxConstants.p_Suffix ,".fax"); params.put(FaxConstants.p_VerticalResolution ,FaxConstants.v_Normal_98lpi); params.put(FaxConstants.p_PageWidth ,FaxConstants.v_1728pixelsIn215mm); params.put(FaxConstants.p_PageLength ,FaxConstants.v_A4_297mm); params.put(FaxConstants.p_PageResolution ,FaxConstants.v_Page_Resolution_0200_0100); params.put(FaxConstants.p_FileType ,FaxConstants.v_T4_1D_ModifiedHuffman); params.put(FaxConstants.p_FaxTimeOut ,new Integer(900000));//15 minutes params.put(FaxConstants.p_MaxPageToReceive ,new Integer(5)); // we receive an incoming call, and act as a receiving fax machine : params.put(FaxConstants.p_Role ,FaxConstants.v_Answerer); params.put(FaxConstants.p_CapabilityToReceive ,Boolean.TRUE); // we do not have any page to send, we just receive : params.put(FaxConstants.p_EnablePolling ,Boolean.FALSE); // start receiving one or more pages (/home/facsimile/pageN1.bmp, /home/facsimile/pageN2.bmp, and so forth) String servicePrefixPlusFaxID = FaxConstants.v_Prefix+"hp OC MP 2.4C2"; mediagroup.record(servicePrefixPlusFaxID,myRtcs,params);The result of the Fax
record() operation is delivered in a
FaxEvent to the
onPlayerEvent()
or
onRecorderEvent()
callback of the ResourceEventListener.
Note : the regular direct receive is delivered with 2.4C2 EA.
params.put(FaxConstants.p_PagesEncoding ,FaxConstants.v_TIFF); params.put(FaxConstants.p_StorePath ,"/home/facsimile/"+uniqueSessionId+"/"); params.put(FaxConstants.p_Suffix ,".fax"); params.put(FaxConstants.p_VerticalResolution ,FaxConstants.v_Normal_98lpi); params.put(FaxConstants.p_PageWidth ,FaxConstants.v_1728pixelsIn215mm); params.put(FaxConstants.p_PageLength ,FaxConstants.v_A4_297mm); params.put(FaxConstants.p_PageResolution ,FaxConstants.v_Page_Resolution_0200_0100); params.put(FaxConstants.p_FileType ,FaxConstants.v_T4_1D_ModifiedHuffman); params.put(FaxConstants.p_FaxTimeOut ,new Integer(900000));//15 minutes params.put(FaxConstants.p_MaxPageToReceive ,new Integer(5)); // parameters above are like for the regular direct receive. // we receive an incoming call, and are sending : params.put(FaxConstants.p_Role ,FaxConstants.v_Caller);// as for the regular direct send params.put(FaxConstants.p_CapabilityToReceive ,Boolean.TRUE);// as for the regular direct receive // we do not have any page to receive, we just send : params.put(FaxConstants.p_EnablePolling ,Boolean.TRUE);// unlike the regular direct receiveThe
record() method will be called the same way.
Note : the reversed polling mode is delivered within late 2.4C2.
| Field Summary |
| 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 |
| Fields inherited from interface hp.telephony.media.EchoCancellerConstants |
p_AcousticEcho, p_AlcInEnable, p_AlcInGain, p_AlcOutEnable, p_AlcOutGain, p_Bypass, p_EchoThreshold, p_MaxDelaySearch, p_Mu, p_NlpControl |
| Fields inherited from interface hp.telephony.media.RTPRecorderConstants |
p_SendSignalsUsingRFC2833 |
| Fields inherited from interface hp.telephony.media.SMSRecorderConstants |
e_TL_InternalError, ev_SMS, q_TL_Message, v_TL_DATA_CFM, v_TL_DATA_ERR, v_TL_DATA_IND, v_TL_DATA_REJ, v_TL_EST_CFM, v_TL_EST_REJ, v_TL_INFO_ABRT, v_TL_INFO_CFM, v_TL_INFO_IND, v_TL_INFO_REJ, v_TL_NOT_DLL_EST_IND, v_TL_REL_ABRT, v_TL_REL_CFM, v_TL_REL_IND |
| Method Summary | |
void |
record(String streamID,
RTC[] rtc,
Dictionary optargs)
Record data from the Terminal into the named Media Stream Container (MSC). |
| Method Detail |
public void record(String streamID,
RTC[] rtc,
Dictionary optargs)
throws MediaResourceException,
AccessControlException
record() encodes the media stream
from the bound Terminal, and stores the result in
the Media Stream Container identified by
the given streamID.
This method can also be used for sending ASR recognize requests as well as for SMS and, soon, faxes.
If the MSC does not exist, it is created and associated
with the coder type specified by parameter .
(instead of original API using p_CoderTypesp_Coder ; value is a one element array, the coder type).
If the MSC does exist, the recording is made using
the coder type associated with that DSD, in case of a WAV file, otherwise, the coder type specified by will be used.
If the Recorder does not support the indicated Coder,
p_CoderTypes throws a record(),
indicating MediaResourceException.
Error.e_Coder
This method is non-blocking. The result is passed in a
event through the
RecorderEventResourceEventListener Interface.
The condition that caused recording to stop is available from the
completion event using .
getQualifier
The optargs argument specifies values for Recorder
parameters for the duration of this record operation.
For example, p_CoderTypes (instead of p_Coder) or p_BeepStart
can be overridden for a single method invocation.
Exceptions are thrown if pre- or post- conditions are not satisfied
Pre-conditions:
p_SilenceTerminationThreshold millis detectedstop() method invokedRecorderConstants.rtca_Stop triggered
streamID - the String name of the MSC where data is to be stored
"rtsp://audioservice"
"sms-tl://"
"fax://".rtc - an Array of RTC (Run-Time-Control) objectsoptargs - a Dictionary of optional arguments among
RecorderConstants.p_FileFormat RecorderConstants.p_CoderTypes RecorderConstants.p_Append RecorderConstants.p_EnabledEvents RecorderConstants.p_MaxDuration RecorderConstants.p_MinDuration RecorderConstants.p_SilenceTerminationOn RecorderConstants.p_SilenceTerminationThreshold RecorderConstants.p_SilenceTruncationOn RecorderConstants.p_SilenceTruncationThreshold RecorderConstants.p_SignalTruncationOn RecorderConstants.p_SilenceEnergyThreshold RecorderConstants.p_StartBeep RecorderConstants.p_StartPaused MediaResourceException - if requested operation fails.
AccessControlExceptionResourceEventListener.onRecorderEvent(hp.telephony.media.RecorderEvent)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||