Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 95131 invoked from network); 3 Feb 2009 16:12:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Feb 2009 16:12:56 -0000 Received: (qmail 76940 invoked by uid 500); 3 Feb 2009 16:12:52 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 76892 invoked by uid 500); 3 Feb 2009 16:12:52 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 76881 invoked by uid 99); 3 Feb 2009 16:12:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2009 08:12:52 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jocke29@gmail.com designates 209.85.220.12 as permitted sender) Received: from [209.85.220.12] (HELO mail-fx0-f12.google.com) (209.85.220.12) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2009 16:12:43 +0000 Received: by fxm5 with SMTP id 5so13877fxm.18 for ; Tue, 03 Feb 2009 08:12:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=j0+ESq7YWmiXae/fP/tCvreEaX9NpCV6tU+g/gscVIE=; b=e1TnaPBvPqAl3KhNMuA+p141wRiSVvfpO1Et9r6JLR31wGDJBCvHzGL0Jdv8v2/zAe VE4nFekIch4CjiSCUZBa4Kme0a1zXhrh3KaDmV28zWscdRhjTaKWf6RJqhk0Si1SOLtu x18mzvjQi9ksofJK5BtBLJim1X7+4ejyyv254= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=fvRnZkZtfWE76JST9FQ+Kay6zZu2f0nTgp2xXIOi9wW8LMBzNGr6aTig0qJNQldzEA idVKcmgo+gTLPD8Ic2pZQN6ckmnq6a5KOk6PSs+fGLnDXjWklLok0TsXb9ZaD4ArJ3Qs 6rMIedgUlwwG4RwjxzkoiIw0b7Ai94FQm/K+s= MIME-Version: 1.0 Received: by 10.181.239.8 with SMTP id q8mr2133523bkr.109.1233677254706; Tue, 03 Feb 2009 08:07:34 -0800 (PST) In-Reply-To: References: <4986F795.9010808@it20one.at> Date: Tue, 3 Feb 2009 17:07:34 +0100 Message-ID: Subject: Re: [SCXML ]Re: Need some guidance in making a SIP application using commons-SCXML From: jocke eriksson To: Commons Users List Content-Type: multipart/alternative; boundary=0016e6dd97cc88c779046205de0f X-Virus-Checked: Checked by ClamAV on apache.org --0016e6dd97cc88c779046205de0f Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I' m sorry for taken some time but had some issues that i had to clear up first. Well I don't think you should use Commons-scxml to manipulate headers. SCXM= L should be used to control logic and flow. You should not pass the sipmessages to the statemachine you should fire events on it and let it decide what to do next. Like this The first event is fired upon the machine when the first invite comes in. This will cause the custom action accept to get called. ------INVITE-------> fire event connection.alerting <---OK------------- --------ACK---------> fire event connection.connected -------INVITE----> and so on. Hope this helps. Regards jocke. 2009/2/3 Saurabh Agarwal > Thanks all for all the help and guidance . > > This is what I have understood and achieved ( a pretty big word just a > hello > world :) ) and need you help in the following: > > > 1. I made a SIP servlet and in doInvite method I am Calling StopClock ( I > am > using the default example ) and starting its state machine using > stopClock.fireEvent . > > So I was able to start and stop the state machine based on some SIP mesag= es > ( So integration of SIP and commons-scxml is done to an extent ) . > > > Now I want to do the following and need your help in moving forward ( I > know > I can read and expirnent more about it but actually I have pretty strict > deadline for the prototyping so need some urgent inputs , Thanks for the > patience and help ). > > 1. I want to pass the SIP message to the state machine: > As far as I can understand I have to use Context to pass the SIP messa= ge > to the State machine , Am I correct on that or I have some better option = . > > 2. I want to do a good amount of SIP Mesage change like removing some > headers , adding some etc , How can I do that . > As far as I understand I can use JEXL etc for it , what will be my bes= t > option . > How can I access the SIP message in the SCXML . > > Any code pointers will help a lot . > > > > Thanks a lot > > Thanks & Regards > Saurabh > On Tue, Feb 3, 2009 at 1:33 PM, Saurabh Agarwal >wrote: > > > Thanks Jocke for taking the pain :) > > > > Actually I am not clear how my java code will be called when the state > > machine executes , Can you please show some code snippet for that . > > > > I use netbeans for development . > > > > Thanks & Regards > > Saurabh > > > > > > On Tue, Feb 3, 2009 at 1:23 PM, jocke eriksson > wrote: > > > >> Well the task that you describing is a bit big to handle over the E-ma= il > >> list. But I will try to make a sample application that you could look > at, > >> but it will take some time though. But the basic id=E9 is that you cre= ate > a > >> statemachine with your custom events when you get an INVITE then you > start > >> fire events that ocurre as your script progress. Pleas look at the CCX= ML > >> spec to get a grip of the custom actions that this script use. > >> > >> This script contains the custom actions accept createcall and join, An= d > >> could be a good start for your project. Pleas stay tuned . > >> > >> > >> > >> >> xmlns:scxml=3D'http://www.w3.org/2005/07/scxml' > >> xmlns:cc=3D'http://www.w3.org/2002/09/ccxml' > >> xsi:schemaLocation=3D'http://www.w3.org/2005/07/scxml scxml.xsd > >> http://www.w3.org/2002/09/ccxml ccxml.xsd' initialstate=3D"start"> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> /> > >> > >> > >> > >> > >> /> > >> >> callerid=3D"sip:ccxml@localhost" dest=3D"sip:sipp@localhost" /> > >> > >> > >> > >> progressing'" > >> /> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> >> succesfull!'" /> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> PS: are you a maven user or netbeans user? > >> > >> 2009/2/3 Saurabh Agarwal > >> > >> > Thanks Jocke, > >> > > >> > As of now I want to make a simple application that will recieve INVI= TE > >> do > >> > some pattern matching like see for text named search in uri and sear= ch > >> the > >> > user in database and send INVITE to it ,if there are multiple users > then > >> > fork INVITES. > >> > > >> > Since I am new to commons-xml can you please help me in understandin= g > >> when > >> > an INVITE comes on sailfin, "doInvite" of my servlet gets called . > >> > > >> > Can you please tell me how to integrate commons-scxml from there so > that > >> > the > >> > SIP request goes to the SCXML state machine and using that I can put > >> some > >> > pattern matching in the state machine and do some processing like > >> forking > >> > INVITES etc . > >> > > >> > Any code snippet will be really helpful. > >> > > >> > Thanks a lot . > >> > > >> > Saurabh > >> > > >> > > >> > > >> > On Mon, Feb 2, 2009 at 11:20 PM, jocke eriksson > >> wrote: > >> > > >> > > Well I have one implementation based on Sailfin and Commons SCXML > and > >> it > >> > > works great. If you could be a bit more specific about what you wa= nt > >> to > >> > do > >> > > then pleas let me know and I will help. Our implementation is clos= e > to > >> > > CCXML. > >> > > > >> > > Regards Jocke. > >> > > > >> > > 2009/2/2 Saurabh Agarwal > >> > > > >> > > > Thanks Rahul, > >> > > > > >> > > > Sorry for posting on dev list but I would request you to please > end > >> my > >> > > > discussion on this list from any subsequent post I will use user > >> list > >> > ,I > >> > > > just dont want to loose context , Hope you will understand. > >> > > > > >> > > > > >> > > > > >> > > > I have one more simple question is anybody aware of any SCXML > >> editors ( > >> > > if > >> > > > possible free or open source ) , Rahut are you aware wich softwa= re > >> is > >> > > used > >> > > > in the slides you mailed me . > >> > > > > >> > > > Thanks & Regards > >> > > > Saurabhj > >> > > > > >> > > > On Mon, Feb 2, 2009 at 10:05 PM, Rahul Akolkar < > >> > rahul.akolkar@gmail.com > >> > > > >wrote: > >> > > > > >> > > > > I've responded below, but if there are subsequent posts, pleas= e > >> > > > > continue this discussion on the user list, which suits this > topic > >> > > > > better. If you change the email subject, please prefix with > >> [SCXML]. > >> > > > > > >> > > > > With respect to SIP and SCXML, I'm aware there have been > >> integration > >> > > > > efforts, though there isn't any code I can point you to. As a > >> brief > >> > > > > conceptual example, see slides 20 and 21 from this WWW07 > >> > presentation: > >> > > > > > >> > > > > http://www.w3.org/2007/Talks/www2007-SCXML.pdf > >> > > > > > >> > > > > More inline ... > >> > > > > > >> > > > > On Mon, Feb 2, 2009 at 10:42 AM, Saurabh Agarwal < > >> > > sagarwal1981@gmail.com > >> > > > > > >> > > > > wrote: > >> > > > > > Thanks Siegfried , > >> > > > > > Yes I am aware that in Sip Servlet spec SIP messgages are > >> treated > >> > as > >> > > > > Java > >> > > > > > Classes etc . > >> > > > > > > >> > > > > > What I intended to ask that how can I use Commons-SCXML with > SIP > >> , > >> > > > > Actually > >> > > > > > this is waht i want to do . > >> > > > > > > >> > > > > > 1. I want to make a SIP application server that will recieve > >> some > >> > SIP > >> > > > > > messages ( INVITE , REFER etc ) and do some processing etc o= n > it > >> > like > >> > > > > check > >> > > > > > some headers , fork SIP messages etc . > >> > > > > > > >> > > > > > I want to do this with the help of Sailfin and SIP Servelts = . > >> > > > > > > >> > > > > > 2. Now what I want now is also use SCXML as my state machine > may > >> > > change > >> > > > > very > >> > > > > > dynamically as per client requirments so I want to use SCXML > so > >> > that > >> > > we > >> > > > > dont > >> > > > > > have to go on changing code frequenly and can concentrate on > >> > buisness > >> > > > > logic. > >> > > > > > > >> > > > > > >> > > > > > >> > > > > Sounds similar to the example I point out above. > >> > > > > > >> > > > > > >> > > > > > Can anybody help me the following: > >> > > > > > > >> > > > > > 1. How can I integrate SIP servlet ( running inside sailfin = ) > >> with > >> > > > > > commons-scxml. > >> > > > > > >> > > > > > >> > > > > There isn't anything special about sailfin in the client > >> environment > >> > > > > for Commons SCXML sense. > >> > > > > > >> > > > > > >> > > > > > 2. How can I pass the SIP message to the state machine defin= ed > >> in > >> > > SCXML > >> > > > > and > >> > > > > > is it possible to easily modify headers in it . > >> > > > > > > >> > > > > > >> > > > > > >> > > > > The basic idea in most use cases is to convert incoming reques= ts > >> or > >> > > > > messages (here, SIP related) to events that get fired on the > state > >> > > > > machine. The state machine context needs to be populated with > all > >> the > >> > > > > information needed for the state machine to make the necessary > >> > > > > transitions and thereby, execute the necessary actions (the > >> context > >> > > > > can be programmatically populated, or payloads can be attached > to > >> > > > > events as might make sense for a particular usecase). Client > >> specific > >> > > > > interactions (clients of Commons SCXML) are carried out with > >> custom > >> > > > > actions or using the external communications module. > >> > > > > > >> > > > > I'd say give the SCXML spec a quick read if you haven't alread= y. > >> Then > >> > > > > check out the Commons SCXML user guide [1], particularly the > items > >> on > >> > > > > contexts [2], event payloads [3] and custom actions [4]. > >> > > > > > >> > > > > -Rahul > >> > > > > > >> > > > > [1] http://commons.apache.org/scxml/guide.html > >> > > > > [2] > >> http://commons.apache.org/scxml/guide/contexts-evaluators.html > >> > > > > [3] http://commons.apache.org/scxml/guide/core-events.html > >> > > > > [4] http://commons.apache.org/scxml/guide/custom-actions.html > >> > > > > > >> > > > > > >> > > > > > > >> > > > > > Any help is highly appreciated . > >> > > > > > > >> > > > > > Thanks > >> > > > > > Saurabh > >> > > > > > > >> > > > > > On Mon, Feb 2, 2009 at 7:09 PM, Siegfried Goeschl < > >> > > > > > siegfried.goeschl@it20one.at> wrote: > >> > > > > > > >> > > > > >> Hi, > >> > > > > >> > >> > > > > >> I don't know SCXML but worked with SIP > >> > > > > >> > >> > > > > >> +) a SIP message is not a ASCII message but a Java data > >> structure > >> > > very > >> > > > > >> similiar to ServletRequest and ServletResponce (afaik > >> > > > SipServletRequest > >> > > > > >> and SipServletResponse) > >> > > > > >> +) depending on your requirements you have to parse the SDP= 's > >> > > > > >> > >> > > > > >> Cheers > >> > > > > >> > >> > > > > >> Siegfried Goeschl > >> > > > > >> > >> > > > > >> > >> > > > > >> Saurabh Agarwal wrote: > >> > > > > >> > Hi All, > >> > > > > >> > > >> > > > > >> > I am new to commons-SCXML and I am trying to make SIP > >> > application > >> > > > > using > >> > > > > >> > sailfin ( Leveraging SIP Servlets ). > >> > > > > >> > > >> > > > > >> > I came across SCXML and thought it can be of great use , = As > >> far > >> > as > >> > > I > >> > > > > had > >> > > > > >> > understood I can write the state machines iusing scxml an= d > >> dont > >> > > have > >> > > > > >> > to write much java code except some helper functions. > >> > > > > >> > > >> > > > > >> > I have couple of questions which I am not able to > understand > >> yet > >> > : > >> > > > > >> > > >> > > > > >> > 1. How to integrate SIP Servlet and Commons-scxml ( I tri= ed > >> to > >> > > > > understand > >> > > > > >> > shale but unable to do so ). > >> > > > > >> > 2. Can Commons-scxml parse and do some logic on a SIP > message > >> ( > >> > > > Ascii > >> > > > > >> messge > >> > > > > >> > ) and give me results. > >> > > > > >> > > >> > > > > >> > Any pointers are highly appreciated. > >> > > > > >> > > >> > > > > >> > Please help > >> > > > > >> > > >> > > > > >> > Thanks > >> > > > > >> > Saurabh Agarwal > >> > > > > >> > > >> > > > > >> > > >> > > > > > > >> > > > > > > >> > > > > > -- > >> > > > > > > >> > > > > > "Successful people make more mistakes because they do more " > >> > > > > > Thanks > >> > > > > > Saurabh Agarwal > >> > > > > > > >> > > > > > >> > > > > > >> --------------------------------------------------------------------- > >> > > > > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > >> > > > > For additional commands, e-mail: dev-help@commons.apache.org > >> > > > > > >> > > > > > >> > > > > >> > > > > >> > > > -- > >> > > > > >> > > > "Successful people make more mistakes because they do more " > >> > > > Thanks > >> > > > Saurabh Agarwal > >> > > > > >> > > > >> > > >> > > >> > > >> > -- > >> > > >> > "Successful people make more mistakes because they do more " > >> > Thanks > >> > Saurabh Agarwal > >> > > >> > > > > > > > > -- > > > > "Successful people make more mistakes because they do more " > > Thanks > > Saurabh Agarwal > > > > > > -- > > "Successful people make more mistakes because they do more " > Thanks > Saurabh Agarwal > --0016e6dd97cc88c779046205de0f--