Configure Firefox to handle callto links in Ubuntu/Debian

Hi all ūüôā

in this post I will show you how to configure Mozilla Firefox to handle callto links. By default if you click on callto link in Firefox shows the following error:

The address wasn't understood

Firefox doesn't know how to open this address, because the protocol (callto) isn't associated with any program.

You might need to install other software to open this address.

These steps are tested on Ubuntu 12.04 LTS i386, Ubuntu 13.10 i386 and Debian Wheezy amd64.

1. Install SFLPhone Software for VOIP calls

apt-get install sflphone-gnome

2.¬†Start the app. First time you will see this screen. Just click ‚ÄúContinue‚ÄĚ:

SFLPhone

¬†We need to choose ‚ÄúRegister an existing SIP account‚ÄĚ on the next screen and click ‚ÄúContinue‚ÄĚ:

SFLPhone

¬†On the next screen we choose ‚ÄúSIP‚ÄĚ and click ‚ÄúContinue‚ÄĚ:

Here we need to fill our data:

Alias: Our name
Host name: Our SIP Server IP
User name: Your user or ID
Password: Your password

¬†After filling the required data, click ‚ÄúContinue‚ÄĚ:

¬†On the next screen just click ‚ÄúApply‚ÄĚ. We don’t need to setup anything here:

 Next you will see summary for your account.

 4. Save this script to /usr/bin/sflphone-handler

#!/bin/sh
#
# This script can be used as a callto: (or other) protocol handler in
# Mozilla Firefox-based browser.
# In Firefox use Preferences > Applications and set the callto handler
# to this script.

# Test if a SFLphone client is already open, if not open a new one
# Opening a new client will start sflphoned if not already running
SFLPHONEC=`ps -A | grep sflphone-client`
if [ "$SFLPHONEC" = "" ]; then
    /usr/bin/sflphone-client-gnome&
fi

# Check 1st argument (phone number)
if [ -z $1 ]; then
echo "Error: argument 1 (phone number) not provided."
    exit 1
fi

# Cleanup destination, keeping numbers only
TO="`echo $1 | sed -e 's/[^0123456789]//g'`"

# Generate call id.
CALLID=${RANDOM}$$

# Dbus placeCallFirstAccount method does not reach sflphoned if starting
# Should find another way to do this
sleep 1

dbus-send \
    --type="method_call" \
    --dest="org.sflphone.SFLphone" \
    "/org/sflphone/SFLphone/CallManager" \
    "org.sflphone.SFLphone.CallManager.placeCallFirstAccount" \
    string:"$CALLID" \
    string:"$TO"

exit 0

# EOF

 Or you can download it from:

https://github.com/LukeCarrier/sflphone/blob/master/tools/mozilla-telify-sflphone/sflphone-handler

5. Make this script executable:

chown root:root /usr/bin/sflphone-handler
chmod 755 /usr/bin/sflphone-handler

6. Add callto handler

sudo echo "x-scheme-handler/callto=sflphone.desktop" >> /usr/share/applications/defaults.list

7. Configure SFLPhone to accept parameters

nano /usr/share/applications/sflphone.desktop

and change

Exec=sflphone-client-gnome

to

Exec=sflphone-client-gnome %u

8. Configure Firefox

Open Firefox and click on callto link. First time you will see this screen:

¬†We need to click ‚ÄúChoose‚ÄĚ and navigate to /usr/bin/sflphone-handler.

Then check ‚ÄúRemember my choice for callto links‚ÄĚ and click ‚ÄúOK‚ÄĚ.

After a while SFLPhone application should start and automatically call the number from the link.

Fixing Ubuntu soft lockup – CPU error

We have some strange issue with an Ubuntu 12.04 System. It takes a lot of time for booting to the login screen. It was approximately 4 minutes, which is definitely not normal. When we read log files, we found real problem:

kernel: BUG: soft lockup - CPU#1 stuck for 23s

We have made hardware tests: CPU stability, Memory test, Hard disk check. There is no hardware problem on it, so it was software issue. Most recent solutions that we found was to make system boot with no ACPI. Way to do it is to edit /etc/default/grub and change GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash” with: GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash acpi=off”

After this change you have to make update-grub and grub-install commands to take effect. When we reboot the system it takes no more than minute to load from grub to login screen. But when we checked the system, we found that it isn’t a good solution, because when you shut down it freezes (without powering off the PC). We tried with other options in grub, but nothing helps for real, so we made it as it was : GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”

Real solutions for us came when we installed this package “amd64-microcode”(Processor microcode firmware for AMD CPUs). Our system runs with AMD CPU, so if it happens on Intel system, the proper package is: intel-microcode.

sudo apt-get install amd64-microcode # For AMD CPUs

or

sudo apt-get install intel-microcode # For Intel CPUs

In that way system runs as it should be – fast loading at boot and normal shutdown, without problems for all used services and applications.
Hope that helps ūüôā