[asterisk-users] Voicemail file

Danny Nicholas danny at debsinc.com
Fri Oct 30 10:51:19 CDT 2009


This thread taught me my "Asterisk Lesson of the day" - to find the
Variables passed to the dialplan from a program, go to the source directory
and do 'grep setvar_helper app'.  Here's the output for app_voicemail.c in
1.4.26.2
grep setvar_helper app_voicemail.c
        pbx_builtin_setvar_helper(ast, "VM_NAME", vmu->fullname);
        pbx_builtin_setvar_helper(ast, "VM_DUR", dur);
        pbx_builtin_setvar_helper(ast, "VM_MSGNUM", passdata);
        pbx_builtin_setvar_helper(ast, "VM_CONTEXT", context);
        pbx_builtin_setvar_helper(ast, "VM_MAILBOX", mailbox);
        pbx_builtin_setvar_helper(ast, "VM_CALLERID",
(!ast_strlen_zero(cidname) || !ast_strlen_zero(cidnum)) ?
        pbx_builtin_setvar_helper(ast, "VM_CIDNAME",
(!ast_strlen_zero(cidname) ? cidname : "an unknown caller"));
        pbx_builtin_setvar_helper(ast, "VM_CIDNUM",
(!ast_strlen_zero(cidnum) ? cidnum : "an unknown caller"));
        pbx_builtin_setvar_helper(ast, "VM_DATE", date);
        pbx_builtin_setvar_helper(ast, "VM_CATEGORY", category ?
ast_strdupa(category) : "no category");
                pbx_builtin_setvar_helper(ast, "ORIG_VM_CALLERID",
origcallerid);
                pbx_builtin_setvar_helper(ast, "ORIG_VM_CIDNAME",
origcidname);
                pbx_builtin_setvar_helper(ast, "ORIG_VM_CIDNUM",
origcidnum);
                pbx_builtin_setvar_helper(ast, "ORIG_VM_DATE", origdate);
                pbx_builtin_setvar_helper(chan, "VMSTATUS", "FAILED");
                        pbx_builtin_setvar_helper(chan, "VMSTATUS",
"FAILED");
                pbx_builtin_setvar_helper(chan, "VMSTATUS", "USEREXIT");
                        pbx_builtin_setvar_helper(chan, "VMSTATUS",
"USEREXIT");
                pbx_builtin_setvar_helper(chan, "VMSTATUS", "FAILED");
                pbx_builtin_setvar_helper(chan, "VM_MESSAGEFILE",
"IMAP_STORAGE");
                        pbx_builtin_setvar_helper(chan, "VMSTATUS",
"FAILED");
                        pbx_builtin_setvar_helper(chan, "VMSTATUS",
"FAILED");
                        pbx_builtin_setvar_helper(chan, "VMSTATUS",
"FAILED");
                                        pbx_builtin_setvar_helper(chan,
"VM_MESSAGEFILE", fn);
                                        pbx_builtin_setvar_helper(chan,
"VM_MESSAGEFILE", "IMAP_STORAGE");
                        pbx_builtin_setvar_helper(chan, "VMSTATUS",
"FAILED");
                        pbx_builtin_setvar_helper(chan, "VMSTATUS",
"SUCCESS");
        pbx_builtin_setvar_helper(chan, "DIFF_DAY", temp);
        pbx_builtin_setvar_helper(chan, "DIFF_DAY", NULL);
                pbx_builtin_setvar_helper(chan, "VMSTATUS", "FAILED");
                pbx_builtin_setvar_helper(chan, "VMBOXEXISTSSTATUS",
"SUCCESS");
                pbx_builtin_setvar_helper(chan, "VMBOXEXISTSSTATUS",
"FAILED");
                pbx_builtin_setvar_helper(chan, "AUTH_MAILBOX", mailbox);
                pbx_builtin_setvar_helper(chan, "AUTH_CONTEXT",
vmus.context);

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Ishfaq Malik
Sent: Friday, October 30, 2009 10:38 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Voicemail file

You could use the AMI to find out how many messages are in the voicemail 
mailbox and then work out the file name from that...

Anahi Ludueña wrote:
> Yes, but is there a way to know the filename of that message?
> For example: msg0029.wav?
> I know where it is saved, but if I want to return it, I need to find 
> the last one... and it is not recommended in my opinion...
> Thanks,
>
> *
> ------------------------------------------------------------------------
> *
>
> *Anahi Ludueña*
>
>  
>
>
>
>
>
> ------------------------------------------------------------------------
> From: danny at debsinc.com
> To: asterisk-users at lists.digium.com
> Date: Fri, 30 Oct 2009 10:14:27 -0500
> Subject: Re: [asterisk-users] Voicemail file
>
> Assuming you aren’t writing your VM’s to a database, the voicemail 
> will be in 
> /var/spool/asterisk/voicemail/default/<extension>/INBOX/msg<####>.WAV 
> (wav, gsm, txt – depends on voicemail.conf).
>
>  
>
> ------------------------------------------------------------------------
>
> *From:* asterisk-users-bounces at lists.digium.com 
> [mailto:asterisk-users-bounces at lists.digium.com] *On Behalf Of *Anahi 
> Ludueña
> *Sent:* Friday, October 30, 2009 10:06 AM
> *To:* asterisk-users at lists.digium.com
> *Subject:* [asterisk-users] Voicemail file
>
>  
>
> Hi all,
> When somebody leaves a message in the voicemailbox, is there a way to 
> know the file name of it?
> I need to return the voicemail file name in the deadagi command.
> Thanks,
>
> Anahi
>
> ------------------------------------------------------------------------
>
> Entra al Nuevo Canal Motor y descubre por qué los coches más rápidos 
> sólo aparcan en MSN. Nuevo diseño, más completo y abierto a tu 
> opinión. ¡Nuevo Canal Motor! <http://motor.es.msn.com/>
>
>
> ------------------------------------------------------------------------
> Todo el espacio y cuidado que merecen tus fotos digitales lo tienes en 
> Windows Live Fotos. ¡Pruébalo! <http://www.vivelive.com/compartirfotos/>
> ------------------------------------------------------------------------
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
Ishfaq Malik
Software Developer
PackNet Ltd

Office:   0161 660 3062

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users




More information about the asterisk-users mailing list