Thursday, November 11, 2021

Asterisk with 2g 3g 4g modules - CS and VoLTE

With help from the Almighty, one of our consultants has been able to modify chan_dongle code that enables Asterisk to work with modern 4g modules such as those from Quectel and Simcom. Writeup and code is available here https://github.com/IchthysMaranatha/asterisk-chan-quectel 

Thursday, September 2, 2021

Using chan_mobile with Raspberry Pi bluetooth controller

This post addresses fixing of audio issues when using chan_mobile with the built-in bluetooth controller of Raspberry Pi 4 or 3B+ (using CYW43455 chipset aka BCM43455). Audio coming in to Asterisk through the mobile sounds distorted with a tinny quality while the audio going out from Asterisk to the mobile device has no issues. The problem is due to frame size being set in chan_mobile code as 48 bytes as seen here

https://github.com/asterisk/asterisk/blob/master/addons/chan_mobile.c#L81

while bluetooth controller actually uses a frame size of 60 bytes for audio sco packets. The idea behind solution was obtained from gleaning this thread

https://github.com/raspberrypi/linux/issues/2229

Steps to resolve the issue

Stop Asterisk service and edit chan_mobile.c found in the source asterisk addons folder. The line #define DEVICE_FRAME_SIZE 48 should be changed to #define DEVICE_FRAME_SIZE 60. Then rerun 'sudo make' and 'sudo make install'. Restart Astersik service and the audio issue should be fixed.

The issue has been well described here

https://issues.asterisk.org/jira/browse/ASTERISK-29606

Hardware and Software Used: Asterisk 16.19 (Current v16), Ubuntu 20.04 on Raspberry Pi 4

It may also work with Pi 3 with the CYW43438 (BCM43438) chip but this is untested. For older firmware, if there is no audio at all Pi 3 might require running this command 

sudo hcitool cmd 0x3F 0x01C 0x01 0x02 0x00 0x01 0x01

to enable audio through HCI. Then fix given in post can be applied. You can let us know if it works for Pi 3 in comments below.

Thursday, August 26, 2021

JasperReports Server Mondrian OLAP - Parent Child Hierarchy Errors

Right from JasperReports Server version 5.6 to the current one (7.8 at the time of posting) there has been a persistent error when trying to navigate through OLAP cube settings or when drilling down on cubes that have parent child hierarchies present in dimensions.

This error is due to ji-jpivot using getSchemaReader() calls instead of getSchemaReader().withLocus() calls as required by newer Mondrian code and thus results in a java.util.EmptyStackException error.

Some of issues raised in this regard are 

https://community.jaspersoft.com/jasperreports-server/issues/3694

https://community.jaspersoft.com/questions/841162/emptystackexception-olap-analysis-after-update-jasperserver-56

One of our Consultants has also raised this issue in the forum 

https://community.jaspersoft.com/jasperreports-server/issues/4005

With helpful tips from some of the others on the forum, he was able to develop a patch and workaround for this issue. The relevant mondrian jar file needs to be replaced with the following patched one https://maplein.com/downloads/mondrian-3.6.7-JS-vfs1-1.jar

If using tomcat, the file is found in the WEB-INF/lib directory within the jasperserver tomcat webapps folder. Stop the application server service (tomcat, glassfish etc), replace mondrian jar file with the patched one downloaded and restart the service. Patched file should be renamed as required; for example in the 5.6.2 version file name is mondrian-3.6.4-JS-2.jar 

An important thing to note if using WinSCP to copy the file over for linux servers is that transfer settings should be set as Binary else file will be corrupted.