We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

asterisk: An introduction to Asterisk Development

00:00

Formal Metadata

Title
asterisk: An introduction to Asterisk Development
Title of Series
Number of Parts
97
Author
License
CC Attribution 2.0 Belgium:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
A brief introduction to the tools used in Asterisk development, as well as the structure of the program. Information regarding how to submit new features and bug reports will be included as well. Asterisk is an open source telephony platform, commonly used to implement PBX's.
5
15
Thumbnail
48:33
41
Thumbnail
35:21
47
48
Thumbnail
1:03:30
50
75
Thumbnail
50:56
94
Software developerComputer animationXMLLecture/Conference
CodeTerm (mathematics)Software bugTraffic reportingOpen sourceBranch (computer science)Order (biology)Mechanism designCodeDifferent (Kate Ryan album)AstrophysicsPoint (geometry)Electronic mailing listLevel (video gaming)Link (knot theory)Computer animation
Mobile appDialectFunction (mathematics)Core dumpComputer fileInclusion mapOpen sourceSoftware testingCodierung <Programmierung>File formatOperations researchLatent heatCommunications protocolDevice driverDevice driverInternettelefonieAnalogySession Initiation ProtocolImplementationCodecSoftware testingDirectory serviceFrame problemComputer fileCore dump1 (number)CodeMultiplication signModule (mathematics)Point (geometry)File formatSystem callAreaSingle-precision floating-point formatCartesian coordinate systemFunctional (mathematics)Latent heatDialectMobile appData structurePlanningInclusion mapWritingKey (cryptography)Communications protocolSimilarity (geometry)Codierung <Programmierung>Reading (process)Operator (mathematics)QuicksortBitMixed realityClient (computing)Instance (computer science)Form (programming)Open sourcePhysical lawComputer animation
Open sourceModul <Datentyp>Category of beingRepository (publishing)Flow separationDirectory serviceRevision controlFitness functionSource codeCodeCategory of beingFunctional (mathematics)Computer fileMusical ensembleInstance (computer science)Module (mathematics)OntologyHand fanPlastikkarteComputer animation
CodeModul <Datentyp>Skeleton (computer programming)Basis <Mathematik>Data modelElement (mathematics)Configuration spaceCodeQuicksortCodeSession Initiation ProtocolSkeleton (computer programming)Endliche ModelltheorieSoftware bugDirectory serviceModule (mathematics)Functional (mathematics)Element (mathematics)Scaling (geometry)Software testingLine (geometry)Mobile appEmailPatch (Unix)Computer fileElectronic mailing listBasis <Mathematik>Device driver2 (number)Amsterdam Ordnance DatumSoftware developerCore dumpPoint (geometry)Instance (computer science)Case moddingProcess (computing)Cartesian coordinate systemPresentation of a group
CodeCoding theoryFeedbackFeedbackTraffic reportingMultiplication signSoftware bugQuicksortPatch (Unix)Point (geometry)Focus (optics)Queue (abstract data type)Code
Link (knot theory)Software developerModule (mathematics)QuicksortSystem callBlogModule (mathematics)MereologyCASE <Informatik>Link (knot theory)2 (number)Probability density functionMathematicsSoftware developerRoutingRepository (publishing)Slide ruleWeb pageMultiplication sign
XML
Transcript: English(auto-generated)
Good afternoon. I am Mark Michaelson, and of course what I want to talk to everybody about is an introduction to Asterisk development. Asterisk, by the way, is a
is a it's an open source telephony engine. Now the thing is I find that whenever I go to open source conventions and such, most people have heard of and possibly also used Asterisk, but most of them haven't taken the you know the plunge to try to actually start developing it. So that's why I'm here today. So the very first thing you have to do in order to develop Asterisk is you have to get code.
And I've only provided three links. There's a whole bunch more Asterisk branches which have specific features in them and such, but the biggest thing you'd want to be getting is either the trunk if you were interested in say writing a new feature, if you are interested in just seeing what the latest and greatest
official release is, you would get the 1.6.2 branch, and if you're looking at the one that most people are still using these days because it's the latest long-term release branch, you would go with the 1.4 one. So after you've gotten the code, I say the best thing to do if you want to start developing Asterisk is to actually use it first. Because it makes a huge difference if you understand the mechanics of it, at least at the user level, before you start trying to develop.
And then the next thing you want to do is try to, you know, reach out to some of the community. If you have questions, specifically user questions, there's the Asterisk users mailing list, the pound asterisk IRC channel, and if you have a bug report that you want to discuss, you can go in the asterisk bugs IRC channel as well.
The thing about the asterisk IRC channel, for any of you who have never been in there before, there are some quirky characters in there, and while they may seem like total assholes, they are, you know, they mean well. So, you know, give them a shot at least.
So, all right, so you've gotten to the point now where you've used Asterisk a little bit, and so now you want to start looking at the source. Now, a lot of people, when they open up their Asterisk directory, they start looking at this source, and they go, oh, forget this. There's way too many directories and way too many files. I don't know where to even start looking. So, that's why I'm here, and I'm not going to go over every single directory or file in Asterisk because that's pointless.
I'm just going to go over the main ones that most people would actually want to code in, should they actually decide to write Asterisk code. So, the very first two we got include and main. These are the only two that I'm going to go over that don't have anything to do with loadable modules. The include file really goes without saying. It's .h files that all the files in Asterisk include.
The main directory has APIs that are defined by the core. Things like, for instance, the Asterisk channel structure, which is one of the most basic key structures in Asterisk, has all of its APIs defined in the main directory, as
well as the PBX core and other APIs that are just used all over the source. The next directory I want to discuss is the apps directory. The apps directory contains dial plan applications from within Asterisk. So, for anyone who's used Asterisk before, you've probably used things like dial and voicemail and possibly other
applications, and these are all contained within the apps directory. I also put in here in parentheses that this is a great starting point because, for most people who use Asterisk, this is what they see or what they feel like they see when they're using it. So, this is a good point to look at and see what sort of core API calls are being called there, so that you can
then possibly dig deeper from that point. Then there's the funcs directory, which is dial plan functions, which dial plan functions are similar to dial plan applications, but they focus more on reading and writing specific values. Rather than actually executing applications.
The next two directories can be kind of confusing for some people because they seem sort of similar. You have the codecs, which are encoder decoder modules for specific audio formats. Like, here in Europe, the codec A-law is probably the most commonly used for telephony. And then, of course, other higher end codecs like codec G722 are also defined here.
The formats, on the other hand, have to do with file format operations. So, if you have, for instance, a WAV file and you want to be able to read a frame of audio from it, this is the format module is how that's done. The next directory is one that a lot of people like to dabble into.
It's the channels directory, and this has the specific channel drivers that Asterisk implements. Asterisk, you know, the most common one that people hack on there is chancip because SIP is a protocol that has just a myriad of new features that could be added to Asterisk, and a lot of people want to get their hands dirty and go into there.
Asterisk also has its own specific voice over IP protocol. It's called the inter-Asterisk exchange protocol. ChanX2 is the channel driver for that. And another VoIP channel driver that I have here is the ChanH323 driver. There are also other channel drivers for more traditional telephony,
such as ISDN and analog calls as well. And then another directory is the test directory, which is still kind of in its infancy right now because there just haven't been a whole lot of tests added, but we're focused on adding a lot more,
and this is actually a great area for people to contribute to if they're looking to do that in Asterisk for the first time. Also in the trunk version of Asterisk, there's an add-ons directory. It used to be that Asterisk add-ons was a separate repository from Asterisk itself
because the code that it contained was licensing compatible with Asterisk. Asterisk is dual licensed. It's licensed under both GPL and under a commercial license as well. And so for pure GPL modules, we couldn't just include that with Asterisk because if we included it with a commercial module,
then customers would have to always have the source code for those postable, and most commercial customers are not fans of that. And then the final directory is kind of the wildcard directory. It's the res directory. Res is short for resources. And res contains files that really just don't fit in any other category.
So for instance, the music on hold API and functionality is in the res directory because it really just doesn't fit anywhere else, really. So you have a brief understanding of the directories now within Asterisk, so how do you start?
Well, as I said before in the presentation, I think using Asterisk is a great way to start. Start with applications, dial-plan functions, and such that you already understand and try working down from there to the core. It's a slow process, but it's the best way to do it, though.
And then of course, if you decide that you're not going to actually use Asterisk, I'd say start with an element of telephony that you're familiar with already outside of Asterisk. So for instance, if one of you out there is a SIP guru of some sort and you want to add some sort of SIP feature to Asterisk that you know is not there, you may just start looking in the SIP channel driver and just add your code directly there without even having used Asterisk.
Now the second thing, of course, is read the coding guidelines. A lot of submissions that we get for new modules and bug fixes and stuff, they're perfectly fine except they just don't fit the coding guidelines, so we tell them to redo their patch. And of course, it would just be time-saving if people got it right to begin with.
So read the coding guidelines, and if you have any questions about how to do things, you can probably look at some existing code and just model yours after the way it's done. Feel free, of course, also to ask development-related questions. There's an IRC channel, pound asterisk dev, and an asterisk dev mailing list,
both of which, the audience of those two somewhat overlap, but I think the asterisk dev mailing list has a lot more subscribers to it. Also, there's two skeleton modules which are defined in asterisk. There's a test scale and an app scale, which they don't actually do anything themselves,
they're just modeled as a basis for you if you want to write your own asterisk module. And sort of on the same lines as reading the coding guidelines, if you have some function that you want your new code to do, for instance, asterisk is highly configuration-file driven, so if you want your new module or whatever to be able to read a configuration file,
you could try to go and memorize the API, but that seems kind of silly when you could just use code that you know already reads a configuration file and use that instead. So, you get to the point now where you've actually written some code. So the very first thing I would suggest that you do
is you upload your patch to issues.asterisk.org. That's our issue tracker where we have both new features and bug reports posted there. And then after you do that, you have to be patient because we have a lot of bug reports
and unfortunately we don't have unlimited resources to work on those bug reports. So we try to get some immediate feedback right away just because some people just really don't like having their issue ignored outright. So you'll try to get some immediate high-level feedback from our lead bug marshal and then after that it's just a matter until it comes up in our queue
as far as being high enough priority to get a lot of focus. And of course if you get some sort of negative feedback from a bug marshal don't take that as a defeat because most of the time they're not just going to reject anything outright they're just going to tell you do it a different way.
And so it's really just a matter of just following through whenever you get some sort of negative feedback. And finally I have some very helpful links for any of you who are interested in Asterisk. First of all, if you're not one who's used Asterisk before
the first link I have here, which is a freely downloadable PDF of a book called Asterisk, The Future of Telephony, second edition gives a very detailed look at how to install, set up, and make calls with Asterisk as well as pretty much any sort of feature you would want to be able to use as a user.
My colleague Russell Bryan, who's also here with me, has a blog post of his, it's a three part blog post which explains how to write an Asterisk module. I have the link to part one here in my slides and you can replace the one with two and three to watch parts two and three. And if you do decide to go down the development route
I highly suggest that you check out asterisk.org slash developers because that has instructions ranging from how to merge changes within our SVN repositories as well as documentation for our APIs and other developer related resources that you might need.
And that's it for my talk. I've got about five minutes left, so if anyone has any questions now would be a great time. I'll put the links page back up just in case people want to copy those down.
No questions?