⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 interface-final.html

📁 Intercom 是一个 Unix系统上灵活的语音传输软件。支持标准音频压缩比如GSM, G.711, and G.72x和其他音频编码。Intercom专为高速网络设计来传输高品质的语音
💻 HTML
字号:
<HTML><HEAD><TITLE>Putting it all Together</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.77+"><LINKREL="HOME"TITLE="Intercom"HREF="intercom.html"><LINKREL="UP"TITLE="Interfacing With Intercom"HREF="interface.html"><LINKREL="PREVIOUS"TITLE="Conditionals"HREF="interface-if.html"><LINKREL="NEXT"TITLE="GNU Free Documentation License"HREF="gfdl.html"></HEAD><BODYCLASS="SECTION"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">Intercom: Version 0.15 Reference Manual</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="interface-if.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 5. Interfacing With Intercom</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="gfdl.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="SECTION"><H1CLASS="SECTION"><ANAME="INTERFACE-FINAL"></A>Putting it all Together</H1><P>The hook, exec, and if commands on their own offer very littlefunctionality with the possible exception of exec.  However, combined, theyallow the user to perform simple to complex Intercom tasks.  A hook commandfor example, could call a shell script.  It could even execute a commandbased on the exit-code of that script.  In the following section, you willfind some practical examples which demonstrate using these commandstogether.  You may be able to use some of them as-is and some will needmodifications.</P><DIVCLASS="SECTION"><H2CLASS="SECTION"><ANAME="INTERFACE-FINAL-EXAMPLES"></A>Practical Examples</H2><DIVCLASS="SECTION"><H3CLASS="SECTION"><ANAME="INTERFACE-FINAL-EXAMPLES-SOUND"></A>Incoming Audio Alert</H3><P>Most people will probably want some sort of audio alert when an incomingcall is received.  Hooks make this very easy to implement.  For thisexample, you will need a wave player such as bplay and a wave to play.  Anywave will do but don't make it too long or you will have to wait beforeanswering the call.  The below example assumes that ring.wav resides in thesounds directory off of the home directory of the user runningIntercom.</P><P><TTCLASS="PROMPT">intercom: </TT><BCLASS="COMMAND">hook add call_incoming'exec "bplay $HOME/sounds/ring.wav 1&#62;/dev/null 2&#62;&#38;1 "'</B></P><P>Adding an audio alert when a call is terminated is fairly trivial andis left as an excersize for the reader.</P></DIV><DIVCLASS="SECTION"><H3CLASS="SECTION"><ANAME="INTERFACE-FINAL-EXAMPLES-MIXER"></A>Setting the Mixer</H3><P>If you often record from your Line input or another source, you willprobably want Intercom to switch the OSS recording source to the mic input. The following simple example should do just this.  <DIVCLASS="NOTE"><P></P><TABLECLASS="NOTE"WIDTH="100%"BORDER="0"><TR><TDWIDTH="25"ALIGN="CENTER"VALIGN="TOP"><IMGSRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"HSPACE="5"ALT="Note"></TD><TDALIGN="LEFT"VALIGN="TOP"><P>You willmost likely need to adjust the cmix command below for the particular mixeryou use.</P></TD></TR></TABLE></DIV></P><P><TTCLASS="PROMPT">intercom: </TT><BCLASS="COMMAND">hook add call_connect 'exec "cmix rcs mic on"'</B></P></DIV><DIVCLASS="SECTION"><H3CLASS="SECTION"><ANAME="INTERFACE-FINAL-EXAMPLES-TIME"></A>Call Time Restrictions</H3><P>The following is a more complicated example which demonstrates apossible implementation of hooks and conditionals.  Let's say you wanted toautomatically reject calls before 08:00 and after 18:00.  To accomplishthis, you would use a hook command which looks something like thefollowing.</P><P><TTCLASS="PROMPT">intercom: </TT><BCLASS="COMMAND">hook add call_incoming"if \"test `date +%H` -lt 8 -o `date +%H` -gt 18\" hangup"</B></P><P>The date calls are expanded by Intercom to the values of the hour. This assumes you are using GNU date though and may have to be adjusted forother date implementations.</P></DIV></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="interface-if.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="intercom.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="gfdl.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Conditionals</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="interface.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">GNU Free Documentation License</TD></TR></TABLE></DIV></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -