Detect Disconnect clients

73 views
Skip to first unread message

Ben

unread,
Feb 10, 2009, 8:40:46 PM2/10/09
to mobicents-public
Hi, folks,

my app based on Mobicents is almost ready to roll! However, there is
one critical problem: we rely on the BYE msg from the UAC to
disconnect the client. It has happened many times that the clients are
not sending a BYE upon disconnect.

Any idea, how I can actively detect this?


Ben

Jean Deruelle

unread,
Feb 11, 2009, 3:29:27 AM2/11/09
to mobicent...@googlegroups.com
IIRC, the MSC API of the Media Server gives you some listener methods to implement to detect if a link or connnection has been disconnected (connectionDisconnected method from MsConnectionListener). I think you should be able to call the same logic that you use upon BYE requests from there.

The Mobicents Media Server Team might be able to confirm that.

Jean

Oleg Kulikov

unread,
Feb 11, 2009, 5:20:20 AM2/11/09
to mobicent...@googlegroups.com
The connection lifetime is configured in the jboss-service.xml. The default value is 30min, 
 
Oleg.

2009/2/11 Jean Deruelle <jean.d...@gmail.com>

Ben

unread,
Feb 11, 2009, 5:26:05 AM2/11/09
to mobicents-public
Thanks, Both.

We had to change the 30 min config, as our clients regularly have
conference calls for over 3 or 4 hours.

We are looking into the possiblility of a silence detector. It doesn't
appear to be too hard. Here's our logic: if a line has been silent for
too long, let's see over 30 min, we'll drop that line. What do you
think?


Ben

On Feb 11, 5:20 am, Oleg Kulikov <oleg.kulik...@gmail.com> wrote:
> The connection lifetime is configured in the jboss-service.xml. The default
> value is 30min,
>
> Oleg.
>
> 2009/2/11 Jean Deruelle <jean.derue...@gmail.com>
>
> > IIRC, the MSC API of the Media Server gives you some listener methods to
> > implement to detect if a link or connnection has been disconnected
> > (connectionDisconnected method from MsConnectionListener). I think you
> > should be able to call the same logic that you use upon BYE requests from
> > there.
>
> > The Mobicents Media Server Team might be able to confirm that.
>
> > Jean
>

Jean Deruelle

unread,
Feb 11, 2009, 5:26:50 AM2/11/09
to mobicent...@googlegroups.com
but what happens if the other end disconnect the RTP Stream, is MMS sending a notification to the app ?

Amit Bhayani

unread,
Feb 11, 2009, 5:32:22 AM2/11/09
to mobicent...@googlegroups.com
The RTP is over UDP and hence if receiving end is closed, there is no way MMS can know about it. In this case what we need to implement is RTCP of RTP RFC3550. Not sure what % of MMS users would be interested in this feature?

Amit.

Oleg Kulikov

unread,
Feb 11, 2009, 5:36:44 AM2/11/09
to mobicent...@googlegroups.com
RTCP is optional and is not supported by many of the MGW. We have it in roadmap but currently it is not implemented. Silence detector depends on silence suppression options.
 
 


 
2009/2/11 Amit Bhayani <amit.b...@gmail.com>

Vladimir Ralev

unread,
Feb 11, 2009, 6:48:04 AM2/11/09
to mobicent...@googlegroups.com
Actually there is an ICMP message Port Unreachable coming back everytime you attempt for send. In Jav it's not exactly easy to intercpt this one though. Another option (less reliable, but will work in most cases) is detecting if the incoming RTP at the MsConnection should be possible.

Oleg Kulikov

unread,
Feb 11, 2009, 6:52:04 AM2/11/09
to mobicent...@googlegroups.com
Vlad, these are not good ways. For guaranted control RTCP only can be used, Silence on RTP channel if silence suppression is not enabled or timeout.


 
2009/2/11 Vladimir Ralev <vladimi...@gmail.com>

Vladimir Ralev

unread,
Feb 11, 2009, 7:03:13 AM2/11/09
to mobicent...@googlegroups.com
The ICMP interception is pretty realiable as long as you give it 5 seconds free-pass at the begining of the call (when the other side might still not have opened the port). After that any ICMP error should disconnect the call.

Oleg Kulikov

unread,
Feb 11, 2009, 7:05:48 AM2/11/09
to mobicent...@googlegroups.com
Mode may be half duplex

2009/2/11 Vladimir Ralev <vladimi...@gmail.com>

Vladimir Ralev

unread,
Feb 11, 2009, 7:10:18 AM2/11/09
to mobicent...@googlegroups.com
IIRC half-duplex mode doesn't concern the RTP stream - it's still flowing, just not propagated to the link. I know some phones may opt not to send or receive audio at all, but that would be pretty rare.

Jean Deruelle

unread,
Feb 11, 2009, 7:12:38 AM2/11/09
to mobicent...@googlegroups.com
Do MMS know it if it is in half duplex mode ?

Oleg Kulikov

unread,
Feb 11, 2009, 7:15:42 AM2/11/09
to mobicent...@googlegroups.com
If mode is half-duplex MMS does not send any packets and ICMP never will be return back.

2009/2/11 Vladimir Ralev <vladimi...@gmail.com>

Vladimir Ralev

unread,
Feb 11, 2009, 7:22:11 AM2/11/09
to mobicent...@googlegroups.com
It doesnt matter, because if we dont send we will know it and if we are still receiving we will know that the call remote side has not closed the connection. If we are both not sending and not receiving, disconnect..

Oleg Kulikov

unread,
Feb 11, 2009, 7:24:21 AM2/11/09
to mobicent...@googlegroups.com
UA with silence suppresion

2009/2/11 Vladimir Ralev <vladimi...@gmail.com>

Vladimir Ralev

unread,
Feb 11, 2009, 7:26:42 AM2/11/09
to mobicent...@googlegroups.com
Silenece supression sends small packets from time to time. I remember g729 specifies 1-2 bytes every 20ms for silence.

Amit Bhayani

unread,
Feb 11, 2009, 7:37:35 AM2/11/09
to mobicent...@googlegroups.com
I would still suggest stick to standards RTCP which can be latter extended for QoS too if needed

In fact I was thinking about its OPTIONAL function to convey minimal session control information, for example participant identification to be displayed in the user interface. This is something that you wanted for your Seam App for Conference I guess

Oleg Kulikov

unread,
Feb 11, 2009, 7:33:52 AM2/11/09
to mobicent...@googlegroups.com
then we can use RTP receiver for active connections

2009/2/11 Vladimir Ralev <vladimi...@gmail.com>

Ben

unread,
Feb 17, 2009, 12:45:53 PM2/17/09
to mobicents-public
Hi, guys,

have we reached a conclusion on this thread? We did actually go ahead
and implemented a silent detect by openning a new MediaSink on the
MsConnection which is connected to the RTP socket. The problem we have
is that we also use SEND_ONLY mode as the mute function. In this mode,
MsConnection will turn off receiving stream on the rtp socket and
hence no packet will be received.

I am thinking of implementing our MUTE function differently, so the
MsConnection will still receive packets. Any suggestion on what to
use?

Here's our architecture. Our application is all conference based:
RTP <-> Packet Relay End Point <-> MsLink |
RTP <-> Packet Relay End Point <-> MsLink | <-> Conf End Point
RTP <-> Packet Relay End Point <-> MsLink |

Thanks in advance,

Ben

On Feb 11, 7:33 am, Oleg Kulikov <oleg.kulik...@gmail.com> wrote:
> then we can use RTP receiver for active connections
>
> 2009/2/11 Vladimir Ralev <vladimir.ra...@gmail.com>
>
> > Silenece supression sends small packets from time to time. I remember g729
> > specifies 1-2 bytes every 20ms for silence.
>
> > On Wed, Feb 11, 2009 at 2:24 PM, Oleg Kulikov <oleg.kulik...@gmail.com>wrote:
>
> >> UA with silence suppresion
>
> >> 2009/2/11 Vladimir Ralev <vladimir.ra...@gmail.com>
>
> >>> It doesnt matter, because if we dont send we will know it and if we are
> >>> still receiving we will know that the call remote side has not closed the
> >>> connection. If we are both not sending and not receiving, disconnect..
>
> >>> On Wed, Feb 11, 2009 at 2:15 PM, Oleg Kulikov <oleg.kulik...@gmail.com>wrote:
>
> >>>> If mode is half-duplex MMS does not send any packets and ICMP never will
> >>>> be return back.
>
> >>>> 2009/2/11 Vladimir Ralev <vladimir.ra...@gmail.com>
>
> >>>>> IIRC half-duplex mode doesn't concern the RTP stream - it's still
> >>>>> flowing, just not propagated to the link. I know some phones may opt not to
> >>>>> send or receive audio at all, but that would be pretty rare.
>
> >>>>> On Wed, Feb 11, 2009 at 2:05 PM, Oleg Kulikov <oleg.kulik...@gmail.com
> >>>>> > wrote:
>
> >>>>>> Mode may be half duplex
>
> >>>>>> 2009/2/11 Vladimir Ralev <vladimir.ra...@gmail.com>
>
> >>>>>>> The ICMP interception is pretty realiable as long as you give it 5
> >>>>>>> seconds free-pass at the begining of the call (when the other side might
> >>>>>>> still not have opened the port). After that any ICMP error should disconnect
> >>>>>>> the call.
>
> >>>>>>> On Wed, Feb 11, 2009 at 1:52 PM, Oleg Kulikov <
> >>>>>>> oleg.kulik...@gmail.com> wrote:
>
> >>>>>>>> Vlad, these are not good ways. For guaranted control RTCP only can
> >>>>>>>> be used, Silence on RTP channel if silence suppression is not enabled or
> >>>>>>>> timeout.
>
> >>>>>>>> 2009/2/11 Vladimir Ralev <vladimir.ra...@gmail.com>
>
> >>>>>>>> Actually there is an ICMP message Port Unreachable coming back
> >>>>>>>>> everytime you attempt for send. In Jav it's not exactly easy to intercpt
> >>>>>>>>> this one though. Another option (less reliable, but will work in most cases)
> >>>>>>>>> is detecting if the incoming RTP at the MsConnection should be possible.
>
> >>>>>>>>> On Wed, Feb 11, 2009 at 12:32 PM, Amit Bhayani <
> >>>>>>>>> amit.bhay...@gmail.com> wrote:
>
> >>>>>>>>>> The RTP is over UDP and hence if receiving end is closed, there is
> >>>>>>>>>> no way MMS can know about it. In this case what we need to implement is RTCP
> >>>>>>>>>> of RTP RFC3550. Not sure what % of MMS users would be interested in this
> >>>>>>>>>> feature?
>
> >>>>>>>>>> Amit.
>
> >>>>>>>>>> On Wed, Feb 11, 2009 at 3:56 PM, Jean Deruelle <
> >>>>>>>>>> jean.derue...@gmail.com> wrote:
>
> >>>>>>>>>>> but what happens if the other end disconnect the RTP Stream, is
> >>>>>>>>>>> MMS sending a notification to the app ?
>
> >>>>>>>>>>> On Wed, Feb 11, 2009 at 11:20 AM, Oleg Kulikov <
> >>>>>>>>>>> oleg.kulik...@gmail.com> wrote:
>
> >>>>>>>>>>>> The connection lifetime is configured in the jboss-service.xml.
> >>>>>>>>>>>> The default value is 30min,
>
> >>>>>>>>>>>> Oleg.
>
> >>>>>>>>>>>> 2009/2/11 Jean Deruelle <jean.derue...@gmail.com>
>
> >>>>>>>>>>>> IIRC, the MSC API of the Media Server gives you some listener
> >>>>>>>>>>>>> methods to implement to detect if a link or connnection has been
> >>>>>>>>>>>>> disconnected (connectionDisconnected method from MsConnectionListener). I
> >>>>>>>>>>>>> think you should be able to call the same logic that you use upon BYE
> >>>>>>>>>>>>> requests from there.
>
> >>>>>>>>>>>>> The Mobicents Media Server Team might be able to confirm that.
>
> >>>>>>>>>>>>> Jean
>

Zdenek

unread,
Feb 17, 2009, 1:57:47 PM2/17/09
to mobicent...@googlegroups.com
Hello all,

I am trying to install mobicents according to install guide on http://hudson.jboss.org/hudson/job/MobicentsBooks/lastSuccessfulBuild/artifact/jain-slee/index.html, but I have problems with running the script: run.sh.

Could me someone help to solve this problem, please.
Thanks.
Zdenek.


I am including the log during script running:


ims@Aplication ~/mobicents-jainslee-server-1.2.3.GA-jboss-4.2.3.GA/jboss-4.2.3.GA/bin $ ./run.sh
=========================================================================

JBoss Bootstrap Environment

JBOSS_HOME: /home/ims/mobicents-jainslee-server-1.2.3.GA-jboss-4.2.3.GA/jboss-4.2.3.GA

JAVA: /etc/java-config-2/current-system-vm/bin/java

JAVA_OPTS: -Dprogram.name=run.sh -server -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.net.preferIPv4Stack=true

CLASSPATH: /home/ims/mobicents-jainslee-server-1.2.3.GA-jboss-4.2.3.GA/jboss-4.2.3.GA/bin/run.jar:/etc/java-config-2/current-system-vm/lib/tools.jar

=========================================================================

20:37:44,375 INFO [Server] Starting JBoss (MX MicroKernel)...
20:37:44,376 INFO [Server] Release ID: JBoss [Trinity] 4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)
20:37:44,387 INFO [Server] Home Dir: /home/ims/mobicents-jainslee-server-1.2.3.GA-jboss-4.2.3.GA/jboss-4.2.3.GA
20:37:44,388 INFO [Server] Home URL: file:/home/ims/mobicents-jainslee-server-1.2.3.GA-jboss-4.2.3.GA/jboss-4.2.3.GA/
20:37:44,389 INFO [Server] Patch URL: null
20:37:44,391 INFO [Server] Server Name: default
20:37:44,391 INFO [Server] Server Home Dir: /home/ims/mobicents-jainslee-server-1.2.3.GA-jboss-4.2.3.GA/jboss-4.2.3.GA/server/default
20:37:44,391 INFO [Server] Server Home URL: file:/home/ims/mobicents-jainslee-server-1.2.3.GA-jboss-4.2.3.GA/jboss-4.2.3.GA/server/default/
20:37:44,392 INFO [Server] Server Log Dir: /home/ims/mobicents-jainslee-server-1.2.3.GA-jboss-4.2.3.GA/jboss-4.2.3.GA/server/default/log
20:37:44,392 INFO [Server] Server Temp Dir: /home/ims/mobicents-jainslee-server-1.2.3.GA-jboss-4.2.3.GA/jboss-4.2.3.GA/server/default/tmp
20:37:44,393 INFO [Server] Root Deployment Filename: jboss-service.xml
20:37:44,678 INFO [ServerInfo] Java version: 1.6.0_07,Sun Microsystems Inc.
20:37:44,678 INFO [ServerInfo] Java VM: Java HotSpot(TM) Server VM 10.0-b23,Sun Microsystems Inc.
20:37:44,679 INFO [ServerInfo] OS-System: Linux 2.6.25-gentoo-r7,i386
20:37:45,091 INFO [Server] Core system initialized
20:37:45,106 ERROR [MainDeployer] Could not make local copy for file:/home/ims/mobicents-jainslee-server-1.2.3.GA-jboss-4.2.3.GA/jboss-4.2.3.GA/server/default/conf/jboss-service.xml
java.io.IOException: No such file or directory
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.checkAndCreate(File.java:1704)
at java.io.File.createTempFile(File.java:1793)
at org.jboss.deployment.MainDeployer.makeLocalCopy(MainDeployer.java:1185)
at org.jboss.deployment.MainDeployer.init(MainDeployer.java:851)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:809)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
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:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
at org.jboss.Main.boot(Main.java:200)
at org.jboss.Main$1.run(Main.java:508)
at java.lang.Thread.run(Thread.java:619)
20:37:45,113 ERROR [MainDeployer] Could not initialise deployment: file:/home/ims/mobicents-jainslee-server-1.2.3.GA-jboss-4.2.3.GA/jboss-4.2.3.GA/server/default/conf/jboss-service.xml
org.jboss.deployment.DeploymentException: Failed to find META-INF/jboss-service.xml for archive jboss-service.xml
at org.jboss.deployment.SARDeployer.parseDocument(SARDeployer.java:618)
at org.jboss.deployment.SARDeployer.init(SARDeployer.java:181)
at org.jboss.deployment.MainDeployer.init(MainDeployer.java:872)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:809)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
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:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
at org.jboss.Main.boot(Main.java:200)
at org.jboss.Main$1.run(Main.java:508)
at java.lang.Thread.run(Thread.java:619)
Failed to boot JBoss:
org.jboss.deployment.DeploymentException: Failed to find META-INF/jboss-service.xml for archive jboss-service.xml
at org.jboss.deployment.SARDeployer.parseDocument(SARDeployer.java:618)
at org.jboss.deployment.SARDeployer.init(SARDeployer.java:181)
at org.jboss.deployment.MainDeployer.init(MainDeployer.java:872)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:809)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
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:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
at org.jboss.Main.boot(Main.java:200)
at org.jboss.Main$1.run(Main.java:508)
at java.lang.Thread.run(Thread.java:619)
20:37:45,136 INFO [Server] Runtime shutdown hook called, forceHalt: true
20:37:45,136 INFO [Server] JBoss SHUTDOWN: Undeploying all packages
20:37:45,154 INFO [Server] Shutdown complete
Shutdown complete
Halting VM

Eduardo Martins

unread,
Feb 17, 2009, 8:13:33 PM2/17/09
to mobicent...@googlegroups.com
May be weird to ask, since I see a "~" there, which should mean user
home, but that user has rights to modify the file system at
~/mobicents-jainslee-server-1.2.3.GA-jboss-4.2.3.GA/jboss-4.2.3.GA? Or
maybe it is a bad/incomplete extraction of the distribution zip file?

-- Eduardo

Oleg Kulikov

unread,
Feb 18, 2009, 12:04:22 AM2/18/09
to mobicent...@googlegroups.com
Hi Ben,
 
Your suggestions are interested. Can you attach your patch?
 
Oleg 

2009/2/17 Ben <ben....@gmail.com>
Reply all
Reply to author
Forward
0 new messages