Boutique Tech Conference · 4. – 6. June in Rostock (Germany)
Picture of the talk

Particle Programming with AGI

in English by Nir Simionovich of Greenfield Technologies Ltd at AMOOCON 2009

Abstract

Asterisk Gateway Interface (AGI) is one of the most common methods of developing Asterisk applications. Issues arising from poor AGI development methodologies and traditional programming skills cause developers to develop non-scalable Asterisk AGI environments.
AGI Particle Programming (AKA: Atomic AGI) is a different approach to AGI programming, allowing a developer to rapidly prototype and develop highly scalable solutions with AGI, utilizing PHP and Web service technologies.

Nir

Additional material

Here you can find all available material for this talk.

PDFs

Audio recordings

Video recordings

The slides

There are 28 different slides. Click on them to view an enlarged version.

  1. Slide-0
  2. Slide-1
  3. Slide-2
  4. Slide-3
  5. Slide-4
  6. Slide-5
  7. Slide-6
  8. Slide-7
  9. Slide-8
  10. Slide-9
  11. Slide-10
  12. Slide-11
  13. Slide-12
  14. Slide-13
  15. Slide-14
  16. Slide-15
  17. Slide-16
  18. Slide-17
  19. Slide-18
  20. Slide-19
  21. Slide-20
  22. Slide-21
  23. Slide-22
  24. Slide-23
  25. Slide-24
  26. Slide-25
  27. Slide-26
  28. Slide-27

Transcript

Nir Simionovich: So, my name is Nir. I’m from Israel, as you can see. Oh, yes. In Israel, I’m the founder/owner/everything of a company that answers to the name of Greenfield Tech. We deal mainly with Asterisk custom development, that means not custom core development that may violate GPL code but actually hooking externally into Asterisk and developing various platforms and applications. The presentation that you’re about to see, if you’re familiar with AGI or you’re a fast AGI developer, you may scream, ah [unintelligible] that means that you’re going to see something that may piss you off. But, if you’re a traditional AGI developer, there is something here that you should learn. The previous title is more the business title. This is how I like to look at this topic because actually we’re moving complexity because AGI as is, many people will say if you’re an experienced Asterisk developer or you’re experienced with AGI. So, everything looks more or less pretty simple, but there is a very – a high level of complexity to AGI that people actually don’t realize. Just a bit about myself I found out blah, blah, blah, has been maintaining the Asterisk user group in Israel since around 2002 – 2003, more or less. And the offer two books about one about now. The second book that was published in January 2009 is actually about AGI programming and what you’re about to see is actually a primer of what the book is about. You can buy the book off of Amazon . That is true. Okay, warning: If you’re an experienced AGI developer, you may, this fine. You may, some of this information already you know. Yes, most probably. In addition to that, if you’re familiar with fast AGI, this means presentation will seem redundant. It is not. Stick around. Okay. So, what is AGI actually? If you look at AGI, AGI is defined as if you – if you look back into the history of AGI, people examined it and said, AGI very much like CGI. We have an ability to use STD and STD others. It is input and output streams out of a script and be able to actually inter – interact with Asterisk externally. Theoretically, any language can be used for AGI, even Bash. I’ve seen people writing AGI with Bash. I have no idea why they would like to do that, but they can. Bear in mind the following. The fact that you can write an AGI in any language doesn’t mean you should, okay? I can remember my first days back in 2003, writing an AGI with Java. At 10, calls on the system. 10 JVM is running. Wasn’t that fun. But then here actually dropped on my head like a ton of brick, saying, why do you do that? And then I realize that something is definitely wrong. Sorry?

Nir: Wrong with me, not with Asterisk It was wrong with me, I admit it. So, if you look at how Asterisk can, Kevin will most probably be able to correct me if I may be a little off here. Versions 1.0 and 1.2 of Asterisk were more or less single threaded. Whenever you execute it, an AGI would actually fork out of complete Asterisk and run your AGI script in that. with the introduction of multithreading and 1.4 and 1.6, we actually ended up with something a bit different. True, we still fork out a new process, but it’s not a full Asterisk a full-blown Asterisk, just a new thread. True, multithreading did go about and make things better because now we consume less resources. True. But again, the problem still lies on AGI itself because AGI is like a – a two-edged sword. It’s very easy to attack your opponent, the target that you’re trying to do. You’re to be very easy to go about and do whatever you want to do but at the same time, the minute you – you know, you pull your sword away from your enemy, you end up stabbing yourself because you did something wrong. This is your average clueless as AGI developer. Dear God, extensions.conf is one of the most annoying pieces of configuration any person ever saw, I admit it. As much as I like it – I do like it, I – I admit I like it, makes perfect sense to me. But, they took me about three years to get there. But, again, for a new developer or one that has no idea what to do, he looks at extensions.conf and says this is way too complicated to be a programming language. This is way too – on one hand, it’s too complicated to understand, on the other hand, it looks too simplistic. So, it doesn’t look like a powerful tool. So, they go about and saying, I’ll just move everything to AGI. Truly, they could – they can. Doesn’t mean they should. The main issue is actually that these clueless – I call them clueless AGI developers – never do anything twice. There is no systematic way to anything that – what they do. They write a script, they write in different script, and then another, and another one. They’re never identical. The only thing systematic about them – they’ll never write two pieces of code that behave identically because they – they evolve. As they write new code, they evolve, they become better. But it doesn’t mean that their methodology is good. Most of AGI developers, and I hope that the people in this room I – do not perceive them as such, regard themselves as script kiddies that don’t spend time developing a proper development framework. In, I guess that, in the US and Europe. People that actually develop stuff, be it an application for an IVR or an application for anything else, do regard themselves as developers. But, most developers were Icom, especially in the world of IVR, do not perceive themselves as developers. They see themselves as, we’re fancy – we’re fancy configuration editors, we’re glorified sysadmins. So, they end up believing that they should not go abandoned, we don’t need to invest time in developing a framework. What we’re actually see right now is – by the way, all the examples are in the PHP . Anybody in the – in the room that has no idea how to work with PHP, some PHP? Okay, everybody is good, okay. So – doesn’t look that here. In any case, what you’re seeing actually right now is what call – what I call an AGI wrapper. The idea of the wrapper where, in this specific case, we’re using a library called the PHP AGI , which is the default or the defacto PHP AGI library that round. What we’ve actually done here – we’re actually wrapping. We’re creating a, let’s say, a bootstrapping script for anything that we want to go about and execute with AGI and PHP AGI. The end result is that in any script that I’ll ever write, and basically they’re included over here, I will always refer to the AGI as AGI wrapper, always. I will always be able to know exactly all the scripts, will always behave identically. For example, if I open here a Asterisk log then, wherever I go within my actual script, I can go refer to sis log and I’ll have a sis log entry. If I’m referring back to AGI, I know it will be identical in every script. This is very important. We can include whatever you want as a baseline to our scripts. You can add as many includes as here. I like this specific database library. Another library that I would like to use is called the Incutio. And that’s I-N-C-U-T-I-O, that’s an XML rpc requester. Once we’ve actually established our environment in terms of – okay this is what I need. In terms of the libraries that I need to preload, these are the variables that – this is – this is the actual AGI wrapper class that I want to use, we go by and include two files basically from the actual execution line within [unintelligible] we take two perimeters. Sorry, two RV – and we use these to actually load our modules. So, we have a primary project and we have a loadable mojo. The project may have a config file, it can be empty, but at least it’s there, we can use it, and we can load our modules. So, there’s nothing new. I guess that – how many people are using some form of what you’ve just seen. Okay. So, out of a room of – let’s see, we’ve got about 30 people here? And I got three hands. That means that 10 percent of the room is actually using some form of framework which unified to execute your scripts. Be it PHP AGI [unintelligible] it doesn’t really matter. But, look at the example here. How does that relate to particle programming? Well, it doesn’t, not yet. But the idea is that to understand that, you need a framework. You need something that is unified in order to be able to work very systematically with an AGI. Sorry. Okay, particle programming or, as I call it, atomic AGI relies on a very simple rule: AGI scripts are used to traverse and process information only. What does that mean? Does that – that means that if your AGI script does exact dial, you’ve done something wrong. An AGI script will not remain active for a long duration of time. Voice and DTMF processing is performed via the dial plan. The dial plan has all the tools that you need in order to read DTMF, process them, process them, understand that they’re valid, that they’re invalid. It has all that power. There is no reason why to do that was in your AGI script. I know many developers, they go about and execute a script and the first line read data, string data. Why? What’s wrong when using playback? What’s wrong with using dial plan read? Oh, because it’s a dial plan it looks a bit more complicated. If you do that, then you’ll end up with AGI scripts that are enormous and are very hard to go by and maintain. So, right now, if we’ve got a clues developer in the – in the house right now, this is what – is what you’re probably thinking: Dial plan? No way, I’m not dealing with dial plan. Just a question, how many of you have a dial plan that looks like this? Answer, AGI, hang up. One, two, three, four – four people in the house. Well, just a very small application. Well, if it’s a small application, it’s okay, you know, but sometimes it’s okay to do something like that. But again, sometimes, if your application starts to grow, that kind of methodology will end up with a very complex AGI, unless you’re using a complex AGI, of course. And that’s a totally different story. By carefully balancing our usage between AGI and dial plan, we can create applications that scale much better than normal applications because you’re able now to do more stuff. In addition, you are relying on [unintelligible] to handle more calls because you’re freeing up resources. This is very important. A proper atomic AGI script will not remain active for a duration of more than five seconds. If your script works for more than five seconds, you’ve done something wrong, absolutely wrong. If you’re doing a request to a database and that takes too much time, then you’ve got a problem somewhere. Either your database is not [unintelligible] enough, it’s not optimized, it’s not indexed, whatever. In any case, an AGI will always return in five seconds. Why will it – why does it need to return in no more than five seconds? Answer. That’s not a rhetorical question. Exactly, if we have a person, an IVR is interactive system, we’ve got somebody on the line, yes. That’s [unintelligible] you want to do something a synchronously, that’s something else. I’m not talking about an a synchronous environment. I’m talking about a fully interactive interaction between a user. If I’m right now – okay, let’s say it’s a dating system, okay? And I’m punching in my information, duh-duh-duh-duh-duh-duh, I don’t want at the end of the input to go about and say, okay, I confirm everything and suddenly, I start hearing music while the system goes about and registers my information, doesn’t make any sense, because I want already to be in the system. I’m paying premium money for that. Sure, the solution provider or the service provider would like me to spend 30 more seconds on the premium number. That is for sure. But, me, as a customer, will find that really annoying and I will not come back to this service again. This is also very important with call centers, same concept applies. Unless it’s – you’re very good, yes.

Man: Okay.

Nir: I’ll – I’ll grant you that.

Man: Okay.

Nir: In terms of how the actual dial plan looks. This is a live example. This is a living example from a – okay, I’m going to do, there’s another slide called the shameless plug, so I’m going to do the shameless plug now. Later on today, I’ll be doing a talk about Amazon EC2 cloud computing [unintelligible]. This example is actually taken from that specific project. This example shows exactly how the wrapper is executed. Now, you’re probably wondering to yourself, what is this. This doesn’t look like working with inside a wrapper, it’s completely outside, right? Well, it’s okay to have something which is outside as long as it is very, very small. The idea of, for example, [unintelligible] session idea will just set me some form of session variable, session #, which will be carried on for all the scripts of associated with this specific channel. That goes into [unintelligible] log, goes into the database, goes into a different information system. The end result is that I can have a complete track from one side to the other on all systems. End result is you can scale result systems to whatever grove, to whatever size you want. So, why is this good? Why is this methodology – why is – why is this methodology so important to us as developers? If you use AGI to traverse information only and you make sure that your scripts to make really, really quickly, you end up freeing resources for the important thing, which is [unintelligible]. Let’s be honest [unintelligible] when it deals with many calls – let’s say, you’ve got an IVR system running 240 calls concurrently, that’s a resource. That’s a resource hog, it will consume a lot of resources. And you want to free those resources for [unintelligible] because it needs them. But, sometimes, property development techniques will actually free up 15 – 20 – 22 percent more resources for [unintelligible]. So, in a normal system, that means what? Another PRI circuit? 30 more channels? Maybe 60 more channels, depending on your platform. (Coughs) Sorry. We’ve conducted may test with the various customers with various, let’s say, operational systems, various applications, we’ve always seen like this. I call it the glass ceiling which we never – we were never able to surpass in terms of load average. You’re able to surpass it in terms of the number of concurrent channels that we’ve got. We ended up with systems running on, let’s say, single quad-core – quad-core [unintelligible] single process or quad-core, running up to 200 concurrent channels with a load average of 1.5. The load average was mainly it was not CPU. Anybody familiar with this thing? How many? I’d like to know. I – I’ve got one, I’ve got two. Who else? Just two? What do you do with it.

Man: [unintelligible]

Nir: Oh, you know him? You can tell him this. Because, I’ve patched that thing over and over. How about you, what do you do with it?

Man: [unintelligible]

Nir: Billing. Billing for? Calling card platform? Again, hundred people? Small time operator? Yes, why not? Okay, [unintelligible] billing is a wonderful example of how not to write AGI scripts. Why is that? First of all, AGI [unintelligible] billing executes AGI – the dial command directly from the AGI script. What happens is that, let’s say you’ve got 50 calls, now you’ve got 50 instances of PHP running in the background. Each one has its own environment, has its own memory, has its own – has everything. These are inter – this is an interpreted language. So, I have 50 instances of [unintelligible] running at the same time, while I’m having [unintelligible] on the other side. Now, if any of you have been using [unintelligible] billing, you know, there’s this thing over there called zombies. It never dies right. And you end up with like, a thousand zombies on your machine. Dial application, meet me application, voicemail – each one of these are considered a blocking application. Why is it blocking? Because, as long as the user is currently interacting with it, it will not exit. So, if I’m running a blocking application with – from [unintelligible] AGI, till that application ends, the – my AGI script is still in the air, still consuming resources. That’s a bad practice to handle. Execution of a blocking AGI again always on an AGI script remaining in midair till the application completes. Now, that’s if – if your script is PHP. And PHP usually has some form of limitation on how long your process is allowed to remain active. So, you may – you may end up with very weird results. For example, this is why [unintelligible] billing requires to be run as that AGI. Not as AGI. If you run [unintelligible] billing as a normal AGI, the billing doesn’t work. You’ve noticed that? any of you’ve ever noticed that?

Man: No.

Nir: Okay. What?

Man: [unintelligible]

Nir: You don’t run it. We have our own? Yes. Okay. So, doing it the wrong way will consume resources like crazy. I’ve seen systems that crash after 50 calls with [unintelligible] billing. So, what we do? We add more CPU, more memory. And you end up with systems that have duo-quad core, 16 [unintelligible] and a shit load of disk, and it will do what? 140? 160 calls? Great. But, what if we need more? So, essentially, what we say is, the more resources are free, the more calls we can handle. In other words, less is more. If you do less inside AGI and return back the control to [unintelligible] you will gain more resources, you’ll be able to do more calls, you’ll be able to handle more sessions, and always remember that. Fast AGI, if you’re familiar with Fast AGI, you’re probably wondering, this is completely redundant. Fast AGI is a completely external, I’m running my Fast AGI server. I’m using [unintelligible] Java or I’m suing [unintelligible] .net, God forbid, or whatever. But, it’s completely external, so I don’t really care. True, I admit, Fast AGI is slightly better than this methodology, actually. It may surpass it by 10 percent, but there is a difference. The added value of using this methodology is the fact that the rapid development of that is surpassing any development time you will do with fast AGI. And that is for a fact. I’ve seen – well, it all depends on your experience with Fast AGI, true, I admit. If you’re an experienced AGI developer, then yes. Fast AGI and this will be actually the same. And I can see, and actually, I can see Tim like, smiling, yeah, right. You’re right. But, if you’re, let’s say, an intermediate developer, somebody who’s just starting off. This methodology will enable you to write something really fast and it will be really scalable. Additional – additional modules that I like to include are XML rpc requesters. As I mentioned before, database classes kind of activity to [unintelligible] manager via [unintelligible] depends on what you prefer, your imagination here controls. The pros – we’ve been talking about the pros, true. Rapid development, no big deal there, nothing new, easy to implement and utilize. Even a very early day beginner – a very early day developer can use this methodology and say, oh, I’ll use that. Actually, I’ve had – a part of what I do in Israel, I’m also the local ATP, so I do the advance classes. And I’ve had people in the invest class finish the advanced class and I’ve – in the advance class, I actually teach them how – I teach this methodology. And they actually ended up developing very interesting platforms, ranging from hour clocks for a company that has 7,000 employees with terminal scattered all over Israel. I have a – a man do that, which is very interesting. And how do you handle right now? The guy has 300 phones scattered all over Israel and everybody punches in around 7:30. So, between 7:30 a.m. and 7:35 a.m. the guy has 7,000 requests coming into the system. Ta-da-da-da-da-da-da. That’s a killer. Another added value is that if your company is dealing in services, you can now delegate some of your development work to your sysadmins or your technical support training them into what we got glorified sysadmins. Well, these are sysadmins that have [unintelligible] for scripting. They have [unintelligible] for developing new things. Property utilization and planning especially when you utilizing things like web services, let’s say XMRPC or other type of rest type interfaces will enable you to create highly scalable systems and you will be able to see that next presentation later on tonight. The cons, well there are few cons. First con, require that the developer have in depth knowledge of Asterisk Dial Plan.

Man: True.

Nir: And do much about it. If you can’t handle the Dial Plan, then this is not a methodology for you. If you prefer to stay away from it, this is not for you. I mean it’s not for everybody. Require certain level of feness when balancing between Dial Plan and AGI, requires planning, it requires an understanding of what works where, that means that you need to have experience, true. That experience can be let’s say learned pretty fast but you – you do need to have some form of let’s say solid knowledge. If your PM – well, most of the people here I guess know Asterisk, right. How many – how many people on class did the Asterisk, the vast class, the boot camp, dCAP – oh somebody is [unintelligible], just kidding. Sorry. Another con is the fact that we are still in this case relying on interpreted languages, well, PHP, Python, Ruby, true. But these concepts can also be applied to cosmopolitan languages. Yes.

Man: [unintelligible]

Nir: Does what?

Man: [unintelligible]

Nir: EX Rel, I never – I never used it.

Man: [unintelligible]

Nir: Oh you mean like – like [unintelligible] like -

Man: [unintelligible]

Nir: Well, I never used it, I have to be honest but I have no idea what kind of impact that will have. I – I never -

Man: [unintelligible]

Nir: If it has a huge impact on the website, then it may have an impact here but I can’t say exactly or even estimate what it would be because actually I don’t think it will have such an impact because we dealing with STD and STDL where whereas the web is more embedded, so there is a difference here. Think about a web page goes in, you – you are writing something inside your page and then you into a database or it will cash that – it will cash that information and EXrel will -

Man: [unintelligible]

Nir: Then it – it won’t have any value here, I don’t think it will have a – a meaningful value.

Man: [unintelligible]

Nir: What?

Man: [unintelligible]

Nir: Maybe.

Man: [unintelligible]

Nir: Maybe.

Man: [unintelligible]

Nir: I have to admit that we never use accelerators because we never really need it, so up till now we never had a – a situation where [unintelligible] failed in terms of capacity, so we are always surpassing whatever we – we put it ourselves, so that never intuits any problem. Again, if your – your scripts were for more than five seconds, you are doing something wrong. You are either doing too much processing in your AGI, you are working with too many external resources or trying to do too many functions inside your AGI, something is definitely wrong. Later on today actually at 6:00 pm as I said [unintelligible] was plug – I will be giving a talk about [unintelligible] Amazon EC2 and how to implement [unintelligible] inside a clouded environment. Now within a clouded environment, you have to remember that the resources that you have are well below the normal things you are actually used doing, let’s say dealing with normal service. If you are dealing – if you are accustomed to using let’s say a Bfi dual quad core server with eight gigs of Ram and God know what is your back – what is your machine backplane at the background [unintelligible], what kind of a bus you have inside Amazon or any other cloud computing environment life is different and we utilize it differently, so we use there also a lot atomic AGI in terms of how we develop the application but also have the application it is built and I do admit that in that specific scenario, we do use some cash but not at that level. Okay. If you have more questions about atomic AGI or [unintelligible] in general, I am – I am here, you are welcome to approach me, this is all my contact information. Questions. Yes.

Man: [unintelligible]

Nir: Um-hm.

Man: [unintelligible]

Nir: You are correct. You are absolutely correct. It might have some form of good impact that is one but let’s take your rational okay IVR application environment. Okay. How many lines or how many [unintelligible] are we going to get into a single server. A 100 – 200. So what is the topmost number of concurrent scripts – concurrent instances of let’s say PHP I will have in such an – in such an environment. A 100 [unintelligible]. If my – if my [unintelligible] plan is written correctly, then the actual number will be no more than five. And – and I can show you that. If you like, later on I can show you actually a system that at peak times receives about a 100 concurrent calls on each of their servers and at any given time have no more than 4 PHB – 4 PHB scripts running at any given time. Well, these guys are using a few services at the same time, so it’s not a single one. Okay. So, they load balanced it. They have a few servers, each one is located but again the information system at the back is afterwards getting like 7,000 hits but again it’s able to scale that much.

Man: [unintelligible]

Nir: Yes, so another question, yes.

Man: [unintelligible]

Nir: Well, I will ask you this, do you feel that this way of – of working requires more – more developers?

Man: [unintelligible]

Nir: More expensive developers.

Man: [unintelligible]

Nir: With hardware, yes.

Man: [unintelligible]

Nir: Well, I will – I will tell you this – yes.

Man: [unintelligible]

Nir: In my view, I would rather pay 50 percent more for a good developer and know that my platform and what I currently run – what I am currently running is rock solid and it’s scalable and it’s – it will do what I need and it will handle what I need than just buying more hardware at some point reaching an unknown glass ceiling somewhere around either the database or the network or God knows where because my program is half clueless and develop something which is bad.

Man: [unintelligible]

Nir: Okay.

Man: [unintelligible]

Nir: No. I agree. There is – well, you know something, that’s an interesting question but – but let’s examine the problems that web developers, okay, are most common denominator developer right now is a web developer. There is nothing, like that’s the – I call these the lowest form of developers. These are not core developers. People may find me abusive at this point, yes I agree but it is a form of developer but we cannot – you cannot say that a web developer is somebody who – who is able to touch the [unintelligible] core. Do you agree with – with me there?

Man: [unintelligible]

Nir: What I am referring to the [unintelligible] core, I am referring to the actual C-code, I am not referring to the [unintelligible], okay. So, if these developers – these developers are completely unaware of – if they are completely unaware of how [unintelligible] works, they will write programs in AGI or fast AGI or whatever that they will work, true. But at some point in time which is completely unknown and sometimes it’s even too close to comfort, whatever they write will become completely unscalable and that point in time all [unintelligible]. I have – actually I have a wonderful example. One of my customers are very large international web based call back company. I won’t say the name because they are well known, extremely well known but I have their consultant for about a year and a half now. When I started working with them, their [unintelligible] plan looked like answer AGI, another AGI and then a go to. That was more or less the [unintelligible] plan. And they were doing everything with AGI. Now they were running everything off a [unintelligible], everything was [unintelligible], so they invested over a $150,000.00 in [unintelligible] infrastructure worldwide. [unintelligible] like IVM blade centers. Fully packed 14 servers, all running VMware ESX, okay. And that thing each server was able to carry no more than 50 – 60 calls. Would do all [unintelligible]. And I came in there and said this is wrong, it’s possible to do. So I sat down with them and we redeveloped their AGI as a mixture of AGIs and [unintelligible] plan. Capacity increased by six per server. Now in my view if I am able to utilize the technology correctly and gain – and the developer has – has no willingness to learn something in order to do the job right, I am not willing to work with that developer. You may perceive me as a purist or as an enledist, I don’t mind, I truly don’t mind because I do believe the platform should be developed correctly. Developers by nature are lazy. We are all lazy people, we are like what. And it’s good – it’s good to be lazy because lazy makes you work four hours before more in order to work less 20 hours but if somebody saves me the four hours at the beginning and then works 20 hours more, it doesn’t help me at all. That’s why I prefer to pay a good developer 50 percent more so you will do the job right, they will spend four hours, they will spend four hours, they will spend five hours initially thinking about what he is going to do, write the proper framework and then save time across time. The long investment in – in IVR system and [unintelligible] systems is much more expensive than whatever you will save on the developer. And you know that as much as I do.

Man: [unintelligible]

Nir: More questions, this is time to [unintelligible] me.

Man: [unintelligible]

Nir: Yes.

Man: [unintelligible]

Nir: If possible, yes. If possible, yes. Just to -

Man: [unintelligible]

Nir: Things not to do in [unintelligible] plan? What not to do in [unintelligible] plan for example. Okay. [unintelligible] has this somewhat interesting ability to perform [unintelligible] requests directly from the Dial Plan. Phone co DBC for example don’t. Why, it makes your Dial Plan code fairly unreadable. If you have ever looked at how [unintelligible] query looks inside [unintelligible], MySQL . Annoying, that is annoying. I would – I never do MySQL within [unintelligible], never. I will fork an AGI, do the request, process of whatever I need and return back only [unintelligible] that I need. There is no need to get everything back.

Man: [unintelligible]

Nir: Yes.

Man: [unintelligible]

Nir: Again.

Man: [unintelligible]

Nir: At one point, it is gone yes, I know. But again I don’t want to see inside my Dial Plan something that looks like select star from something left, join something left, join something left, join something left, join some – it will make something to look like this inside the Dial Plan. Can you read that?

Man: [unintelligible]

Nir: Oh, so -

Man: [unintelligible]

Nir: You define a view, then you define a function and – and now what you have reached, now you need a good developer. Then – so we are back to square one. A really good developer, so he knows how to use triggers [unintelligible] procedures, it doesn’t end.

Man: [unintelligible]

Nir: Again – and yet again you remain with the fact that you need a really good developer to do it, a mediocre developer or a – a beginning developer won’t be able to do that, he won’t be able to understand it. So again or even these functions which we look, this is really – this is really cute. One of my customers decided that they want to write an IVR [unintelligible]. And the guy decided to do it and ask DB. He will store all the questions and all the answers and everything inside as DB. And I said okay, how many questions do you want to have, 2,000. And I am thinking what’s 2,000 [unintelligible]. That’s going to be 10,000 entries inside SDB. I am not even sure SDB is meant to do that. And – and I go why do you want it to do it in SDB as your – well, because it is there. I said well, the Everest is also there, you don’t see me climbing but sure why not. You can do – you can do different things, yes sure. But should you do them? The thing is that developers, that [unintelligible] end up doing all the wrong things in the beginning. They execute multiple job of virtual machines. They go about and do MySQL queries directly from the Dial Plan. They go by and execute Dial and blocking application from their AGI ending up platform they don’t scale. And for example one of the worst things you can do and right, I am going to say something that I am confident that at least 50 percent of the room is doing is access MySQL from an AGI directly from your [unintelligible]. How many people are doing that, one – two. So nobody else writes an AGI script and accesses MySQL for it in the room. What? [unintelligible] MySQL, okay. Net picking. Okay. So okay. I will rephrase. How many people access a database directly from their [unintelligible]. Some form of database. Okay. This is going to be a very funny video. I can actually – I can actually look at – I can actually see how it’s going to look on You Tube. What? It doesn’t matter. The thing is that if you access – if you access it directly from MySQL, you – you are accessing MySQL with some form of database directly from your [unintelligible]. You will end up with resources on your [unintelligible] again being consumed because you are now doing either a Unix socket and you are a file handle and you are opening more resources and I imagine you can off load that into something else, that is less resources – that works faster, that you can cash. That gives you a lot of power. But we will talk about that at 6 o’clock. Okay. Anything else?

Man: [unintelligible]

Nir: Yes. That’s the idea.

Man: [unintelligible]

Nir: Were – were you here at the beginning? What?

Man: [unintelligible]

Nir: Did you see the AGI refer? No, okay. It’s going to – well -

Man: [unintelligible]

Nir: Okay. So what we have on the screen is actually a PH – that’s an AGI rapper. The idea is that I have this every script in my Dial Plan is actually [unintelligible] like this thing. So what will happen is that I will set up an environment for whatever I need to make sure I don’t fall. For example, I am actually building my AGI rapper class for [unintelligible]. Once that is done and actually include two file, one is the config file from directory that I have selected – that I have selected actually within the Dial Plan and then I am actually including a module, some form of module from within that directory. Now what will happen because what PHB actually does is it actually inserts the code right at that point. So I end up with like a bigger script but everything is now unified because the rapper actually made everything like audit for me, okay. So the Dial Plan at the end looks like this. You see in here, AGI rapper, for example, GBB XML new session. In this specific example what happens is that the XML here, this – this script actually reads from the – from [unintelligible] a variable called ID session which is set by session ID here and it will issue an XML [unintelligible] query to an external system asking okay, I want to open a session on your side, is it okay to – is it okay to continue and then that will return back [unintelligible] session created from that script and then I am checking that one from within Dial Plan, okay. Yes. You know, on the config file, you define it as you go on, you can – basically the interface is just reading variables from [unintelligible] and then writing back to [unintelligible] whatever you need. You don’t need to read everything and you don’t need to write everything, you just take what you need, that’s it. Although if you want to well – well defined interface I can take to you and show you something later but that’s something.

Man: [unintelligible]

Nir: Yes.

Man: [unintelligible]

Nir: This and this.

Man: [unintelligible]

Nir: Okay, this one and this one. Yes.

Man: [unintelligible]

Nir: Right.

Man: [unintelligible]

Nir: So an executive.

Man: [unintelligible]

Nir: Oh, you say why not do directly in this and I could have done that. I could have done that but then I would have made an – a Dial Plan code which is unreadable to somebody else. Because what will happen is you see, new session and then the ID classified but then let’s say something fails here, you won’t know that it failed in the year unless it goes to some logged file. In this form what will happen is that the – somebody who debugs the Dial Plan will actually see it in here, think ah, this variable is now invalid, so it failed. Sure, you can do that. It won’t – let’s say the added value is negligible, so I would prefer into doing it in a two step operation but it’s entirely up to you, yes you are correct.

Man: [unintelligible]

Nir: In terms of resources?

Man: [unintelligible]

Nir: Yes, yes. Just a bit, just a bit. But in – in my view it’s fairly negligible. Right, exactly. Well, that’s why we have something called specification document.

Man: [unintelligible]

Nir: Well, if you want to have a [unintelligible] you have to do within your document. If you specify, then it will be a convention. It all – it all depends on you and the specific example – the person who defined this with the return value how it’s called is my customer, he said I am going to return in the XML, something called session created. So I am actually using that as is. I could have unified and said [unintelligible] whatever. It’s just a question of how you define it. Again, you are – this is a specific example from specific customer. We are talking about a methodology and that in general, not about a specific case, so you need to go by and say okay, I am going to write or define specific or let’s say name space or a specific methodology of how the variables need to be carried back and forth or what’s their name value.

Man: [unintelligible]

Nir: Sure. It – it can actually there is – again, if you want, I will show you later on. There is something that I have done. It is a – well, it’s a product and that one does have a unified methodology of actually returning values and how it looks. Well, it’s different, it’s completely different idea. Any more questions. Okay. So I guess we are done. Again thank you very much and I hope to see you back at 6 o’clock for the EC2 part.