Upgrade 3CX to v18 and get it hosted free!

Asterisk cmd TestServer

Author image

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)


Go back to Asterisk – documentation of application commands

Related Posts:

Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.