Voice service system programming based on TURBOWAY phone card

zhaozj2021-02-08  254

Voice service system programming based on TURBOWAY phone card

Author: Xu Jing Zhou

Download instance code (http://www.9cbs.net/cnshare/soft/2/2185.shtm)

Combining computer and telephone organic combining a unmanned telephone automatic service system, it has become more and more common in today's society. This user only needs to call the phone, according to the computer's automatic prompt, according to the corresponding operation key, can complete the purpose of what he needs. Do you want to implement these features? Let's tell you with an instance of this aspect I have ever used by VC (complaints and repair management system).

This system only needs to install a TurboWay TW8A phone card, you can complete all the features you see by the phone you have seen. The specific implementation steps are as follows:

1. Insert the TW8A phone card into the expansion slot, set the jet, so that the TW8A phone speech card occupies a 2kByte within the C800-EF00 memory extension address, the drive software will automatically find the correct memory address. (Note: In the use of EMM386 or other software, you should leave the corresponding memory address space, otherwise the phone card driver will not find the error message of the card. Therefore, you can add Device = C in the config.sys file: /Windows/emm386.exe noems x = d000-d0ff, the default value of the TW8A phone speech card factory is d000.)

2, under Windows 95, when running the program, copy TW8A.VXD and TW8A.DLL to the / System directory. Under Windows NT 4.0, you can copy tw 8a.sys to / System32 / Drivers, copy tw 8a.dll to / System32, then run the following procedure to register tw8a: regini tw8a .Ini

3. In the engineering file generated with VC, add and include the header file Tw8a.h, and then connect the input library TW8A.LIB to the project, which can use the voice interface provided by TW8A from the line to design your own needs. Phone voice service program.

Below you will make a brief description with some of my instances (see instance code):

1. When the user presses the 1 button, it will enter the corresponding complaint type. The computer will play the information of the corresponding complaint type and prompt the user corresponding to the button (1 to 3). After the user hangs up, the computer will make an automatic coal complaint. The computer will automatically pull the superior leadership number within 30 seconds after the coament.

E.g:

After the 1 button starts the complaint of leaking information and perform recording, after completing the recording and hang up.

After the 2-button starts complaints, the leakage information is started and recorded at the same time, and the recording can be ended according to any one button and hang up.

After the 3-button starts to complain the leakage information and record at the same time, you can end the recording and hang up by any button.

After the 4-button complaints, the computer will call the internal call directly.

Some code is achieved as follows:

... (previous code implementation is omitted)

/ ************** In the playback selection complaint prompt, the button *********** /

Else IF (InputChar [i] == Appeal)

{

Switch (DTMF)

{

CASE '1':

Case '2':

Case '3':

Case '4':

IF (InputChar [I] == LeaveWord) DTMF = '0';

FILENAMESTR = GetFileName (DTMF, I);

STRCPY (filename [i], filenamestr);

Fail = tw_startRecordfile (i, filename [i], 0, long_max);

IF (fail == - 1) {

MessageBox ("Initial Recording Failed!", "Error", MB_ok | MB_ICONSTOP);

STRCPY (filename [i], welcomfile;

Tw_StartPlayFile (I, FileName [i], 0, long_max);

Tw_StartPlayFile (3, filename [i], 0, long_max); // The playup module starts playing

CS [I] = WS_PLAY;

Inputchar [I] = start;

}

Else

CS [I] = WS_RECORD;

Break;

... (behind the rear code is omitted)

2. When the user presses the 2 button, it will enter the corresponding message type. At this time, the computer will prompt the various types of information and the corresponding type of user button (0 to 9).

E.g:

When the user presses any one of 0 to 9, the user can make a message and record the message information at the same time. After the message is completed, you can end the message by any button and transfer to the initial welcome playback file.

Some code is achieved as follows:

... (previous code implementation is omitted)

Else if (InputChar [i] == Appeal || Inputchar [i] == LeaveWord)

{

Switch (DTMF)

{

CASE '1':

Case '2':

Case '3':

Case '4':

... (this complaint part code is omitted)

Break;

DEFAULT:

IF (InputChar [I] == LeaveWord)

{

FILENAMESTR = GetFileName ('0', i);

STRCPY (filename [i], filenamestr);

Fail = tw_startRecordfile (i, filename [i], 0, long_max);

IF (fail == - 1) // Recording failed

{

MessageBox ("Initial Recording Failed!", "Error", MB_ICONQUESTION;

STRCPY (filename [i], welcomfile;

Tw_StartPlayFile (I, FileName [i], 0, long_max);

Tw_StartPlayFile (3, filename [i], 0, long_max); // The playup module starts playing

CS [I] = WS_PLAY;

Inputchar [I] = start;

}

Else

CS [I] = WS_RECORD;

}

Else

{

STRCPY (filename [i], welcomfile;

Inputchar [I] = start;

Tw_StartPlayFile (I, FileName [i], 0, long_max);

Tw_StartPlayFile (3, filename [i], 0, long_max); // The playup module starts playing

}

Break;

}

... (behind the rear code is omitted)

3. When the user presses the 3-key, it will enter the corresponding information query (such as water fees, electricity bills, fever), and the computer will prompt the button that corresponds to the information query. After the information play is complete, the system will automatically transfer to the initial welcome playback file.

E.g:

Press 1 to play water information.

Press 2 to play the electricity fee information.

Press the 3 button to play the feeding information.

Some code is achieved as follows:

... (previous code implementation is omitted)

ELSE IF (InputChar [i] == inquire) // Enter the query function

{

Switch (DTMF)

{

CASE '1':

STRCPY (filename [i], information; cs [i] = WS_PLAYINF;

Break;

Case '2':

STRCPY (filename [i], information;

CS [I] = WS_PLAYINF;

Break;

Case '3':

STRCPY (filename [i], information;

CS [I] = WS_PLAYINF;

Break;

DEFAULT:

STRCPY (filename [i], choiseinf);

Break;

}

Tw_StartPlayFile (I, FileName [i], 0, long_max);

Tw_StartPlayFile (3, FileName [i], 0, long_max); // Playing module

While (Tw_PlayFilerest (i)> 0 && tw_playfilerest (3)> 0);

}

... (behind the rear code is omitted)

4. When the user presses the 0 button, it will enter special features (leadership). This feature prompts to enter the information of the corresponding password. After the password is correct, you can query the user's message and complaint information and recordable information files (water fees, electricity, fever).

E.g:

When the password is 1999, the corresponding button (0 to 3) of the query message and the complaint type will be prompted. Press 0 to query message information, and query 1 to 3 complaint information from 1 to 3 key. (Press the * button to query the nearest message information, press the # button to check the recent complaint information.)

When the input password is 2000, the corresponding button of recording information file (water fee, electricity, fever) will be prompted, and the recording is completed after the recording is completed. Otherwise, when the password is not entered correctly or waits for 15 seconds, it is automatically hang up.

Some code is achieved as follows:

... (previous code implementation is omitted)

Else IF (InputChar [i] == particular) // Enter a special function input password

{

Passwordpointer = 0;

Password [PasswordPointer ] = DTMF;

Tw_startTimer (i, 30);

CS [I] = WS_WAITFORPASSWORD;

}

Case WS_WAITFORPASSWORD

... (back part of the code is omitted)

The specific code implementation of the above voice service system and other features (such as internal voice services, etc.), please refer to the source code and its documents after downloading the instance code.

Contact information:

Email: jingzhou_xu@163.com

Future Studio (Future Studio)

转载请注明原文地址:https://www.9cbs.com/read-2102.html

New Post(0)