The following steps can be used to analyze Audio and echo issues.

Test #1 - Verify that native FXO/FXS calls are fine

Purpose

Verify the call quality between an analog phone (POTS) and an FXO line to the Central Office (CO). Native means that there is no codec transformation.



Procedure
1) Make some call between FXO and FXS in either direction.
1a) If you are using freePBX, refer to How to add PIKA Channels.

2) Repeat Multiple times
3) Verify the call quality.



Test #2 - Verify that non-native FXO/FXS calls are being done properly

Purpose

Verify the call quality between an analog phone (POTS), going through Asterisk and then to an FXO line to the Central Office (CO). Non-Native means that there is some transformation being done by Asterisk/PIKA Channel Driver.





Procedure
1) In /etc/asterisk/pika.conf set the parameter to
usenativebridge=no
2) Restart Asterisk
3) Make some calls between FXO and FXS in either direction.
4) Repeat Multiple times.
5) Verify the call Quality.


Post Procedure
1) In /etc/asterisk/pika.conf set the parameter back to its original value that is:
usenativebridge=yes



Test #3 - Log PIKA Channel events from Asterisk for SIP to FXO

Purpose
When making SIP to analog calls, it might be necessary to analyze the transactions between Asterisk and the PIKA Channel Driver. This test attempts to capture some logs for this purpose.



Procedure
1) In /etc/asterisk/logger.conf, set the full parameter to:
full=>notice,warning,error,debug,verbose
2) Stop Asterisk
3) Clear all the asterisk logs
# rm /var/log/asterisk/full
# touch /var/log/asterisk/full
4) Restart asterisk
5) Enter Asterisk console and turn on PIKA logging.
# asterisk -vvvvvvvvvvvvvvvvv
WARP*CLI> pika debug on
6) Make Multiple calls.
7) Once the audio problem is reproduced, copy the
/var/log/asterisk/full file to your PC and rename it to pkchantest3_x.txt (where x is 1,2,3...).
8) The more times this is reproducible the better.
9) Analyze the log files.


Post Procedure
1) In /etc/asterisk/logger.conf, set the full parameter to:
full=>notice,warning,error


Test #4 - Monitor the call from the Asterisk perspective

Purpose
When analysing voice quality between Asterisk and the PIKA channel driver, it might be necessary to monitor (record) the call. This test is used to record both direction of the call from the Asterisk perspective.


Procedure
1) Identify the file where the dial plan rule for the PIKA/fxo/g0 circuit is located.
2) Make a backup of that file.
3) Add the Monitor(format,filename,b) Application command before the Dial(PIKA/fxo...)
4) Add the StopMonitor() after the Dial command
5) Restart Asterisk
6) Repeat until the problem has been reproduced.
7) Two files should be produced, an input and an output in /var/spool/asterisk/monitor. Zip the files up into one and name it pkchantest4_x.zip.
8) The more times this is reproducible the better.
9) Analyse the files using a program like Audacity.

Post Procedure
1) Return the dial plan to its original state.


Test #5 - Gather PIKA logs - disable media stream logs

Purpose
It may sometimes be necessary to analyze low level logs without affecting the call quality. These steps are meant to capture these logs to SD.


Procedure
1) Set the PIKA Logs
In /persistent/etc/localenv change
export PKH_LOGS_DIR=SYSLOG
export PKX_LOGS_DIR=SYSLOG
to read
export PKH_LOGS_DIR=/mnt/sd/
export PKX_LOGS_DIR=/mnt/sd/
then use the command source /persistent/etc/localenv to apply the changes

To update the Grandprix logging, in /persistent/etc/pika/pikagp.cfg look for the header [logs], modify the file to contain

[logs]
level=debug
files=5
size=5

this will make 5 log files each 5 mb large

To update the AoH logs, in /persistent/etc/pika/pikagp_aoh.cfg again look for the header [logs] and modify the file to contain

[logs]
level=debug
api=0xffffcffb ; disable api message from the queue, play and record
object.mediastream=0x3 ; disable all mediastream logging other than errors or warnings
hsp=ffffe7ff ; disable the hsp messages for play and record
files=5
size=5

2) Restart Asterisk
3) Repeat until the problem has been reproduced.
4) Zip all the /var/log/message.* , /mnt/sd/aoh_xxxxxx.* and /mnt/sd/gp_xxxxxx.* files into one file call pknomediatest5_x.zip
5) The files can then be analyzed.

Post Procedure
1) Set the log files to their original states.



Test #6 - Gather PIKA logs - echo cancelling test

Purpose
The following steps are meant to capture logs and call quality specifically for Echo Cancellation purposes. All files are saved to SD.



Procedure
1) In /etc/asteriks/pika.conf modify:
echologging=yes

2) Set the PIKA Logs
In /persistent/etc/localenv change
export PKH_LOGS_DIR=SYSLOG
export PKX_LOGS_DIR=SYSLOG
to read
export PKH_LOGS_DIR=/mnt/sd/
export PKX_LOGS_DIR=/mnt/sd/
then use the command source /persistent/etc/localenv to apply the changes, or reboot the unit
To update the AoH logs, in /persistent/etc/pika/pikagp_aoh.cfg again look for the header [logs] and modify the file to contain

[logs]
level=debug
api=0xffffcffb ;
object.mediastream=0x3
files=5
size=5

3) Restart Asterisk
4) Repeat until the problem has been reproduced.
5) Zip all the /mnt/sd/aoh_xxxxxx.* files into one file call pkectest6_x.zip
6) Send us the files.

Post Procedure
1)Set the log files to their original states.
2)Set the pika.conf file to its original state.