Failover and Sip Balancer packaging

49 views
Skip to first unread message

Jean Deruelle

unread,
Jun 6, 2008, 7:22:26 AM6/6/08
to mobicent...@googlegroups.com
Hi all,

I've been hacking on failover for Sip Servlets since yesterday
Since we already have a mecanism for that for JAIN-SLEE, I thought I
would reuse it so that it would be a cross cutting concern to both
technologies.
I've been successful in this direction. I just got the junit green for
a basic failover test :

Sip Balancer in front of 2 sip servlets node.
Sip client sending INVITE that goes through SipBalancer that proxies
it statelessly to node 1.
node 1 sends back 180 then OK through SIP Balancer.
client replies back with ACK through SIP BAlancer.
client sends BYE through SIP Balancer
node 1 sends ok to BYE through SIP Balancer.

then node 1 is killed.

and the call flow is replayed again. This time everything goes to node 2.

since we don't have any distributed caching for sessions and dialog
state for now. we can only have basic call failover but not mid call
failover, but this will come.

However, in reusing the sip balancer of JAIN SLEE, I think we need a
refactoring of its packaging so that it is applicable to both JAIN
SLEE and sip servlets.
Currently the sip balancer maven project holds the sip balancer code
and the mbean code (that is present on the nodes and reponsible for
sending heartbeat and health status to the balancer(s)). and it is
packaged as a jboss sar archive. This prevents its inclusion in an
eclipse classpath project (apparently accept only jar) and moreover
only the mbean part needs to be a sar the sip balancer is a standalone
processs started in its own JVM.
Hence, I would like to split it in 2 maven projects :

Jean Deruelle

unread,
Jun 6, 2008, 7:32:15 AM6/6/08
to mobicent...@googlegroups.com
Hi all,

I've been hacking on failover for Sip Servlets since yesterday Since
we already have a mecanism for that for JAIN-SLEE, I thought I would
reuse it so that it would be a cross cutting concern to both
technologies.
I've been successful in this direction. I just got the junit green for
a basic failover test :

Sip Balancer in front of 2 sip servlets node.
Sip client sending INVITE that goes through SipBalancer that proxies
it statelessly to node 1.
node 1 sends back 180 then OK through SIP Balancer.
client replies back with ACK through SIP BAlancer.
client sends BYE through SIP Balancer
node 1 sends ok to BYE through SIP Balancer.

then node 1 is killed.

and the call flow is replayed again. This time everything goes to node 2.

since we don't have any distributed caching for sessions and dialog
state for now. we can only have basic call failover but not mid call

failover, but this will come hopefully next week...

However, in reusing the sip balancer of JAIN SLEE, I think we need a
refactoring of its packaging so that it is applicable to both JAIN
SLEE and sip servlets.
Currently the sip balancer maven project holds the sip balancer code
and the mbean code (that is present on the nodes and reponsible for
sending heartbeat and health status to the balancer(s)). and it is
packaged as a jboss sar archive. This prevents its inclusion in an
eclipse classpath project (apparently accept only jar) and moreover
only the mbean part needs to be a sar the sip balancer is a standalone
processs started in its own JVM.

Hence, I would like to split it in 2 maven projects :

* sip-balancer : which will contain the code for the sip balancer
only and will be packaged as a jar and will be referenced by jslee and
sip servlets projects. This will be hosted in the svn at
trunk/tools/sip-balancer
* node : this will contain the code for a node to send heartbeat
and health status info. This code will have a dependency on the
sip-balancer jar (for the SIpNode class). Depending on the project
will be packaged as sar for jslee and part of sip-servlets-impl jar
for sip servlets (the code for sending heartbeat and all is part of a
subclass of the SipStandardService class which represents the Tomcat
server or embedded tomcat server for jboss)

I would like to have your thoughs on this and know if I can proceed to
the refactoring if you agree. (the refactoring is already done for
sips not for jslee but should be pretty quick)

Thanks
Jean

Ivelin Ivanov

unread,
Jun 6, 2008, 10:49:00 AM6/6/08
to mobicent...@googlegroups.com
Sounds good. Its nice that it worked out without change for SIPS.

Jean Deruelle

unread,
Jun 6, 2008, 11:15:19 AM6/6/08
to mobicent...@googlegroups.com
I did some minor changes but overall it worked quite nicely.
I also Just added a new call flow in the basic failover test :
there is one sender and one receiver UA.
goes through Sip Balancer then on the node goes through SpeedDial and
Location Services (2 proxy applications).

Jean Deruelle

unread,
Jun 6, 2008, 4:33:51 PM6/6/08
to mobicent...@googlegroups.com
I committed the sip-balancer under svn/trunk/tools.
If someone could build it and upload a snapshot version of it to jboss
repo that would be great. (or send me the info for doing it)
Because the sip servlets trunk will fail meanwhile or one would have
to check out the code of sip balancer and build it to have in its repo
to be able to compile sipservlets.
It will also allow me to refactor the jslee balancer project as
discussed earlier in this thread

Eduardo Martins

unread,
Jun 6, 2008, 8:57:24 PM6/6/08
to mobicent...@googlegroups.com
To upload snapshots of a project you just need two things:

1) pom that descends directly or not from root pom

2) execute "mvn deploy"

Jean Deruelle

unread,
Jun 7, 2008, 2:48:41 PM6/7/08
to mobicent...@googlegroups.com
<parent>
<artifactId>mobicents</artifactId>
<groupId>org.mobicents</groupId>
<version>1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

mvn deploy output :

[INFO] [deploy:deploy]
altDeploymentRepository = null
[INFO] Retrieving previous build number from snapshots.jboss.org
[WARNING] repository metadata for: 'snapshot
org.mobicents.tools:sip-balancer:1.0-SNAPSHOT' could not be retrieved
from repository: snapshots.jboss.org due to an error: Unsupported
Protocol: 'dav': Cannot find wagon which supports the requested
protocol: dav
[INFO] Repository 'snapshots.jboss.org' will be blacklisted
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error deploying artifact: Unsupported Protocol: 'dav': Cannot
find wagon which supports the requested protocol: dav

Component descriptor cannot be found in the component repository:
org.apache.maven.wagon.Wagondav.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8 seconds
[INFO] Finished at: Sat Jun 07 20:47:11 CEST 2008
[INFO] Final Memory: 10M/80M

Moreover it seems that someone changed the jsip version to 1.2.1.71
but it can't be found on any repository...

Jean Deruelle

unread,
Jun 7, 2008, 3:06:51 PM6/7/08
to mobicent...@googlegroups.com
I fixed the problem by adding this to the pom.xml of the sip-balancer
project but now I got a 401 because I don't have the credentials. see
error below, can someone send me the credentials by mail ?
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-webdav</artifactId>
<version>RELEASE</version>
</extension>
</extensions>

[INFO] [deploy:deploy]
altDeploymentRepository = null
[INFO] Retrieving previous build number from snapshots.jboss.org

7 juin 2008 21:04:38 org.apache.commons.httpclient.HttpMethodBase
processAuthenticationResponse
ATTENTION: No credentials available for the 'JBoss Snapshot WebDav
Repository' authentication realm at snapshots.jboss.org


[WARNING] repository metadata for: 'snapshot
org.mobicents.tools:sip-balancer:1.0-SNAPSHOT' could not be retrieved

from repository: snapshots.jboss.org due to an error: Authorization
failed: Not authorized.


[INFO] Repository 'snapshots.jboss.org' will be blacklisted

Uploading: https://snapshots.jboss.org/maven2/org/mobicents/tools/sip-balancer/1.0-SNAPSHOT/sip-balancer-1.0-20080607.190436-1.jar
7 juin 2008 21:04:39 org.apache.commons.httpclient.HttpMethodBase
processAuthenticationResponse
ATTENTION: No credentials available for the 'JBoss Snapshot WebDav
Repository' authentication realm at snapshots.jboss.org
7 juin 2008 21:04:39 org.apache.commons.httpclient.HttpMethodBase
processAuthenticationResponse
ATTENTION: No credentials available for the 'JBoss Snapshot WebDav
Repository' authentication realm at snapshots.jboss.org
7 juin 2008 21:04:39 org.apache.commons.httpclient.HttpMethodBase
processAuthenticationResponse
ATTENTION: No credentials available for the 'JBoss Snapshot WebDav
Repository' authentication realm at snapshots.jboss.org
7 juin 2008 21:04:39 org.apache.commons.httpclient.HttpMethodBase
processAuthenticationResponse
ATTENTION: No credentials available for the 'JBoss Snapshot WebDav
Repository' authentication realm at snapshots.jboss.org
7 juin 2008 21:04:39 org.apache.commons.httpclient.HttpMethodBase
processAuthenticationResponse
ATTENTION: No credentials available for the 'JBoss Snapshot WebDav
Repository' authentication realm at snapshots.jboss.org
7 juin 2008 21:04:40 org.apache.commons.httpclient.HttpMethodBase
processAuthenticationResponse
ATTENTION: No credentials available for the 'JBoss Snapshot WebDav
Repository' authentication realm at snapshots.jboss.org
7 juin 2008 21:04:40 org.apache.commons.httpclient.HttpMethodBase
processAuthenticationResponse
ATTENTION: No credentials available for the 'JBoss Snapshot WebDav
Repository' authentication realm at snapshots.jboss.org


[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------

[INFO] Error deploying artifact: Failed to transfer file:
https://snapshots.jboss.org/maven2/org/mobicents/tools/sip-balancer/1.0-SNAPSHOT/sip-balancer-1.0-20080607.190436-1.jar.
Return code is: 401 Unauthorized

[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error
deploying artifact: Failed to transfer file:
https://snapshots.jboss.org/maven2/org/mobicents/tools/sip-balancer/1.0-SNAPSHOT/sip-balancer-1.0-20080607.190436-1.jar.
Return code is: 401 Unauthorized
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error
deploying artifact: Failed to transfer file:
https://snapshots.jboss.org/maven2/org/mobicents/tools/sip-balancer/1.0-SNAPSHOT/sip-balancer-1.0-20080607.190436-1.jar.
Return code is: 401 Unauthorized
at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:174)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:447)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
... 16 more
Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException:
Error deploying artifact: Failed to transfer file:
https://snapshots.jboss.org/maven2/org/mobicents/tools/sip-balancer/1.0-SNAPSHOT/sip-balancer-1.0-20080607.190436-1.jar.
Return code is: 401 Unauthorized
at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:94)
at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:162)
... 18 more
Caused by: org.apache.maven.wagon.TransferFailedException: Failed to
transfer file: https://snapshots.jboss.org/maven2/org/mobicents/tools/sip-balancer/1.0-SNAPSHOT/sip-balancer-1.0-20080607.190436-1.jar.
Return code is: 401 Unauthorized
at org.apache.maven.wagon.providers.webdav.WebDavWagon.put(WebDavWagon.java:311)
at org.apache.maven.artifact.manager.DefaultWagonManager.putRemoteFile(DefaultWagonManager.java:237)
at org.apache.maven.artifact.manager.DefaultWagonManager.putArtifact(DefaultWagonManager.java:153)
at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:80)
... 19 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 24 seconds
[INFO] Finished at: Sat Jun 07 21:04:40 CEST 2008
[INFO] Final Memory: 11M/80M
[INFO] ------------------------------------------------------------------------

Eduardo Martins

unread,
Jun 7, 2008, 8:06:54 PM6/7/08
to mobicent...@googlegroups.com
You need a jboss.org account, once you have it ask Paul G (pg...@redhat.com) to add you to the authorized users list.

Regarding the errors, that's very weird, I never saw it doing deploys from poms like servers/jain-slee, sip-presence, tools/..., can it be something that is redefined in the balancer's pom?

Eduardo Martins

unread,
Jun 7, 2008, 8:09:57 PM6/7/08
to mobicent...@googlegroups.com
On Sat, Jun 7, 2008 at 7:48 PM, Jean Deruelle <jean.d...@gmail.com> wrote:
 
Moreover it seems that someone changed the jsip version to 1.2.1.71
but it can't be found on any repository...



Guys, please note, we need all external dependencies in jboss maven repositories, if you want to add or update one (as jain sip in this case) you need to have a jboss.rg account, ask Paul G for credentials to upload to jboss maven svn, and upload it manually (install the dependency in your local repository then copy it's dir to jboss svn).
 

Jean Deruelle

unread,
Jun 9, 2008, 3:31:42 AM6/9/08
to mobicent...@googlegroups.com
I thought the jsip version change was subject to QA validation ? Has
it been given for 1.2.1.71 ?

Amit Bhayani

unread,
Jun 9, 2008, 3:34:52 AM6/9/08
to mobicent...@googlegroups.com
1.2.1.71 is still not in jboss mvn repo and hence its failing.

Jean Deruelle

unread,
Jun 9, 2008, 3:38:34 AM6/9/08
to mobicent...@googlegroups.com
Is someone able to revert back to version 1.2.1 in the main pom and
upload it to jboss repo in the meanwhile ?

Amit Bhayani

unread,
Jun 9, 2008, 3:41:43 AM6/9/08
to mobicent...@googlegroups.com
I have made changes to my local pom for things to work. I think let Luis take this responsibility as he is maintaining the versions.

Eduardo Martins

unread,
Jun 9, 2008, 6:22:45 AM6/9/08
to mobicent...@googlegroups.com
Reverted to 1.2.1, of course QA has to validate the new one.

Jean Deruelle

unread,
Jun 9, 2008, 3:59:13 PM6/9/08
to mobicent...@googlegroups.com
Thanks Ed !

The sip balancer snapshot version has been uploaded

Ivelin Ivanov

unread,
Jun 9, 2008, 5:09:47 PM6/9/08
to mobicent...@googlegroups.com
Luis?

Jean Deruelle

unread,
Jun 10, 2008, 12:31:31 PM6/10/08
to mobicent...@googlegroups.com
First Basic version of failover working. Mobicents Sip Servlets
doesn't currently
support mid-call failover, since neither sip sessions and sip
application sessions
nor dialog state are distributable yet.
To check the progess of those, check out Issue 114 and Issue 139.

Code committed. Test case available here :
http://code.google.com/p/mobicents/source/browse/trunk/servers/sip-servlets/sip-servlets-test-suite/testsuite/src/test/java/org/mobicents/servlet/sip/testsuite/failover/BasicFailoverTest.java

The test case tests different scenario a simple UAS/UAC one, a
callforwarding B2BUA,
and a composition by proxy with speed dial and location service applications.

The mobicents sip balancer has needed some rework (the way it was built, it was
impossible for the callee to send a BYE, refactored that in using double record
routing and removing the custom router implemtenation). The new sip
balancer code is
available at http://code.google.com/p/mobicents/source/browse/trunk/tools/sip-balancer

A runnable standalone version is present in the jboss snapshot repo :
the latest one
is
http://snapshots.jboss.org/maven2/org/mobicents/tools/sip-balancer/1.0-SNAPSHOT/sip-balancer-1.0-20080610.154258-5-jar-with-dependencies.jar.
Run it with the following command java -jar
sip-balancer-1.0-20080610.154258-5-jar-with-dependencies.jar 127.0.0.1 5065 5060

Full Documentation available here :
http://www.mobicents.org-a.googlepages.com/failover.html

Reply all
Reply to author
Forward
0 new messages