10
I Use This!
Activity Not Available

News

Analyzed about 1 year ago. based on code collected over 2 years ago.
Posted over 16 years ago by amit.bhayani
Posted over 16 years ago by amit.bhayani
Posted over 16 years ago by Jean Deruelle
Here is our new shiny Mobicents Sip Servlets 0.9 release !The focus of this release has been to add support for converged HTTP/SIP failover with complete converged replication (both of HTTP Sessions and SIP Sessions), add Tooling support with a brand ... [More] new Sip Servlets Eclipse plugin to create Sip Servlets applications and an eclipse embedded Sip Phone to be able to test those apps.We also added support for JRuby so that you can create pure JRuby (and on Rails) VoIP applications able to start or receive calls.Also as part of this release, the Mobicents IPBX advances to BETA1 version with the new Seam Telco Framework 2.0Our Mobicents Sip Servlets implementation run (and is certified against the SIP Servlets 1.1 spec) on top of Apache Tomcat 6.0.14, JBoss AS 4.2.3.GA and JBoss AS 5.0.1.GA.The other highlights of this release are : * Java EE/EJBs/SIP converged applications are now supported for the JBoss 5 version * Bundled User Guides for both Mobicents Sip Servlets and Mobicents Media Server * More than 20 bug fixesDownloads are here, online documentation is here, User Guide is here, the 0.9 changelog and roadmap is here and the Mobicents Google Group for feedback and questions is here.Try out this new awesome release and give us your feedback !Enjoy and Have Fun !The Mobicents Sip Servlets Team [Less]
Posted over 16 years ago by Ivelin
Posted over 16 years ago by Jean Deruelle
Following on the previous blog (My JRuby-Rails app on JBoss and Mobicents can make Phone calls !), we took things a step further in the JRuby Telco integration with JBoss 5 and Mobicents Sip Servlets.We thought this was a hassle to have to create a ... [More] multi language jruby-java application for pure rubyists to be able to calls in their application, so we decided to remove the Java part altogether and allow the application to be a pure Ruby application handling VoIP to benefit from runtime modification (without having to redeploy anything) to cut development time drastically and in addition to that have all the benefits (Media support, Diameter support, STUN, advanced monitoring, clustering, failover, ...) of Mobicents Sip Servlets for free :-)Note that this application will be bundled with our next 0.9 release that should be out very soon.So let's go through a quick walk-through on how to do that in redoing the same application as in the previous blog post but this time pure Ruby :The code source of the application is available here.For the hackers that want to create it themselves here are the steps :So let's create the application skeleton :$ jruby -S rails pure-jruby-telco -d mysqlGo into the “pure-jruby-telco" directory, then modify the config/database.yml.Adjust the adapter name, and instead of ‘mysql’ put ‘jdbcmysql’. You might also want to delete the lines starting with “socket:” or set it to tmp dir.Here’s a simple example for the development environment:development:adapter: jdbcmysqlencoding: utf8database: pure-jruby-telco_developmentpool: 5username: rootpassword:socket: /tmp/mysqld.sockAlso edit the config/environment.rb to specify the gem dependency we have on the jdbcmysql adapter (this step is mandatory for freezing the dependencies in your app later on)Rails::Initializer.run do |config|...config.gem "activerecord-jdbcmysql-adapter", :version => '0.9', :lib => 'active_record/connection_adapters/jdbcmysql_adapter'...endNow, it’s time to create our database:$ jruby -S rake db:create:allThe next step is to create some minimal scaffolding to create the complaint system$ jruby script/generate scaffold Complaint customer_name:string company:string complaint:text sip_uri:string$ jruby -S rake db:migratenow, we will add the logic to make the phone call once a complaint has been created, to do that edit app/controllers/complaints_controller.rb and the create function should look like this :def create @complaint = Complaint.new(params[:complaint]) respond_to do |format| if @complaint.save # get the sip factory from the servlet context @sip_factory = $servlet_context.get_attribute('javax.servlet.sip.SipFactory') # create a new sip application session @app_session = request.env['java.servlet_request'].get_session().get_application_session(); # create a new sip servlet request to start a call to the sip phone with from header equals to "sip:[email protected]" and the to header equals to the sip_uri from the complaint @sip_request = @sip_factory.create_request(@app_session, 'INVITE', 'sip:[email protected]', @complaint.sip_uri); # actually sending the request out to the sip phone @sip_request.send(); flash[:notice] = 'Complaint was successfully created.' format.html { redirect_to(@complaint) } format.xml { render :xml => @complaint, :status => :created, :location => @complaint } else format.html { render :action => "new" } format.xml { render :xml => @complaint.errors, :status => :unprocessable_entity } endendOk we are done with the web part that make phone calls, let's make the app able to handle phone calls, create a sip directory : mkdir app/sip This directory will contain our sip controllers to handle SIP messages, so let's create such a controller, by adding a sip_handler.rb file, to the app/sip directory, containing the following code :# Note that the class extend a JBoss provided sip controller called JBoss::Sip::SipBaseHandler# that mimic the Java Sip Servlet class the ruby wayclass SipHandler < JBoss::Sip::SipBaseHandler # Handle INVITE request to setup a call by answering 200 OK def do_invite(request) request.create_response(200).send end # Handle BYE request to tear down a call by answering 200 OK def do_bye(request) request.create_response(200).send end # Handle REGISTER request so that a SIP Phone can register with the application by answering 200 OK def do_register(request) request.create_response(200).send end # Handle a successful response to an application initiated INVITE to set up a call (when a new complaint is filed throught the web part) by send an acknowledgment def do_success_response(response) response.create_ack.send endendPlease read the comments in the above code, they should be insightful on what's going on.Ok that's it the app can now receive phone calls and handle the signaling part :-)Let's prepare the application for deployment to the Mobicents Sip Servlets on top of JBoss 5 app server.Now let's freeze the rails version and the associated gems dependencies we are using into our application so that if rails or a dependency is upgraded in the system, our application will always use the version we freezed and not the newly upgraded version of rails from the system. Note: this is highly recommended for production env and really is a best practice (google freeze rails for more information)Note that freezing is mandatory if you wish to deploy your application to JBoss 5 with the jboss-rails plugin.It is a 2 steps process, first freeze rails then the dependencies (in our case the jdbcmysql adapter)Here is the command to freeze your rails application :$ jruby -S rake rails:freeze:gemsHere is the command$ jruby -S rake gems:unpack:dependenciesYou can verify that it worked by issuing this command$ jruby -S rake gemsThat will produce the following output : - [F] activerecord-jdbcmysql-adapter = 0.9 - [F] activerecord-jdbc-adapter = 0.9 - [F] jdbc-mysql = 5.0.4I = InstalledF = FrozenR = Framework (loaded before rails starts)Let's add jboss-rails-support to the application so that it can be deployed and run on JBoss 5 and even start JBoss 5 from the commandline, grab the following zip and extract it to the vendor/plugins directory of our application.Now grab Mobicents Sip Servlets latest binary snapshot and extract it to any location that suits you and set JBOSS_HOME env variable to it.Then in JBOSS_HOME/server/default/deploy create a file called pure-jruby-telco.yml containing :--- application: RAILS_ENV: development RAILS_ROOT: /home/deruelle/workspaces/mobicents-sip-servlets/sip-servlets-examples/pure-jruby-telcoweb: context: /jruby-telcosip: appname: PureJRubyTelcoApplication rubycontroller: SipHandlerchange the RAILS_ROOT in it to the location of your application.Then let's roll and fire up the server, from the root directory of the application do $ rake jboss:as:runWhen the server has started go to the Mobicents Sip Servlets management console and for INVITE and REGISTER select PureJRubyTelcoApplication in the select box then click 'Save'. This will instruct the Mobicents Sip Servlets container to route INVITE and REGISTER requests to our JRuby application.You're ready to test the application. Starts your favorite Sip Phone (wengo phone, linphone, ekiga, sip communicator, ...) and configure it to register to 127.0.0.1:5080 then go to http://localhost:8080/pure-jruby-telco/complaintsCreate a new complaint and make sure that in the sip uri field you put the address of the sip phone as shown hereNow enjoy your first JRuby Rails Sip-Servlets application making a call to your sip phone.Note that with some more coding and a VoIP provider such as http://www.callwithus.com, it could call real land-line phones or cell phones.This application doesn't play any media yet so you hangup the phone whenever you like.You can also call the application in dialing sip:[email protected]:5080 :-) [Less]
Posted over 16 years ago by Ivelin
Posted over 16 years ago by amit.bhayani
Here comes the first stable version of Mobicents Media Server (MMS) 1.0.0.GA that we all were waiting for!Follow the announcement hereDownload hereUser Guide is hereThe initial days of MMS was nothing more than JAIN SLEE Resource Adaptor (RA) on top ... [More] of JMF project and was shipped with early versions of Mobicents JAIN SLEE Server. The RA was un-stable and more over JMF is project to fulfill the media needs of a desktop application. For something to truly serve the needs of telco applications we needed much more robust and scalable server. We also explored the FMJ project but that too didn't meet the requirements we had. We searched around to see if there are already existing Open Source Media Server's on top of which we can build our own or re-use it as its. But there were none and hence we decided to build our own Media Server :)We released first Alpha version of MMS on end of Feb 2008 and took approx 13 months to come up with first stable release. Thanks to all those who has contributed, provided valuable feed-backs and big thanks to Mobicents Core Team. Last but not least a big thank you to MMS users. MMS 1.0.0.GA is the first Open Source Media Server that has passed MGCP TCK test.MMS 1.0.0.GA has all the features from simple announcement, recording, IVR to complicated ones like Conference. MMS has support for majority of audio codecs used in industry today like PCM-U, PCM-A, G729, GSM, Speex. MMS can be easily used with JAIN SLEE Server with either MGCP Resours Abaptor or MSC Resource Adaptor or it can be integrated with Sip Servlets using the MSC API.With release of 1.0.0.GA the life-cycle for 1.x.y comes to an end and we will be actively doing development for version 2.x.yGoing Forward....The support for video has already begun (check out code from SVN trunk). MMS is also actively developing endpoints for SS7 support. Have a look at wiki page http://groups.google.com/group/mobicents-public/web/mobicents-ss7-roadmap. The first Alpha release of 2.0.0 will also have initial support for JSR-309. JSR-309 is protocol agnostic API for Media Server Control. The MMS implementation for JSR - 309 will be on top of MGCP.Mobicents Google Group for feedback, queries is hereNjoy!Mobicents Media Server Team [Less]
Posted over 16 years ago by Vladimir Ralev
This year, the Mobicents project is part of the JBoss/Red Hat/Fedora GSoC student mentoring organisation. We have collected some project ideas here, but if you have others ideas, they are welcome and you can work on them as well.I signed up as a ... [More] mentor and I am particularly interested in seeing some contributors on the PBX project or the tooling. The PBX project combines all the cutting edge Web and VoIP technologies and there are many cool tasks on the todo-list. Moreover, the project is allows you to push your own design ideas and contribute to our Seam Telco Framework.Check the program homepage, where you can read more details, register and apply.Any questions or comments should go to our google group. [Less]
Posted over 16 years ago by amit.bhayani
Posted over 16 years ago by Jean Deruelle
Following on the previous blog, I'll describe the steps to create a multi language JRuby-Rails application that utilize the power of the Sip Servlets 1.1 specification to make phone calls.It will be bundled as a war and will be deployed on top of ... [More] Mobicents Sip Servlets.So the application will allow one to file complaints and every time a complaint is filed, a confirmation call is made to your phone saying that is has been taken into account and has been routed to a sales representative.You can download the prebuilt application, if you're not interested in build it yourself and just want to test things out.Note also that the source code for this app is available hereIn any case, make sure you have JRuby correctly setup as explained in my previous postDeploy the war to your favorite Mobicents Sip Servlets container. Currently only the current trunk (0.9-SNAPSHOT) is able to work correctly with a JRuby/Rails - Sip Servlets app, you can find the corresping binary snapshots of the trunk on our hudson jobCopy the war into your $JBOSS_HOME/server/default/deploy directory($JBOSS_HOME points to the location where you extracted Mobicents Sip Servlets zip) and then starts the jboss container as usual with$ sh $JBOSS_HOME/bin/run.shWhen started, go to http://localhost:8080/sip-servlets-management and remove all configured applications in clicking on all the Delete buttons then click on Save.You're ready to test the application. Starts your favorite Sip Phone (wengo phone, linphone, ekiga, sip communicator, ...) then go to http://localhost:8080/jruby-demo-sip-servlet-1.0-SNAPSHOT/complaintsCreate a new complaint and make sure that in the sip uri field you put the address of the sip phone as shown hereNow enjoy your first JRuby Rails Sip-Servlets application making a call to your sip phone.Note that with some hacking and a VoIP provider such as http://www.callwithus.com, it could call real land-line phones or cell phones.The next step now is to integrate with the JBoss Rails Deployer and add to it the ability to recognize those converged telco applications, so that you don't need to recreate the war everytime you change the rails part of the app and benefit from the rails features of live modification and also of the JBoss enterprise features in your Rails application !Also if you want to help us and contribute check our Google Summer of Code project ideas for MobicentsFor the hackers that want to create it themselves here are the steps :(Note that the prebuilt application is integrated with Mobicents Media Server and as such has the media features of playing the audio but we will not see that below, it will just showcase the call setup.)So let's create the application skeleton :$ jruby -S rails jruby-sips-demo -d mysqlGo into the “jruby-sips-demo” directory, then modify the config/database.yml.Adjust the adapter name, and instead of ‘mysql’ put ‘jdbcmysql’. You might also want to delete the lines starting with “socket:” or set it to tmp dir.Here’s a simple example for the development environment:development:adapter: jdbcmysqlencoding: utf8database: blog_developmentpool: 5username: rootpassword:socket: /tmp/mysqld.sockAlso edit the config/environment.rb to specify the gem dependency we have on the jdbcmysql adapter (this step is mandatory for freezing the dependencies in your app later on)Rails::Initializer.run do |config|...config.gem "activerecord-jdbcmysql-adapter", :version => '0.9', :lib => 'active_record/connection_adapters/jdbcmysql_adapter'...endNow, it’s time to create our database:$ jruby -S rake db:create:allThe next step is to create some minimal scaffolding to create the complaint system$ jruby script/generate scaffold Complaint customer_name:string company:string complaint:text sip_uri:string$ jruby -S rake db:migratenow, we will add the logic to make the phone call once a complaint has been created, to do that edit app/controllers/complaints_controller.rb and the create function should look like this :def create @complaint = Complaint.new(params[:complaint]) respond_to do |format| if @complaint.save # get the sip factory from the servlet context @sip_factory = $servlet_context.get_attribute('javax.servlet.sip.SipFactory') # create a new sip application session @app_session = request.env['java.servlet_request'].get_session().get_application_session(); # create a new sip servlet request to start a call to the sip phone with from header equals to "sip:[email protected]" and the to header equals to the sip_uri from the complaint @sip_request = @sip_factory.create_request(@app_session, 'INVITE', 'sip:[email protected]', @complaint.sip_uri); # actually sending the request out to the sip phone @sip_request.send(); flash[:notice] = 'Complaint was successfully created.' format.html { redirect_to(@complaint) } format.xml { render :xml => @complaint, :status => :created, :location => @complaint } else format.html { render :action => "new" } format.xml { render :xml => @complaint.errors, :status => :unprocessable_entity } endendOk we are done with the rails, let's create the war so that we can deploy it on a Java EE compliant container such as JBoss, for that we need to install Warbler :$ jruby -S gem install -y jruby-openssl warblerand set it up for our application with :$ jruby -S warble configUsing jdbcmysql adapter, don't forget to uncomment this line in config/warble.rb:config.gems += ["activerecord-jdbcmysql-adapter"]Create the .war :$ jruby -S warble warOk we are done with the rails app, now we need to create the java Sip Servlets code that will handle SIP related requests and responses and package it with the war.So let's create the directory structure for the java classes :$ mkdir -p src/main/java/org/mobicents/servlet/sip/demo/jrubymkdir -p src/main/sipapp/WEB-INFNow let's add the Sip Servlet class that will handle the SIP calls in src/main/java/org/mobicents/servlet/sip/demo/jruby :public class JRubySipServlet extends SipServlet { @Override protected void doSuccessResponse(SipServletResponse resp) throws ServletException, IOException { //acknowledge that the call is accepted by the phone if (resp.getStatus() == SipServletResponse.SC_OK) { SipServletRequest ack = resp.createAck(); ack.send(); } } @Override protected void doBye(SipServletRequest request) throws ServletException, IOException { //respond to the hangup request SipServletResponse ok = request.createResponse(SipServletResponse.SC_OK); ok.send(); }}Now let's create the sip.xml deployment descriptor in src/main/sipapp/WEB-INF :<?xml version="1.0" encoding="UTF-8"?><sip-app><app-name>org.mobicents.servlet.sip.demo.jruby.JRubySipServletApplication</app-name> <servlet> <servlet-name>JRubySipServlet</servlet-name> <display-name>JRubySipServlet</display-name> <description>JRuby SIP servlet</description> <servlet-class> org.mobicents.servlet.sip.demo.jruby.JRubySipServlet </servlet-class> <load-on-startup>1</load-on-startup> </servlet></sip-app>Now let's create the web.xml deployment descriptor in src/main/sipapp/web.xml so that the application uses the development database<web-app><context-param><param-name>rails.env</param-name><param-value>development</param-value></context-param><context-param><param-name>public.root</param-name><param-value>/</param-value></context-param><context-param><param-name>jruby.max.runtimes</param-name><param-value>1</param-value></context-param><filter><filter-name>RackFilter</filter-name><filter-class>org.jruby.rack.RackFilter</filter-class></filter><filter-mapping><filter-name>RackFilter</filter-name><url-pattern>/*</url-pattern></filter-mapping><listener><listener-class>org.jruby.rack.rails.RailsServletContextListener</listener-class></listener></web-app>Now let's tie everything together by creating a maven pom.xml to bundle the jruby app and the sip servlets code together in a single war so create the pom.xml at the root of your project<project xmlns="http://maven.apache.org/POM/4.0.0" xsi="http://www.w3.org/2001/XMLSchema-instance" schemalocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"><modelversion>4.0.0</modelversion><parent><groupid>org.mobicents.servlet.sip.example</groupid><artifactid>sip-servlets-examples-parent</artifactid><version>1.2</version><relativepath>../pom.xml</relativepath></parent><groupid>org.mobicents.servlet.sip.example</groupid><artifactid>jruby-demo-sip-servlet</artifactid><packaging>war</packaging><version>1.0-SNAPSHOT</version><name>JRuby Sip Servlet Demo Application</name><url>http://www.mobicents.org/jruby-sip-servlets.html</url><build><plugins><plugin><artifactid>maven-compiler-plugin</artifactid><configuration><source>1.5</source><target>1.5</target></configuration></plugin><plugin><artifactid>maven-war-plugin</artifactid><configuration><warsourcedirectory>${basedir}/src/main/sipapp</warsourcedirectory><webresources><resource> <directory>tmp/war</directory> <excludes> <exclude>**/web.xml</exclude> </excludes></resource><resource> <directory>log</directory> <!-- override the destination directory for this resource --> <targetpath>WEB-INF/log</targetpath></resource></webresources></configuration></plugin></plugins></build></project>Create the converged jruby sip servlets war with$ mvn clean install [Less]