Asterisk Tutorial 35 – Session Initiation Protocol in Detail [english]


hey guys welcome to yet another episode from the web guys last time around we had a rather detailed introduction to the SIP protocol and what the protocols thick yeah okay so I was initiated protocol and description protocol and then the real time protocol for payload transmission and so on we gotta go Matthias is gonna go a little bit further this time around into the actual protocol itself and yeah so what are we getting okay we have a look to the slide again um this is the slide from the last episode and here we have to real-time protocol which is actually the payload and sip n session description now we have a look in detail to the first protocol okay which is the SIP protocol and we see how that works if we understand that and then became Deepak I think the most things okay so it’s important to understand that and it’s really easy to understand yeah it’s easy to understand because you can really read the SIP protocol okay so it’s not a kind of unreadable machine generated blah blah it’s machine generated but it’s not it’s not optimized for machine read and write it’s optimized that humans can read it okay that’s gonna optimize but it’s okay for humans to read it right I mean to understand it and that’s very important and that makes really makes it easy if you understand it all right you can really read a heart this is the side a ones that aside p1 state and you can understand it try to see where the problem is okay it’s human really that’s the advantage of the SIP protocol and I think this is a part of the success the SIP protocol because it’s easy to read understand and to implement not for everybody but who has to implement it or has to read it or debug it it’s just easier than okay we will have a look at it it works like this here we have such a session initiation what’s important to understand in most cases you have two so-called core legs one from your phone to the PBX you’re using or the soft switch or how you ever call it grease should not say P weeks you should say the advanced super system unified communicate our system yeah does not matter some system if you can which means be sip means in between and then there is another colic to the phone to phone to can be the PSTN this can be the landline this could be the GSM network or something or this could be a gateway or blah blah blah but how to understand it and to see that it’s not that complicated we have from a some kind of PBX which could be the Moby Dick and another phone mm-hmm so how does this work this is a very friendly protocol at first you get an invite that’s always nice yeah that’s nice yeah you get an invitation and a phone one says I invite phone to please I want to talk to phone – and then the PBX answers I’m trying okay and then the PBX invites the second phone and tries to call the second phone so there is much in between there could be something like hey you’re not allowed to please send authentification than you would send again and invite without an education so in this very easy example there is no off but yeah you can see that it’s really friendly and it’s really readable so you have to invite then it invites the phone be it is ringing then the PBX system signals okay this is ringing and then we have the situation this phone makes this phone rings right then there isn’t okay that happens if somebody answers the call on this side and okay and an okay back to the other phone that now we can talk and Hawk is going back that everything is okay and then the session is established uh-huh and from this point on we are sending media RDP so the media is now going from one phone to the server and from the server to the other phone yeah and this is very important this is the standard behavior of asterisk okay so if you have a asterisk system which is like Moby Dick asterisk system then the standard behavior is exactly like this media from here to there and from the PBX to the second phone okay this is very important to understand so the signaling is done between always the signaling is done between asterisk and the phones yep and the RTP stream is also running over asterisk but not in every case we will see that this is another case possible if you remember on the last video we said RDP is completely independent not completely but it can take an other way through the network I have the app dynamo then the invitation in the new SIP protocol then there is another way the phones could do something which is called re-invite so they can talk and say hey phone you reachable through the asterisk Irvin and other phones as yes and but we could talk directly to each other if you want to we don’t need the PBX system AHA and then they can send directly data from phone a to forbade to phone P I have a slide for that this is the reading right and this is how it works so the invite is the same and then followed by three in white and that’s very very important and that then the media goes directly from phone to phone be my passing the education server and now we should talk about the advantages or disadvantages when should I do this shouldn’t that’s useful to know actually yeah yeah so if you like to do something like voice recording or recording of course yeah then for sure the stream has to go through the asterisk system yeah because if the s3 system does not see the stream it cannot record it uh-huh or there are some special features an asterisk like you can press a key DTMF key uh-huh and then as there is does something you can do this outside through the SIP protocol it through signaling from the SIP protocol in subscriptions and so on but in simple case you’ve just been rated somebody presses one and then the asterisk server does something okay and he has to read he has to listen to the stream and say hey this was a people know I can do something right so for example if you’re setting up your astrick system for a contact center you would probably want to use just go over this server for a cool record and culture control purposes and so on okay yes in what scenarios would you use the re-invite the rewrite is very handy if you don’t want the whole payload going through your asterisk system maybe you have 1,000 users and everybody payload which is the main Lord in the network goes through an asterisk server why you can bypass it then there there is no we are no load on the asterisk of itself okay so maybe it’s much more much more performant to do it like this or let think about your asterisk is in a data center and you will me want to call each other from one office to the other yeah we’re sitting let’s say there are 10 meters between us so by for you what happens the signaling goes through our data center gap but the payload can run from my phone on the local on directly to your phone uh-huh it’s very very good yeah and it’s much better for the server it’s also I mean for internal calls it makes sense pretty much because you don’t need any extra bells and whistles like cool recording and so on yes so you always have to think about that the parameter s to risk we will see that later is can we invite yes or no okay you allow this or not but the easiest way is to go a tool to route all traffic over the server why it works in most cases and the next thing is let’s think about you have site a and site B and they have different networks and maybe phone a is not allowed to speak to found B directly but over the PBX yeah or over the asterisks so maybe it does something and if you don’t know that it could be like this with re-invite yeah then you get really confused and you don’t know how to debug it it’s very very important for you to understand again the SIP protocol with the session description of the session initiation is one part and the other part is the payload which can go another way through your network depends on your configuration uh-huh that’s really important to understand yeah and it’s important to understand how to debug it and how to read the SIP protocol life how you can do that but there’s part of one of our next yeah when are we gonna get out to the debugging yeah yeah okay so next time debugging oh maybe a little bit more introduction than the it’s quite a complex topic so right and they have next time around we’ll go in even more depth into sip and then eventually we get ran into debugging and watching until next time goodbye all right you you

You May Also Like