📄 agichannel.html
字号:
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> char</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/asteriskjava/fastagi/AgiChannel.html#streamFile(java.lang.String, java.lang.String)">streamFile</A></B>(java.lang.String file, java.lang.String escapeDigits)</CODE><BR> Plays the given file and allows the user to escape by pressing one of the given digit.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/asteriskjava/fastagi/AgiChannel.html#verbose(java.lang.String, int)">verbose</A></B>(java.lang.String message, int level)</CODE><BR> Sends a message to the Asterisk console via the verbose message system.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> char</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/asteriskjava/fastagi/AgiChannel.html#waitForDigit(int)">waitForDigit</A></B>(int timeout)</CODE><BR> Waits up to 'timeout' milliseconds to receive a DTMF digit.</TD></TR></TABLE> <P><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="getName()"><!-- --></A><H3>getName</H3><PRE>java.lang.String <B>getName</B>()</PRE><DL><DD>Returns the name of the channel.<P><DD><DL><DT><B>Returns:</B><DD>the name of the channel.</DL></DD></DL><HR><A NAME="getUniqueId()"><!-- --></A><H3>getUniqueId</H3><PRE>java.lang.String <B>getUniqueId</B>()</PRE><DL><DD>Returns the unqiue id of the channel.<P><DD><DL><DT><B>Returns:</B><DD>the unqiue id of the channel.</DL></DD></DL><HR><A NAME="sendCommand(org.asteriskjava.fastagi.command.AgiCommand)"><!-- --></A><H3>sendCommand</H3><PRE><A HREF="../../../org/asteriskjava/fastagi/reply/AgiReply.html" title="interface in org.asteriskjava.fastagi.reply">AgiReply</A> <B>sendCommand</B>(<A HREF="../../../org/asteriskjava/fastagi/command/AgiCommand.html" title="interface in org.asteriskjava.fastagi.command">AgiCommand</A> command) throws <A HREF="../../../org/asteriskjava/fastagi/AgiException.html" title="class in org.asteriskjava.fastagi">AgiException</A></PRE><DL><DD>Sends a command to asterisk and returns the corresponding reply.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>command</CODE> - the command to send.<DT><B>Returns:</B><DD>the reply of the asterisk server containing the return value.<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/asteriskjava/fastagi/AgiException.html" title="class in org.asteriskjava.fastagi">AgiException</A></CODE> - if the command can't be sent to Asterisk (for example because the channel has been hung up)</DL></DD></DL><HR><A NAME="answer()"><!-- --></A><H3>answer</H3><PRE>void <B>answer</B>() throws <A HREF="../../../org/asteriskjava/fastagi/AgiException.html" title="class in org.asteriskjava.fastagi">AgiException</A></PRE><DL><DD>Answers the channel.<P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../org/asteriskjava/fastagi/AgiException.html" title="class in org.asteriskjava.fastagi">AgiException</A></CODE><DT><B>Since:</B></DT> <DD>0.2</DD></DL></DD></DL><HR><A NAME="hangup()"><!-- --></A><H3>hangup</H3><PRE>void <B>hangup</B>() throws <A HREF="../../../org/asteriskjava/fastagi/AgiException.html" title="class in org.asteriskjava.fastagi">AgiException</A></PRE><DL><DD>Hangs the channel up.<P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../org/asteriskjava/fastagi/AgiException.html" title="class in org.asteriskjava.fastagi">AgiException</A></CODE><DT><B>Since:</B></DT> <DD>0.2</DD></DL></DD></DL><HR><A NAME="setAutoHangup(int)"><!-- --></A><H3>setAutoHangup</H3><PRE>void <B>setAutoHangup</B>(int time) throws <A HREF="../../../org/asteriskjava/fastagi/AgiException.html" title="class in org.asteriskjava.fastagi">AgiException</A></PRE><DL><DD>Cause the channel to automatically hangup at the given number of seconds in the future.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>time</CODE> - the number of seconds before this channel is automatically hung up.<p> 0 disables the autohangup feature.<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/asteriskjava/fastagi/AgiException.html" title="class in org.asteriskjava.fastagi">AgiException</A></CODE><DT><B>Since:</B></DT> <DD>0.2</DD></DL></DD></DL><HR><A NAME="setCallerId(java.lang.String)"><!-- --></A><H3>setCallerId</H3><PRE>void <B>setCallerId</B>(java.lang.String callerId) throws <A HREF="../../../org/asteriskjava/fastagi/AgiException.html" title="class in org.asteriskjava.fastagi">AgiException</A></PRE><DL><DD>Sets the caller id on the current channel.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>callerId</CODE> - the raw caller id to set, for example "John Doe<1234>".<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/asteriskjava/fastagi/AgiException.html" title="class in org.asteriskjava.fastagi">AgiException</A></CODE><DT><B>Since:</B></DT> <DD>0.2</DD></DL></DD></DL><HR><A NAME="playMusicOnHold()"><!-- --></A><H3>playMusicOnHold</H3><PRE>void <B>playMusicOnHold</B>() throws <A HREF="../../../org/asteriskjava/fastagi/AgiException.html" title="class in org.asteriskjava.fastagi">AgiException</A></PRE><DL><DD>Plays music on hold from the default music on hold class.<P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../org/asteriskjava/fastagi/AgiException.html" title="class in org.asteriskjava.fastagi">AgiException</A></CODE><DT><B>Since:</B></DT> <DD>0.2</DD></DL></DD></DL><HR><A NAME="playMusicOnHold(java.lang.String)"><!-- --></A><H3>playMusicOnHold</H3><PRE>void <B>playMusicOnHold</B>(java.lang.String musicOnHoldClass) throws <A HREF="../../../org/asteriskjava/fastagi/AgiException.html" title="class in org.asteriskjava.fastagi">AgiException</A></PRE><DL><DD>Plays music on hold from the given music on hold class.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>musicOnHoldClass</CODE> - the music on hold class to play music from as configures in Asterisk's <code><musiconhold.conf/code>.<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/asteriskjava/fastagi/AgiException.html" title="class in org.asteriskjava.fastagi">AgiException</A></CODE><DT><B>Since:</B></DT> <DD>0.2</DD></DL></DD></DL><HR><A NAME="stopMusicOnHold()"><!-- --></A><H3>stopMusicOnHold</H3><PRE>void <B>stopMusicOnHold</B>() throws <A HREF="../../../org/asteriskjava/fastagi/AgiException.html" title="class in org.asteriskjava.fastagi">AgiException</A></PRE><DL><DD>Stops playing music on hold.<P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../org/asteriskjava/fastagi/AgiException.html" title="class in org.asteriskjava.fastagi">AgiException</A></CODE><DT><B>Since:</B></DT> <DD>0.2</DD></DL></DD></DL><HR><A NAME="getChannelStatus()"><!-- --></A><H3>getChannelStatus</H3><PRE>int <B>getChannelStatus</B>() throws <A HREF="../../../org/asteriskjava/fastagi/AgiException.html" title="class in org.asteriskjava.fastagi">AgiException</A></PRE><DL><DD>Returns the status of the channel.<p> Return values: <ul> <li>0 Channel is down and available <li>1 Channel is down, but reserved <li>2 Channel is off hook <li>3 Digits (or equivalent) have been dialed <li>4 Line is ringing <li>5 Remote end is ringing <li>6 Line is up <li>7 Line is busy </ul><P><DD><DL><DT><B>Returns:</B><DD>the status of the channel.<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/asteriskjava/fastagi/AgiException.html" title="class in org.asteriskjava.fastagi">AgiException</A></CODE><DT><B>Since:</B></DT> <DD>0.2</DD></DL></DD></DL><HR><A NAME="getData(java.lang.String)"><!-- --></A><H3>getData</H3><PRE>java.lang.String <B>getData</B>(java.lang.String file) throws <A HREF="../../../org/asteriskjava/fastagi/AgiException.html" title="class in org.asteriskjava.fastagi">AgiException</A></PRE><DL><DD>Plays the given file and waits for the user to enter DTMF digits until he presses '#'. The user may interrupt the streaming by starting to enter digits.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>file</CODE> - the name of the file to play<DT><B>Returns:</B><DD>a String containing the DTMF the user entered<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/asteriskjava/fastagi/AgiException.html" title="class in org.asteriskjava.fastagi">AgiException</A></CODE><DT><B>Since:</B></DT> <DD>0.2</DD></DL></DD></DL><HR><A NAME="getData(java.lang.String, long)"><!-- --></A><H3>getData</H3><PRE>java.lang.String <B>getData</B>(java.lang.String file, long timeout) throws <A HREF="../../../org/asteriskjava/fastagi/AgiException.html" title="class in org.asteriskjava.fastagi">AgiException</A></PRE><DL><DD>Plays the given file and waits for the user to enter DTMF digits until he presses '#' or the timeout occurs. The user may interrupt the streaming by starting to enter digits.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>file</CODE> - the name of the file to play<DD><CODE>timeout</CODE> - the timeout in milliseconds to wait for user input.<p> 0 means standard timeout value, -1 means "ludicrous time" (essentially never times out).<DT><B>Returns:</B><DD>a String containing the DTMF the user entered<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/asteriskjava/fastagi/AgiException.html" title="class in org.asteriskjava.fastagi">AgiException</A></CODE><DT><B>Since:</B></DT> <DD>0.2</DD></DL></DD></DL><HR><A NAME="getData(java.lang.String, long, int)"><!-- --></A><H3>getData</H3><PRE>java.lang.String <B>getData</B>(java.lang.String file, long timeout, int maxDigits) throws <A HREF="../../../org/asteriskjava/fastagi/AgiException.html" title="class in org.asteriskjava.fastagi">AgiException</A></PRE><DL><DD>Plays the given file and waits for the user to enter DTMF digits until he presses '#' or the timeout occurs or the maximum number of digits has
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -