Automated Scenario-Test Descriptor

Hi,

It's been a long time, can't do much right now, lottachanges, will write about that later. However, I feel the need to share this document I wrote a little while ago; it's a documentation of a test-tool I wrote for the work.

The context of this post: Cataroo

Well, through the process, I learned two things, I believe:
  • I kind of see the value of functional programming now.
  • I feel the need to learn Scala, for its promise of better support for conccurency / parallelism.
  • I see the value of Continuation. I had to keep the number of active threads below certain limit. There are situations where a thread have to wait, but I can't simply use sleep(), because it would't release the thread. So, in Java, without Continuation, I had to do some tricks to achieve the effect pausing / resuming thread (basically I had to make the thread stores its current state somewhere, before entering "paused mode", and immediately exits its run() method. Later, when the thread has to be resumed, another process will retrieve its current state, kick it to run, and pick up from where it left off. Tricky, could've been easier with Continuation, I guess).
Feel free to ask me if you want to know more how it was designed and implemented.

UPDATE: The source code is available at http://www.box.net/shared/q0f90dmmx4

UPDATE: the JAR of the library can be downloaded from http://jananuraga.blogspot.com/2010/01/anything-goes-just-to-have-nasty.html ... the PDF can be downloaded directly from Box.com: https://www.box.com/s/o9jrdseo12u1oieemnxa
Automated Scenario Test

Another random stuff; randomness continued....

[This is a continuation of this entry]

I just finished (quick)reading a book titled "Charging for Mobile All-IP Telecommunications"..., and I think it's a good book. It helps me get a little more into the detail of diameter (protocol). Well, this book does not only explain diameter / charging in IMS network; it also has chapters on charging in GSM and GPRS network. But the part that interests me more of course are the parts on IMS. What I like about the book: it explains the message-exchange for each charging scenario, step-by-step, with some concrete example values to further illustrate the point(s). It helps a lot.



Well, that's all my review :). Ok, I'm not so good at it. Anyway, this charging stuffs is a soup of acronyms (yuck). Here are the acronyms I think I need to know / care about for this moment: CDF, OCS, Ro, Rf, and HSS.

  • CDF (charging data function): the element that receives charging events from various other elements in the (IMS) network, and constructs the complete CDR, before (eventually) handling it over to the billing system.
  • HSS (home subscriber service): the element that stores user's profile (authentication info and subscription profile). The authentication server queries this element (that goes without saying).
  • OCS (online-charging system): the element that calculates service-usage charges. It is primarily used in prepaid-charging scenarios. So, whenenever a service is to be consumed by a subscriber, the SIP proxy / AS sends a request to the OCS, that will trigger a price-calculation on the OCS. Assuming the subscriber still has credits left in her account, the OCS will return a success response, containing the amount of time / volume granted, and the service starts being delivered. In case the service is session-based, the SIP proxy / AS will periodically send other requests, similar to one sent at the beginning, asking for additional credit-usage, to the OCS. All those message-exchanges go through the Ro reference point.
  • Ro: the "reference point" between the CDF and SIP proxies (and the SIP application server) in the (IMS) network. It is used in offline charging. The way I understand "reference point": diameter defines various reference points. I visualize a reference point as a line that connects two elements in the network, and it defines its own set of messages that can be / should be exchanged between those two elements, and in what order. Well, if diameter is a protocol, then I'd say "reference point" is a protocol inside the protocol..., or sub-protocol. So, for each event / session each it manages, those SIP proxies and application server (AS) sends a message to the CDF. Using some correlation mechanism, the CDF builds the complete CDR based on the messages it receives from those proxies and AS.
  • Rf: the "reference point" between the OCS and the SIP proxies and SIP AS.

Ok, those are the factoids. How am I going to use them? Well, I was trying to estimate the development effort for the teleconference system, especially the parts related to charging. First, I need to know what needs to be built. Let's go over them again:

  • CDF: I think we need to develop it. But I guess the "correlation function" would be quite tricky to implement; making it conform to a standard / RFC needs bunch of love, I mean, verifications and validations. I was wondering if there's any open source project, that can be used as a reference / example / base / building block. So far I haven't seen any. Anyway, if we have to build it we need a way to communicate with the SIP proxies / AS (to receive diameter requests, process them, and send the responses), and libraries like jdiameter (or openblox) can be very useful (we'll be using the diameter server library, particularly the one that abstracts away the Rf reference point).
  • HSS: is there such thing as "standard of structure of user profile, subscription profile, etc" for HSS? I guess there is none. At the end, it's "just another database application" in my opinion. You have more freedom in the implementation of your HSS, as long as it can be accessed through Sh reference point. Hmm.... On a second thought, implementing HSS should not be our priority. There are two possible situations: (a) the buyer does not have HSS already, or (b) the buyer already has HSS (e.g.: a telco operator that owns an IMS-network).

    In case (b) we'd better spend our effort more on making sure our teleconferencing system will be able to exploit the richness in the structure of the operator's user / subscription profile (which reflects the operator's charging requirements)..., and vice versa: making sure the operator can exploit the exploit the richness of "chargeabilities" (and functionalities) of our teleconferencing system. In short, we'll have to build an adaptor, a two-way adaptor I'd call it. My tactic would be: (1) brainstorm and investigate the possible ways of charging the users of our teleconferencing system, (2) obtain all the information we can have regarding potential buyer's charging requirements / capabilities, (3) prioritize the list we made in step 1, taking into account the information we obtained in step 2.

    Hmm..., allright, what about case (a)? My short answer for this moment: implement our own HSS. I mean, we define our own schema for storing user and subscriptions profile (just a database application, really, in my view), and provide a thin wrapper around it such that it can be queried using diameter protocol (through Sh reference point). The design of that schema would go in lockstep with the design of the functionalities (thus chargeabilities).
  • Back to CDF: I think the situation is quite similar to that of HSS: (a) the buyer does not have CDF, or (b) the buyer already has CDF. Frankly, I have a couple of doubts related to CDF. First: so, this CDF is the one responsible for the construction of the complete CDR out of the events received from various nodes, by executing the correlation function. But who defines the format of the CDR? Is it tied to the billing system that is used? I guess the answer is no, because there's a mediation element (part of the billing solution) that performs the translation / mapping of the CDRs it receives (in any format) to a format suitable for that billing system. So..., who? Some standard body? I tried googling for it, including looking at the Parlay specs., but nada. Is it the operator (that owns the entire system)? So, in that scenario, the service provider will have to deliver CDRs according to the format specified by the operator. Hmm..., I guess the answer is no, for the same reason: that's why they have the mediation element. What is left then: the service provider itself, us (with close collaboration with the operator, supposedly).

    For the sake of discussion let's assume the latter is true. In that case, the CDF will produce CDR in various formats (one for each service). To me that implies: there are several "correlation functions" installed in that CDF. I picture this "correlation function" as a plugable module (one for each service). Who then is responsible for the implementation of the correlation function of a service? I guess the answer is the service provider itself (again, with close collaboration with the operator), because it posses a better knowledge of the events generated by the service (and their correlations).

    Eh, wait a second..., am I wrong to think that CDF overlaps with meditation in several areas / tasks? But, hey, there's another element between the CDF and the billing system; the "charging gateway function" (CDF)..., and to me (again) it overlaps with billing mediation. This starts to confuse me.

    This whole questioning got me thinking: wouldn't it be easier (and better) if we get a copy of a charging platform that has CDF and HSS, evaluate it, see how it works, see how it can / should be customized or extended in order to make it work with our teleconferencing system. That strategy will help us cast our doubts more quickly. After all, we're not in the business of charging platform (eventhough an intimate knowledge of such platform will be very helpful in designing and selling our solution).

    So I googled around, and here are what I found:
  1. http://www.digitalroute.com/product/productsolutions/ims/
  2. http://www.sitronicsts.com/en/products_and_solutions/telecoms_and_media/bss_oss_product_lines/foris_charging_and_billing.html
  3. http://www.intecbilling.com/Intec/Products+Services/Products/Charging+and+Billing/Intec+IMS+Charging+Solution.htm
  4. http://www.openet-telecom.com/
  5. http://advoss.com/IMS_offlinecharging.htmlhttp://www.marben-products.com/diameter/overview.html
  6. http://www.tieto.com/default.asp?path=1%3B93%3B16080%3B124%3B16837%3B17193%3B16242%3B36978%3B37078

    I had to check the whole set of returned links by google queries: +IMS +charging and "charging data function" just to get that list :).

    Allright..., next what? Hmm.... well, I guess I'll just leave it here for now. On to OCS.
  • OCS: Well, like I already stated, if the 3rd-party charging system we use already has it, then fine, not much to say here. But if not, no other choice we'll have to build it in-house. It is a component that resides very close to the billing system (where subscriber's account information is managed), so I think the OCS can be made as an extension to or something that is built on-top of the billing system. I don't have much time right now to do some more research on this, but if you'd like to know some more, here is an interesting, relevant wikipage: http://en.wikipedia.org/wiki/Online_charging_system.
Finally, I'd like to turn our attention to the application server, where the core of our conferencing server, supposedly, will be deployed. The application will be sending events to various charging elements. It is quite likely that it would be something that changes quite often (i.e.: we add / change feature, we change the structure of service and user profile, etc..., and somehow it would impact the chargeability of the application, hence the the events need to be sent). I was thinking: how to design and implement the application such that those changes in charging would not imply direct change in the main code (whose concern is mainly the administration of live conferences and activities within the conference room). Could it be that aspect-oriented programming is the right answer?

Lastly, for those who like to see things explained with lines of code (me too), here's a nice article from Oracle: "Understanding IMS Charging Architecture"..., and the use of diameter API in BEA (oracle) Weblogic SIP server is detailed here:
One last note: I don't mean to suggest that this conference solution will be designed specifically for deployment in IMS network (only) with this whole rambling about charging-related IMS elements. We should take it at the conceptual level. I mean, at least we should know what things we need to be considered as far as charging is concerned: there should be something that stores user and service profile (HSS), there should be something that correlates the charge-inducing / charging-related events sent by the conference server (CDF), and there should be something that calculates the charge, on-line (OCS). That's all. The names don't really matter. However, by following / learning from how those elements are organized in an IMS network, it will be easier for us to deploy our solution in an IMS network (when the need / opportunity arises). Beside that organization is pretty common I believe, and makes a good sense.

Alright, another last note :): (and this is more a reminder to myself): this whole desk-research over charging elements should not distract us from our main objective that is "to make our conferencing solution (more) appealing, also from charging and billing perspective". I think one way to achieve is by making sure (in the design) that our solution allows us / whoever buy this solution to be as creative / innovative as posssible in charging the users :).

Yet another segment of chapter 4

Another little chunk, still in chapter 4, on implementing click-to-dial application using SIP Servlet. In this chunk the use of Re-INVITE message is shown and explained for the first time.

As usual, we scrutinize-and-map the SIP-flow diagram before doing any actual coding. I hope you like this one, as well ;).

[Context: video series]

Random stuffs #1

Tired.

I feel like crawling to finish the chapter 4 of my video series. Well, to be perfectly honest I haven't done anything about it in the last two weeks. Sigh. I feel exhausted. I need gado-gado, sate babi, sate lilit, tum ayam, ayam betutu, nasi padang, nasi kuning, lawar bali, nasi tim ayam, nasi uduk, etc. They're all my fave indonesian foods :). Ok, one more saturday for chapter 4, and that's it. I will have to use a different strategy for chapter 5 (the final chapter) that talks about VoiceXML. I probably will record directly the training session on VoiceXML I'll try to set-up in the new company I'm working for. That will save time.

Anyway, news: I just changed workplace. I have done my service as system analyst (on the side of nextel mexico) in the implementation of their new rating and billing system (using a product named BSCS iX from a company named LHS). It was a 11-month assignment and it served me well, I got to know the possible parameters & scenarios for charging and reference about a commercial system for that purpose among other things.

Now, still in Mexico City, I work for a startup company that specializes in development of VoIP system, and more specifically teleconferencing.

In this entry I'd like to sum up a couple of things I've been thinking the last couple of days. First: I want to unify the knowledge I've gathered so far in rating & billing, SIP servlet, and VoIP in general in my effort of designing a complete teleconferencing solution (and business). Here's the list of technologies I'm currently looking at:

(1) Conferencing bridge

We have things like Asterisk (with MeetMe or ConfBridge), jVoiceBridge, and some other commercial solutions (e.g.: Avaya's spectel). I know a little about how to use MeetMe in Asterisk, I played around a bit with it in 2006.

jVoiceBridge provides a good documentation at architectural level that helps me get a better idea of the functions / possible uses of a conferencing bridge. Additionaly, someone wrote a nice intro to jVoiceBridge.

The design of the conferencing solution, of course, will have to accomodate the need to interface with several conferencing-bridge products. So, we'll have to build an abstraction layer. But, still, I need to know how those choices compare against each other in term of feature-set and performance, in order to be able to define a lowest-common denominator and prioritize the development effort.

(2) Rating-and-billing (including online-charging, which requires the use of AAA protocol).

This is important because... well, it goes hand-in-hand with the business-model. I mean, the business-model dictates the requirement for the rating and billing system. This is a top-down view in my opinion.

On the other hand, the more well-designed (flexible, extensible) the rating-and-billing system is, the more room is there for the business model to grow / move. This is the bottom-up view.

I'm wearing the engineer hat at this moment; I'm taking the bottom-up view. I need to know what level of flexibility in rating-and-billing is possible with current (readily available) tools; how far we can go. So..., I tried getting opensips + freeradius + cdrtool installed. The reasons: (a) that's the first one that appear on google for my query :), and (b) I've heard good comments about opensips, especially when it comes to performance.

I got opensips installed without problem on my debian linux. But it's completely a different story with CDRTool. The installation guide is not complete (a couple important stuffs are skipped. Apparently it assumes reader's familiarity with integration of freeradius with opensips). At the end, I failed to get it working. I wish somebody had written a better, more thorough, well-written and well-tested manual. Please let me know. I decided to drop it for a while; it already took my entire sunday last weekend!

(3) Still in rating-and-billing.

To my understanding, the combination of opensips + freeradius + cdrtool provides us only a way to decide whether a call is allowed (by querying freeradius), collect the SIP trace, store them in the database, correlate the INVITE and the BYE of a SIP session, calculate the duration, and apply the rating formulas to the session.

Another component is needed for enabling online charging, that allows the call to be terminated once the credit reaches certain threshold. AG-Projects (the same company that produces CDRTool) has a product named "Call Control" just for that. It works together with CDRTool (as the rating engine) and opensips module named callcontrol that queries the "Call Control" application every predetermined amount of time to find out whether or not the call should be dropped. That's how I see it.

However, I just get the impression that CDRTool + CallControl only address the basics of rating. In order to make it commercially viable, it has to be augmented with other software packages that allow us to work with concepts like rate plan, rating package, promotion, free units, hierarchical account, etc. Please note I'm using my knowledge of BSCS iX as a reference.

I came across this one JBilling, an open-source billing software. From a quick glance, it seems to be feature-full enough. My upcoming tasks would be: buy the manuals of jbilling which in total would cost around 140 USD (or 40 USD without the extension and integration guide), evaluate it, and later investigate if it makes sense & worth the effort integrating it with opensips + cdrtool + freeradius + callcontrol.

Worth the effort? Well..., I was a bit put off by the difficulties in getting opensips + freeradius + cdrtool to work, so I started to think: "If it's only about collecting SIP traces, detecting the start and stop of a call, and applying some simple rating functions then what's the big fuss about?". Allright, rating might be the not-so-easy part, but -- assuming jbilling is the right thing -- rating engine is already part of jbilling (see the general architecture diagram of jbilling).

So, what is missing are CDR collection, online-charging (ability to disconnect the call once the credit is up), and authentication-and-authorization. Doing all of them in-house doesn't sound unreasonable to me. I think we can use SIP-servlet to implement them, and deploy them together with jbilling as a single deployment unit.

(4) Newer AAA (authentication, authorization and accounting) protocol: diameter

My last concern about opensips + freeradius is the protocol it uses: radius. Well, there's a newer protocol, diameter. What's the real advantage it offers to the conferencing system I want to build? I don't know yet, but if we plan to sell this solution to telco operator that uses IMS then I believe we have to work with diameter (as diameter is the AAA protocol of choice in the IMS architecture).

So, again, that is another reason not to use opensips + freeradius + cdrtool combo in our solution, but instead implement the interfacing with diameter-based AAA system on our own. Furthermore, I have to think about providing a layer of abstraction in our code that would allow us to sell this solution to two kinds of customer: (a) those who don't have rating-and-billing system, and (b) those who do. For customers of type "a" we can bundle it together with our rating-and-billing system (based on jbilling, for example).

Ok, again, assuming this part of the conferencing solution will be implemented as an enterprise java application containing SIP servlet components, then the availability of diameter stack in the SIP servlet container will be very much welcome. Fortunately that's how it is now: Sailfin will (or already?) have diameter stack (using OpenBlox), read it here: http://blogs.sun.com/theaquarium/entry/sailfin_diameter_support_online_charging. The same thing with Mobicents from Redhat, it comes with diameter stack from jdiameter. More detail here: http://groups.google.com/group/mobicents-public/web/mobicents-diameter.

[Update: continued on this entry]

First stab at chapter 1

Where do I start? Allright, this picture.

diagramku_kecil

Now the context: last monday we met in my place in mexico city. By we I mean: me, Eric, and Antonio. For the recording of chapter one of the video series. There was an interesting talk (platica), mostly between Eric and Antonio.

Ok, this should've been in the video, but we simply didn't / forgot to do it :) No introductions recorded. Therefore allow me to put a brief one here.

Antonio Echeverria works as a solution architect in one of those vendors that are pushing IMS. We knew each other when I was working in a project for an (fixed) operator in mexico. His role / job in the company allows him to get some insights of the current situation of the IMS, business and technical-wise, especially for the mexican market. He's been a telco domain for quite a long time, and I'm fortunate to be able to learn things from him.

Eric Werkhoven was my colleague in the company we used to work for during 2005-2006. The company was developing a hosted call-center solution. Currently he works for another VoIP company producing & providing outbound / predictive dialing solution. A deep understanding and appreciation of the technical challenges in developing and deploying of large-scale VoIP solution is something that I learn from him now and then.

Antonio and Eric are from two different worlds that are colliding (or converging?). I was happy to be able to get them together and talk, exchanging their views, which might not be completely aligned to each other.

The talk we had last Sunday was mostly about the business-models / opportunities around IMS. We think that's the most important point to grasp before delving into technical discussion. I personally am interested to know the value-chain; to see where I -- viewing myself as a (potential :D) service provider -- might be able to fit in, and how to profit from it. That's what I would like to share with others in the video(s). Of course we don't pretend to become an authoritative source for that kind of information. We just wanted to capture our learning process. Here's the unedited conversation I managed to record (only 38 minutes).





Unfortunately, we only had an hour to get together on that day. Because of my stupidity I also forgot to record the first 15 minutes of the conversation (when we were discussing the flow of the dialog); some interesting points were brought up there.

So here I am now, grappling to collect those points and make up for the lacks. I'm trying to back up some of those points with some references I can find on the internet / other sources. Hopefully this can improve the value / usefulness of the information I'm going to provide in the video.

Ok, so that's the context. I promise to post those points as a written text in a couple of days, before presenting them as a video. The point I'm presenting here -- just one point -- is a prelude to that post.

Content proxy. That's one thing that came up during the discussion. We were exploring the scenario where the operator acts as a proxy to the contents in the internet. In Eric's opinion, telco operators are not capable to compete with the internet. The rate of innovation that's happening in the internet is unparalleled. So the operator is not supposed to go down the path trying to (re)create the existing successful services / content on the internet. Basically he considers the thinking that "with IMS the telco operator can be like Google" is misguided at best.

So, being a content proxy might be their (only?) option. Let's go back to the diagram. First and the foremost, IMS is supposed to provide the same set of basic telephony services that people already enjoyed with the current, non-IP, technologies. That's what line A represents.

IMS lives in an IP network (after all IMS is an abbreviation for IP multimedia subsystem :P). In order to be able to fully deliver its promise(s), the clients also need to be in the IP network and have SIP-stack installed (among other things that make them IMS-capable). There aren't enough mobile devices in the market with such characteristics. In fact, it is an obstacle to a wide-spread adoption of IMS.

However, people can already enjoy high-speed access to IP network; 3G. Mobile devices have improved significantly. Things like iPhone, for example, turn lack of screen-space and crippled web browsers into things of the past. People can have direct, unabridged access to services like YouTube, Last.FM, etc. That's what line B represents.

The "content proxy" idea, to my understanding, is like trying to drive the subscribers away from line B to line C. People will do that willingly if they perceive additional values. What kind of additional values can be provided (with access through line C)? What does IMS -- and only IMS -- have to offer that enable such services? There was a relevant point raised during our discussion (that might provide an answer to those questions). It has to do with subscribers' profile (stored in the HSS) or rating & billing system (that is a complex stuff to install, configure, and manage correctly). Operators might be able to bank on it in their IMS offerings. That idea is still not perfectly clear to me, give me time to investigate it further.

In the meantime, please chip in, help me enrich the discussion, help me arrive to the right conclusion.

Thanks in advance and best regards,
Raka

UPDATE: When the recording started we were talking about Connected Home that Antonio mentioned to us. It got me thinking of the effort from Ericsson to push further the widespread of this telco 2.0 app. development, by providing hosting for SIP-servlet applications (on Sailfin), and some helper APIs and other stuffs. Check it out on the Ericsson Labs page.

A little note on C++

I just did a little rehearsal, as part of bit-by-bit effort to revive the old plan of (re)implementing DBConan (this time with GUI). I plan to implement it using QT framework, and that also means the programming language will be C++.

Why QT? It looks neat and I need that because I will be very much concerned with interactivity, ease-of-use, graphical presentation of data, some (cool) animations maybe, and all that stuffs. QT seems to be a great choice.

And why C++? I want to take advantage of Oracle OCCI, because this tool (in its first version) will be made specific for Oracle database. I haven't got a chance to check if there is something similar to Oracle Data Dictionary -- which is vital for DBConan -- in other RDBMS..., let alone study them.

Before anything else, here's the code, and below is the screenshot from running the code. I don’t have time and space right now to explain it. In fact, I don't think any explanation is needed. It's just some test-code I used to confirm / disprove my worries and cast my doubts.

Designing and writing program in C++ is one thing I don't feel very confident about myself. Well, the last time I programmed in C++ was in 2006, using wxWidget and Skype API for the early prototype of peerant's client application, which was not a lot of code, and lasted only for 6 months. So it's not enough.

I've always been a defensive programmer; I always try (up-front) to avoid making silly mistakes that can be hard to spot when the codebase gets big. To me, the keyword is "consistency". I remember my lecturer in the university taught me to be consistent in my choice of words, structure, and style in writing papers / technical documentations. I think the same exact principle holds true for software codes. First I need to know the field, understand the rules of the games, know the potential issues, make up some rules for avoiding the potential issues, and follow / apply them in a consistent manner.

Straight to the core of the matter: I worry about object-lifetime management in C++. I want to minimize the likeliness of (me) making mistakes on that area. I need to clearly describe my worries, organize / structurize them, and hopefully come up some simple rules for avoiding the pitfalls..., or at least a kind of lookup-table for scanning such mistakes during code reviews.

In Java / C# I don't remember I ever worried (too much) about this. It doesn't mean memory-related problems can not exist in applications written in those languages. Memory leaks can still occur, especially whenever in some parts of our code we cache objects (in containers like map or list) and forget to remove the cached object whenever we no longer use it, keeping the reference count from reaching 0..., and GC is of no help in that situation.

But, in my understanding, it's relatively easier to detect (and avoid) that kind of problems with those languages. Beside, those languages have been designed in such way that there are less paths to getting into trouble with object-lifecycle management.

"Less ways to get ourselves in trouble"? How come? One of the reasons, I think: in those languages we only deal with one thing, (object) reference. When we pass an object as function argument or return value, we always pass the reference to the object..., and that's the default behavior. Whenever we want to pass a copy of the object instead, we have to make that copy explicitly.

It's quite different in C++; where we have both choices. We can declare the function this way:

(a) void aFunction(Buck buck) //pass-by-value. The arg will be a new instance, whose internal values will be initialized through the copy-constructor.

or this way:

(b) void laFuncion(Buck& buck) //no copying here, it's pass-by-reference.

How does it lead to problems? Hmm..., well, it lies in the assumption that the client programmer might use. Let's suppose we go the (a) way.

If the client programmer does not read the method signature carefully enough, she might think / assume that the buck being used inside the laFuncion is exactly the same buck that she has within her code (outside the laFuncion). This assumption (mis)leads her to think the modification she made to the buck (outside the laFuncion) will be seen from inside the laFuncion. Bla bla bla, error.

Of course it is her mistake for being such a sloppy programmer. But let's not be so quick to judge (and punish). Maybe she's a decent programmer actually. It's just that she's coming from Javaland, or C#land (which is exactly my case). Well, with the intention to help her (or myself), then I thought: "Why don't we simply go the (b) way? That's the Java way she's familiar with. That would eliminate the issue, right?". Could be. But before we get to that, I'd like to review why would we consider the (a) way at the first place?

Apart from presenting the issue above, it is copious, unnecesarrily copious. That buck in the function argument is an instance whose lifetime is limited to the scope of the function; it will be automatically destroyed whenever the function returns. What's the point of creating a new instance which will be destroyed in such a short time anyway? I'm thinking of flies (I just learned that a fly lives only for a day from watching the obamaninja video). Why did She create flies? They're so useless.

To make the point clearer, let's get down to the code.
---------------
class ObjectA
{
private:
Buck buck;
public:
ObjectA(Buck buck) {
this->buck = buck;
}
};

class ObjectB
{
private:
Buck buck;
public:
ObjectB(Buck& buck) {
this->buck = buck;
}
};
---------------

When we create an instance of ObjectA, passing along an instance of Buck, the following things will take place:

(1) An instance of Buck, that corresponds to the argument "buck", will be created. The copy-constructor will be used for the creation.
(2) An instance of Buck, that corresponds to the instance variable "buck" of ObjectA, will be created. The default (no-arg) constructor will be used.
(3) When the assigment occurs, the assignment operator of of the instance variable "buck" will be called. That's how the internal values of the argument "buck" get copied to the instance variable "buck".
(4) When the function returns, the buck that corresponds to the argument "buck" will be destroyed.

On the other hand, when we create an instance of ObjectB, passing along an instance of Buck, the following things will take place:

(1) An instance of Buck, that corresponds to the instance variable "buck" of ObjectB, will be created. The default (no-arg) constructor will be used.
(2) When the assigment occurs, the assignment operator of of the instance variable "buck" will be called. That's how the internal values of the argument "buck" get copied to the instance variable "buck".

See, an (extra) invocation of copy-constructor is involved in the pass-by-value case; and the final effect is the same for both cases: either ObjectA or ObjectB will have its own instance of Buck, whose internal values are the same as that of the instance of Buck passed in by the client programmer. In Java speak: value equality, but not reference equality. So I declare (b) way as the winner; same effect, less steps.

But wait, I was supposed to come up with an answer for "why would we consider the (a) way at the first place?". Hmm, I just mentioned the key idea of the answer: owning. My initial goal was to ensure the object that gets the value (buck) passed-in, will _own_ the buck. In other word that object will be the one responsible for the lifecycle of the buck. Keyword: composition (instead of aggregation).

Well, we just saw the (b) way accomplishes that goal, as well. So I think we can completely discard the (a) way now.

Going a little further: if that object is supposed to be responsible for the lifecycle of the buck, then (ideally) it should be responsible for it from the beginning (right?); that is to say: wouldn't it be better if that object instantiates the buck (instead of being fed with it)? "Factory method" comes to mind. I think I will consider this as one of the rules for my code.

---
class ObjectB
{
private:
Buck* pBuck;
public:
ObjectB() { }
Buck& getBuck() {
if (pBuck == 0) {
pBuck = new Buck();
}
return *pBuck;
}
};
---

On the flip side: in the cases where we want to state that the object will not / is not supposed to be responsible for the lifecycle of the the buck, then we can use this form:

----
class ObjectC
{
private:
Buck& buck;
public:
ObjectC(Buck& buck) : buck(buck) {
}
};
----

The steps involved:
(0) None of the four things above (mentioned in the (a) way).

Now the problem: this code assumes the buck gets passed into it the instance of ObjectC wouldn't get destroyed before the ObjectC itself is destroyed. I'd say, in a more concrete terms, the buck must be allocated with the new operator, like this:

---
ObjectC* otroFuncion() {
...
Buck* pBuck = new Buck();
ObjectC* pobjC = new ObjectC(*pBuck);
return pObjC;
}
---

Instead of...
---
ObjectC* otroFuncion() {
...
Buck buck();
ObjectC* pobjC = new ObjectC(buck);
return pObjC;
}
---

Hmm..., I think that's not a safe assumption. How to enforce it? But wait..., if the object (ObjectC) is "conscious" that it is _not_ responsible for the lifecycle of the the buck (thus has no control over it), then it is its responsibility to do the checking to see if the buck is still alive, before it does something with it. Hmm..., I guess that's a fair rule.

Argh.... :D. I think that's all. I write down this train-of-thoughts here just in order not to repeat doing this next time. If you think there's something inaccurate / misleading / just plain non-sense here, please let me know. Thank you in advance.

The third (last) example – click-to-dial.

This is the part of section 4 (on SIP servlet programming), where the audience is guided through implementing a click-to-dial application.

Hopefully by this the audience get a her first taste of "third-party call control", and begin to see the potential of the "convergence" between the telephony and web, that is becoming even more practical with protocol like SIP and programming framework like SIP-servlet.

As usual, can’t write a lot right now; will update this entry later. I hope you like this one, chau!

The usual notice: The source code for chapter 4 is available in this URL: http://www.box.net/shared/tk4ghghllg. It’s a netbeans’ project folder. Use Netbeans 6.x and follow the instruction in this video in order to be able to compile those codes successfuly.

[Context: video series]

(An attempt) to answer Eric….

Allright, a couple of weeks ago I had a chat with a friend, Antonio, here in Mexico City, who works for a company that provides IMS platform to telco operators, in my attempt to get another perspective on IMS.

Remember, on the earlier chat with another friend, Eric, who comes from a different background, all we got was skepticism. Basically the questions he posed were:

  1. Why trying to be an "app-store", another "me too"?
  2. Why transmiting the voice -- between the mobile 3G handset and the operator -- in IP, when the infrastructure for voice transmission (non IP) is already there, working just fine? Plus we know what it takes to transmit voice over IP... serializing, packetizing, unpacketizing, deserializing, etc. It sounds like a lot of things to do, compared to simply transmiting the voice signal as, you know, waveform (that's how they basically do it, right?).

Yadda-yadda from me: this skepticism here is not nay-saying; quite the contrary. I am enthusiastic about this whole IMS thing, and I do plan to put (some of) my eggs in it. But I need to validate some of my assumptions; "this will definitely work and become a boom very soon :-)" being one of them. I would say I'm trying to do some reality checks.

For the second question above, the way I see it: if it's doable why not? I mean, the cost of operating a single infrastructure (IP for all) should be cheaper, right? I need some hard facts, some figures might help. If you have happen to have a link to that information, please share it with us.

Assuming that is true, then the next question would or should be: why haven't they done it? Why are voice calls still transmitted over non-IP channel? Allright, I don't know the answers, so I asked my friend Antonio. Here are the answers, verbatim copy, which to my (momentarily) lazy mind boil down to "it's all about money":

  • Mobile networks are good businesses even if they don't use IP. Operational margin in most MNOs (such as Telcel, for example) is so good, that the supposed savings coming from the IP change don't look so compelling. At least, not yet. SDH is still being supported and it does not imply large OPEX (yet).
  • Elaborating on the previous reason. Even though IP-based transport is said to be cheap, so it is the TDM-based one. SDH and WDM technologies have improved and became cheaper a great deal during the last 3-5 years. Many network operators have made large investments in TDM-based transport less than 3-4 years ago. In their view, that investment has not paid off enough as yet. The ROI (Return on Investment) has not been satisfactory enough in many cases. Many MNOs are waiting for their SDH/WDM networks to depreciate even more.
  • Paraphrasing some famous TV program: "what is the other option, anyway?"... what I mean by this is: if the MNO is supposed to throw away its SDH network, what is he supposed to buy instead? the common word in the last years is called Metro Ethernet. The truth is: even if Metro Ethernet can look as cheap as SDH in terms of $$$ per Mbps, it doesn't look as mature in other aspects, especially regarding O&M capabilities. The ones who are operating SDH networks are today very familiar with its ways of operation and maintenance, and know very well how to troubleshoot these circuit-based networks. It just does not look as clear in the case of Metro Ethernet.
  • Lack of know-how on IP-based technologies. Even if the change seems inevitable (it really is), there is a lot of reluctancy within the engineering and operation organizations of the MNOs to move towards the all-IP paradigm. They just don't know enough of IP to take such an important decisions.

I'll process those information later. I keep it here for my future references. Now, where am I heading, or where am I in my train of thoughts? Allright, I guess the question #2 by Eric has been addressed (more or less).

However, I really don't understand why should I be concerned (too much) about this? I mean this whole rant I'm putting here is actually just a prelude to the point I want to bring up: the switch to IP is inevitable, they're going to do it, just wait (1-2 years, depends on which country you live in), and IMS is there just waiting for adoption, as it provides the architectural framework for their needs (by the time they've switched to full IP). For me -- as software developer trying to profit from that -- that means: my investment in learning SIP Servlet, IMS, and stuffs wouldn't become a waste. That's all I wanted to say. Well, that's what I want to believe.

The kind of application I'm thinking of that I can develop is some mobile applications (together with some server side components implemented as SIP Servlet) that enables funky (yet useful) interaction scenarios (voice, image, video, etc), connected to things like social network, document management, customer management, etc., taking advantage of the nature of the protocols that enables that kind of service convergence. For that kind of applications I don't think I really need to care whether the voice is transmitted over IP or TDM. Or am I wrong? Can you tell me what kind of scenarios wouldn't be possible if the voice / video is not transmitted over IP?

Anyway, let's move on to the question #1 from Eric: why trying to be an "app-store", another "me too"?

I don't know :) So please chip in here. Anyway, in the process of trying to find the answer / get some insights, I came across this thing called SDP (service delivery platform). I was looking at a product from a company JNetX.com. Hmm, well it seems to be one of the building-block for an "app-store" of telco. I need to find out how they go, the clients they have, the reasons those clients use their product, maybe that way I'll arrive at the answer for question #1.

Wrapping up..., I need to:

  • Find an information that says : the cost of using IP for all their service is be cheaper.
  • Try to process the points mentioned by Antonio.
  • Keep this question alive: what scenarios would be made possible (only) if the voice & video is transmitted in IP?
  • Dig service delivery platform (SDP).
UPDATE: I will put my notes and the notes of some collaborators, over our findings / study of VoIP, SIP, IMS, mobile, etc in a wiki workspace here: http://jananuraga.pbworks.com. I also added a link to that wiki workspace in the menu bar. Look for this image:

YAC (yet another chunk) of section 4

In this 8-minutes video we learn how to deal with the provisional responses (such as the ringing signal), success responses (such as OK), and the bye requests. This is the continuation of this video, where the application we’re developing is explained, and the way we handle the initial invite-request from the caller is explained.

The upcoming video will be about implementation of click-to-dial application, and it would conclude chapter 4.

I also decided to create a mini chapter that follows chapter 4 – I’ll name it… chapter 4 extra – where I make the test calls to and trace analysis for each SIP servlets explained in chapter 4.

There’s one more thing: the source code for chapter 4 is available in this URL: http://www.box.net/shared/tk4ghghllg. It’s a netbeans’ project folder. Use Netbeans 6.x and follow the instruction in this video in order to be able to compile those codes successfuly.

I hope you enjoy the videos! Zaijian!

[Context: video series]

Another chunk of section 4

This is the part of section 4 (on SIP servlet programming), where the audience is guided through coding her second SIP Servlet, which acts as a back-to-back user agent. This second SIP servlet simply connects the caller to one specific destination (a person named alice).

In this 8-minutes video I can only explain the way we handle the initial invite-request coming from the caller; which we do inside the doInvite method of the SIP servlet. The upcoming video will cover the way we handle the other methods (doProvisionalResponse, doSuccessResponse, and doBye).

That's all. I hope you enjoy this video. Chau!

[Context: video series]

Section 4 part B.1 – programming the first SIP servlet.

Here it comes, the first SIP-servlet, a very simple one that simply accepts INVITEs (thus starting a dialog with the caller). The audience will also learn how to deploy a SIP-servlet application into BEA Weblogic SIP Server.

Sorry, this is such a quickie entry, I’m so not imaginative at this moment. I will update it later tonight (or tommorow :D). Enjoy, chau!

[Context: video series]

Chapter 4, first part (intro. of SIP-servlet programming).

Finally, here it is: the first part of chapter 4 (crashcourse on SIP-servlet programming). This 7-minutes video is basically a warming up before we perform the programming activities in the next part. Here we also set up our development environment (Netbeans 6.5); registering the BEA weblogic server in the IDE, setting Java platform to 1.5, and importing sipservlet JAR.

I’m at this moment editing the second section of this chapter…, so, well, see you soon. I actually wanted to upload the complete narration of the chapter 4, but the upload is very slow at this moment. Please check back later tonight.

Context: http://jananuraga.blogspot.com/2009/02/preview-of-section-2-ims-app-dev.html

Request for help: CSS stuff

Dear reader,

I'd really appreciate it if you can help me with the following thing.

I need to improve the visual balance this blog with the hope of seeing an improvement of the level of interactivity. I was thinking of moving some widgets to the right. Those widgets also should be hidden initially, and there will floating tabs, one for each widget. I hope the following figure illustrates my point.


By clicking the tab, the widget will displayed, also floating on the page. Additionaly, scrolling the page wouldn't change the location where the widget (and the tabs) are displayed on the screen. Another requirement is: only one of those tabs can have its widget displayed at a time.


I've been trying to look for the answers in some CSS / web-design / blogger tricks sites, no result so far. I mean, I was not sure what the correct search expression would be.

If you have some clues please drop me a comment. Thanks in advance.

My skepticism over IMS

I guess this is the first entry in my blog where I actually try to recall things and organize them into a more or less coherent rambling... :D. I need to write it down so I wouldn't forget these interesting (and possibly valid) points...; mostly skepticisms. A healthy dose of it :). And when I say skepticism what I really mean is: I need some education. So, please, feel free to chip in.

Allright, so I just had a talk in zona rosa*) with one of the guys who are going to help me with the production of chapter 1 (it's going to be a dialogue, a bit of change in the plan: from interview to a dialogue; more persons will be involved).

Where do I start? Ok: bit pipe. I picked that term from a paper that explains a couple of (suggested?) business models around IMS (IP Multimedia Subsystem). Backtrack: you know the title of this video series I'm making is "IMS Application Development using SIP Servlet and VoiceXML". Lately I think the title is a bit inaccurate though.

The production of video series was actually started from the idea to share some experience and knowledge I've acquired in developing application using SIP Servlet and VoiceXML. It just happen to be the most recent project where I used those stuffs has something to do with IMS, in the sense that the application was deployed in the IMS network of a telco operator (in mexico).

SIP Servlet, SIP, and VoiceXML, they're all internet technologies, it's not exclusively IMS (i.e.: we can use those stuffs for developing telecomunication services outside the context of / that have little to do with IMS). Anyway, I'm just trying to put some context around SIP Servlet and VoiceXML programming, and I picked IMS. Beside, I think it's useful to know / keep an eye of what those telco operators are up to, what are they going to do this IP thing (3G, etc).

That's it: what are they going to do? Actually -- according to that paper -- this is one of the business motivations for telco operators to adopt IMS: to avoid the gloomy fate of degenerating into a mere bit-pipe. Basically, what they would like to be: a kind of marketplace for the services -- IP based services -- and profit from it (that's how I understand it).

That sounds reasonable to me. The paper went on by stating this IMS will provide a framework for achieving that objective. I vaguely recall it's mentioned somewhere that the centralistic nature of the framework fits in very well with the tendencies / preferences / (or habit?) of those operators: maintaining as much control as possible.

With the subscriber base in their hands, the service providers that are hooked to them, and the premise that the subscribers are more likely to their trust their sensitive data in the hand of telco operators: throw the single sign-on thing in, and voila, the telco operator turn into a hub. Money. Money?

Somehow it reminds me of portal. I was wondering if the paper is suggesting something similar to it, but for telco. I'm quite skeptical. To begin with, portal to me is useless. I don't want to be confined in one single page with all the stuffs fitted into those small boxes throughout my browsing session. Instead, I have lots of tabs in my browser, and my homepage is set to Google. What else do I really need? I find that a more effective way of navigating this mish-mash of information. I believe unproportionately large population of netizens think that way too. So, portal is a NO to me in my browser..., and so is it in my handset (phone).

Another example closer to telco is this walled-garden approach, where the telco operators basically tries to hide the internet from the user. Yes, they tried that and they failed. Simple: lack of content only generates lack of interest. If we try again today in the age of 3G and iPhone, we will fail again, in a much harsher way. Lesson learned: don't fight the internet. Just don't.

Seriously I don't think that is they path they are going to (re)take. I mean: I don't want to believe it is the case. So I must be missing something here. Anyone?

This boils down to a (temporary) conclusion: this push to avoid "becoming a bit pipe scenario" is misguided. I mean, why should they try to become something that they are not? Their business has always been providing access, so why not focus on it. It's fine becoming a "mere" bit pipe. Just win the market by building bigger, better pipes. Right?

I have more to say but it's very late now. I'm sorry I can't provide the link to the paper I mentioned, I'm too tired to look for it. Again, please chip in, I'd love to hear your opinion or the facts you might have.

Oh, one last thing: the chapter 4, the introduction to SIP Servlet programming. Yes, I already have the video recordings and also the voice recordings. Now comes the tedious task of cuting-and-pasting those video and voice recording segments. I really do want to finish doing it this Saturday.

--
*) Why all the cantinas are closed tonight, that we had to walk to zona rosa just to find a place to drink and talk?

Chapter 3 is completed! – Installing and configuring Asterisk.

The final step in chapter 3 (on setting up the lab): installing and configuring asterisk, which we will utilize as the media gateway in our lab.

I split it into two separate videos (because of youtube’s 10-minutes constraint). This video below is for the installation:

I simply followed the step-by-step installation procedure available on the Practical Asterisk 1.4 website.

Finally, this video below covers the configuration and quick-test (to see if we’ve installed and configured the asterisk correctly).

Even if you’re not into the IMS, SIP Servlet programming, or VoiceXML, you can still use this video as a quick intro to the asterisk (just enough to get you up and running in no time). I’d recommend the book Asterisk: the future of telephony for you who want to dig deeper into it.

I'd also recommend a booklet I wrote in 2006 on telephony application development using Asterisk and Java. It might be a good companion to these videos, especially for you who'd like to program something with Asterisk.

I hope you enjoy the videos and find them useful. Coming up: section 4, on introduction to SIP Servlet programming. Stay tuned!

Update: chapter 4 has just taken off. This way: http://jananuraga.blogspot.com/2009/05/chapter-4-first-part-intro-of-sip.html.

[Context: video series]

Section 3 A – Setting up the lab.

Allright, another bit just came out of the oven :). This one contains the quick guide of the installation of BEA Weblogic SIP Server and Voxpilot Media Server.

Enjoy! Coming up next: quick guide of the installation of Asterisk (and right after that we’ll start coding, the SIP Servlet, in section 4).

Section 2 is finished – finally.

These two videos below close the chapter 2 of the “IMS application development tutorial” video series.

In the first we make a comparison between the call we made through SIP proxy and the call through back-to-back user agent. At the end of it I explain the reason why – in my opinion – we are more likely to develop back-to-back user agents (using SIP servlet technology).



The second video contains the demo of the EZ-IVR application (that's the complex application we are going to develop at the end of this video tutorial -- chapter 6, 7, and 8 -- utilizing all the knowledge we acquire throughout the preceeding chapters). In addition to the demo, the video also gives a quick overview of the interaction between the elements that make up the application.



Well, that's all for section 2. I learned something from this process: I did it the wrong way (I mean, the technique of making the video), that's why the process was slower than I expected. In the upcoming chapters I'm going to record all my activities on the screen first (without saying anything), and do the voice-overs after that.

What about chapter 1? A good news: a friend of mine is going to help me with that. He's more knowledgable and experienced in this area. I'm glad and honoured to have him in this video. Chapter 1 is going to be an interview with him. We're still working on the script, expect to see the video in 7-10 days from now.

IMS Application Development - Section 2 part C - 2

Here comes other chunk…. In this part, we make a call through a SIP proxy, and followed by another call through back-to-back user agent.

Sorry for the short commentary; I’m still working on the editing of this video series. *Phew*. Hang on, we’re almost there. One more part, where we’ll make a comparison between the two calls in the video above followed by short demo of EZ IVR, and we’ll be done with section 2.

Be right back. Chau.

IMS Application Development - Section 2 part C - 1

Wow..., editing video is not as quick & easy as I thought before. This is what I managed to come up with last weekend.

Actually I planned to stuff all the remaining of section 2 in the same video..., but due to time constraint, I decided to cut it at the end of the explanation of the SIP signals exchanged during the demo direct-call we saw in section 2 part B.

That means, two parts are still missing from section 2:

  • Demo of call through back-to-back user agent (along with some explanations).
  • Demo of call through sip proxy (+ explanations).
  • Quick demo of EZ IVR (I hope it will serve as a teaser / another dose of dope..., for motivation).

They all will be available in the upcoming section 2 part C-2 (which I'm going to start editing this Saturday).

I hope you enjoy this part, and..., until next week!

IMS Application Development - Section 2 _PREVIEW_ (B)

This is the second chunk of section 2. I decided to deliver series of small chunks (3-4 minutes). Psychologically it's a better way to go, I believe :). In this chunk a little demo of basic SIP call is presented.

Coming up next (in the other chunk -- taping is already done, missing the editing):

  • SIP Headers and SDP
  • Call through SIP Proxy
  • Call through Back-to-back User Agent
  • Demo of EZ IVR (motivation)

..., and that would conclude section 2.

Side note: the videos in this series are put together in a play list titled IMS Application Development using SIP Servlet and VoiceXML on my channel on youtube.

Preview of section 2 – IMS App. Dev. Tutorial

This is a 5-minutes preview of section 2 of the video series "IMS application development using SIP Servlet and VoiceXML. The video series will have 8 sections, with the following organization:

  • Segment I
    1. Overview of IMS and the series: this entry is our first stab at it.
    2. Brief introduction to SIP: this entry, this one, this one, and this one :).
    3. Installation of servers (SIP Servlet container, VoiceXML server, Asterisk as media gateway, and sip softphones): here and here.
    4. Programming SIP Servlet quick course: (so far) this, this, this, this, this, and this :).
    5. Programming VoiceXML quick course.
  • Segment II
    1. Designing of the EZ IVR
    2. Implementing EZ IVR
    3. Testing EZ IZR


Playlist available on YouTube.

The source code of the SIP-servlet crashcourse: http://www.box.net/shared/tk4ghghllg

They're all brewing. Up to this date I already have the narrations done for section 1-5. All the parts for section 2 have been fully recorded, but most of them have not gone through editing room. What I’m showing here is what I managed to come up with last night. When completed, this section 2 will have a demo (and explanation) of SIP calls (various scenarios) and call-tracing (with wireshark).


UPDATE: Date 25 Feb. 2010. Just uploaded the first part of Cataroo (video) presentation. The video is still related to this series (also talks about SIP application development). This time it's about a technique to test such applications, specifically on automating the testings.

Update: I just realized that the series of Cataroo presentation is actually what I had in mind for segment II of this IMS App. Dev. Tutorial. Oh, well.