Configuring, using and debugging chan_mobile on Asterisk

Source: snapvoip.blogspot.com

If you read the previous post on chan_mobile on asterisk, here is the follow up, straight from Asterisk SVN.

Configuring chan_mobile :-
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.

Using chan_mobile :-
chan_mobile.so 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

Above 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 which is like an ethernet mac address.
The Name field is whatever is configured into the device as its name (default name of the device).
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
*CLI>

As each phone is connected you will see a message on the Asterisk console :-

Loaded chan_mobile.so => (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

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

SMS Sending / 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

[incoming-mobile]
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 :-

[incoming-mobile]
exten => sms,1,JabberSend(transport,user@jabber.somewhere.com,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′

DTMF 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

[LGTU550]
address=00:12:56:90:6E:00
port=4
context=incoming-mobile
dtmfskip=50

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.

Debugging :-

Different phone manufacturers have different interpretations of the Bluetooth Hands free Profile Spec. This means that not all phones work the same way, particularly in the connection setup / initialization 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 ;) (not ME, the developer!)

Feedback, Support, Please can you make Mobile Phone X work… etc :-

as always, bugs should be reported at http://bugs.digium.com

email the man responsible for this mess at david.bowerman at gmail.com or dseeb_ on #asterisk & #asterisk-dev irc.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • blinkbits
  • BlinkList
  • Blue Dot
  • Fark
  • Fleck
  • Furl
  • Netscape
  • NewsVine
  • Reddit
  • Shadows
  • Slashdot
  • SphereIt
  • Spurl
  • StumbleUpon
  • Technorati
  • YahooMyWeb





Last 20 posts tagged "SMS"

Nokia leaves Asterisk users in the cold

Source: goebel.net

If you’re new here, you may want to subscribe to my RSS feed. Thanks for visiting!

A commentator to my last post "Why Truphone and Gizmo5 applaud that Nokia turns it’s back …

Published on August 31st, 2008 under , , , , , , , , , , , ,

On Facebook, Many SMS Apps Find Little Use

Source: gigaom.com

Earlier this morning I met with Sarik Weber, co-founder of Hamburg, Germany based mobile call back service, Cellity. He brought me up to speed on his company, but he also mentioned that they …

Published on April 20th, 2008 under , , , , , , , ,

Further improvements and a great announcement at Maxroam

Source: goebel.net

If you’re new here, you may want to subscribe to my RSS feed. Thanks for visiting!

Next week I will be at the Mobile World Congress in Barcelona and I will take my Maxroam SIM card with …

Published on February 3rd, 2008 under , , , , ,

Israeli mobile VoIP software miracle automatically connects the cheapest way

Source: goebel.net

If you’re new here, you may want to subscribe to my RSS feed. Thanks for visiting!

Last year I was nagging that "Packet8 MobileTalk could be done much better" and I was right. …

Published on January 6th, 2008 under , , , , , , , , , , ,

Configuring, using and debugging chan_mobile on Asterisk

Source: snapvoip.blogspot.com

If you read the previous post on chan_mobile on asterisk, here is the follow up, straight from Asterisk SVN.
Configuring chan_mobile :-The configuration file for chan_mobile is /etc/asterisk/mobile.conf. …

Globe7, World’s No1 VoIP Provider

Source: voip-tech.blogspot.com

Source: voip-tech.blogspot.com

Globe7 results to be, by the website My VoIP Provider, the world’s best VoIP provider, according to rates and the service provided.Globe7 offers a free software …

Published on September 27th, 2007 under , , , ,

“sipgate API”, embed sipgate into your own applications

Source: snapvoip.blogspot.com

DÜSSELDORF, Germany, September 11 /PRNewswire/ — sipgate is the first VoIP provider to give customers direct access to its system via a designated, proprietary interface. At the same time, …

Published on September 11th, 2007 under , , , , ,

Sipgate opens API for VoIP mashups

Source: goebel.net

The VoIP company Sipgate, one of the biggest in Germany with also significant business in the UK, offers a special service for developers. "Sipgate API" is a new interface to integrate …

Published on September 10th, 2007 under , , , , ,

Whole world on your phone with Mig33

Source: snapvoip.blogspot.com

When you hear the word MIG and when you are as old as me, the only thing comes to mind is the Cold war era Russian fighter Jets. But Russell Shaw pointed me to a another form of MIG. MIG33 is …

Published on September 6th, 2007 under , , ,

Socialize with Yahoo Mail via SMS

Source: snapvoip.blogspot.com

Yahoo mail is offering SMS talk or texting with new Mail interface as it emerges from beta phase,WeSeePeople: Socialize with Yahoo Mail

Published on August 28th, 2007 under , , ,

Voipbuster offers free SMS from mobile phones

Source: goebel.net

The Betamax company Voipbuster now offers free SMS from a mobile phone. I have just checked it out and it works great. You just have to install a small Java applet on your cell phone. Voipbuster …

Published on August 13th, 2007 under , , , ,

Have Skype SMS your Voicemail text: By Late 2007

Source: gigaom.com

Thanks to a deal between Skype and SpinVox, Skype customers can now soon get their voicemail messages converted to text and sent to their mobile phones via SMS. The service launches soon today, …

Published on August 1st, 2007 under , ,

Chocophone come back

Source: voip-tech.blogspot.com

Source: voip-tech.blogspot.com

It’s come back the Chocophone’s VoIP, by Abbeynet, a company located in Cagliari (Sardinia - Italy) founded in the year 2000 that operate in VoIP communication …

Published on July 19th, 2007 under , , , ,

Cheaper SMS Via Skype

Source: andyabramson.blogs.com

I’ve been using various desktop tools on the Macintosh that let me send "free" SMS from my laptop, but I haven’t really found a workable solution to sending and receiving from a personal …

Published on May 12th, 2007 under ,

Skype reduces SMS prices by 50 percent

Source: voipcentral.org

SMS messages are the cheapest and most convenient way to express your thoughts instantly with your friends and families. It does not matter whether they are offline or online. Therefore, it is …

Published on May 4th, 2007 under , ,

South African Telcos charge for Skype and SMS over their networks, mobile and broadband

Source: snapvoip.blogspot.com

VoIP IP Telephony @ http://snapvoip.blogspot.com
According to a post on MyADSK.CO.ZA, Users of Skype and a free SMS (simple messaging service) or otherwise known as text messaging will incur …

Published on March 14th, 2007 under , , ,

Free SMS To Any Mobile Phone via GizmoSMS

Source: snapvoip.blogspot.com

VoIP IP Telephony @ http://snapvoip.blogspot.comIn an email from Micheal, I learned to today that Gizmo Project/SIPphone has another sibling, GizmoSMS. Here it is straight from his email;"Today …

Published on March 12th, 2007 under , , , , ,

Live from ETel - Extending SMS and MMS

Source: www.voip-news.com

Dorrian Porter demoes Google Earth, with a soundtrack of theme music.  Really, it makes it far more interesting to watch that globe spin with suspenseful orchestral arrangements building in …

Published on March 1st, 2007 under

Live from Etel - SMS Server for Rural Farms in India - updated

Source: www.voip-news.com

[UPDATE at bottom]
Sean Blagsvedt, Head of Program Management and Advanced Prototyping, MSR India and Rajesh Veeraraghavan, Associate Researcher, MSR India take the stage.
In India, 60% of …

Published on February 28th, 2007 under

Skype Does More SMS

Source: andyabramson.blogs.com

Skype this past week put together two SMS related deals.The fact that Skype will have full blown, bi-directional SMS is very interesting. …

Published on July 29th, 2006 under ,

Member of "Hype Media! Network"