Open Source SIP Phone With Red5 And Flex3

Source : http://www.igniterealtime.org/community/blogs/

ignite/2008/05/05/flashbased-audio-in-openfire-part-ii

Just over a year ago, I blogged about using audio and video with openfire. At that time, I implemented a SIP based softphone in Adobe Flash using AsteriskWin32 and VAC4. My argument for an open-source, standards based, no-install web-based softphone as a requirement for Web 2.0 voice applications is still valid today and the emergence of Ribbit, TringMe, Zingaya (Flashphone) and others confirmed my thinking was not isolated.

It has however been a disappointment that all implementations I have encountered to-date have been closed, proprietary and inaccessible for integration (both client and server).

The latest release of the Red5 Plugin for Openfire features a completely open-source implementation of a web-based SIP softphone written in Flex3 and should work on both Windows and Linux. It uses MjSIP as the SIP user agent in the plugin and should work with most SIP proxies, but I have only tested with Asterisk. I have also only tested 2 simultaneous users, but there is no limit and will depend on how many users and media streams Red5 can cope with before it dies. Each telephone conversation consumes 2 user RTMP connections and 4 audio streams on Red5. All source code is provided and you are free to use it in your Openfire Red5 Plugin applications. Just confirm that the open-source licenses of MjSIP and Nelly2PCM are to your liking.

http://red5.4ng.net/gtms/flashphone3.jpg

I have also integrated the softphone into SparkWeb and the Openfire SIP plugin. This will enable a user to make SIP calls from Spark and SparkWeb with the same user profile. The old Red5gateway will be depreciated and in a later release for window users, I will be adding AsteriskWin32 to the plugin and provide a complete SIP solution for Openfire.

As usual, any feedback will be appreciated.

For details of how this works read on…..

http://red5.4ng.net/gtms/flashphone2.jpg

The red5Phone Flex3 client makes a NetConnection with the Red5 SIP application. When it recieves a success response, it makes a remote “open” method call in the Red5 SIP application which creates a pair of SIPUser and RTMPUser objects for that user and instructs SIPUser to register the user with the specified SIP proxy. When the NetConnection is closed by the Flex3 client, the pair of objects are destroyed and the user is unregistered from the SIP proxy.

When the Flex3 client invokes “call” remotely, SIPUser starts a SIP outgoing call with the SIP proxy and exchanges RTP audio streams. It invokes “connected” on the Flex3 client and informs it of what stream names Flex3 client should use to publish from the PC microphone and play to the PC speaker. It then resamples the incoming audio RTP packets from 8KHZ to 11KHZ, converts from ulaw to ADPCM and calls a method in the RTMPUser object to publish the audio to Red5 using the same name it gave to the Flex3 client to play.

The RTMPUser objects also plays the stream being published by the Flex3 client which is in the Nellymoser ASAO codec. It calls asao2ulaw (my modified version of the open source nelly2pcm) to convert the packets to ulaw and pass to SIPUser through a PipedOutputStream.

An incoming call follows the same pattern, the incoming SIP signal appears as a remote “incoming” call on the flex3 client. The user can then pickup the call and the Red5phone Flex3 client remotely calls “accept” in SIPUser to accept the call. The audio is setup the same way as an outgoing call.

Posted by dele

6 Comments

  1. 1
    crajanm Says:

    Do you any idea integrate SIP with Flex 3 and Flash Media Server.

  2. 2
    venkatkrishna2008 Says:

    Hi,
    I followed the steps wat u have specified,
    But when i run the link http://localhost:5080/sip
    it gives
    HTTP ERROR: 404

    NOT_FOUND

    RequestURI=/

    Powered by jetty://

    can u please help

  3. 3
    venkatkrishna2008 Says:

    Hi
    I got every working fine.
    I have installed the red5 plugin into openfire.
    and when i make a call i can hear the voice only from one side
    in a two user communication.
    Can u please help me this and can u suggest me what has to be configured in the openfire 3.6.2 and red5 and sip.

  4. 4
    venkatkrishna2008 Says:

    HI

  5. 5
    venkatkrishna2008 Says:

    Hi,

    I am facing a problem in sip registration.
    The request for registering is sent to the sip server.
    But for confirmation the sip server asks for one more request from client.
    At this time the client sends the same message

  6. 6
    dammalapati Says:

    I tried the above document but it was not working. So i switch back to sip phone with standalone Red5 server given in the

    http://npramesh.wordpress.com/2008/06/05/web-based-sip-phone-with-flex-java-and-red5-server/.

    I was trying the all the above solution in Linux, none of them r working. can any one help me to deploy sip phone with Red5 standalone server in Linux platform.


RSS Feed for this entry

Leave a Comment

You must be logged in to post a comment.