<html>
<head>
<base href="https://wiki.asterisk.org/wiki">
<link rel="stylesheet" href="/wiki/s/2042/1/7/_/styles/combined.css?spaceKey=AST&forWysiwyg=true" type="text/css">
</head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
<h2><a href="https://wiki.asterisk.org/wiki/display/AST/Record+Application">Record Application</a></h2>
<h4>Page <b>edited</b> by <a href="https://wiki.asterisk.org/wiki/display/~mdavenport">Malcolm Davenport</a>
</h4>
<br/>
<h4>Changes (3)</h4>
<div id="page-diffs">
<table class="diff" cellpadding="0" cellspacing="0">
<tr><td class="diff-snipped" >...<br></td></tr>
<tr><td class="diff-unchanged" >#* {code:lang=javascript}[day-menu] <br>exten => s,1,Answer(500) <br></td></tr>
<tr><td class="diff-changed-lines" >same => <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">n(playback),Background(custom-menu)</span> <span class="diff-added-words"style="background-color: #dfd;">n(loop),Background(custom-menu)</span> <br></td></tr>
<tr><td class="diff-unchanged" >same => n,WaitExten() <br></td></tr>
<tr><td class="diff-unchanged" > <br>exten => 1,1,Goto(users,6001,1) <br></td></tr>
<tr><td class="diff-snipped" >...<br></td></tr>
<tr><td class="diff-unchanged" > <br>exten => i,1,Playback(option-is-invalid) <br></td></tr>
<tr><td class="diff-unchanged" >same => n,Goto(s,loop) <br></td></tr>
<tr><td class="diff-unchanged" > <br>exten => t,1,Playback(are-you-still-there) <br></td></tr>
<tr><td class="diff-changed-lines" >same => <span class="diff-changed-words">n,Goto(s,loop)<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{code}</span></span> <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">{code} <br> <br></td></tr>
<tr><td class="diff-unchanged" ># Dial extension *6597* to record your auto-attendant sound prompt. Your sound prompt should say something like "Thank you for calling! Press one for Alice, press two for Bob, or press 9 for a company directory". Press the hash key (*#*) on your keypad when you're finished recording, and Asterisk will play it back to you. If you don't like it, simply dial extension *6597* again to re-record it. <br># Dial extension *6599* to test your auto-attendant menu. <br></td></tr>
<tr><td class="diff-snipped" >...<br></td></tr>
</table>
</div> <h4>Full Content</h4>
<div class="notificationGreySide">
<p>For creating your own auto-attendant or IVR menus, you're probably going to want to record your own custom prompts. An easy way to do this is with the <b>Record()</b> application. The <b>Record()</b> application plays a beep, and then begins recording audio until you press the hash key (<b>#</b>) on your keypad. It then saves the audio to the filename specified as the first parameter to the application and continues on to the next priority in the extension. If you hang up the call before pressing the hash key, the audio will not be recorded. For example, the following extension records a sound prompt called <b>custom-menu</b> in the <b>gsm</b> format in the <b>en/</b> sub-directory, and then plays it back to you.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<script type="syntaxhighlighter" class="toolbar: false; theme: Confluence; brush: javascript; gutter: false"><![CDATA[exten => 6597,1,Answer(500)
same => n,Record(en/custom-menu.gsm)
same => n,Wait(1)
same => n,Playback(custom-menu)
same => n,Hangup()]]></script>
</div></div>
<div class='panelMacro'><table class='tipMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/wiki/images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Recording Formats</b><br />When specifiying a file extension when using the <b>Record()</b> application, you must choose a file extension which represents one of the supported file formats in Asterisk. For the complete list of file formats supported in your Asterisk installation, type <b>core show file formats</b> at the Asterisk command-line interface.</td></tr></table></div>
<p>You've now learned the basics of how to create a simple auto-attendant menu. Now let's build a more practical menu for callers to be able to reach Alice or Bob or the dial-by-name directory.</p>
<h4><a name="RecordApplication-%26nbsp%3BProcedure216.1.BuildingaPracticalAutoAttendantMenu"></a> Procedure 216.1. Building a Practical Auto-Attendant Menu</h4>
<ol>
        <li>Add an extension 6599 to the [docs:users] context which sends the calls to a new context we'll build called [docs:day-menu]. Your extension should look something like:
        <ul>
                <li><div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<script type="syntaxhighlighter" class="toolbar: false; theme: Confluence; brush: javascript; gutter: false"><![CDATA[exten=>6599,1,Goto(day-menu,s,1)]]></script>
</div></div></li>
        </ul>
        </li>
        <li>Add a new context called <b>[docs:day-menu]</b>, with the following contents:
        <ul>
                <li><div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<script type="syntaxhighlighter" class="toolbar: false; theme: Confluence; brush: javascript; gutter: false"><![CDATA[[day-menu]
exten => s,1,Answer(500)
same => n(loop),Background(custom-menu)
same => n,WaitExten()
exten => 1,1,Goto(users,6001,1)
exten => 2,1,Goto(users,6002,1)
exten => 9,1,Directory(vm-demo,users,fe)
exten => *,1,VoiceMailMain(@vm-demo)
exten => i,1,Playback(option-is-invalid)
same => n,Goto(s,loop)
exten => t,1,Playback(are-you-still-there)
same => n,Goto(s,loop)
]]></script>
</div></div></li>
        </ul>
        </li>
</ol>
<ol>
        <li>Dial extension <b>6597</b> to record your auto-attendant sound prompt. Your sound prompt should say something like "Thank you for calling! Press one for Alice, press two for Bob, or press 9 for a company directory". Press the hash key (<b>#</b>) on your keypad when you're finished recording, and Asterisk will play it back to you. If you don't like it, simply dial extension <b>6597</b> again to re-record it.</li>
        <li>Dial extension <b>6599</b> to test your auto-attendant menu.</li>
</ol>
<p>In just a few lines of code, you've created your own auto-attendant menu. Feel free to experiment with your auto-attendant menu before moving on to the next section.</p>
</div>
<div id="commentsSection" class="wiki-content pageSection">
<div style="float: right;">
<a href="https://wiki.asterisk.org/wiki/users/viewnotifications.action" class="grey">Change Notification Preferences</a>
</div>
<a href="https://wiki.asterisk.org/wiki/display/AST/Record+Application">View Online</a>
|
<a href="https://wiki.asterisk.org/wiki/pages/diffpagesbyversion.action?pageId=4817379&revisedVersion=6&originalVersion=5">View Changes</a>
|
<a href="https://wiki.asterisk.org/wiki/display/AST/Record+Application?showComments=true&showCommentArea=true#addcomment">Add Comment</a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>