fixed prompts fallback

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

@ -242,8 +242,7 @@ AmSession* DSMFactory::onInvite(const AmSipRequest& req)
} else {
start_diag = req.cmd;
}
DSMDialog* s = new DSMDialog(prompts, diags, start_diag, NULL);
DSMDialog* s = new DSMDialog(&prompts, diags, start_diag, NULL);
prepareSession(s);
return s;
}
@ -270,7 +269,7 @@ AmSession* DSMFactory::onInvite(const AmSipRequest& req,
cred = dynamic_cast<UACAuthCred*>(cred_obj);
}
DSMDialog* s = new DSMDialog(prompts, diags, start_diag, cred);
DSMDialog* s = new DSMDialog(&prompts, diags, start_diag, cred);
prepareSession(s);
if (NULL == cred) {

@ -30,7 +30,7 @@
#include "AmMediaProcessor.h"
#include "DSM.h"
DSMDialog::DSMDialog(AmPromptCollection& prompts,
DSMDialog::DSMDialog(AmPromptCollection* prompts,
DSMStateDiagramCollection& diags,
const string& startDiagName,
UACAuthCred* credentials)
@ -47,7 +47,7 @@ DSMDialog::~DSMDialog()
audiofiles.begin();it!=audiofiles.end();it++)
delete *it;
used_prompt_sets.insert(&prompts);
used_prompt_sets.insert(prompts);
for (set<AmPromptCollection*>::iterator it=
used_prompt_sets.begin(); it != used_prompt_sets.end(); it++)
(*it)->cleanup((long)this);
@ -175,14 +175,15 @@ inline UACAuthCred* DSMDialog::getCredentials() {
void DSMDialog::playPrompt(const string& name, bool loop) {
DBG("playing prompt '%s'\n", name.c_str());
if (prompts.addToPlaylist(name, (long)this, playlist,
if (prompts->addToPlaylist(name, (long)this, playlist,
/*front =*/ false, loop)) {
if ((var["prompts.default_fallback"] != "yes") ||
default_prompts.addToPlaylist(name, (long)this, playlist,
default_prompts->addToPlaylist(name, (long)this, playlist,
/*front =*/ false, loop)) {
DBG("checked [%p]\n", default_prompts);
SET_ERRNO(DSM_ERRNO_UNKNOWN_ARG);
} else {
used_prompt_sets.insert(&default_prompts);
used_prompt_sets.insert(default_prompts);
SET_ERRNO(DSM_ERRNO_OK);
}
} else {
@ -270,8 +271,8 @@ void DSMDialog::setPromptSet(const string& name) {
}
DBG("setting prompt set '%s'\n", name.c_str());
used_prompt_sets.insert(&prompts);
prompts = *it->second;
used_prompt_sets.insert(prompts);
prompts = it->second;
SET_ERRNO(DSM_ERRNO_OK);
}

@ -44,8 +44,8 @@ class DSMDialog : public AmSession,
std::auto_ptr<UACAuthCred> cred;
DSMStateEngine engine;
AmPromptCollection& prompts;
AmPromptCollection& default_prompts;
AmPromptCollection* prompts;
AmPromptCollection* default_prompts;
DSMStateDiagramCollection& diags;
string startDiagName;
AmPlaylist playlist;
@ -57,7 +57,7 @@ class DSMDialog : public AmSession,
bool checkVar(const string& var_name, const string& var_val);
public:
DSMDialog(AmPromptCollection& prompts,
DSMDialog(AmPromptCollection* prompts,
DSMStateDiagramCollection& diags,
const string& startDiagName,
UACAuthCred* credentials = NULL);

Loading…
Cancel
Save