NEWS FLASH Incredible PBX for CuBox-i

Bob Helbush

Member
Joined
May 22, 2013
Messages
96
Reaction score
25
Location
Atlanta, GA
Got my CuBox running today. BBB had been my go to low end box, but I'm really liking the CuBox. Fast, small, comes ready to go with case and power supply. The only nit is the microSD socket makes me nervous. Much prefer the one on the BBB and the new Pi's.
 
  • Like
Reactions: wardmundy

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
15,431
Reaction score
2,737
The non-springloaded microSD slot was apparently a real estate problem in the design. I use a tiny flat-blade screwdriver to pry the card out from the bottom, and it works fine. I've probably already swapped in a new card over 100 times. :ack2:
 
  • Like
Reactions: zhando

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
15,431
Reaction score
2,737
Latest image on SourceForge this morning adds Bluetooth Support.

Here's what works for connecting to a smartphone to make and receive calls...

1. Buy the proper 99¢ USB Blueoooth v2.0 adapter and plug it into a USB slot and then boot up the CuBox
2. Activate Bluetooth visibility mode on your phone (it's in left button Bluetooth pull-down on Android)
3. From Linux CLI figure out the MAC address AND the port of your Bluetooth phone: asterisk -rx "mobile search"
4. Edit /etc/asterisk/chan_mobile.conf and add entry for your phone. Example:
Code:
[GalaxyS4]
address=10:D5:42:16:15:CF    ; the address of the phone
port=3                ; the rfcomm port number (from mobile search in step #3)
context=from-trunk        ; dialplan context for incoming calls
adapter=blue            ; adapter to use
group=1                ; this phone is in channel group 1
sms=yes                ; support SMS, defaults to yes but had to force it for S4
nocallsetup=yes        ; set this only if your phone reports that it supports call progress notification, but does not do it. Motorola L6 for example.
5. Restart Asterisk: amportal restart
6. From Linux CLI, run: bluez-simple-agent
7. Turn Bluetooth OFF and back ON on your phone. Then scan for Bluetooth devices and pair to cubox-0. If you can't find cubox-0, decipher your phone's BT MAC address and: bluez-simple-agent hci0 BT-MAC-ADDRESS (which pushes cubox-0 selection to Bluetooth on your phone)
8. When prompted, enter 0000 for the PIN on your phone
9. At Linux CLI, bluez-simple-agent should now be prompting for PIN: 0000
10. bluez-simple-agent asks you to confirm passkey: yes (maybe not. just Ctrl-C to exit if phone shows paired)
11. Check to be sure you're linked to Asterisk. From Linux CLI: asterisk -rx "mobile show devices" (should show connected Yes)
12. To place an outbound call through Bluetooth, dial 9 and 10-digit number from an extension on your server
13. Inbound calls to your cellphone will automatically ring extension 701 on Incredible PBX

NOTE: There is a major delay from call connection to proper audio. It gets sorted out in about 15 seconds with both parties talking. Otherwise, it takes longer. You probably won't want to use this connection for that big job interview. :smartass:

Here's what doesn't work at all: older smartphones include iPhone 4 and smartphones from Samsung older than the S4 and Note III. LG G3 works great. There are probably other newer phones as well. We'll update this list as reports come in. After pairing with Bluetooth, what you will see is a momentary connection to Asterisk followed by "Error initializing Bluetooth device." I suspect the developers of the chan_mobile module didn't have older phones, and the handshake is slightly different. Anyway, both the Galaxy S III and the Galaxy Note II fail. I didn't go back to more vintage devices.

Here's what doesn't work for phone calls (NO AUDIO) but works fine for Proximity Detection apps such as the Nerd Vittles example. These entries currently are commented out in /etc/rc.local bootup script. If you want to activate them and solve the NO AUDIO problem, you could win this week's YOU DA MAN award.

1. Activate the internal Bluetooth adapter but don't restart the Bluetooth service or it goes away.
Code:
/usr/local/bin/brcm43xx-firmware-update
/usr/sbin/hciattach -n /dev/brcm43xx any 3000000 &
amportal restart
2. If you need to restart Bluetooth with the internal adapter, here's how...
Code:
/etc/init.d/bluetooth restart
/usr/sbin/hciattach -n /dev/brcm43xx any 3000000 &
amportal restart
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
15,431
Reaction score
2,737
Installing a Beefy eSATA Hard Drive with CuBox-i4PRO (only)



1. First, you have to buy one. Be sure it is an eSATA drive with a cable. Here's the one we're using which comes with eSATA cable.
2. Plug it in and reboot your CuBox-i4PRO.
3. fdisk -l should show a new: /dev/sda
4. Copy your microSD card to the drive (erases everything!!): dd if=/dev/mmcblk0 of=/dev/sda bs=1M
5. reboot
6. fdisk /dev/sda (HINT: blank lines below mean hit the ENTER key)
Code:
p
d
2
n
p
2
 
 
p
w
7. reboot
8. Issue the following commands:
Code:
e2fsck -fy /dev/sda2
resize2fs /dev/sda2
mount /dev/mmcblk0p1 /boot
sed -i 's|mmcblk0p2|sda2|' /boot/uEnv.txt
echo "/dev/sda2 / ext4 relatime,errors=remount-ro 0 1" >> /etc/fstab
echo "/dev/sda1 / ext4 relatime,errors=remount-ro 0 1" >> /etc/fstab
mkdir /esata1
mount /dev/sda1 /esata1
mkdir /esata2
mount /dev/sda2 /esata2
sed -i 's|mmcblk0p2|sda2|' /esata1/boot/uEnv.txt
sed -i 's|mmcblk0p1|sda2|' /esata2/etc/fstab
sed -i 's|mmcblk0p0|sda1|' /esata2/etc/fstab
9. reboot
10. Clean up status for Whopper Drive: sed -i 's|cut -f 9|cut -f 12|' /usr/local/sbin/status
 
  • Like
Reactions: zhando

zhando

Guru
Joined
Aug 7, 2014
Messages
22
Reaction score
11
Darn it Ward. Man after my own heart. Just have to use ALL the hardware..

I use a UUID for my /var raid1 setup but in this case (cutting the sd card out of the loop) sda is a pretty safe bet.

And makes the image moving target more viable I'm seeing.

My experience with esata cables and the cubox screams: short thick cables, esata 3.0 rated. A 5 foot cable from monoprice worked but a little intermittently and I got just 1.5 GB/s out of it.
 
  • Like
Reactions: wardmundy

zhando

Guru
Joined
Aug 7, 2014
Messages
22
Reaction score
11
Have to wake up early tomorrow morning and will be in meetings till 16:30 pdt..

Someone could run with this if they're up to it:

https://bbs.archlinux.org/viewtopic.php?id=166678&p=2

You'll have to translate a little from 1) arch to ubuntu and 2) bluez5 to bluez4 - which Ubuntu is still stuck with because bluez5 still doesn't support HFP.. Which may be actually a good thing for incredible pbx.

Too bad because bluez5's bluetoothctl is pretty cool.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
15,431
Reaction score
2,737
zhando: Not sure where to go with that since we're using bluez4 which actually works fine with an external BT adapter. That tells me the problem with the internal BT adapter lies somewhere between the adapter and the audio layer, not with the audio layer itself (since it works fine with the external adapter).

The latest image has all of the internal BT software pieces in place. The software pieces just aren't loaded because the audio doesn't work. $1 buys everybody an external BT adapter that works on all of the CuBox devices rather than just the i4PRO which has BT built in, such as it is. If you get time to experiment further, that would be great but we're moving on.

Because of the lengthy (10-15 second) audio setup on calls, we'd rate the BT phone call quality as barely above :001 9898: unless somebody is so strapped for money that cellular service with an existing unlimited calling plan is the only available option to make and receive calls.

The chan_mobile module also has its own share of issues not the least of which is it rarely works with smartphones that are more than a year old. Whether this was because of lack of testing or because the developers just gave up really doesn't matter. One would think that, if a Bluetooth connection was already established between the computer and a smartphone, that should be adequate for Asterisk to set up a reliable BT channel. Unfortunately, we didn't find that to be true with numerous older smartphones... and we've got lots of them. Also worth noting is that different vendors have implemented Bluetooth calling different ways. For example, on Samsung Galaxy devices, both the smartphone and the Asterisk trunk ring on incoming cellphone calls. On the LG G3, only the Asterisk trunk rings when you're within Bluetooth range.

We're all about bang for the buck. This was a fun science experiment, but the chance of folks actually using it for real phone calls in the real world is ZERO. It comes down to how much :banghead: one can stand. In this case, we're over our threshold. A buck solves the connection and audio problems. But the solution is nowhere close to meeting the WAF standard for real phone calls. So... BT case closed (at least for us).

 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
15,431
Reaction score
2,737
And Now It's a Fax Machine, too!

Thanks to the pioneering efforts of Josh North, we have a new Incredible PBX for CuBox image that incorporates Incredible Fax with HylaFax and AvantFax. Unfortunately, you cannot upgrade to this version. Nor can you restore a backup from a previous release since HylaFax/Avantfax make use of MySQL to function. But, if you're willing to start over, you'll be glad you did!



Even Fax Detection works!



1. Download and install the latest image from SourceForge.
2. Go through the usual automated steps to get your server running by booting up the image twice.
3. Resize the partition to match your microSD card: /root/resize-partition
4. Change your root password: passwd
5. Change your FreePBX admin password: /root/admin-pw-change
6. Change your Avantfax admin password: /root/avantfax-pw-change
7. Set your email destination for incoming faxes in PDF format: /root/avantfax-email-dest
8. Adjust your email from address (if desired): edit /var/www/html/avantfax/includes config.php and local-config.php (change ADMIN_EMAIL from [email protected])
9. Create a trunk to handle the inbound and outbound faxes in FreePBX. Google Voice works great!
10. Set the Destination for the Inbound Route of the trunk handling incoming faxes. You no longer need a dedicated DID since SIP Fax Detection now works. Set Detect Faxes=True, Detection Type: SIP, Detection Time: 4, Fax Destination: Custom Destinations: Fax (Hylafax).
11. Log into AvantFax as admin with password from step #6 using a browser pointed to the IP address of your server and click on AvantFax tab.
12. If you get sick of the constant Asterisk Notices about trivia on your display and in your logs, turn off Notice option in Settings -> Asterisk Logfile Settings.
13. reboot



Just so you know how tiny and awesome the CuBox really is... ^^^^^^
 

Jay Deal

Phhhhhhhhttttttt :)
Joined
Dec 26, 2013
Messages
267
Reaction score
85
Not that it's as amazing as the Cubox is, for the heck of it and thinking I might get lucky, I tried this image on a Cubietruck which has the same processor core and hardware scheme as the Cubox. It unfortunately did not work as the Cubox must use a different booting scheme than the Cubieboard's. As I am bound and determined to get the PBXIAF installer to work on the Cubietruck I have tried it with Debian, Ubuntu and Fedora with it not getting very far each time. The next glimmer of hope is when PBIAX is ported to Debian (with an installer) and I have a pretty good setup to work from that.

I must comment on the incrediblepbx-packages list which is posted along with the images for the Cubox. There must be at least 300 packages/dependencies that comprise the incrediblepbx image for the Cubox. This is a testament to both the amount of effort and complexity of what you are getting for 100% off of 0 which of course is 0 - certainly getting some bang for the cost of interweb electrons I would say. Hats off to everyone who works on, supports and provides the images for devices like this as they are a truly incredible accomplishment that still amaze me to this day. :clap:
 
  • Like
Reactions: wardmundy

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
15,431
Reaction score
2,737
Yeah, this has been quite the project. Our attention span usually doesn't make it for two full weeks, but the CuBox has really been fun. And we couldn't have done it without the pioneering efforts of zhando and Josh North. If you don't have one, you really don't know what you're missing. This little box has the horsepower of a Dual Core Atom at about 1/3 the price and a fraction of the size. And everything "just works."

Just think. This Ubuntu adventure began just two short months ago. WOW, what a box (the one on the right) :Angel anim:

 
  • Like
Reactions: Bob Helbush

Josh North

Guru
Joined
Aug 5, 2014
Messages
27
Reaction score
11
Glad to be able to give something back. Though to be fair I had a good script to jump start it.

Hope to get a Cubox next month to try it myself!
 
  • Like
Reactions: wardmundy

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
15,431
Reaction score
2,737
Enabling SAMBA Windows Networking on Incredible PBX for Ubuntu

Here are the steps to get SAMBA up and running:

1. Install required packages:
Code:
apt-get -y install samba samba-common python-glade2 system-config-samba
2. Add the missing pieces for SAMBA:
Code:
cd /etc/samba
mv smb.conf smb.orig.conf
wget http://incrediblepbx.com/samba-ubuntu.tar.gz
tar zxvf samba-ubuntu.tar.gz
rm *.tar.gz
sed -i '/# End of Trusted Provider Section/r '/etc/samba/smb.iptables'' /etc/iptables/rules.v4
iptables-restart
service smbd restart
service nmbd restart
sed -i 's|/usr/local/sbin/amportal restart|service smbd restart\nservice nmbd restart\n/usr/local/sbin/amportal restart|' /etc/rc.local
# set up root password for SAMBA access with full RW privileges
smbpasswd -a root
3. On your favorite Mac or Windows machine, log in to Incredible PBX as root with your new SAMBA password.

NOTE: To add additional accounts, you must first create a new system user account with disabled login and no home directory.
Also add the new user to the valid users list in [incrediblepbx] section of /etc/samba/smb.conf and then restart SAMBA.
Code:
useradd joeschmo --shell /bin/false
smbpasswd -a joeschmo
sed -i 's|root|root joeschmo|' /etc/samba/smb.conf
service smbd restart
 

Alejandro

New Member
Joined
Sep 2, 2014
Messages
5
Reaction score
0
As soon as I upgrade the modules., the gui for the cubox become slow.. any reasons why? Also, I cant find any really good tutorial to built the IVR for the cubox.. any tips will be appreciate it. thx!
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
15,431
Reaction score
2,737
This is a NEW platform for all of us. You'll sleep better if you don't try to improve things that are already working. Start over and leave the operating system as you find it.
 
  • Like
Reactions: randy7376

Members online

No members online now.

PIAF 5 - Powered by 3CX

Forum statistics

Threads
22,581
Messages
138,982
Members
14,676
Latest member
BluePeter