Part II: Developing Outbound Applications: Generate VXML File And Send it to the Gateway | Gateway Tutorial
Since the call message includes dynamic information, we cannot pre-install the vxml file to the gateway as we did in the first version of the sample.
1. Generate The VXML FileIn callnowDlg.cpp
, the method GenerateVxml()
generates the VXML file based on the message in the dialog. The result vxml is like the following:
<?xml version="1.0"?> <vxml version="1.0"> <form id="td"> <block> <audio src="callnow/hello.wav"/> ... message in the dialog box ... </block> </form> </vxml>2. Send The VXML File to the Gateway
The following code creates a directory under the gateway call scheduler directory and sends the newly created vxml file over.
CString targetdir = "\\outcall\\webapps\\" + GetClientName() + "\\"; VgateClient::CreateDir(targetdir); if (! VgateClient::SendFile("callnow.vxml", targetdir + "\\callnow.vxml", false)) { AfxMessageBox(VgateClient::GetLastError()); return; }