Hi, Im looking at using MixMonitor to record calls and I know that I need to set the filename first. However, with the number of calls coming in, hard coding the filename isnt an option. So I need to do something like this:- MixMonitor(RANDOMNUMBER.wav) But can't find a way to generate a random number. I thought that maybe I could use a unique variable that already exists for the current call, but I'm not sure which one to pick. Can anyone give me some advice on this? Thanks Dan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100914/d5483b40/attachment.htm
Dan Journo wrote:> Hi, > > > > Im looking at using MixMonitor to record calls and I know that I need to > set the filename first. > > > > However, with the number of calls coming in, hard coding the filename > isnt an option. > > > > So I need to do something like this:- > > > > MixMonitor(RANDOMNUMBER.wav) > > > > But can't find a way to generate a random number. > > > > I thought that maybe I could use a unique variable that already exists > for the current call, but I'm not sure which one to pick. > > > > Can anyone give me some advice on this? > > > > Thanks > > Dan >${UNIQUEID} is going to be realtivly unique certnely in the short term unless the sysyem is restarted. I mormally combine it with the date & time to make it truly unique.
I use ${UNIQUEID} with ${CDR(accountcode)} and it works great. But this is when you have an accountcode for each user. As the last poster suggest, you can append it with date and time and it'll be truly unique and also help you keep track of the recording. Zeeshan A Zakaria -- www.ilovetovoip.com On 2010-09-14 9:54 AM, "Dan Journo" <dan at keshercommunications.com> wrote: Hi, Im looking at using MixMonitor to record calls and I know that I need to set the filename first. However, with the number of calls coming in, hard coding the filename isnt an option. So I need to do something like this:- MixMonitor(RANDOMNUMBER.wav) But can't find a way to generate a random number. I thought that maybe I could use a unique variable that already exists for the current call, but I'm not sure which one to pick. Can anyone give me some advice on this? Thanks Dan -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100914/cfd0edcc/attachment.htm
On Tue, 14 Sep 2010, Gareth Blades wrote:> ${UNIQUEID} is going to be realtivly unique certnely in the short term > unless the sysyem is restarted. I mormally combine it with the date & > time to make it truly unique.UNIQUEID is the concatenation of AST_SYSTEM_NAME, the number of seconds since EPOCH and the number of channels created by this instance of Asterisk since it was started. (Check channel.c.) How is this not unique? Since UNIQUEID is already based on time, how does adding the date and time make it truly unique? -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000
On Tue, 14 Sep 2010, Dan Journo wrote:> Im looking at using MixMonitor to record calls and I know that I need to > set the filename first. > > However, with the number of calls coming in, hard coding the filename > isnt an option. > > So I need to do something like this:- > > MixMonitor(RANDOMNUMBER.wav) > > But can't find a way to generate a random number. > > I thought that maybe I could use a unique variable that already exists > for the current call, but I'm not sure which one to pick.Using a random number would not be the correct approach. Random does not mean unique. You will have collisions at some point in time. The UNIQUEID channel variable is what you want, but wouldn't it be useful to include something meaningful in the file name like the DNIS and the ANI? How about: mixmonitor(${ANI}-${EXTEN}-${UNIQUEID}.wav) Personally, I prefer "human readable" numbers so I would probably extract the channel count from UNIQUEID and use something like: mixmonitor(${ANI}-${EXTEN}-${STRFTIME(${EPOCH},,%Y-%m-%d-%H-%M-%S)}-${X}.wav) -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000
> ${UNIQUEID} is going to be realtivly unique certnely in the short termI dont understand something. When I do ${UNIQUEID}, I get something like this:- "SIP/215.166.5.140-00000bbf" Is this correct? Its not a valid file name. Thanks Dan
Actually, ignore my last email. Forgot to reload.
Can you post what are you doing to see UNIQUEID? And also what version of Asterisk you are using? Zeeshan A Zakaria -- www.ilovetovoip.com On 2010-09-14 12:11 PM, "Dan Journo" <dan at keshercommunications.com> wrote:> ${UNIQUEID} is going to be realtivly unique certnely in the short termI dont understand something. When I do ${UNIQUEID}, I get something like this:- "SIP/215.166.5.140-00000bbf" Is this correct? Its not a valid file name. Thanks Dan -- _____________________________________________________________________ -- Bandwidth and Colocati... -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100914/3665c53d/attachment.htm
>From: asterisk-users-bounces at lists.digium.com[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Zeeshan Zakaria>Sent: Tuesday, September 14, 2010 11:15 AM >To: Asterisk Users Mailing List - Non-Commercial Discussion >Subject: Re: [asterisk-users] Random File Name>Can you post what are you doing to see UNIQUEID? And also what version ofAsterisk you are using?>Zeeshan A Zakaria-- www.ilovetovoip.com>>On 2010-09-14 12:11 PM, "Dan Journo" <dan at keshercommunications.com> wrote:>>> ${UNIQUEID} is going to be realtivly unique certnely in the short term>>I dont understand something. When I do ${UNIQUEID}, I get something likethis:->>"SIP/215.166.5.140-00000bbf">>Is this correct? Its not a valid file name.>>Thanks >>DanMy guess is that "Dan" is doing something like this Exten => 1234,1,Verbose(ID is ${EXTEN}) "SIP/215." is an ${EXTEN} value Should be doing something like Exten => 1234,1,Verbose(ID is ${UNIQUEID}) This should return something like 120003949488.0003 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100914/9fd4938c/attachment.htm
Or 1234 => { Verbose (ID is ${UNIQUEID}); }; :) Zeeshan A Zakaria -- www.ilovetovoip.com On 2010-09-14 12:27 PM, "Danny Nicholas" <danny at debsinc.com> wrote: *>From:* asterisk-users-bounces at lists.digium.com [mailto: asterisk-users-bounces at lists.digium.com] *On Behalf Of *Zeeshan Zakaria>*Sent:* Tuesday, September 14, 2010 11:15 AM >*To:* Asterisk Users Mailing List - Non-Commercial Discussion >*Subject:* Re: [asterisk-users] Random File Name>Can you post what are you doing to see UNIQUEID? And also what version ofAsterisk you are usi...> > >>On 2010-09-14 12:11 PM, "Dan Journo" <dan at keshercommunications.com>wrote:> > >>> ${UNIQUEID...My guess is that ?Dan? is doing something like this Exten => 1234,1,Verbose(ID is ${EXTEN}) ?SIP/215?? is an ${EXTEN} value Should be doing something like Exten => 1234,1,Verbose(ID is ${UNIQUEID}) This should return something like 120003949488.0003 -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100914/cc2ac287/attachment.htm