@ -209,8 +209,9 @@ static int testclient_exec(struct ast_channel *chan, void *data)
else
else
res = - 1 ;
res = - 1 ;
}
}
if ( ! res )
if ( ! res ) {
res = ast_safe_sleep ( chan , 1000 ) ;
res = ast_safe_sleep ( chan , 1000 ) ;
}
if ( ! res ) {
if ( ! res ) {
/* Step 2: Send "2" */
/* Step 2: Send "2" */
ast_debug ( 1 , " TestClient: 2. Send DTMF 2 \n " ) ;
ast_debug ( 1 , " TestClient: 2. Send DTMF 2 \n " ) ;
@ -272,7 +273,7 @@ static int testclient_exec(struct ast_channel *chan, void *data)
}
}
if ( ! res ) {
if ( ! res ) {
/* Step 9: Measure noise */
/* Step 9: Measure noise */
ast_debug ( 1 , " TestClient: 6 . Measure tone\n " ) ;
ast_debug ( 1 , " TestClient: 9 . Measure tone\n " ) ;
res = measurenoise ( chan , 4000 , " TestClient " ) ;
res = measurenoise ( chan , 4000 , " TestClient " ) ;
fprintf ( f , " MEASURETONE: %s (%d) \n " , ( res < 0 ) ? " FAIL " : " PASS " , res ) ;
fprintf ( f , " MEASURETONE: %s (%d) \n " , ( res < 0 ) ? " FAIL " : " PASS " , res ) ;
if ( res > 0 )
if ( res > 0 )
@ -280,7 +281,7 @@ static int testclient_exec(struct ast_channel *chan, void *data)
}
}
if ( ! res ) {
if ( ! res ) {
/* Step 10: Send "7" */
/* Step 10: Send "7" */
ast_debug ( 1 , " TestClient: 7 . Send DTMF 7\n " ) ;
ast_debug ( 1 , " TestClient: 10 . Send DTMF 7\n " ) ;
res = ast_dtmf_stream ( chan , NULL , " 7 " , 0 , 0 ) ;
res = ast_dtmf_stream ( chan , NULL , " 7 " , 0 , 0 ) ;
fprintf ( f , " SEND DTMF 7: %s \n " , ( res < 0 ) ? " FAIL " : " PASS " ) ;
fprintf ( f , " SEND DTMF 7: %s \n " , ( res < 0 ) ? " FAIL " : " PASS " ) ;
if ( res > 0 )
if ( res > 0 )
@ -296,6 +297,9 @@ static int testclient_exec(struct ast_channel *chan, void *data)
else
else
res = - 1 ;
res = - 1 ;
}
}
if ( ! res ) {
res = ast_safe_sleep ( chan , 1000 ) ;
}
if ( ! res ) {
if ( ! res ) {
/* Step 12: Hangup! */
/* Step 12: Hangup! */
ast_debug ( 1 , " TestClient: 12. Hangup \n " ) ;
ast_debug ( 1 , " TestClient: 12. Hangup \n " ) ;
@ -391,7 +395,6 @@ static int testserver_exec(struct ast_channel *chan, void *data)
if ( res > 0 )
if ( res > 0 )
res = 0 ;
res = 0 ;
}
}
if ( ! res ) {
if ( ! res ) {
/* Step 5: Wait one second */
/* Step 5: Wait one second */
ast_debug ( 1 , " TestServer: 5. Wait one second \n " ) ;
ast_debug ( 1 , " TestServer: 5. Wait one second \n " ) ;
@ -400,7 +403,6 @@ static int testserver_exec(struct ast_channel *chan, void *data)
if ( res > 0 )
if ( res > 0 )
res = 0 ;
res = 0 ;
}
}
if ( ! res ) {
if ( ! res ) {
/* Step 6: Measure noise */
/* Step 6: Measure noise */
ast_debug ( 1 , " TestServer: 6. Measure tone \n " ) ;
ast_debug ( 1 , " TestServer: 6. Measure tone \n " ) ;
@ -409,7 +411,6 @@ static int testserver_exec(struct ast_channel *chan, void *data)
if ( res > 0 )
if ( res > 0 )
res = 0 ;
res = 0 ;
}
}
if ( ! res ) {
if ( ! res ) {
/* Step 7: Send "5" */
/* Step 7: Send "5" */
ast_debug ( 1 , " TestServer: 7. Send DTMF 5 \n " ) ;
ast_debug ( 1 , " TestServer: 7. Send DTMF 5 \n " ) ;
@ -418,7 +419,6 @@ static int testserver_exec(struct ast_channel *chan, void *data)
if ( res > 0 )
if ( res > 0 )
res = 0 ;
res = 0 ;
}
}
if ( ! res ) {
if ( ! res ) {
/* Step 8: Transmit tone noise */
/* Step 8: Transmit tone noise */
ast_debug ( 1 , " TestServer: 8. Transmit tone \n " ) ;
ast_debug ( 1 , " TestServer: 8. Transmit tone \n " ) ;
@ -437,8 +437,9 @@ static int testserver_exec(struct ast_channel *chan, void *data)
else
else
res = - 1 ;
res = - 1 ;
}
}
if ( ! res )
if ( ! res ) {
res = ast_safe_sleep ( chan , 1000 ) ;
res = ast_safe_sleep ( chan , 1000 ) ;
}
if ( ! res ) {
if ( ! res ) {
/* Step 10: Send "8" */
/* Step 10: Send "8" */
ast_debug ( 1 , " TestServer: 10. Send DTMF 8 \n " ) ;
ast_debug ( 1 , " TestServer: 10. Send DTMF 8 \n " ) ;