[Opalvoip-svn] SF.net SVN: opalvoip:[23009] opal/trunk/samples/openphone/main.cxx
Brought to you by:
csoutheren,
rjongbloed
From: <rjo...@us...> - 2009-06-29 04:26:13
|
Revision: 23009 http://opalvoip.svn.sourceforge.net/opalvoip/?rev=23009&view=rev Author: rjongbloed Date: 2009-06-29 04:26:13 +0000 (Mon, 29 Jun 2009) Log Message: ----------- Fixed OpenPhone ability to play a file to remote party while in a call, switches to IVR, plays WAV file, then switches back. Modified Paths: -------------- opal/trunk/samples/openphone/main.cxx Modified: opal/trunk/samples/openphone/main.cxx =================================================================== --- opal/trunk/samples/openphone/main.cxx 2009-06-29 04:24:23 UTC (rev 23008) +++ opal/trunk/samples/openphone/main.cxx 2009-06-29 04:26:13 UTC (rev 23009) @@ -1961,15 +1961,14 @@ if (from.empty()) from = "pc:*"; - PString token; - if (SetUpCall(from, address, token, NULL, 0, options)) { + m_activeCall = SetUpCall(from, address, NULL, 0, options); + if (m_activeCall != NULL) { LogWindow << "Calling \"" << address << '"' << endl; - m_activeCall = FindCallWithLock(token, PSafeReference); - SetState(CallingState, token); + SetState(CallingState, m_activeCall->GetToken()); } else { LogWindow << "Could not call \"" << address << '"' << endl; - SetState(IdleState, token); + SetState(IdleState, PString::Empty()); } } @@ -2009,6 +2008,11 @@ void MyManager::OnRinging(const OpalPCSSConnection & connection) { + if (connection.GetStringOptions().Contains("Auto-Answer")) { + pcssEP->AcceptIncomingConnection(connection.GetToken()); + return; + } + m_incomingToken = connection.GetCall().GetToken(); PString alertingType; @@ -2438,11 +2442,13 @@ wxFD_OPEN|wxFD_FILE_MUST_EXIST); if (dlg.ShowModal() == wxID_OK && m_activeCall != NULL) { m_lastPlayFile = dlg.GetPath(); + LogWindow << "Playing " << m_lastPlayFile << ", please wait ..." << endl; + PStringStream ivrXML; ivrXML << "ivr:<?xml version=\"1.0\"?>" "<vxml version=\"1.0\">" "<form id=\"PlayFile\">" - "<transfer bridge=\"false\" dest=\"" << connection->GetLocalPartyURL() << "\">" + "<transfer bridge=\"false\" dest=\"pc:*;Auto-Answer=1\">" "<audio src=\"" << PURL(PFilePath(m_lastPlayFile)) << "\"/>" "</transfer>" "</form>" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |