1、Disconnect Supervision When the caller hangs up, Dialogic card does not detect the disconnection. Why? Most of the PBXs and switches today do not use loop current drop to notify the other party of the disconnection. Instead, They use "disconnect tone", which is usually the same as busy t
2、one. Disconnect tone will be sent to the called party as soon as the calling party hangs up. For local calls, however, the disconnect tone is usually sent to the calling party 30 seconds after the called party hangs up. Dialogic cards, by default, is enabled to detect loop current drop. H
3、owever, disconnect tone supervision is not enabled. How to implement Disconnect Tone Supervision? There are two ways of implementation: Advanced Tone Feature (driver approach) Global Tone Detection (application approach) 1. Advanced Tone Feature This feature is curren
4、tly available on DOS, Windows 95 and Windows NT (Streams version SDK only). This method makes use of Tone Set File created by PBXpert or PBXpert/32. By simply using appropriate TSF file, you can make your system to work on any analog switches or PBXs. To enable this feature, do the following:
5、 For Windows NT: Click Start/Programs/Dialogic System Software/Advanced Tone Features program item. Then tick Disconnect Tone Supervision and Tone Set File Enabled buttons on the Advanced Tone Features window. Lastly, specify the TSF file to be used. For Windows 95: Similar to that of
6、Windows NT. The path is Start/Programs/Dialogic Development Package/Configuration Manager. Then click Advanced button on the Dialogic Configuration Manager window. For DOS: After Dialogic voice driver is loaded, run TONEDNLD.EXE program to overwrite the default tone definitions contained i
7、n the
driver with those contained in the TSF file.
genload
d40drv -h
8、When the disconnect tone is detected, an LCOFF event will be generated, as if it is a loop current drop event. The example in asynchronous callback model below shows how to terminate dx_play() function upon detection of disconnect tone. void start_playback (int index) { DV_TPT tpt[1] =
9、{0}; dx_clrtpt(tpt,1); tpt[0].tp_type = IO_EOT; tpt[0].tp_termno = DX_LCOFF; tpt[0].tp_length = 1; tpt[0].tp_flags = TF_LCOFF; : if (dx_play(Channel[index].voxhdl, &Channel[index].iott, tpt, EV_ASYNC) == -1) { : } int play_handler (void)
10、{ : device = sr_getevtdev(0); cause = ATDX_TERMMSK(device); if (cause & TM_LCOFF){ printf("Play terminated due to Loop Current Drop\n"); disconnect(device); : } Make sure you do not enable DM_LCOFF with dx_setevtmsk(), otherwise TDX_CS
11、T event will be generated and captured by CST handler. 2. Global Tone Detection This approach can be used in all platforms. You need to add codes into your application to detect the specified disconnect tone(s). To make your application more portable across PBXs, I suggest that you
12、 make your application read a parameter file
in which the disconnect tone definitions is defined. The example below shows you how to do it:
#define POTS_DISCTONE 201
void main(int argc, char *argv[]) {
:
for(n=0; n 13、) == -1)
process_error(Channel[n].voxhdl, "dx_deltones");
// Singapore disconnect tone 425 Hz, 750 ms on, 750 ms off
if (dx_bldstcad(POTS_DISCTONE,425,30,75,6,75,6,2) == -1)
process_error(Channel[n].voxhdl, "dx_bldstcad");
for(n=0; n 14、
if (dx_addtone(Channel[n].voxhdl,NULL,0) == -1)
process_error(Channel[n].voxhdl,"dx_addtone");
:
}
You can disconnect the line either with TPT or CST handler.
2.1 Use TPT to terminate playback or recording then disconnect the line.
void start_playback 15、int index) {
DV_TPT tpt[1] = {0};
dx_clrtpt(tpt,1);
tpt[0].tp_type = IO_EOT;
tpt[0].tp_termno = DX_TONE;
tpt[0].tp_length = POTS_DISCTONE;
tpt[0].tp_flags = TF_TONE;
tpt[0].tp_data = DX_TONEON;
:
if (dx_play(Channel[index].voxhdl, &Chan 16、nel[index].iott, tpt, EV_ASYNC) == -1) {
:
}
int play_handler (void) {
:
device = sr_getevtdev(0);
cause = ATDX_TERMMSK(device);
if (cause & TM_TONE){
printf("Play terminated due to Loop Current Drop\n");
disconnect(device);
:
17、
}
2.2 Use CST handler to disconnect the line.
int cst_hndlr(void) {
DX_CST *cstp;
device = sr_getevtdev(0);
cstp = sr_getevtdatap(0);
switch (cstp->cst_event){
case DE_TONEON:
if (cstp->cst_data == POTS_DISCTONE) {
v 18、oxstate = ATDX_STATE(device);
if ((voxstate==CS_PLAY)||(voxstate==CS_RECD)) {
/* if in record or play, stop activity on voice channel*/
if (dx_stopch(device, EV_ASYNC)==-1)
printf("ERROR: dx_stopch() failed\n 19、");
}
disconnect(device);
:
}
Attachments:
Demo program
Home | What's New | Search | FAQs | Feedback
Product Installation | Sample Code | Technical Notes | Tech 20、nical Tips | Release Notes | Application Notes
Problem Tracking Reports | Download Page | Discussion Web | Software Releases | Online Resources
© 1997 by Dialogic
Corporation
Dialogic World Headquarters
1515 Route 10
Parsippany, NJ 07054 USA
Technical Support Email: custeng@
Technical Support Hotline: 973-993-1443
Technical Support Fax: 973-993-8387
©2010-2025 宁波自信网络信息技术有限公司 版权所有
客服电话:4009-655-100 投诉/维权电话:18658249818