 Good afternoon. I am Mark Michelson, 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 at 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 Think about the asterisk IRC channel for any of you 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 got into 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 in 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 as 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 funx 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 some 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 you know higher end codecs like codec g7 22 are also defined here The formats on the other hand have to do with file format operations So if you have for instance a wave 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 chan sip 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 chan eeks to is is the channel driver for that and Another VoIP channel driver that I have here is the chan h323 driver There are also other channel drivers for non-tradit for more traditional telephony such as ISDN and analog calls as well And then another directory is the test directory, which is it's still kind of in 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 the GPL and under a commercial license as well And so for pure GPL modules We couldn't just include that with asterisk because it was a it would if we included with a commercial module it then customers would have to always Have the 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 plant functions and such that you already understand and try working down from there to the core It's probably it's a slow process, but it's 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 You know 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 of the coding guidelines a lot of Submissions that we get for new modules and bug fixes and stuff You know they're perfectly fine except they just don't fit the coding guidelines So we tell them to redo their patch and of course you know it would just be time saving if people got it right to begin with So read the coding guidelines and if you have any you know questions about how to do things You know 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 You know they have there's the audience of those two some 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 module and Sort of on the same lines is 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 dot asterisk org. That's our issue tracker where we have both new features and bug reports get 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 resource to resources to work on those bug reports So we try to get you know some immediate feedback right away Just because you know some people people just really don't like having their issue ignored outright So you'll try to get some you know just some immediate high-level feedback from from our lead bug Marshall And then after that it's just a matter until it comes up in our queue as far as you know being high enough priority to get a lot of focus And of course if you get some sort of negative feedback from a bug Marshall Don't take that as 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, it's just a matter of just following through whenever you get some sort of negative feedback and 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 Brian 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 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 will be a great time I'll put the links page back up just in case people want to copy those down No questions