All posts under tagged ‘Dialplan’

Feed for all posts filed under "Dialplan"

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.

Asterisk 1.4 branch, what changes did it bring? Updated

Source: snapvoip.blogspot.com

Following an article on Asterisk blog by Russell, "Sneak peek at new features" and provided a link to SVN reository. Following is a part of it (85 lines, there are 235 lines of description). I was surprised that so many features had sneaked by and yet we are happy to use…!

UPDATE!
Seems like formatting makes this impossible to read;

So you have to go Asterisk developer site (SVN repository) see the complete document.Thanks
1 -------------------------------------------------------------------------------    2 --- Functionality changes since Asterisk 1.4-beta was branched ----------------    3 -------------------------------------------------------------------------------    4      5 AMI - The manager (TCP/TLS/HTTP)    6 --------------------------------    7   * Added the URI redirect option for the built-in HTTP server    8   * The output of CallerID in Manager events is now more consistent.    9      CallerIDNum is used for number and CallerIDName for name.   10   * enable https support for builtin web server.   11      See configs/http.conf.sample for details.   12   * Added a new action, GetConfigJSON, which can return the contents of an   13      Asterisk configuration file in JSON format.  This is intended to help   14      improve the performance of AJAX applications using the manager interface   15      over HTTP.   16   * SIP and IAX manager events now use "ChannelType" in all cases where we   17      indicate channel driver. Previously, we used a mixture of "Channel"   18      and "ChannelDriver" headers.   19   * Added a "Bridge" action which allows you to bridge any two channels that   20      are currently active on the system.   21   * Added a "ListAllVoicemailUsers" action that allows you to get a list of all   22      the voicemail users setup.   23     24 Dialplan functions   25 ------------------   26   * Added the DEVSTATE() dialplan function which allows retrieving any device   27     state in the dialplan, as well as creating custom device states that are   28     controllable from the dialplan.   29   * Extend CALLERID() function with "pres" and "ton" parameters to   30      fetch string representation of calling number presentation indicator   31      and numeric representation of type of calling number value.   32   * MailboxExists converted to dialplan function   33     34 CLI Changes   35 -----------   36   * New CLI command "core show settings"   37   * Added 'core show channels count' CLI command.   38     39 SIP changes   40 -----------   41   * The default SIP useragent= identifier now includes the Asterisk version   42   * A new option, match_auth_username in sip.conf changes the matching of incoming requests.   43      If set, and the incoming request carries authentication info,   44      the username to match in the users list is taken from the Digest header   45      rather than from the From: field. This feature is considered experimental.   46   * The "musiconhold" and "musicclass" settings in sip.conf are now removed,   47      since they where replaced by "mohsuggest" and "mohinterpret" in version 1.4   48   * The "localmask" setting was removed in version 1.2 and the reminder about it   49      being removed is now also removed.   50   * A new option "busy-level" for setting a level of calls where asterisk reports   51      a device as busy, to separate it from call-limit   52   * A new realtime family called "sipregs" is now supported to store SIP registration   53      data. If this family is defined, "sippeers" will be used for configuration and   54      "sipregs" for registrations. If it's not defined, "sippeers" will be used for   55      registration data, as before.   56   * The SIPPEER function have new options for port address, call and pickup groups   57   * Added support for T.140 realtime text in SIP/RTP   58   * The "checkmwi" option has been removed from sip.conf, as it is no longer   59      required due to the restructuring of how MWI is handled.  See the descriptions   60      in this file of the "pollmailboxes" and "pollfreq" options to voicemail.conf   61      for more information.   62   * Added rtpdest option to CHANNEL() dialplan function.   63   * Added SIPREFERRINGCONTEXT and SIPREFERREDBYHDR variables which are set when a transfer takes place.   64     65 IAX2 changes   66 ------------   67   * Added the trunkmaxsize configuration option to chan_iax2.   68   * Added the srvlookup option to iax.conf   69   * Added support for OSP.  The token is set and retrieved through the CHANNEL()   70      dialplan function.   71     72 DUNDi changes   73 -------------   74   * Added the ability to specify arguments to the Dial application when using   75      the DUNDi switch in the dialplan.   76   * Added the ability to set weights for responses dynamically.  This can be   77      done using a global variable or a dialplan function.  Using the SHELL()   78      function would allow you to have an external script set the weight for   79      each response.   80   * Added two new dialplan functions, DUNDIQUERY and DUNDIRESULT.  These   81      functions will allow you to initiate a DUNDi query from the dialplan,   82      find out how many results there are, and access each one.   83     84 ENUM changes85....235.....So you have to go Asterisk developer site (SVN repository) see the rest of the lines."Sneak peek at new features"

Published on July 2nd, 2007 under , , , , , , , ,

Asterisk: The Future Of Telephony under under the Creative Commons license

Source: snapvoip.blogspot.com


O’Reilly Media has released the Asterisk: The Future Of Telephony under under the Creative Commons license. Kudos goes to O’Reilly Media and the three authors, Jim Van Meggelen, Jared Smith, and Leif Madsen. Download links and Authors links are under the links at the bottom of the post.
Once I know the rules, I will post it in IPTELEPHONY in Google Groups.
Asterisk: FOT has received wide attention in the VoIP and IPPBX realm. It is a very well put together book that appeals to new comer to Asterisk as well as to the IPPBX pro. For information, I have listed the contents of the book below.

Contents of the Asterisk: The future of Telephony
Foreword

Preface

1. A Telephony Revolution
VoIP: Bridging the Gap Between Traditional Telephony and Network Telephony
Massive Change Requires Flexible Technology
Asterisk: The Hacker’s PBX
Asterisk: The Professional’s PBX
The Asterisk Community
The Business Case
This Book

2. Preparing a System for Asterisk
Server Hardware Selection
Environment
Telephony Hardware
Types of Phone
Linux Considerations
Conclusion

3. Installing Asterisk
What Packages Do I Need?
Obtaining the Source Code
Compiling Zaptel
Compiling libpri
Compiling Asterisk
Installing Additional Prompts
Updating Your Source Code
Common Compiling Issues
Loading Zaptel Modules
Loading libpri
Loading Asterisk
Directories Used by Asterisk
Conclusion

4. Initial Configuration of Asterisk
What Do I Really Need?
Working with Interface Configuration Files
FXO and FXS Channels
Configuring an FXO Channel
Configuring an FXS Channel
Configuring SIP
Configuring Inbound IAX Connections
Configuring Outbound IAX Connections
Debugging
Conclusion

5. Dialplan Basics
Dialplan Syntax
A Simple Dialplan
Adding Logic to the Dialplan
Conclusion

6. More Dialplan Concepts
Expressions and Variable Manipulation
Dialplan Functions
Conditional Branching
Voicemail
Macros
Using the Asterisk Database (AstDB)
Handy Asterisk Features
Conclusion

7. Understanding Telephony
Analog Telephony
Digital Telephony
The Digital Circuit-Switched Telephone Network
Packet-Switched Networks
Conclusion

8. Protocols for VoIP
The Need for VoIP Protocols
VoIP Protocols
Codecs
Quality of Service
Echo
Asterisk and VoIP
Conclusion

9. The Asterisk Gateway Interface (AGI)
Fundamentals of AGI Communication
Writing AGI Scripts in Perl
Creating AGI Scripts in PHP
Writing AGI Scripts in Python
Debugging in AGI
Conclusion

10. Asterisk for the Über-Geek
Festival
Call Detail Recording
Customizing System Prompts
Manager
Call Files
DUNDi
Conclusion

11. Asterisk: The Future of Telephony
The Problems with Traditional Telephony
Paradigm Shift
The Promise of Open Source Telephony
The Future of Asterisk

A. VoIP Channels

B. Application Reference

C. AGI Reference

D. Configuration Files

E. Asterisk Command-Line Interface Reference

Index

Links;
download book as a single entity,a PDF file.(4.5MB) USA1 USA2 UK NL
Download each chapter is a seperate PDF file (3.1MB) USA1 USA2 UK NL
O’Reilly Media
Jim Van Meggelen
Jared Smith
Leif Madsen

OpenPBX RC2 is ready for testing.

Source: snapvoip.blogspot.com

If you not heard before, OpenPBX.org is a community driven software PBX project.OpenPBX in the same line of Asterisk but with differences. The most important differences between OpenPBX and Asterisk are;
Built-in STUN support,
The use of SpanDSP for better codecs
Full T.38 fax over IP support
Sqlite instead of Berkeley DB
Universal jitterbuffer,
POSIX timers to avoid Zaptel timing dependencies
Greater speed
Efficient dialplan execution.

Support is via mail list and Wiki
I am testing the current release on a FreeBSD 7. But I have not come across any major issues. I did have some trouble, my own making, with Zaptel drivers. You can help out the development by testing on your favorite platform, which includes NetBSD, FreeBSD 6.2 and 7, Mac OS X, and of course your favorite, happy feet, linux distribution.

Links;
OpenPBX home
OpenPBX wiki
OpenPBX mailing list

Published on November 27th, 2006 under , , , , , , , , ,

Member of "Hype Media! Network"