Posts Tagged ‘Java’

Voxeo PRISM supports wideband VoIP now

Monday, May 9th, 2011

Voxeo PRISM 10.1 is available at www.voxeo.com/prism for download now.

One of the biggest changes in Voxeo PRISM 10.1 is to support some of wideband VoIP codecs. These wideband, sometimes referred as HD, codecs offer much better sound quality than the traditional codecs.

Here are the codecs Voxeo PRISM 10.1 can set up with the phones.

CODEC NAME SAMPLING RATE DESCRIPTION LICENSE
PCMA 8KHz G.711 alaw INCLUDED
PCMU 8KHz G.711 ulaw INCLUDED
G722 16KHz G.722 INCLUDED
G726-32 8KHz G.726 at 32Kbit/s INCLUDED
GSM 8KHz GSM 6.10 INCLUDED
L16 8/16KHz 16-bit Linear PCM INCLUDED
G729 8KHz G.729 ADDITIONAL
G729 8KHz G.729 Annex B ADDITIONAL
SPEEX 8/16/32KHz Speex INCLUDED
AMR 8KHz AMR-NB ADDITIONAL
AMR-WB 16KHz AMR-WB ADDITIONAL
telephone-event RFC 2833 INCLUDED

Voxeo PRISM 10.1 also supports the following file formats and codecs in playback and recording.

FILE NAME EXTENSION MIME TYPE SUPPORTED CODEC
.wav audio/wav G.711 alaw/ulaw
8/16-bit Linear PCM
Microsoft GSM
.ulaw audio/ulaw G.711 ulaw
.alaw audio/alaw G.711 alaw
.pcm audio/pcm 16 bit Linear PCM
.gsm audio/gsm GSM 6.10
.au audio/au G.711 alaw/ulaw
8/16-bit Linear PCM
.mp3 audio/mpeg MP3
.ogg audio/ogg Vorbis
Speex
.spx audio/ogg Speex
.amr audio/amr AMR
.awb audio/amr-wb AMR-WB


Want to learn how Voxeo can help unlock your communications and deliver a better customer experience? Please contact us!

If you found this post interesting or helpful, please consider either subscribing via RSS, becoming a fan on Facebook, or following us on Twitter.


How to make Voxeo Prism to talk to PSTN?

Thursday, March 24th, 2011

If you have tried Click-To-Dial example, you might wonder if it is possible to call your home phone or cellular phone, besides the SIP phones. It is definitely possible with Voxeo Prism.

In SIP Servlet, a PSTN phone number is represented by a TelURL object based on RFC 3966. For example, here is the code snippet to generate a TelURL object for 407-555-1212.

  URI target = sipFactory.createURI("tel:+1-407-555-1212");

Once you have a TelURL, you can use it the same way as a SipURI, both of which are URI. When Voxeo Prism tries to send a SIP message to a TelURL, it will try to map the telephone number (in E.164 format) to a SIP address based on ENUM.

According to ENUM, a telephone number in E.164 format should be converted to a unique key based the following steps.

1. Remove all characters with the exception of the digits.  For
      example, given the E.164 number "+1-407-555-1212" (which would
      then have been converted into an AUS of "+14075551212"), this
      step would simply remove the leading '+', producing
      "14075551212".
2. Reverse the order of the digits.  Example: "21215557041"
3. Put dots ('.') between each digit.  Example:
      "2.1.2.1.5.5.5.7.0.4.1"
4. Append the string ".e164.arpa." to the end and interpret as a
      domain name.  Example: 2.1.2.1.5.5.5.7.0.4.1.e164.arpa.

Then the key is used to look up the corresponding SIP address in the DNS NAPTR records. E.g. the following record maps “+1-407-555-1212” to “sip:14075551212@example.com“.

$ORIGIN 2.1.2.1.5.5.5.7.0.4.1.e164.arpa.
       NAPTR 100 50 "u" "E2U+sip"             "!^(\\+14075551212)$!sip:\\1@example.com!"    .
       NAPTR 100 51 "u" "E2U+h323"            "!^\\+14075551000$!h323:operator@example.com!"    .
       NAPTR 100 52 "u" "E2U+email:mailto"    "!^.*$!mailto:info@example.com!"

By default, Voxeo Prism uses the default DNS server configured on the system to perform the ENUM lookup. However, it is possible to specify a specific DNS server for the ENUM lookup. You can even specify a different domain suffix instead of the default “e164.arpa“. Please see Voxeo Prism User Guide for more information on how to configure that.

While ENUM gives you complete control on how to map individual telephone number to different SIP address, another popular way to connect Voxeo Prism to PSTN is through a VoIP (SIP trunking) provider.

Voxeo Prism always looks up ENUM first. If no mapping is found in ENUM and a VoIP provider is configured, the SIP messages will sent to the VoIP provider. The following picture shows where you can configure the VoIP provider’s gateway information.

Obviously, Gateway’s Host, Port, and Protocol specify where the gateway is. If the gateway requires SIP registration, you further configure the Registration section. The registrar’s Host and Port is the same as gateway’s, unless specified differently. The User and Domain allows you to specify the Address-of-Record (AOR) for registration. The Auth User and Password allows you to specify credentials in case the registrar requires authentication.  For more information on specific fields, please refer to Voxeo Prism User Guide.


Want to learn how Voxeo can help unlock your communications and deliver a better customer experience? Please contact us!

If you found this post interesting or helpful, please consider either subscribing via RSS, becoming a fan on Facebook, or following us on Twitter.


Click To Dial: a converged application on Voxeo Prism

Saturday, March 19th, 2011

Voxeo Prism is a converged application platform where you can mingle Web (HTTP) functionality with real-time communication (SIP or XMPP) functionality in a single programming model and application.

A classic example of converged application is Click-To-Dial, where the user can enter two telephone numbers in a web page and the web application calls each phone and connect them together.

In this blog, I will show how to build a simple Click-To-Dial application on Voxeo Prism that can connect two SIP softphones together.

Voxeo Prism supports both Java Servlet 2.5 API and JSP 2.1. It also supports SIP Servlet 1.1 API. So I built this application using JSP and SIP Servlet. Here is how the application, a.k.a. WAR, looks like.

Tutorial.4
   |-- WEB-INF
   |         |-- sip.xml
   |         |-- web.xml
   |         |-- xmpp.xml
   |         |-- sipmethod-application.xml
   |         |-- classes
   |                  |-- com/voxeo/prism/tutorial/four/Call.class
   |                  |-- com/voxeo/prism/tutorial/four/ClickToDialServlet.class
   |-- call.jsp
   |-- index.jsp
   |-- status.jsp
   |-- terminate.jsp
   |-- phone.jpg

Once the application is deployed on Voxeo Prism, go to http://localhost:8080/Tutorial.4 to open home page (index.jsp). It will look like the following.

Once you enter two reachable SIP addresses, e.g. sip:john@somedomain.com and sip:doe@otherdomain.com, and click the Call button. The call.jsp will be invoked to make the call to sip:john@somedomain.com and sip:doe@otherdomain.com respectively and join them together when both have answered.

The following diagram shows how the JSPs, Java objects, and SIP servlet interact with each other.

The logic of making outbound calls  are in the Call.call() method, as shown below. “_factory” is the SipFactory object. “_left” and “_right” are the URIs submitted from the index.jsp. “_servlet” is the name of the ClickToDialServlet defined in its annotation or deployment descriptor. By setting the servlet as  the handler of the session, the servlet will receive all messages for that session.

      _inviteL = _factory.createRequest(_session, "INVITE", _left, _right);
      _inviteR = _factory.createRequest(_session, "INVITE", _right, _left);
      _inviteL.setRequestURI(_right);
      _inviteR.setRequestURI(_left);
      _inviteL.getSession().setHandler(_servlet);
      _inviteL.getSession().setAttribute(Call.class.getName(), this);
      _inviteR.getSession().setHandler(_servlet);
      _inviteR.getSession().setAttribute(Call.class.getName(), this);
      _inviteL.send();
      _inviteR.send();

Once both phones have responded with 2xx answers, Call.connect() will generate ACK for each phone with the SDP from the other phone. If one of the phones returns an error response, the call is terminated. Here is the logic in Call.connect() method.

  synchronized void connect(SipServletResponse response) {
    SipServletResponse otherResponse = null;
    int code = response.getStatus();

    if (code < 200) {
      return;
    }

    if (_inviteL.getSession().equals(response.getSession())) {
      _responseL = response;
      otherResponse = _responseR;
    }
    else if (_inviteR.getSession().equals(response.getSession())) {
      _responseR = response;
      otherResponse = _responseL;
    }

    //TODO: handle 3xx for redirection
    if(code >= 300) {
      terminate();
      return;
    }

    if (otherResponse != null) {
      try {
        if (response.getStatus() >= 200 && response.getStatus() < 300 && otherResponse.getStatus() >= 200 && otherResponse.getStatus() < 300) {
          SipServletRequest ack = response.createAck();
          ack.setContent(otherResponse.getRawContent(), otherResponse.getContentType());
          SipServletRequest otherAck = otherResponse.createAck();
          otherAck.setContent(response.getRawContent(), response.getContentType());
          ack.send();
          otherAck.send();
          _state = State.CONNECTED;
        }
        // container automatically sends ACK in other cases.
      }
      catch (Exception e) {
        terminate();
      }
    }
  }

When the call is terminated, we have to send either CANCEL or BYE to each telephone. Based on RFC 3261, CANCEL should be sent before receiving the final response. The follow is the code to terminate the call to one telephone.

  private void terminate(SipServletRequest invite, SipServletResponse response) {
    try {
      if (invite != null) {
        if (invite.isCommitted()) {
          if (response == null) {
            invite.createCancel().send();
          }
          else {
            invite.getSession().createRequest("BYE").send();
          }
        }
      }
    }
    catch (Exception e) {
      // nothing we can do at this point
    }
  }

To try it out, download and deploy the application to <prism>/apps. Open the home page at http://localhost:8080/Tutorial.4. Make sure you type in valid and reachable SIP addresses. By default, PSTN telephone number won’t work unless VoIP gateway or ENUM are configured, which I will show you in the future blog.


Want to learn how Voxeo can help unlock your communications and deliver a better customer experience? Please contact us!

If you found this post interesting or helpful, please consider either subscribing via RSS, becoming a fan on Facebook, or following us on Twitter.


The Simplest Application on Voxeo Prism

Wednesday, January 26th, 2011

This is the simplest application on Voxeo Prism.

The content of the application is like the following

myapp
  |-- WEB-INF

That’s it!

Simply copying the myapp.war to <prism>/apps directory. The container will automatically detect that and load it up. When it loads myapp up, it will unpack the WAR into <prism>/apps/myapp directory.

Of course, this simplest application doesn’t do anything. Since Voxeo Prism is a converged SIP application server, it can handle both SIP and HTTP. The easiest way to make this application do something is to add an index.html page, as the following.

myapp
  |-- WEB-INF
  |-- index.html

You can simply create an index.html with your favorite text editor and copy it under <prism>/apps/myapp directory.

Here is what I put in my index.html

Hello, welcome to My Application!

And here is what I will see when I open http://localhost:8080/myapp

Try it out.


Want to learn how Voxeo can help unlock your communications and deliver a better customer experience? Please contact us!

If you found this post interesting or helpful, please consider either subscribing via RSS, becoming a fan on Facebook, or following us on Twitter.


How to Find Me or Follow Me?

Friday, January 7th, 2011

Virtual number with Find-Me and Follow-Me service is getting popular. The idea is you can give your friends and family a virtual number. Then you can register multiple phones, such as your cellphone, home phone, and work phone, to that virtual number. When people call your virtual number, the virtual number can ring your registered phones either one by one — Follow Me — or all at the same time — Find Me — until you pick up one of them.

In SIP world, your SIP address, e.g. sip:wchen@voxeo.com, essentially is the virtual number. You can register multiple SIP phones to your SIP address. To Find Me, simply proxy the call to all the registered addresses in parallel. To Follow Me, simply proxy the call to all the registered addresses sequentially.

In the Using SIP Servlet to implement SIP Registrar and Proxy Server blog, I described how registration and proxy works. With SIP Servlet, adding Find-Me and Follow-Me is trivial.

The following code was shown in that blog to demonstrate how SIP proxy works.

  @Override
  protected void doInvite(SipServletRequest req) throws ServletException, IOException {
    // application only has to worry about forwarding the initial request.
    // the rest is taken care by the container.
    if (req.isInitial()) {
      URI callee = req.getTo().getURI();
      Proxy proxy = req.getProxy();

      //let's see if the Location Service has bindings for this callee.
      List<URI> targets = _locator.getContacts(callee);
      if (targets.size() > 0) {
        // The Proxy Server should stay on the signaling path
        proxy.setRecordRoute(true);

        // Let the container handles all the 3xx redirect automatically
        proxy.setRecurse(true);

        // Try all the registered phones for this callee sequentially
        proxy.setParallel(false);

        //Yes, let's proxy the call to the registered phones.
        proxy.proxyTo(targets);
      }
      else {
        // Oops, no phone is registered right now. Let's do our best.
        proxy.proxyTo(callee);
      }
    }

When you have multiple phones registered, the above code essentially provides Follow-Me.

You can change one line — #19 –  to make this become Find-Me.

        proxy.setParallel(true);

What if you want to provide a PSTN virtual number and register PSTN numbers? SIP Servlet can work with either SIP URI and Telephone URL. So there is no difference as far as proxy code concerns. What you need is to connect the platform to a VoIP provider that can provide SIP-PSTN connectivity. In the future blog, I will show you how to configure Voxeo Prism to provide PSTN connectivity.


Want to learn how Voxeo can help unlock your communications and deliver a better customer experience? Please contact us!

If you found this post interesting or helpful, please consider either subscribing via RSS, becoming a fan on Facebook, or following us on Twitter.


Introduction to Voxeo Prism

Thursday, November 18th, 2010

Voxeo Prism is carrier-grade converged communication platform. It supports both Web technologies and communication technologies such as SIP and XMPP.  It comes with full media capabilities such as media playback and recording, as well as multi-party conferencing. It also supports advanced speech technologies such as text-to-speech and speech recognition.

Voxeo Prism can be used for various applications, from traditional softswitch and call center to real-time social networking applications. Voxeo Prism is built from the ground up with performance and scalability in mind.  It can support up to 40,000 concurrent calls at 1,000 call attempts per second (CAPS) on a single high performance Intel server.

You may wonder how Voxeo Prism compares with Voxeo Prophecy and Voice Object products. In short, Voxeo Prism provides a flexible and powerful general-purpose API-driven development platform for communication applications. Voxeo Prophecy, on the other hand, is an XML driven development platform for IVR-centric applications. Voice Object provides a drag-n-drop GUI development platform for IVR applications. Currently only Voxeo Prophecy and Voice Object application hosting is provided in Voxeo cloud.

From a technology stack point of view, Voxeo Prism is the cornerstone for Voxeo Prophecy and other Voxeo offerings such as Tropo and Phono. For example, a Voice Object application generates VoiceXML documents to be executed by Voxeo Prophecy, which, in turn, translates all the VoiceXML semantics into API calls on Voxeo Prism, as illustrated by the following diagram.

Voxeo Prism supports the following standard Java APIs. You can use any or all of these APIs in a single application to support multimodal use cases.

  • Java Servlet/JSP is the standard Java API for building web applications.
  • SIP Servlet is the standard Java API for building communication applications using SIP, such VoIP call centers.
  • XMPP Servlet is an API developed by Voxeo based on the Java Servlet framework for building XMPP based application such as instant messaging.
  • Java Media Control is the standard Java API for controlling media operations on a media server.

Voxeo Prism includes a HMP media server on Windows, Linux, and Mac. The media server supports the following media capabilities. All these capabilities can be manipulated through Java Media Control APIs.

  • media playback and text-to-speech.
  • DTMF detection and voice recognition.
  • media mixing and multiparty conferencing.
  • media recording or multi-track call recording.

In summary, Voxeo Prism is a powerful platform for innovative IP communication applications.  If you are a Java programmer and want to develop communication applications, Voxeo Prism is the right platform for you. To try out, simply go to www.voxeo.com/prism to download one of the installers for your desired platform. As always, Voxeo provides free 24×7 technical support for developers.

In the next blog, I will show you how to install Voxeo Prism on your system.


Want to learn how Voxeo can help unlock your communications and deliver a better customer experience? Please contact us!

If you found this post interesting or helpful, please consider either subscribing via RSS, becoming a fan on Facebook, or following us on Twitter.


Slides available for Voxeo CTO RJ Auburn’s JavaOne talk “Taking a SIP of Java”

Thursday, June 4th, 2009

This week Voxeo CTO RJ Auburn spoke out at the JavaOne conference on the topic of “Taking a SIP of Java“. RJ’s slides are now available on SlideShare at:

http://www.slideshare.net/voxeo/javaone-a-sip-of-java-rj-auburn

And the presentation, also embedded below, looks to be a classic RJ kind of talk… fun, lively, interesting… and also with some code. I don’t know if there were any recordings made, but if there were I’ll update the article with a link. Enjoy the talk!


If you found this post interesting or helpful, please consider either subscribing via RSS, becoming a fan on Facebook or following us on Twitter.


Technorati Tags: , , , , ,


Want to learn how Voxeo can help unlock your communications and deliver a better customer experience? Please contact us!

If you found this post interesting or helpful, please consider either subscribing via RSS, becoming a fan on Facebook, or following us on Twitter.


SIPMethod Application Server now passes JSR 289 TCK

Thursday, October 9th, 2008

JSRs are specifications of Java technologies. JSR 289 is the new specification for SIP Servlet technology. Each JSR comes with a Technology Compatibility Kit (TCK) to verify if an implementation of the JSR indeed fully complies with the specification.

SIPMethod Application Server is a SIP application server based on SIP Servlet technology. Its latest release (beta 3) passes JSR 289 TCK, which means now SIPMethod is in full compliance with JSR 289 specification.

SIPMethod supports not only SIP servlets but also HTTP servlets and Web Service endpoints. It enables the development of converged applications – applications that mix VoIP, Web and SOA capabilities.

SIPMethod is available for download for evaluation purpose right now. Please do check it out if you are interested in building cool Web 2.0 applications with VoIP.


Want to learn how Voxeo can help unlock your communications and deliver a better customer experience? Please contact us!

If you found this post interesting or helpful, please consider either subscribing via RSS, becoming a fan on Facebook, or following us on Twitter.