From: Craig S. <cso...@us...> - 2006-04-30 14:34:50
|
Update of /cvsroot/openh323/opal/src/opal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28406/src/opal Modified Files: ivr.cxx Log Message: Backport of IVR updates from PluginBranch Index: ivr.cxx =================================================================== RCS file: /cvsroot/openh323/opal/src/opal/ivr.cxx,v retrieving revision 2.11 retrieving revision 2.12 diff -C2 -d -r2.11 -r2.12 *** ivr.cxx 13 May 2005 10:05:06 -0000 2.11 --- ivr.cxx 30 Apr 2006 14:34:42 -0000 2.12 *************** *** 25,28 **** --- 25,35 ---- * * $Log$ + * Revision 2.12 2006/04/30 14:34:42 csoutheren + * Backport of IVR updates from PluginBranch + * + * Revision 2.11.4.1 2006/04/30 13:49:35 csoutheren + * Add ability to set TextToSpeech driver + * Add useful defaults for VXML handling + * * Revision 2.11 2005/05/13 10:05:06 dsandras * Slightly modified code so that it compiles with pwlib HEAD. *************** *** 181,184 **** --- 188,195 ---- } + BOOL OpalIVREndPoint::StartVXML() + { + return FALSE; + } ///////////////////////////////////////////////////////////////////////////// *************** *** 197,201 **** #pragma warning(disable:4355) #endif ! vxmlSession(this) #ifdef _MSC_VER #pragma warning(pop) --- 208,212 ---- #pragma warning(disable:4355) #endif ! vxmlSession(this, PFactory<PTextToSpeech>::CreateInstance(ep.GetDefaultTextToSpeech())) #ifdef _MSC_VER #pragma warning(pop) *************** *** 226,230 **** OnConnected(); ! if (!vxmlSession.Load(vxmlToLoad)) { PTRACE(1, "IVR\tVXML session not loaded, aborting."); Release(EndedByLocalUser); --- 237,241 ---- OnConnected(); ! if (!StartVXML()) { PTRACE(1, "IVR\tVXML session not loaded, aborting."); Release(EndedByLocalUser); *************** *** 240,243 **** --- 251,276 ---- } + BOOL OpalIVRConnection::StartVXML() + { + if (vxmlToLoad.IsEmpty()) + vxmlToLoad = endpoint.GetDefaultVXML(); + + if (vxmlToLoad.IsEmpty()) + return endpoint.StartVXML(); + + if (vxmlToLoad.Find("<?xml") == 0) + return vxmlSession.LoadVXML(vxmlToLoad); + + else { + if (vxmlToLoad.Find("file:") == 0) + vxmlSession.PlayFile(vxmlToLoad.Mid(5), FALSE); + else + vxmlSession.PlayText(vxmlToLoad, PTextToSpeech::Default, FALSE); + + vxmlSession.SetFinishWhenEmpty(TRUE); + + return TRUE; + } + } BOOL OpalIVRConnection::SetAlerting(const PString & calleeName, BOOL) *************** *** 267,271 **** phase = ConnectedPhase; ! if (!vxmlSession.Load(vxmlToLoad)) { PTRACE(1, "IVR\tVXML session not loaded, aborting."); Release(EndedByLocalUser); --- 300,304 ---- phase = ConnectedPhase; ! if (!StartVXML()) { PTRACE(1, "IVR\tVXML session not loaded, aborting."); Release(EndedByLocalUser); |