Red5, SIP Phone, Sparkweb

I would like to thank and congratulate dele for this contribution.

I’ve installed an asterisk system in my company and later on I added the openfire server, which opened some doors to missing functions we were expecting from our service. The goal here was to have a single application which would like just as skype, centralizing file transfers, chat, conferences and phone calls. Sometimes, however, our employees are in mission at companies whose networks block much of the traffic and that’s where I think red5 would come in handy.

The idea is that we could connect to our jabber accounts through a web browser and have access to the company’s phone line thanks to the sparkweb integration, all in a unified and good looking window. I guess many other people expect this same behaviour. The thing is, I can’t get it to work so far.

1- when I access the red5 test page and fill in with my proxy settings, I can register to my SIP account and even make a call (internal and externally), but dtmf does not work, so it’s kinda useless for voicemail retrieval or other things that require dialing some keys. The main problem, however, is that once I go to the sparkweb page (either by changing the url or by following the link) and login to my account, I get along with my contact list a window which states “SIP Phone Error - 401 Unauthorized”. I also noted that my sip peers status on asterisk is Unreachable rather than ok and once I quit the browser, it is still the same for long after.

2 - When I enter sparkweb, why should I fill in the server information?? It looks a bit obvious to me that if we reach that url, the jabber server we’re looking for is pretty obvious. My complaint is rather that I find it confusing the fact the it does not accept localhost as a value and I always need to enter my server’s IP address.

3 - The flash application which is running on my browser window communicates with my jabber server through which ports? I wish all communication would go through standard http, even voice… is it possible? Where could I get some details about the connections’ architecture??

4 - Am I doing something wrong or the button “exit sparkweb” does not work?

Thanks for your help and attention, please keep up this good work.

SIP Phone Error - 401 Unauthorized".

I assume you are using the SIP plugin for openfire to setup the SIP profile for the user and you that you have first confirmed that this works with Spark. The Admin console web page for the SIP user profile show show “registered” or whatever the status is.

I also noted that my sip peers status on asterisk is Unreachable rather than ok

Another bug in MjSIP that has been identified. Set Qualify=no in Asterisk as a temp solution

When I enter sparkweb, why should I fill in the server information??

There is thread in the Spark community right now about changes that you want to see. I suggest you register this suggestion there.

I wish all communication would go through standard http, even voice… is it possible?

Flash by default, makes an RTMP connection on port 1935. All media (audio/video) is transmitted both ways over mulitple streams. Flash will also tunnel RTMP over HTTP. That is called RTMPT. Change your Red5 URL to rtmpt://your_server:8000/sip instead if rtmp:/sip. If port 8000 does do work for you look for the file plugins/red5/WEB-INF/classes/red5-rtmpt.xml and edit it accordingly. You can’t use the HTTP-Bind port.

exit sparkweb" does not work?

If you look at SparkWeb source code you will see “not implemented yet”

but dtmf does not work

It is working in latest version. No audio feedback but it works for RFC2833 type DTMF which is the default for Asterisk. DTMF with INFO messages is not yet implemented. It works on my Asterisk and public phone numbers in the UK. I have not added this to SparkWeb yet.

Thanks for your help and attention, please keep up this good work.

You are welcome. It is however a challenge to juggle all this with a full time day job.

I assume you are using the SIP plugin for openfire to setup the SIP profile for the user and you that you have first confirmed that this works with Spark. The Admin console web page for the SIP user profile show show “registered” or whatever the status is.

Indeed I am. Spark used to work fine with these settings. I am still having some trouble with remote connection, where voice is not passing through, but that is probably a port forwarding problem and I shouldn’t bother you with that. The thing is, all my communication is working quite well locally, but red5 is still not connecting. As I got a “registered” when using spark, when I try with red5/sparkweb/ I get a “registration failed”. When I use red5 only (the test page), I manage to have the phone working.

What I understood from you is that the test page uses the parameters set in the flash form : (here’s where the image would be, in case I screw the formatting)

cid:5061B13F-7087-4D60-B16C-C3435AF1CDEE

On the other hand, the /red5/sparkweb/ section uses the parameters set both on the red5 (the red5 URL being that initially set with rtmp:/somewierdaddress which I have changed to rtmpt://220.110.24.198:8000/sip) admin section and the sip phone section. That’s where I get confused, because if I’m right and since my sip phone plugin works correctly with Spark, I can’t understand why sparkweb is not working at all. I’m not a pro with asterisk, but I debugged sip on the Asterisk CLI and here’s what I got :

<— SIP read from 220.110.24.198:5064 —>

REGISTER sip:220.110.24.198 SIP/2.0

Via: SIP/2.0/UDP 127.0.0.1:5064;rport;branch=z9hG4bK33285

Max-Forwards: 70

To: “3010” sip:3010@220.110.24.198

From: “3010” sip:3010@220.110.24.198;tag=z9hG4bK96257610

Call-ID: 582777981678@127.0.0.1mailto:582777981678@127.0.0.1

CSeq: 1 REGISTER

Contact: sip:3010@127.0.0.1:5064

Expires: 3600

User-Agent: mjsip stack 1.6

Content-Length: 0

<----


— (11 headers 0 lines) —

Using latest REGISTER request as basis request

Sending to 220.110.24.198 : 5064 (NAT)

<— Transmitting (NAT) to 220.110.24.198:5064 —>

SIP/2.0 100 Trying

Via: SIP/2.0/UDP 127.0.0.1:5064;branch=z9hG4bK33285;received=220.110.24.198;rport=5064

From: “3010” sip:3010@220.110.24.198;tag=z9hG4bK96257610

To: “3010” sip:3010@220.110.24.198

Call-ID: 582777981678@127.0.0.1

CSeq: 1 REGISTER

User-Agent: Asterisk PBX

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY

Supported: replaces

Contact: sip:3010@220.110.24.198

Content-Length: 0

<----


<— Transmitting (NAT) to 220.110.24.198:5064 —>

SIP/2.0 401 Unauthorized

Via: SIP/2.0/UDP 127.0.0.1:5064;branch=z9hG4bK33285;received=220.110.24.198;rport=5064

From: “3010” sip:3010@220.110.24.198;tag=z9hG4bK96257610

To: “3010” sip:3010@220.110.24.198;tag=as6a68790d

Call-ID: 582777981678@127.0.0.1

CSeq: 1 REGISTER

User-Agent: Asterisk PBX

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY

Supported: replaces

WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce=“4fb442d8”

Content-Length: 0

<----


Scheduling destruction of SIP dialog ‘582777981678@127.0.0.1’ in 32000 ms (Method: REGISTER)

As you can see 220.110.24.198 is my pbx internal IP and since I’m running my openfire server in the same machine, it sometimes uses 127.0.0.1 and sometimes that IP. Another thing I noticed is that my Asterisk server first gives a Unauthorized answer to all SIP peers (for exemple those connecting from x-lite, I never knew why) and a 200OK response on the second attempt, which the mjsip stack doesn’t make. Last, but not least, I’ve changed my red5 “enter” and “end” SIP and RTP ports into 5060-5099, 10000-20000 respectively, to compile with my company’s defaults… I now think it was a stupid move, since all of those connections (I think) are going to be made from localhost only, so I shouldn’t bother with opening those ports to the WAN (is that reasoning right?).

Well, I still got loads of doubts and I’m really sorry to waste your time with my newbie questions, specially knowing you have a hard schedule. If on the other hand you manage to take a look at my post, I would be really grateful.

Thanks in advance.

On the other hand, the /red5/sparkweb/ section uses the parameters set both on the red5 (the red5 URL being that initially set with rtmp:/somewierdaddress which I have changed to rtmpt://220.110.24.198:8000/sip) admin section and the sip phone section

My bad!!. It does not. I missed that opportunity. SparkWeb does a service discovery to get SIP parameters, but does not query the Red5 plugin. It is hard-coded with rtmp/sip.

From com/jivesoftware/spark/managers/SiparkManager.as

     private function login():void {
          netConnection.connect("rtmp:/sip");
          setStatus("Registering");
     }

Thanks for finding this. I will try and fix this as soon as I possibly can. I have made a few changes to MjSIP, so upgrade to latest version if you can.

-dele

Where can I get the latest version?? I’m currently using 0.0.19, which

I got from a link somewhere (don’t remember), but the openfire page

points to 0.0.18… If there’s a newer one or a website I could check

constantly for updates, I could keep it up in a better way. Besides,

my internship program is based in deploying something like the

solution you are developing so if you find it useful, I can beta test

everything you add. It’s just that I am not that experienced with all

the stuff you talk about, so my understanding of things will be

sometimes limited. I’ll make an extra effort to inform myself of

everything in order to keep it up.

One last thing: any comments on my changing of port ranges? I don’t

know if my post got entirely published, with the whole sip debugging

and stuff.

Thanks a lot!

The lastest fixes will always be at http://red5.4ng.net/red5.war while the stable version will be on igniterealtime.

As your asterisk and openfire installs are on the same server and are both listening on UDP, you have to make sure your MjSIP ports (SIP & RTP) do not clash with Asterisk. It think asterisk config is in etc/asterisk/udp.conf. Latest version is 0.0.20 and it only fixes the problem with incoming calls sometimes being ignored. I saw the SIP messages, but can’t analyse them right now.

-dele

Hi Dele like the new plugin very much.But am having trubles setting up the openfire sip gatway I keep getting phone not registered no matter how I program the sip.I have even got a Gizmo account witch the gatway connects fine but nun of the client side apps will register.I am not sure what I mite be doing wrong.I cant find any error or debug that mite shed any light on this.So I am lost :_|

Bruce

Hi Bruce,

I have even got a Gizmo account which the gatway connects fine but none of the client side apps will register

Can you give us a bit more info on what you are doing. Are you trying to us the Red5Phone Flex (connects directly to SIP from MjSIP inside Red5 Plugin) or are you trying to use SparkWeb which uses Red5Phone with Openfire SIP plugin or are you trying to make this work with the old Red5Gateway?

-dele

I am running openfire 3.5.1 red5 v0.0.21 on windowsxp to .All clients including the flash phone shoe in admin page as

RegistrationFailed on the sip phone admin page spark web when I click the phone icon get the message phone not registerd.I am using the openfire sip plugin cant fined any error or debug logs that aply to using the sip just

RegistrationFailed.I wish I had more info but there is nun.should I have any spacific type of sip server installed on my system.As for Gizmo I have an account and used ther sip gateway connection setup got this when I run the test

SIP Account Successfully Tested.But sparkweb and spark get the same RegistrationFailed and if I try to make a phone call with the falsh pnone on the gizmo account the call will not work.There is nothing in the logs to post .It seems the problem is the clients registering with the openfire sip phone plugin.

.I wish I had more info but there is nun.

The SIP client log files are in the logs folder and are named xxxx.xxxx.xxxx.xxxx:nnnn_messages and xxxx.xxxx.xxxx.xxxx:nnnn_events. Look in stdout.log, red5.log and red5error.log for the Red5 plugin log messages.

-dele

here is spark error logs

net.java.sipmack.sip.CommunicationsException: Could not create a register transaction!

Check that the Registrar address is correct!

at net.java.sipmack.sip.RegisterProcessing.register(RegisterProcessing.java:315)

at net.java.sipmack.sip.SipManager.register(SipManager.java:575)

at net.java.sipmack.sip.SipManager.startRegisterProcess(SipManager.java:615)

at net.java.sipmack.softphone.SoftPhoneManager.handleRegisterRequest(SoftPhoneMana ger.java:393)

at net.java.sipmack.softphone.SoftPhoneManager$2.run(SoftPhoneManager.java:910)

at java.lang.Thread.run(Unknown Source)

javax.sip.InvalidArgumentException: Address already in use: Cannot bind

at gov.nist.javax.sip.SipStackImpl.createListeningPoint(SipStackImpl.java:678)

at net.java.sipmack.sip.SipManager.start(SipManager.java:304)

at net.java.sipmack.sip.SipManager.registrationFailed(SipManager.java:665)

at net.java.sipmack.sip.SipManager.fireRegistrationFailed(SipManager.java:1279)

at net.java.sipmack.sip.RegisterProcessing.register(RegisterProcessing.java:333)

at net.java.sipmack.sip.SipManager.register(SipManager.java:575)

at net.java.sipmack.sip.SipManager.startRegisterProcess(SipManager.java:615)

at net.java.sipmack.softphone.SoftPhoneManager.handleRegisterRequest(SoftPhoneMana ger.java:393)

at net.java.sipmack.softphone.SoftPhoneManager$2.run(SoftPhoneManager.java:910)

at java.lang.Thread.run(Unknown Source)

Caused by: java.io.IOException: Address already in use: Cannot bind

at gov.nist.javax.sip.stack.UDPMessageProcessor.<init>(UDPMessageProcessor.j ava:141)

at gov.nist.javax.sip.stack.SIPTransactionStack.createMessageProcessor(SIPTransact ionStack.java:1669)

at gov.nist.javax.sip.SipStackImpl.createListeningPoint(SipStackImpl.java:659)

… 9 more

net.java.sipmack.sip.CommunicationsException: Could not create a register transaction!

Check that the Registrar address is correct!

at net.java.sipmack.sip.RegisterProcessing.register(RegisterProcessing.java:315)

at net.java.sipmack.sip.SipManager.register(SipManager.java:575)

at net.java.sipmack.sip.SipManager.register(SipManager.java:523)

at net.java.sipmack.sip.SipManager.registrationFailed(SipManager.java:667)

at net.java.sipmack.sip.SipManager.fireRegistrationFailed(SipManager.java:1279)

at net.java.sipmack.sip.RegisterProcessing.register(RegisterProcessing.java:333)

at net.java.sipmack.sip.SipManager.register(SipManager.java:575)

red5 logs

2008-05-26 08:36:45,703 INFO org.red5.server.jmx.JMXAgent - JMX HTML adapter was not enabled

2008-05-26 08:36:45,718 INFO org.red5.server.jmx.JMXAgent - JMX RMI adapter was not enabled

2008-05-26 08:36:49,265 INFO o.r.s.net.rtmp.RTMPMinaTransport - RTMP Mina Transport Settings

2008-05-26 08:36:49,281 INFO o.r.s.net.rtmp.RTMPMinaTransport - IO Threads: 2

2008-05-26 08:36:49,281 INFO o.r.s.net.rtmp.RTMPMinaTransport - Event Threads - core: 4, max: 8, queue: -1, keepalive: 60

2008-05-26 08:36:49,531 INFO o.r.s.net.rtmp.RTMPMinaTransport - TCP No Delay: true

2008-05-26 08:36:49,546 INFO o.r.s.net.rtmp.RTMPMinaTransport - Receive Buffer Size: 65536

2008-05-26 08:36:49,562 INFO o.r.s.net.rtmp.RTMPMinaTransport - Send Buffer Size: 271360

2008-05-26 08:36:49,687 INFO o.r.s.net.rtmp.RTMPMinaTransport - RTMP Mina Transport bound to 0.0.0.0/0.0.0.0:1935

2008-05-26 08:36:49,703 INFO org.red5.server.jmx.JMXFactory - Object name: org.red5.server:type=RTMPMinaTransport,address=0.0.0.0,port=1935

2008-05-26 08:36:49,734 INFO org.red5.server.jmx.JMXFactory - Object name: org.red5.server:type=IoServiceManager,address=0.0.0.0,port=1935

red5 error logs empty

can I have sample of a working sip user set up I have tried many thay all do the same I used the instructions from gizmo sip setup the gismo account.

Same problem here too, this is from the openfire error log file

Let me back up. In the version 3.4.3 of openfire without ever having installed red5 (didn’t know about it) the SIP plugin worked sucessfully with Gizmo Account settings. Since openfire’s revisions I have not been able to get a connections with SIP support at all for a Gizmo account to register in openfire. Below is a copy of the error log in openfire when trying to register with Gizmo with the SIP support plugin. Hopefully someone could lend a helping hand on this error. Thank you for your time.

Gizmo Settings:

server: proxy01.sipphone.com

port: 5060

**described setting on gizmo site: proxy01.sipphone.com:5060

stun: stun01.sipphone.com

stun port: 3478

**described setting on gizmo site: stun01.sipphone.com:3478

2008.05.26 10:12:28 org.jivesoftware.openfire.stun.STUNService.startLocalServer(STUNService.java:161 )

Disabling STUN server

java.net.BindException: Cannot assign requested address: Cannot bind

at java.net.PlainDatagramSocketImpl.bind0(Native Method)

at java.net.PlainDatagramSocketImpl.bind(Unknown Source)

at java.net.DatagramSocket.bind(Unknown Source)

at java.net.DatagramSocket.<init>(Unknown Source)

at java.net.DatagramSocket.<init>(Unknown Source)

at de.javawi.jstun.test.demo.StunServer.<init>(StunServer.java:32)

at org.jivesoftware.openfire.stun.STUNService.startLocalServer(STUNService.java:15 4)

at org.jivesoftware.openfire.stun.STUNService.start(STUNService.java:143)

at org.jivesoftware.openfire.XMPPServer.startModules(XMPPServer.java:600)

at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:466)

at org.jivesoftware.openfire.XMPPServer.<init>(XMPPServer.java:161)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at java.lang.Class.newInstance0(Unknown Source)

at java.lang.Class.newInstance(Unknown Source)

at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:106)

at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:51)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)

at com.exe4j.runtime.WinLauncher.main(Unknown Source)

here is a snapshot of my openfire startup

Hi dele,

I get 401 message from my asterisk pbx with my red5phone(red5 plugin 0.024), but can not send authentication info back to asterisk, How to get around 401?

Thanks

well an update since my last post on this issue

Well it appears that Gizmo SIP settings for Registering SIP in Spark is now successful which all of you may know already.

Here is the settings I used:

Gizmo Settings:

server: proxy01.sipphone.com

port: 5060

**described setting on gizmo site: proxy01.sipphone.com:5060

http://powerplus.hopto.org/images/SIP_Settings01.PNG

stun: stun01.sipphone.com

stun port: 3478

**described setting on gizmo site: stun01.sipphone.com:3478

http://powerplus.hopto.org/images/SIP_Settings03.png

SIP Phone Mapping:

SIP Username: {YOUR GIZMO USER NAME}

Authorization Name: {YOUR GIZMO USER NAME}

Display Phone Number: {YOUR GIZMO SIP PHONE NUMBER}

Outbound Proxy: {LEAVE THIS BLANK}

http://powerplus.hopto.org/images/SIP_Settings02.png

When you add these Settings TEST DOES NOT WORK, however this will register when you start spark with SIP plugin enabled. Don’t be discouraged by the failed TEST. Launch Spark and this should work, as always make sure you have the appropriate ports open on your firewall.

Problems are:

What does prompt for user credentials do?

Is this only for Asterisk SIP?

DELE:***ACCOUNT DOES NOT REGISTER IN SPARK WEB ~~~ DELE IF YOUR READING THIS WHAT DO YOU SUGGEST ON THIS PROBLEM?

Hope this helps anyone, since this has been a thorn in my side for a while.

Display Phone number is used in SIP addresss (sip:phone@server)
Server is used as SIP Realm/domain (sip:phone@server)

Outbound Proxy is the SIP server host name or IP Address

Username and Password are used for SIP registration

Authorization Username is unused

In your settings, the Outbound proxy and Display Phone number will not work with SparkWeb

Hi;

I was meet same problem with red5,

my setting detail:

Red5 Properties–>url:rtmpt://ip_address:8000/sip

and sip phone mapping display user registered.

and have change the red5/sparkweb/index.html setting same to rtmpt://ip_address:8000/sip.

but when two sparkweb user call is ok, but when press make telphone call icon will get

“SIP Phone Error:phone not registered”

so, any one can help me resolve it?

thanks
k.lin

Hi,

I too faced the same 401 Unauthorized problem. When I changed my red5url & in index.html to “rtmpt://mySIPserverIPAddress:8000/sip” now the problem is solved. But in Phone Mappings it showing as Registering and I can’t see registered users list in my openser server. I guess it’s not hitting SIP Server. I don’t know what mistake did I made in the settings.

My Settings are:

  1. I have created two users in my SIP(OpenSER) Server say as Gouri & Prasad.

  2. In Openfire admin console I have added the same two users in USers/Groups Tab.

Username: Gouri

Name: Gouri

Password: gouri123

Confirm Password: gouri123

  1. I have se the in Red5 as

Name: red5

URL: rtmpt://210.24.31.133:8000/sip where 210.24.31.133 is my SIP(OpenSER) Server IP Address

  1. I have Mapped the two users as

XMPP: Gouri

SIP Username: Gouri

Authorized Username: Gouri

Display Phone No: sip:Gouri@210.24.31.133 where 210.24.31.133 is SIP(OpenSER) Server IP Address.

Password: gouri123

Server: 210.24.31.133:5080 where where 210.24.31.133 is SIP(OpenSER) Server IP Address and 5080 is my SIP Port.

  1. My SIP Settings:

SIP Server: 210.24.31.133:5080

StunServer: stun01.sipphone.com

Port: 3478

Can anyone please tell me what mistake I have made in my settings or Can anyone give me the solution for call working(any document) in sparkweb.

Thanks,

Gouri Prasad.