<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
On 04/16/2012 04:09 PM, Billy Kaye wrote:
<blockquote cite="mid:CBB26547.9F3D%25billy.kaye@crystal-int.com"
type="cite">
<title>Re: [asterisk-users] Custom Application recording problem</title>
<font size="4"><font face="Calibri, Verdana, Helvetica, Arial"><span
style="font-size: 11pt;">Thanks Dale,<br>
<br>
Am not sure why it was working in 1.4 but for some reason it
was ( Note : My Asterisk is running bundled with Elastix).<br>
But any your suggestion worked very fine.<br>
<br>
</span></font></font></blockquote>
<br>
Glad to hear it.<br>
<br>
<blockquote cite="mid:CBB26547.9F3D%25billy.kaye@crystal-int.com"
type="cite"><font size="4"><font face="Calibri, Verdana,
Helvetica, Arial"><span style="font-size: 11pt;">
Now am having one problem how can define those extensions
only with in different contexts, the problem I see is since
am <br>
Building 3 recording applications only one will be able call
its AGI file,<br>
<br>
Say if someone calls custom extension 1114<br>
They can record message <br>
-Press 1 to Replay Press 2 to Re-record or Press 3 to Save
the file<br>
<br>
Also if someone calls custom extension 1115<br>
-Press 1 to Replay Press 2 to Re-record or Press 3 to Save
the file<br>
<br>
Note Each save file selection calls a different AGI file <br>
<br>
E.g<br>
<br>
exten => 1,1,Goto,timo|3552|9<br>
exten => 2,1,Goto(3552,7) ; re-record message<br>
exten => 3,1,Goto(4,1)<br>
exten => 4,AGI(timorec.php)<br>
</span></font></font><br>
</blockquote>
<br>
There a few ways to do it. Probably the easiest to maintain in the
long run would be via the use of a macro.<br>
<br>
<font size="4"><font face="Calibri, Verdana, Helvetica, Arial"><span
style="font-size: 11pt;">[macro-timo]<br>
exten => s,1,Set(RecordingType=${ARG1})<br>
exten => s,n,Set(TIMEOUT(digit)=2) ; Set Digit
Timeout to 5 seconds<br>
exten => s,n,Set(TIMEOUT(response)=2) ; Set
Response Timeout to 10 seconds<br>
exten => s,n,Answer<br>
exten => s,n,NoOp(${CALLERID(num)})<br>
exten => s,n,Set(number=${CALLERID(num)})<br>
exten => s,n,NoOp(${number})<br>
exten => s,n(recordmsg),Background(recmsg1) ;"Please say
yo message after the beep and end with a hash" <br>
exten =>
s,n,Record(crystalrecords/${RecordingType}/${number}.gsm)<br>
exten =>
s,n(playmsg),Playback(crystalrecords/${RecordingType}/${number})<br>
exten => s,n(askuser),Background(ackrec) ;"Press 1 to
replay or 2 to re-record, 3 to save "<br>
exten => s,11,WaitExten(5)<br>
<br>
exten => 1,1,Goto(s,playmsg)<br>
exten => 2,1,Goto(s,recordmsg) ; re-record message<br>
exten => 3,1,Goto(4,1)<br>
exten => 4,AGI($RecordingType}.php)<br>
<br>
exten => i,1,Background(invalidentry)<br>
exten => i,n,Goto(s,askuser)<br>
<br>
exten => t,1,Playback(thankyoubye)<br>
exten => t,n,Return<br>
</span></font></font><br>
Here I have taken you original dialplan and created a macro out of
it. I made a few other changes such as using the 'n' priority and
labels to make the macro easier to maintain later.<br>
This macro takes an argument which would be the recording type. I
do not know what the three variations you need are, but that is not
really relevant. When the macro is called, it will save the
argument as a variable 'RecordingType' which is used elsewhere. It
saves the recording under a subdirectory of 'crystalrecords' that is
the same name as the recording type. When saving the message, it
also calls the AGI as RecordingType.php, so simply name the script
the same as the recording type.<br>
<br>
Then, in your dialplan you simply make calls to your macro with the
correct argument.<br>
<br>
[from-internal-custom]<br>
<br>
exten => 1114,1,Macro(timo,type1)<br>
exten => 1114,n,Hangup()<br>
<br>
exten => 1115,1,Macro(timo,type2)<br>
exten => 1115,n,Hangup()<br>
<br>
exten => 1116,1,Macro(timo,type3)<br>
exten => 1116,n,Hangup()<br>
<br>
<br>
<br>
Dale<br>
<br>
<pre class="moz-signature" cols="72">--
"The truth speaks for itself. I'm just the messenger."
Lyta Alexander - Babylon 5
</pre>
</body>
</html>