Asterisk cmd TestServer

TestServer

Execute Interface Test server; to be used together with TestClient()
Introduced with Asterisk 1.1dev (1.2 release)

Details

TestServer(): Perform test server function and write call report.
Results stored in /var/log/asterisk/testreports/<testid>-server.txt
or possibly /var/log/asterisk/testresults/<testid>-server.txt depending on * version

file format as follows:
-rw-r--r-- 1 root 109 Mar 31 23:18 testa-client.txt

CLIENTCHAN: IAX2/s3701-10
CLIENTTEST ID: testa
ANSWER: PASS
WAIT DTMF 1: FAIL
-- END TEST--

Example

extensions.conf on the server side:

; testing
[default]
exten => 8787,1,Answer
exten => 8787,n,Testserver

extensions.conf on the client machine:

; testing
[default]
exten => 8782,1,Answer
exten => 8782,n,Testclient(testa)

Shell script for the client machine to generate calls:


 #! /bin/bash
 #
 cat <<EOD >/var/spool/asterisk/outgoing.temp/test-$$
 Channel: Zap/g1/8787
 MaxRetries: 0
 RetryTime: 60
 WaitTime: 30
 
 Context: default
 Extension: 8782
 Priority: 1
 
 EOD
 mv /var/spool/asterisk/outgoing.temp/test-$$ /var/spool/asterisk/outgoing/
 echo Made call test-$$ >&2



This script triggers an outgoing call to the server being tested, then starts the Testclient on our side. The client and server do their thing and leave a log on both sides.

Make sure you use a valid channel and outgoing extension in the bash script above...

You can confirm the activity in /var/log/asterisk/messages with the tail -f to watch activity.

Tests over Zaptel

The above example needs slight modification over a Zaptel channel.
If you call over zaptel, you'll have to limit yourself you test IDs that are legal phone DTMF chracters. Otherwise you'll end up with the error:

  WARNING[2665]: app.c:307 ast_dtmf_stream: Illegal DTMF character 't' in string. (0-9*#aAbBcCdD allowed)


(As of writing this I have not yet gotten an app_test call over zaptel working)

See also



Go back to Asterisk - documentation of application commands

TestServer

Execute Interface Test server; to be used together with TestClient()
Introduced with Asterisk 1.1dev (1.2 release)

Details

TestServer(): Perform test server function and write call report.
Results stored in /var/log/asterisk/testreports/<testid>-server.txt
or possibly /var/log/asterisk/testresults/<testid>-server.txt depending on * version

file format as follows:
-rw-r--r-- 1 root 109 Mar 31 23:18 testa-client.txt

CLIENTCHAN: IAX2/s3701-10
CLIENTTEST ID: testa
ANSWER: PASS
WAIT DTMF 1: FAIL
-- END TEST--

Example

extensions.conf on the server side:

; testing
[default]
exten => 8787,1,Answer
exten => 8787,n,Testserver

extensions.conf on the client machine:

; testing
[default]
exten => 8782,1,Answer
exten => 8782,n,Testclient(testa)

Shell script for the client machine to generate calls:


 #! /bin/bash
 #
 cat <<EOD >/var/spool/asterisk/outgoing.temp/test-$$
 Channel: Zap/g1/8787
 MaxRetries: 0
 RetryTime: 60
 WaitTime: 30
 
 Context: default
 Extension: 8782
 Priority: 1
 
 EOD
 mv /var/spool/asterisk/outgoing.temp/test-$$ /var/spool/asterisk/outgoing/
 echo Made call test-$$ >&2



This script triggers an outgoing call to the server being tested, then starts the Testclient on our side. The client and server do their thing and leave a log on both sides.

Make sure you use a valid channel and outgoing extension in the bash script above...

You can confirm the activity in /var/log/asterisk/messages with the tail -f to watch activity.

Tests over Zaptel

The above example needs slight modification over a Zaptel channel.
If you call over zaptel, you'll have to limit yourself you test IDs that are legal phone DTMF chracters. Otherwise you'll end up with the error:

  WARNING[2665]: app.c:307 ast_dtmf_stream: Illegal DTMF character 't' in string. (0-9*#aAbBcCdD allowed)


(As of writing this I have not yet gotten an app_test call over zaptel working)

See also



Go back to Asterisk - documentation of application commands

Created by: JustRumours, Last modification: Wed 20 of Jun, 2012 (04:54 UTC) by admin
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+