pri loop TestClient/TestServer fails: server SEND DTMF 8

app_test was failing when sending the last DTMF digit, 8, because of the 100ms pause issued after DTMF is sent.  During this pause the other side would hang up causing the test to look like it failed. Now the other side waits a second before hanging up.

(closes issue #12442)
Reported by: tzafrir



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@184388 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
David Vossel
2009-03-26 21:07:32 +00:00
parent a81abfbd02
commit d64575ac5c

View File

@@ -164,10 +164,8 @@ static int testclient_exec(struct ast_channel *chan, void *data)
res = 0;
if (option_debug)
ast_log(LOG_DEBUG, "server version: %s\n", serverver);
if (res > 0)
res = 0;
if (!res)
res = ast_safe_sleep(chan, 1000);
/* Send test id */
@@ -201,8 +199,9 @@ static int testclient_exec(struct ast_channel *chan, void *data)
else
res = -1;
}
if (!res)
if (!res) {
res = ast_safe_sleep(chan, 1000);
}
if (!res) {
/* Step 2: Send "2" */
if (option_debug)
@@ -272,7 +271,7 @@ static int testclient_exec(struct ast_channel *chan, void *data)
if (!res) {
/* Step 9: Measure noise */
if (option_debug)
ast_log(LOG_DEBUG, "TestClient: 6. Measure tone\n");
ast_log(LOG_DEBUG, "TestClient: 9. Measure tone\n");
res = measurenoise(chan, 4000, "TestClient");
fprintf(f, "MEASURETONE: %s (%d)\n", (res < 0) ? "FAIL" : "PASS", res);
if (res > 0)
@@ -281,7 +280,7 @@ static int testclient_exec(struct ast_channel *chan, void *data)
if (!res) {
/* Step 10: Send "7" */
if (option_debug)
ast_log(LOG_DEBUG, "TestClient: 7. Send DTMF 7\n");
ast_log(LOG_DEBUG, "TestClient: 10. Send DTMF 7\n");
res = ast_dtmf_stream(chan, NULL, "7", 0);
fprintf(f, "SEND DTMF 7: %s\n", (res < 0) ? "FAIL" : "PASS");
if (res > 0)
@@ -298,6 +297,9 @@ static int testclient_exec(struct ast_channel *chan, void *data)
else
res = -1;
}
if (!res) {
res = ast_safe_sleep(chan, 1000);
}
if (option_debug && !res ) {
/* Step 12: Hangup! */
ast_log(LOG_DEBUG, "TestClient: 12. Hangup\n");
@@ -403,7 +405,6 @@ static int testserver_exec(struct ast_channel *chan, void *data)
if (res > 0)
res = 0;
}
if (!res) {
/* Step 5: Wait one second */
if (option_debug)
@@ -413,7 +414,6 @@ static int testserver_exec(struct ast_channel *chan, void *data)
if (res > 0)
res = 0;
}
if (!res) {
/* Step 6: Measure noise */
if (option_debug)
@@ -423,7 +423,6 @@ static int testserver_exec(struct ast_channel *chan, void *data)
if (res > 0)
res = 0;
}
if (!res) {
/* Step 7: Send "5" */
if (option_debug)
@@ -454,8 +453,9 @@ static int testserver_exec(struct ast_channel *chan, void *data)
else
res = -1;
}
if (!res)
if (!res) {
res = ast_safe_sleep(chan, 1000);
}
if (!res) {
/* Step 10: Send "8" */
if (option_debug)