<div dir="ltr">this will help you..<br><br><pre><font size="4">;-------- DIY VOICEMAIL ---------<span style="font-family:arial,helvetica,sans-serif">-----------</span><br style="font-family:arial,helvetica,sans-serif"><b><span style="font-family:arial,helvetica,sans-serif">[ck987_vm_record]</span></b><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">;&quot;start recording after the beep.  Press # when done.&quot;</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">exten =&gt; 1,1,Playback(/home/ck987/asterisk_sounds/vm-record-start)</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">;build this call&#39;s recorded message file name &lt;uniqueID&gt;_&lt;phone number&gt;</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">;every call is assigned a unique id.</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">exten =&gt; 1,n,Set(record_file=${UNIQUEID}_${CALLERID(num)})</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">; records into my vm_msg folder.</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">;Ends if # is hit, silence for 2 secs, or recording lasts for 60 seconds</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">exten =&gt; 1,n,Record(/home/ck987/asterisk_sounds/vm_msg/${record_file}.wav,2,60) </span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">; 2 to review message, 3 to re record, or hang up</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">exten =&gt; 1,n,Background(/home/ck987/asterisk_sounds/vm-record-end)</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">exten =&gt; 1,n,WaitExten(5)</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">exten =&gt; 1,n,Playback(/home/ck987/asterisk_sounds/bye)</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">exten =&gt; 1,n,Hangup() </span><br style="font-family:arial,helvetica,sans-serif"><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">exten =&gt; 2,1,Playback(/home/ck987/asterisk_sounds/vm_msg/${record_file})</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">; press 1 to re-record, or hangup if satisfied</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">exten =&gt; 2,n,Background(/home/ck987/asterisk_sounds/vm-record-again)</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">exten =&gt; 2,n,WaitExten(5)</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">;no response, hang up on person.</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">exten =&gt; 2,n,Playback(/home/ck987/asterisk_sounds/bye)</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">exten =&gt; 2,n,Hangup()</span><br style="font-family:arial,helvetica,sans-serif">

<br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">;go back to the record option</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">exten =&gt; 3,1,Goto(ck987_vm_record,1,1) </span><br style="font-family:arial,helvetica,sans-serif">

<br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">;----------DIY VOICEMAIL ADMIN----------------------</span><br style="font-family:arial,helvetica,sans-serif"><br style="font-family:arial,helvetica,sans-serif">

<b><span style="font-family:arial,helvetica,sans-serif">[ck987_vm_admin]</span></b><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">; pass is 9988, jump to n+101 if authentication fails, expect 4 digits</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">exten =&gt; 1,1,Authenticate(9988,j,4)</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">; get number of voicemail messages</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">; SHELL function returns the output from a system command</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">; &quot;ls -1&quot; lists visible files in a list.  &quot;wc -l&quot; will count how many lines there are.  1 line per file!</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">exten =&gt; 1,n,Set(num_messages=${SHELL(ls -1 /home/ck987/asterisk_sounds/vm_msg/ | wc -l)})</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">;you have...</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">exten =&gt; 1,n,Playback(/home/ck987/asterisk_sounds/you-have)</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">exten =&gt; 1,n,SayDigits(${num_messages})</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">;...messages!</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">exten =&gt; 1,n,Playback(/home/ck987/asterisk_sounds/messages)</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">;get file names.  &quot;sed&quot; command trims off any .wav exten.  &quot;tr&quot; command trims off whitespace and line feeds.</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">exten =&gt; 1,n,Set(file_names=${SHELL(ls -m /home/ck987/asterisk_sounds/vm_msg/ | sed &#39;s/.wav//g&#39; | tr -d &#39; \n&#39;)})</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">;start message counter</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">exten =&gt; 1,n,Set(msg_counter=1)</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">; 1 to repeat message, 3 to go to the next message, 7 to go to the previous message</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">exten =&gt; 1,n,Playback(/home/ck987/asterisk_sounds/msg-options)</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">exten =&gt; 1,n,Goto(ck987_vm_play_message,1,1) ; playback loop</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">;try again if password is wrong</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">exten =&gt; 1,102,Goto(ck987_vm_admin,1,1) </span><br style="font-family:arial,helvetica,sans-serif"><br style="font-family:arial,helvetica,sans-serif"><br style="font-family:arial,helvetica,sans-serif">

<b><span style="font-family:arial,helvetica,sans-serif">[ck987_vm_play_message]</span></b><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">exten =&gt; 1,1,Background(beep)</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">exten =&gt; 1,n,Set(current_message=${CUT(file_names,\,,${msg_counter})})</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">exten =&gt; 1,n,NoOp(${file_names} ${current_message} ${msg_counter})</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">exten =&gt; 1,n,Background(/home/ck987/asterisk_sounds/vm_msg/${current_message})</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">exten =&gt; 1,n,Goto(3,1)</span><br style="font-family:arial,helvetica,sans-serif">

<br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">; next message: add 1 and go back to the top of the loop</span><br style="font-family:arial,helvetica,sans-serif">
<span style="font-family:arial,helvetica,sans-serif">exten =&gt; 3,1,Set(msg_counter=$[${msg_counter} + 1])</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">exten =&gt; 3,n,Set(msg_counter=${IF($[${msg_counter} &gt; ${num_messages}]?${num_messages}:${msg_counter})}) </span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">exten =&gt; 3,n,Goto(1,1) </span><br style="font-family:arial,helvetica,sans-serif"><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">; previous message: subtract 1 and go back to the top of the loop</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">exten =&gt; 7,1,Set(msg_counter=$[${msg_counter} - 1])</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">;make sure number never goes below 1</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">exten =&gt; 7,n,Set(msg_counter=${IF($[${msg_counter} &lt; 1]?1:${msg_counter})}) </span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">exten =&gt; 7,n,Playback(/home/ck987/asterisk_sounds/previous_message)</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">exten =&gt; 7,n,Goto(1,1) </span><br style="font-family:arial,helvetica,sans-serif"><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">;delete message</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">exten =&gt; *,1,System(rm /home/ck987/asterisk_sounds/vm_msg/${current_message})</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">;number of files has changed.  reload number of files and file names</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">; &quot;ls -1&quot; lists visible files in a list.  &quot;wc -l&quot; will count how many lines there are.  1 line per file!</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">exten =&gt; *,n,Set(num_messages=${SHELL(ls -1 /home/ck987/asterisk_sounds/vm_msg/ | wc -l)})</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">;get file names.  &quot;sed&quot; command trims off any .wav exten.  &quot;tr&quot; command trims off whitespace and line feeds.</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">exten =&gt; *,n,Set(file_names=${SHELL(ls -m /home/ck987/asterisk_sounds/vm_msg/ | sed &#39;s/.wav//g&#39; | tr -d &#39; \n&#39;)})</span><br style="font-family:arial,helvetica,sans-serif">

<span style="font-family:arial,helvetica,sans-serif">exten =&gt; *,n,Goto(1,1)<br><br>it&#39;s the actual voicemail example which is use by asterisk it self<br></span></font></pre><br><br><div class="gmail_quote">On Tue, May 10, 2011 at 2:53 AM, John Marvin <span dir="ltr">&lt;<a href="mailto:jm-asterisk@themarvins.org">jm-asterisk@themarvins.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On 5/9/2011 3:08 PM, Roger Burton West wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
You could use Monitor to record the whole call, then use an AGI to do<br>
something with it on hangup if the other conditions haven&#39;t been<br>
satisfied...?<br>
<br>
</blockquote>
<br></div>
I understand how to do the first part, and I at least understand that I could do something fancy with the AGI capability. But what I don&#39;t know is how I can take the recording and insert it into a voicemail box such that it can be retrieved through the normal &quot;VoiceMailMain&quot; mechanism.<br>

<br>
Would the asterisk voicemail app dynamically notice something new being dropped into the voicemail mbox directory? Would it only be noticed once Asterisk is restarted? Most importantly, would it send out the notifies to the &quot;phone&quot; associated with that voicemail box? I can probably fake the last part if necessary, but making the voicemail retrievable through the normal voicemail mechanism is what I really need to achieve.<br>

<br>
Thanks,<br><font color="#888888">
<br>
John</font><div><div></div><div class="h5"><br>
<br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
              <a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
  <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><br><br><br>-----<br>Thanks and regards<br><br> Virendra Bhati<br>+91-9172341457<br>Asterisk Engineer<br></div><br>
<div style="visibility: hidden; left: -5000px; position: absolute; z-index: 9999; padding: 0px; margin-left: 0px; margin-top: 0px; overflow: hidden; word-wrap: break-word; color: black; font-size: 10px; text-align: left; line-height: 130%;" id="avg_ls_inline_popup">
</div></div>