Friday, May 31, 2019

Update : About, Configuring, Using and Debugging Mobile Channel aka chan_mobile, Bluetooth Mobile Device channel driver on Asterisk

Our previous post on chan_mobile is not timely and here we will try yo update the information that has changed. Like Digium SVN site to Github and there were changes to source and patches.

chan_mobile or Mobile Channel makes it possible for Asterisk servers, networks and devices to use phones with Bluetooth, usually mobile phones and Bluetooth headsets.
Asterisk Channel Driver to allow Bluetooth Cell/Mobile Phones to be used as FXO devices, and Headsets as FXS devices.
chan_mobile.c was last updated on May 2017 to add caller ID "cnam" support.

chan_mobile Driver Features;
  • Multiple Bluetooth Adapters supported.
  • Multiple phones can be connected.
  • Multiple headsets can be connected.
  • Asterisk automatically connects to each configured mobile phone / headset when it comes in range.
  • CLI command to discover bluetooth devices.
  • Inbound calls on the mobile network to the mobile phones are handled by Asterisk, just like inbound calls on a Zap channel.
  • CLI passed through on inbound calls.
  • Dial outbound on a mobile phone using Dial(Mobile/device/nnnnnnn) in the dialplan.
  • Dial a headset using Dial(Mobile/device) in the dialplan.
  • Application MobileStatus can be used in the dialplan to see if a mobile phone / headset is connected.
  • Supports devicestate for dialplan hinting.
  • Supports Inbound and Outbound SMS.
  • Supports 'channel' groups for implementing 'GSM Gateways'
chan_mobile Driver Requirements;

In order to use chan_mobile, you must have a working bluetooth subsystem on your Asterisk box. This means one or more working bluetooth adapters, and the BlueZ packages.
Any bluetooth adapter supported by the Linux kernel will do, including usb bluetooth dongles.
The BlueZ package you need is bluez-utils. If you are using a GUI then you might want to install bluez-pin also. You also need libbluetooth, and libbluetooth-dev if you are compiling Asterisk from source.
You need to get bluetooth working with your phone before attempting to use chan_mobile. This means 'pairing' your phone or headset with your Asterisk box. I dont describe how to do this here as the process differs from distro to distro. You only need to pair once per adapter.
See for details about setting up Bluetooth under Linux.

chan_mobile Driver Concepts;

chan_mobile deals with both bluetooth adapters and bluetooth devices. This means you need to tell chan_mobile about the bluetooth adapters installed in your server as well as the devices (phones / headsets) you wish to use.
chan_mobile currently only allows one device (phone or headset) to be connected to an adapter at a time. This means you need one adapter for each device you wish to use simultaneously. Much effort has gone into trying to make multiple devices per adapter work, but in short it doesnt.
Periodically chan_mobile looks at each configured adapter, and if it is not in use (i.e. no device connected) will initiate a search for devices configured to use this adapater that may be in range. If it finds one it will connect the device and it will be available for Asterisk to use. When the device goes out of range, chan_mobile will disconnect the device and the adapter will become available for other devices.

chan_mobile Configuration;

The configuration file for chan_mobile is /etc/asterisk/mobile.conf.  It is a normal Asterisk config file consisting of sections and key=value pairs.
See configs/mobile.conf.sample for an example and an explanation of the configuration.
 (mobile.conf.sample on Github Source Tree)

Using chan_mobile Driver; must be loaded either by loading it using the Asterisk CLI, or by adding it to /etc/asterisk/modules.conf
Search for your bluetooth devices using the CLI command 'mobile search'. Be patient with this command as it will take 8 - 10 seconds to do the discovery. This requires a free adapter.
Headsets will generally have to be put into 'pairing' mode before they will show up here.
This will return something like the following :-
*CLI> mobile search
Address Name Usable Type Port
00:12:56:90:6E:00 LG TU500 Yes Phone 4
00:80:C8:35:52:78 Toaster No Headset 0
00:0B:9E:11:74:A5 Hello II Plus Yes Headset 1
00:0F:86:0E:AE:42 Daves Blackberry Yes Phone 7 
This is a list of all bluetooth devices seen and whether or not they are usable with chan_mobile. The Address field contains the 'bd address' of the device. This is like an ethernet mac address. The Name field is whatever is configured into the device as its name. The Usable field tells you whether or not the device supports the Bluetooth Handsfree Profile or Headset profile. The Type field tells you whether the device is usable as a Phone line (FXO) or a headset (FXS) The Port field is the number to put in the configuration file.
Choose which device(s) you want to use and edit /etc/asterisk/mobile.conf. There is a sample included with the Asterisk-addons source under configs/mobile.conf.sample.
Be sure to configure the right bd address and port number from the search. If you want inbound calls on a device to go to a specific context, add a context= line, otherwise the default will be used. The 'id' of the device [bitinbrackets] can be anything you like, just make it unique.
If you are configuring a Headset be sure to include the type=headset line, if left out it defaults to phone.
The CLI command 'mobile show devices' can be used at any time to show the status of configured devices, and whether or not the device is capable of sending / receiving SMS via bluetooth.
*CLI> mobile show devices
ID Address Group Adapter Connected State SMS
headset 00:0B:9E:11:AE:C6 0 blue No Init No 
LGTU550 00:E0:91:7F:46:44 1 dlink No Init No 
As each phone is connected you will see a message on the Asterisk console :-
Loaded => (Bluetooth Mobile Device Channel Driver)
– Bluetooth Device blackberry has connected.
– Bluetooth Device dave has connected. 
To make outbound calls, add something to you Dialplan like the following :- (modify to suit)
; Calls via LGTU5500
exten => _9X.,1,Dial(Mobile/LGTU550/${EXTEN:1},45)
exten => _9X.,n,Hangup
To use channel groups, add an entry to each phones definition in mobile.conf like group=n where n is a number.
Then if you do something like Dial(Mobile/g1/123456) Asterisk will dial 123456 on the first connected free phone in group 1.
Phones which do not have a specific 'group=n' will be in group 0.
To dial out on a headset, you need to use some other mechanism, because the headset is not likely to have all the needed buttons on it. res_clioriginate is good for this :-
*CLI> originate Mobile/headset extension NNNNN@context 
This will call your headset, once you answer, Asterisk will call NNNNN at context context

chan_mobile Dialplan Hints;

chan_mobile supports 'device status' so you can do somthing like
exten => 1234,hint,SIP/30&Mobile/dave&Mobile/blackberry
MobileStatus Application;

chan_mobile also registers an application named MobileStatus. You can use this in your Dialplan to determine the 'state' of a device.
For example, suppose you wanted to call dave's extension, but only if he was in the office. You could test to see if his mobile phone was attached to Asterisk, if it is dial his extension, otherwise dial his mobile phone.
exten => 40,1,MobileStatus(dave,DAVECELL)
exten => 40,2,GotoIf($["${DAVECELL}" = "1"]?3:5)
exten => 40,3,Dial(ZAP/g1/0427466412,45,tT)
exten => 40,4,Hangup
exten => 40,5,Dial(SIP/40,45,tT)
exten => 40,6,Hangup
MobileStatus sets the value of the given variable to :-
  • 1 = Disconnected. i.e. Device not in range of Asterisk, or turned off etc etc
  • 2 = Connected and Not on a call. i.e. Free
  • 3 = Connected and on a call. i.e. Busy
chan_mobile DTMS debouncing;

DTMF detection varies from phone to phone. There is a configuration variable that allows you to tune this to your needs. e.g. in mobile.conf
change dtmfskip to suit your phone. The default is 200. The larger the number, the more chance of missed DTMF. The smaller the number the more chance of multiple digits being detected.

chan_mobile SMS sending and Receiving;

If Asterisk has detected your mobile phone is capable of SMS via bluetooth, you will be able to send and receive SMS.
Incoming SMS's cause Asterisk to create an inbound call to the context you defined in mobile.conf or the default context if you did not define one. The call will start at extension 'sms'. Two channel variables will be available, SMSSRC = the number of the originator of the SMS and SMSTXT which is the text of the SMS. This is not a voice call, so grab the values of the variables and hang the call up.
So, to handle incoming SMS's, do something like the following in your dialplan
exten => sms,1,Verbose(Incoming SMS from ${SMSSRC} ${SMSTXT})
exten => sms,n,Hangup()
The above will just print the message on the console.
If you use res_jabber, you could do something like this :-
exten => sms,1,JabberSend(transport,,SMS from ${SMSRC} ${SMSTXT})
exten => sms,2,Hangup()
To send an SMS, use the application MobileSendSMS like the following :-
exten => 99,1,MobileSendSMS(dave,0427123456,Hello World)
This will send 'Hello World' via device 'dave' to '0427123456'

chan_mobile Debugging;

Different phone manufacturers have different interpretations of the Bluetooth Handsfree Profile Spec. This means that not all phones work the same way, particularly in the connection setup / initialisation sequence. I've tried to make chan_mobile as general as possible, but it may need modification to support some phone i've never tested.
Some phones, most notably Sony Ericsson 'T' series, dont quite conform to the Bluetooth HFP spec. chan_mobile will detect these and adapt accordingly. The T-610 and T-630 have been tested and work fine.
If your phone doesnt behave has expected, turn on Asterisk debugging with 'core set debug 1'.
This will log a bunch of debug messages indicating what the phone is doing, importantly the rfcomm conversation between Asterisk and the phone. This can be used to sort out what your phone is doing and make chan_mobile support it.
Be aware also, that just about all mobile phones behave differently. For example my LG TU500 wont dial unless the phone is a the 'idle' screen. i.e. if the phone is showing a 'menu' on the display, when you dial via Asterisk, the call will not work. chan_mobile handles this, but there may be other phones that do other things too...
Important: Watch what your mobile phone is doing the first few times. Asterisk wont make random calls but if chan_mobile fails to hangup for some reason and you get a huge bill from your telco, dont blame me :)
Hope this helps.

How Super Resolution Zoom Algorithm Brings the Night Sight feature and Super-Res zoom of the Pixel 3 devices To The Future.

'This approach, which includes no explicit de-mosaicing step, serves to both increase image resolution and boost signal to noise ratio,' write the Google researchers in the paper the video is based on. 'Our algorithm is robust to challenging scene conditions: local motion, occlusion, or scene changes. It runs at 100 milliseconds per 12-megapixel RAW input burst frame on mass-produced mobile phones.'
I have been following and working with RAISR: Rapid and Accurate Image Super-Resolution for a while, as far as 2016, as I have a keen interest on imaging science. Digital zoom is my target has never been satisfied with most of the current technologies. Machine learning based algorithms seem to do a better job in taking tough because a   lower resolution image and "reconstruct" missing details reliably, much differently from the typical digital zoom process. Which is a small crop of a single image is scaled up to produce a much larger image and traditionally, this is done by linear interpolation methods, this recreates information that is missing in the original image, and usually introduces artifacts and lacks texture and details. In contrast, most modern single-image zoom procedures use machine learning and produce better results like the RAISR.

This brings us to the Google Pixel 3;

Digital zoom using algorithms (rather than lenses) has long been the “ugly duckling” of mobile device cameras. As compared to the optical zoom capabilities of DSLR cameras, the quality of digitally zoomed images has not been competitive, and conventional wisdom is that the complex optics and mechanisms of larger cameras can't be replaced with much more compact mobile device cameras and clever algorithms. 

With the new Super Res Zoom feature on the Pixel 3, we are challenging that notion. 

The Super Res Zoom technology in Pixel 3 is different and better than any previous digital zoom technique based on upscaling a crop of a single image, because we merge many frames directly onto a higher resolution picture. This results in greatly improved detail that is roughly competitive with the 2x optical zoom lenses on many other smartphones. Super Res Zoom means that if you pinch-zoom before pressing the shutter, you’ll get a lot more details in your picture than if you crop afterwards.
 Google uses the Super Resolution in the Night Sight feature and Super-Res zoom of the Pixel 3 devices and one could learn more about the technology on this article from 2018 on Google AI blog.

Thursday, May 30, 2019

What is Google Instant? Where is "Google Instant" and where is it now?

Image result for google instant
For some reason, Google Instant has spiked interest today. Google Instant was introduced almost nine years ago and this is how the page appeared on 10 Sep 2010 (after the jump). The Google started forwarding the page to about page in about 2012.
The actual "Google Instant" feature was dropped in 2017;
We launched Google Instant back in 2010 with the goal to provide users with the information they need as quickly as possible, even as they typed their searches on desktop devices. Since then, many more of our searches happen on mobile, with very different input and interaction and screen constraints. With this in mind, we have decided to remove Google Instant, so we can focus on ways to make Search even faster and more fluid on all devices.

My own pages on the subject were;

Instantiating The Net, Google Sets A New Trend For Ideas With Google Instant.

Instantiating The Net, Google Sets A New Trend For Ideas With Google Instant.

 How Google page appeared on September 2010

Google Instant is a new search enhancement that shows results as you type. We are pushing the limits of our technology and infrastructure to help you get better search results, faster. Our key technical insight was that people type slowly, but read quickly, typically taking 300 milliseconds between keystrokes, but only 30 milliseconds (a tenth of the time!) to glance at another part of the page. This means that you can scan a results page while you type.
The most obvious change is that you get to the right content much faster than before because you don’t have to finish typing your full search term, or even press “search.” Another shift is that seeing results as you type helps you formulate a better search term by providing instant feedback. You can now adapt your search on the fly until the results match exactly what you want. In time, we may wonder how search ever worked in any other way.


Faster Searches: By predicting your search and showing results before you finish typing, Google Instant can save 2-5 seconds per search.
Smarter Predictions: Even when you don’t know exactly what you’re looking for, predictions help guide your search. The top prediction is shown in grey text directly in the search box, so you can stop typing as soon as you see what you need.
Instant Results: Start typing and results appear right before your eyes. Until now, you had to type a full search term, hit return, and hope for the right results. Now results appear instantly as you type, helping you see where you’re headed, every step of the way.

Did you know:

  • Before Google Instant, the typical searcher took more than 9 seconds to enter a search term, and we saw many examples of searches that took 30-90 seconds to type.
  • Using Google Instant can save 2-5 seconds per search.
  • If everyone uses Google Instant globally, we estimate this will save more than 3.5 billion seconds a day. That’s 11 hours saved every second.
  • 15 new technologies contribute to Google Instant functionality.

Frequently Asked Questions

Can I turn off Google Instant?

If you don't want to see results as you type, you can turn off Google Instant by clicking the link next to the search box on any search results page, or by visiting your Preferences page.
Where is Google Instant available?

Google Instant is starting to roll-out to users on Google domains in the US, UK, France, Germany, Italy, Spain and Russia who use the following browsers: Chrome v5/6, Firefox v3, Safari v5 for Mac and Internet Explorer v8. Please note, users on domains other than can only access Google Instant if they are signed in to a Google Account. We will continue to add new domains and languages over the next several months.
Will Google Instant slow my Internet connection?

We anticipate that Google Instant will not slow your Internet connection, and we plan to automatically turn it off for very slow connections. Even though we are serving more results pages, the additional load this enhancement creates is very small when compared to other types of web services such as streaming video and online gaming. We’ve also worked hard to minimize the amount of data that is sent and received during the search process. For example, when rendering new results as you type, we only send the parts of the page that change, without updating the static elements, such as a the page frame around the results.
I love Google for its simplicity and I usually know what I want to type. Is Google Instant just a distraction for me?

With Google Instant you don’t lose any of the functionality that you know and love about Google. If you want to type your full search term and hit enter, that still works just as it always has. Even for the experienced searcher, though, instant feedback can help you narrow in on the precise results you want, which may have taken several searches before. On top of that, we estimate that about half of your searches will be returned in net zero time because the results you want will appear before you finish typing.
If an offensive or lewd word is a fraction of my query, will Google push these results in front of me as I type?

As always, we provide options to filter the content you see in search. You can choose to set SafeSearch to filter out explicit content, and parents can lock SafeSearch to the strict setting. In addition, autocomplete excludes certain terms related to pornography, violence and hate speech. Learn more about SafeSearch.
Does this change impact the ranking of search results?

No, this change does not impact the ranking of search results.
Is Google Instant available on mobile?

Google Instant is not yet available on mobile, but we plan to release it soon.

Blog Widget by LinkWithin