announcement only mode in voicemail application

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@969 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Stefan Sayer 18 years ago
parent 1a60a09a83
commit 2a96cd7982

@ -507,6 +507,8 @@ AmSession* AnswerMachineFactory::onInvite(const AmSipRequest& req)
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 @@ AmSession* AnswerMachineFactory::onInvite(const AmSipRequest& req)
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 @@ AnswerMachineDialog::AnswerMachineDialog(const string& user,
"message storage reference");
}
}
}
AnswerMachineDialog::~AnswerMachineDialog()
@ -703,7 +706,14 @@ void AnswerMachineDialog::process(AmEvent* event)
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 @@ void AnswerMachineDialog::process(AmEvent* event)
user_timer->invoke("setTimer",di_args,ret);}
status = 1;
break;
} break;
case 1:
a_beep.rewind();
@ -758,6 +768,10 @@ void AnswerMachineDialog::onSessionStart(const AmSipRequest& req)
// 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 @@ void AnswerMachineDialog::onSessionStart(const AmSipRequest& req)
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);

@ -53,6 +53,7 @@ class AmMail;
#define MODE_VOICEMAIL 0
#define MODE_BOX 1
#define MODE_BOTH 2
#define MODE_ANN 3
#define MSG_SEPARATOR "+" // separates values in message name

@ -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 @@ avoid packet fragmentation (UDP).
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.

Loading…
Cancel
Save