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 :
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
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...
[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] ------------------------------------------------------------------------
Moreover it seems that someone changed the jsip version to 1.2.1.71
but it can't be found on any repository...
The sip balancer snapshot version has been uploaded
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