Author: sayer
Date: 2008-05-15 19:25:57 +0200 (Thu, 15 May 2008)
New Revision: 969

Modified:
   trunk/apps/voicemail/AnswerMachine.cpp
   trunk/apps/voicemail/AnswerMachine.h
   trunk/doc/Readme.voicemail
Log:
announcement only mode in voicemail application

Modified: trunk/apps/voicemail/AnswerMachine.cpp
===================================================================
--- trunk/apps/voicemail/AnswerMachine.cpp      2008-05-15 16:13:59 UTC (rev 
968)
+++ trunk/apps/voicemail/AnswerMachine.cpp      2008-05-15 17:25:57 UTC (rev 
969)
@@ -507,6 +507,8 @@
       vm_mode = MODE_BOX;
     else if (mode == "both")
       vm_mode = MODE_BOTH;
+    else if (mode == "ann")
+      vm_mode = MODE_ANN;
   }
 
   if (((vm_mode == MODE_BOTH) || (vm_mode == MODE_VOICEMAIL)) &&
@@ -616,7 +618,7 @@
     throw AmSession::Exception(500,"voicemail: no greeting file found");
 
   // VBOX mode does not need email template
-  if (vm_mode == MODE_BOX) 
+  if ((vm_mode == MODE_BOX) || (vm_mode == MODE_ANN))
     return new AnswerMachineDialog(user, sender, domain,
                                   email, announce_file, greeting_fp,
                                   vm_mode, NULL);
@@ -685,6 +687,7 @@
                                 "message storage reference");
     }
   }
+
 }
 
 AnswerMachineDialog::~AnswerMachineDialog()
@@ -703,7 +706,14 @@
 
       switch(status){
 
-      case 0:
+      case 0: {
+       // announcement mode - no recording
+       if (MODE_ANN == vm_mode) {
+         dlg.bye();
+         setStopped();
+         return;
+       }
+
        playlist.addToPlaylist(new AmPlaylistItem(NULL,&a_msg));
                
        {AmArg di_args,ret;
@@ -713,7 +723,7 @@
 
        user_timer->invoke("setTimer",di_args,ret);}
        status = 1;
-       break;
+      } break;
 
       case 1:
        a_beep.rewind();
@@ -758,6 +768,10 @@
   // disable DTMF detection - don't use DTMF here
   setDtmfDetectionEnabled(false);
 
+  // announcement mode - no receiving needed
+  if (MODE_ANN == vm_mode)
+    setReceiving(false);
+
 #ifdef USE_MYSQL
   string beep_file;
   if (!get_audio_file(BEEP_SOUND, "", "", "", &beep_file) ||
@@ -796,14 +810,17 @@
   msg_filename = "/tmp/" + getLocalTag() + "."
     + AnswerMachineFactory::RecFileExt;
     
-  if(a_msg.open(msg_filename,AmAudioFile::Write,true))
-    throw string("AnswerMachine: couldn't open ") + 
-      msg_filename + string(" for writing");
+  if (vm_mode != MODE_ANN) {
+    if(a_msg.open(msg_filename,AmAudioFile::Write,true))
+      throw string("AnswerMachine: couldn't open ") + 
+       msg_filename + string(" for writing");
+  }
 
   //a_msg.setRecordTime(AnswerMachineFactory::MaxRecordTime*1000);
     
   playlist.addToPlaylist(new AmPlaylistItem(&a_greeting,NULL));
-  playlist.addToPlaylist(new AmPlaylistItem(&a_beep,NULL));
+  if (vm_mode != MODE_ANN) 
+    playlist.addToPlaylist(new AmPlaylistItem(&a_beep,NULL));
   //playlist.addToPlaylist(new AmPlaylistItem(NULL,&a_msg));
 
   setInOut(&playlist,&playlist);

Modified: trunk/apps/voicemail/AnswerMachine.h
===================================================================
--- trunk/apps/voicemail/AnswerMachine.h        2008-05-15 16:13:59 UTC (rev 
968)
+++ trunk/apps/voicemail/AnswerMachine.h        2008-05-15 17:25:57 UTC (rev 
969)
@@ -53,6 +53,7 @@
 #define MODE_VOICEMAIL 0
 #define MODE_BOX       1
 #define MODE_BOTH      2
+#define MODE_ANN       3
 
 #define MSG_SEPARATOR "+" // separates values in message name
 

Modified: trunk/doc/Readme.voicemail
===================================================================
--- trunk/doc/Readme.voicemail  2008-05-15 16:13:59 UTC (rev 968)
+++ trunk/doc/Readme.voicemail  2008-05-15 17:25:57 UTC (rev 969)
@@ -1,13 +1,18 @@
 voicemail (voicemail2email) application 
 
-This application plays a greeting message to the caller, records a 
-voicemail and sends it out as email via SMTP.
+This application plays a greeting message to the caller and records a 
+voicemail. The voicemail is sent out as email via SMTP, saved in voicebox,
+or both. 
 
+In announcement mode, only the greeting message is played.
+
 Audio Files
 -----------
 
-The voicemail application looks in various file system paths or database
-tables for announce and beep messages to be played.
+If try_personal_greeting=yes is set, the voicemail application tries to find 
+a personal greeting message from msg_storage. Then the voicemail application
+looks in various file system paths or database tables for announce and beep 
+messages to be played. 
 
 If file system is used to store audio files, the announcement file to be
 played is looked for in the following order:
@@ -82,6 +87,7 @@
                                   voicemail  : send email (default)
                                   box        : leave in voicebox (store in 
msg_storage)
                                   both       : send email and leave in voicebox
+                                  ann        : just play greeting, don't 
record message.
   Sender          snd         - sender. If empty, From will be used
   Domain          dom         - domain specific announcement files/email 
template. 
                                 defaults to RURI domain.

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to