Asterisk Tutorial 06 – Asterisk Dialplan Introduction [english]


So hello and welcome to another episode of the void guys and back to our astrick tutorials series introducing asterisks we are talking about today, bow plans and how to set them up, and so Mattias introduced us to the concept of table um last time. What did we lost him? Just talk about it, we reduced the two phones, one is the softphone on my computer and this is dead one and the other one is here on our desk yeah, it’s a hardware in her telephone yeah, and then we can have a quick look at our configuration. If I say sip show peers in the asterisk console, we talked already about all that stuff. Then I can see I have the two phones.


One has that IP address the other one is the other IP address yeah. That’S it and then last time we also mentioned. If I try to call something i’m mateus here and I want to call you James, then I just want to dial 100, for example. I died that and what happens he says, call raw materials, because I died something her extension 100 rejected because of extension, not found in context phones back to these contacts again back to those contexts again talk so first thing is that we talk about the concept of Asterisk and what is a context in what is a diet plan? Okay, so the first thing you have to understand is that asterisk is organized in contexts.


Okay, so you can define a context for each thing. You can say all my phones. If you pick up the phones start in context, phones, okay, you can say every call which is coming from outside goes to context incoming okay. If I want to do an outbound call, it goes to context outgoing or thumbs. Okay.


Rather, what is a context? A context is a kind of namespace right and you can do things in there and they do not touch the other things in other contexts. Okay, so if you’re talking about extensions yeah, then they could the context a that with extension, 100 and context, be also with extension, 100 yeah. So it’s a different name space. We will start first with only one context: it won’t be not too confusing.


Okay, yes, but he gets that yeah only one context and we will define it. If you pick up a phone, then he will go to the context. Phones yeah, as you already saw in our st risks, Eli and it tries to go to phones. Why is this? Because we told in the sitcom file that each phone should go to that context or you can have another look yeah.


No to that again, I am – and this is the first step to not to understand what understand the concept you have context, but not how we should use them and how we should know just to keep it simple. Okay, we just start with one context and then there is another thing the call starts in that context. Yeah you called the whole thing, a diet plan yeah, and then he looks what should I do now and he looks into that context. This context does not exist or there are no configuration lines in that context, so he says I can do nothing and stop here that all right. So how is the diet plan working?


He searches for an extension or whatever you died. You can also dial a name. Okay, yeah: it’s not usually a dialing number, he searches for the number in that context, and then he tries to find that number. Okay and you have to define that number yeah and maybe, if I call one hundred then he has to search in that context. For the extension 100, okay and then he does something.


Maybe he locks the call in a log file. Maybe he makes a look up to database uh-huh? Maybe he does. I don’t know, but at the end he should do a call who you he should die. Your phone, so it’s basically the configurations behind how the coolest babblin together and broken down again mm-hmm and it’s one line after the other.


So you say first, if you dial 100, go to the context, blahblah search for 100 into first that one second, that one third that one. So it’s really easy and it’s line by line what he should do in it. Okay and this concept is called the die plane. Okay, it’s very easy, but it can become very complex. I can imagine yeah yeah yeah, especially with the large systems.


Okay, then we will have a look to the base okay now and see, and try to understand why that happened. Why did we get deadlines? So the first thing is, we have to go to ET see asterisk sip conf again this is our SIP conf, as we left it last time, and here you can see that context yeah last video as I just ignore it, but now we have to explain it So here you can define the context, and this is the starting point of the die plan for those two telephones. Okay, if I want to, I could say context James and context matthias. Then there would be two different contexts.


They could not see each other and I have then to jump from one context to the other pair, but to make things easy into garden to understand it. We just throw every call into the context: phones, okay, so this is the first thing we have to do. The second thing we have to do is to configure the die plan. There is the main file where you can do it. It’S called extensions dot-com and, as in one of the last tutorials you just copied, because it’s really huge okay and the documentation is again inside right.


Okay, um – and maybe it’s very confusing for you alright, so we call it Eckstein and start original or something like this, and then we just do it do a trick with a a hoe, a cow, nothing into extensions, come and then we get an empty file. Aha now another editor, so we have an empty file here and I want to start with an empty file because to explain all the concepts and and that we can define something. So first we do is define a context. You can do it in brackets and you say phones. This opens an context.


You can have more of them blah it’s a special context. Yeah and those are our namespaces. There are some predefined contexts. We can talk about them later. I just want you to understand.


Okay and what’s going on and then we have to write a kind of die plane. Okay, in that context, how does that work? You say X, 10, make that error and exten means extension yep and then you say 100 and then you say 1. That means first, you do okay, and then you can provide an application like no up. Nope is a great application.


It does nothing, it does just print something on the s3 see like okay, you want to so it’s good for testing, and then we say first line. So and then we can say: yes, that’s not enough again. If somebody does 100 a second do again, no op second line and because we’re going crazy. Now we add a third line and we say hang up. If you do not hang up a call, then it waits for a timeout all right and then it just hangs up okay.


So this is our short dial plan. Okay, and we can try now if it works. What do we expect if we die 100? It go to the context, phones, it searches for 150 died. 100.


Then it first should print first line. Then it should print second line and then he just should hang up. Okay. This is not very useful but yeah. It’S useful to understand the concept.


So I go out of there. I go back to the asterisks Eli and now, as we mentioned before, it’s not directly online. You have to reload the dial player and there is a special command line. You can say diet line reload, then it only reloads. The diet line or has got a little tap yeah and the next important thing it.


You can see arrows alright if there are arrows in your diet plan. If you made a mistake, you could see now and now. If we are lucky and I dial 100, then it should find our context in print the lines 100. Maybe the very positive level is not high enough again. It was not high enough.


Another tip. You need three Wiis: okay to see the iPod okay Tyler, and here you can see now what happens at last time. We just get the error message yeah and now we can see he searches for phones, for the context, phones and at that context he searches for 100 and he does first first line then second line, and then he hangs up yeah. So that’s it, and here you can see your channel your channel ID who you are, who does this and what’s going on yeah? Okay, so I think that’s far enough for our first tutorial and we are lucky, then we could buy something and that we can see the response yeah.


What’S next in the next tutorial, we will try to really dial another telephone call heck, but the concepts are the same yeah and then we will try to make it even better, because what I now typed is the most expensive the most longest way you can type A diet plan there are many short things that you can do it. I fast okay, um, and we will see this okay stuff next time, so there you have it next time we have shortcuts and so on. Thank so much for watching. If you want more information about past karma moby-dick, please do a website, WWF now you’re right! You, you

You May Also Like