Error while enabling STUN in standalone MMS

82 views
Skip to first unread message

Sachin Parnami

unread,
Aug 18, 2009, 9:44:21 AM8/18/09
to mobicent...@googlegroups.com
Hi All,

1> As suggested in http://www.mobicents.org/mms/user_guides/media_server/2.0.0.BETA2/html_single/index.html#ctms-MMS_STUN_Support

When i add <property name="stunAddress">stun.ekiga.net:3478</property> in bootstrap-beans.xml i get below mention error

mobicents@mobicents-laptop:~/Sachin/Work/mobicents-media-server-core/server-standalone/target/mms-standalone-pojo.dir/bin$ ./run.sh
=========================================================================

  MMS Bootstrap Environment

  MMS_HOME: /home/mobicents/Sachin/Work/mobicents-media-server-core/server-standalone/target/mms-standalone-pojo.dir

  JAVA: /home/mobicents/jdk1.5.0_16/bin/java

  JAVA_OPTS: -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000

  CLASSPATH: /home/mobicents/Sachin/Work/mobicents-media-server-core/server-standalone/target/mms-standalone-pojo.dir/bin/run.jar

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

0    [main] INFO  org.mobicents.media.server.bootstrap.Main  - log4j configured
2    [main] INFO  org.mobicents.media.server.bootstrap.Main  - Booting from file:/home/mobicents/Sachin/Work/mobicents-media-server-core/server-standalone/target/mms-standalone-pojo.dir/conf/bootstrap-beans.xml
1264 [main] INFO  org.mobicents.media.server.impl.naming.InnerNamingService  - Started
18 Aug, 2009 6:54:26 PM net.java.stun4j.stack.NetAccessPoint start
INFO: Bound a socket on ap: net.java.stun4j.stack.AccessPoint@/192.168.0.110:9200 status:  running
18 Aug, 2009 6:54:27 PM net.java.stun4j.client.NetworkConfigurationDiscoveryProcess doTestI
INFO: TEST I res=/69.0.208.27:3478 - stun01.sipphone.com
18 Aug, 2009 6:54:37 PM net.java.stun4j.client.NetworkConfigurationDiscoveryProcess determineAddress
INFO: mapped address is=/115.113.66.24:60756, name=115.113.66.24
18 Aug, 2009 6:54:40 PM net.java.stun4j.client.NetworkConfigurationDiscoveryProcess determineAddress
INFO: backup server address is=/69.0.209.22:3479, name=69.0.209.22
18 Aug, 2009 6:54:40 PM net.java.stun4j.client.NetworkConfigurationDiscoveryProcess doTestII
INFO: Test II res=/69.0.209.22:3479 - 69.0.209.22
16942 [main] INFO  org.mobicents.media.server.impl.rtp.RtpFactory  - Binding RTP transceiver to /192.168.0.110:9200
16982 [main] INFO  org.mobicents.media.server.impl.rtp.RtpFactory  - Binding RTP transceiver to /192.168.0.110:9204
16985 [main] INFO  org.mobicents.media.server.impl.rtp.RtpFactory  - Bound RTP transceiver to /192.168.0.110:9204, NAT public address is /192.168.0.110:9204
Exception in thread "main" java.lang.IllegalStateException: Incompletely deployed:

DEPLOYMENTS IN ERROR:
  Deployment "RTPAudioFactory" is in error due to: java.net.BindException: Address already in use

    at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.internalValidate(AbstractKernelDeployer.java:278)
    at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.validate(AbstractKernelDeployer.java:174)
    at org.mobicents.media.server.bootstrap.Main.boot(Main.java:125)
    at org.mobicents.media.server.bootstrap.Main.main(Main.java:81)



2> And i am passing stun.ekiga.net:3478 as my stun server but it is picking up stun01.sipphone.com:3478 is there any where else changes require for that?

--
Regards,
Sachin Parnami

Sachin Parnami

unread,
Aug 19, 2009, 1:35:32 AM8/19/09
to mobicent...@googlegroups.com
Any thoughts on it :)
--
Regards,
Sachin Parnami

Vladimir Ralev

unread,
Aug 19, 2009, 4:58:49 AM8/19/09
to mobicent...@googlegroups.com
Looks like a bug. In MMS 1 STUN wasnt practical, but in MMS 2 there is
only one socket and it can actualy work. Still, I dont see why would
you need it. What is your use-case? If you are just using some remote
asterisk server for PSTN - it doesnt need STUn for example.

Sachin Parnami

unread,
Aug 19, 2009, 5:26:35 AM8/19/09
to mobicent...@googlegroups.com
Thanks for replying Vladmir

Below is my scenario

              INVITE1                         INVITE2
UE1--------------------------->Server------------------------->VoIP GW------------------------>UE2

UE1 and Server both are behind NAT

INVITE2 goes without SDP
onOk its SDP1 is being used for createConnection (CRCX using MGCP for Stand alone MMS)

Now SDP2 returned by Standalone-MMS onCreateConnectionResponse (of CRCX) being carried into ACK of INVITE2 as negotiated SDP 

Now problem is that i get media server bound to NAT address in SDP2 :( , Is there any other way to overcome this?

Please guide
--
Regards,
Sachin Parnami

Vladimir Ralev

unread,
Aug 19, 2009, 5:32:19 AM8/19/09
to mobicent...@googlegroups.com
What is the VoIP gateway? It is very possile that it will ignore the
prive address in SDP and just stream to the source address.

Sachin Parnami

unread,
Aug 19, 2009, 5:41:42 AM8/19/09
to mobicent...@googlegroups.com
On Wed, Aug 19, 2009 at 3:02 PM, Vladimir Ralev <vladimi...@gmail.com> wrote:

What is the VoIP gateway?

Web service by which we can call from VoIP to legacy ( SS7 specifically )
 
It is very possile that it will ignore the
prive address in SDP and just stream to the source address.

Need to investigate that, was trying to get it done from our end , instead of depending upon GW behavior ;)



--
Regards,
Sachin Parnami

Oleg Kulikov

unread,
Aug 19, 2009, 10:40:54 AM8/19/09
to mobicent...@googlegroups.com

Sachin Parnami

unread,
Aug 19, 2009, 10:20:09 PM8/19/09
to mobicent...@googlegroups.com
Thanks Oleg will give it a try and let you know if it works
--
Regards,
Sachin Parnami

Sachin Parnami

unread,
Aug 20, 2009, 12:01:32 AM8/20/09
to mobicent...@googlegroups.com
Just checked out the code from trunk i am at revision 7424 currently
But DTMF has stopped working which was working fine  :(
--
Regards,
Sachin Parnami

Oleg Kulikov

unread,
Aug 20, 2009, 1:44:42 AM8/20/09
to mobicent...@googlegroups.com
looks like outdated. last commit was at revision 7487.

2009/8/20 Sachin Parnami <sachin...@gmail.com>

Sachin Parnami

unread,
Aug 20, 2009, 2:33:07 AM8/20/09
to mobicent...@googlegroups.com
Checked out again

A    core/server-standalone/src/main/config/loop-beans.xml
A    core/server-standalone/src/main/resources
A    core/server-standalone/pom.xml
 U   core
Checked out revision 7492.

But problem still persist :( no DTMF is detcted
--
Regards,
Sachin Parnami

Oleg Kulikov

unread,
Aug 20, 2009, 2:50:17 AM8/20/09
to mobicent...@googlegroups.com
enable trace in log and attach log

2009/8/20 Sachin Parnami <sachin...@gmail.com>

Sachin Parnami

unread,
Aug 20, 2009, 3:42:23 AM8/20/09
to mobicent...@googlegroups.com
Please find attached server.log
--
Regards,
Sachin Parnami
server.log

Oleg Kulikov

unread,
Aug 20, 2009, 4:08:26 AM8/20/09
to mobicent...@googlegroups.com
I do not see trace messages. Did you enable TRACE level?

2009/8/20 Sachin Parnami <sachin...@gmail.com>

Sachin Parnami

unread,
Aug 20, 2009, 5:04:00 AM8/20/09
to mobicent...@googlegroups.com
My bad had put it on DEBUG
Please find attached file with TRACE level
--
Regards,
Sachin Parnami
server.log.zip

Oleg Kulikov

unread,
Aug 20, 2009, 5:46:42 AM8/20/09
to mobicent...@googlegroups.com
Looks like this is NAT problem again. I do not see input stream. Can you make a wireshark trace to be sure?

Oleg

2009/8/20 Sachin Parnami <sachin...@gmail.com>

Sachin Parnami

unread,
Aug 20, 2009, 6:21:57 AM8/20/09
to mobicent...@googlegroups.com
Yes, because when i remove STUN setting property from bootstrap-bean.xml it works just fine

Please find attached wireshark trace
--
Regards,
Sachin Parnami
dtmf-not-detected

Oleg Kulikov

unread,
Aug 20, 2009, 6:33:02 AM8/20/09
to mobicent...@googlegroups.com
Your gateway address 115.113.66.64? I do not see stream from this address.

2009/8/20 Sachin Parnami <sachin...@gmail.com>

Sachin Parnami

unread,
Aug 20, 2009, 6:45:56 AM8/20/09
to mobicent...@googlegroups.com


On Thu, Aug 20, 2009 at 4:03 PM, Oleg Kulikov <oleg.k...@gmail.com> wrote:
Your gateway address 115.113.66.64?
 
Its mine public IP.
Currently i am trying

UE1 ------------------>Server(Jain-SLEE) ----------> Standalone-MMS (STUN enabled)

All are behind NAT (i.e. bound to 192.168.0.110)
 
I do not see stream from this address.

Same i am trying to investigate :(




--
Regards,
Sachin Parnami

Vladimir Ralev

unread,
Aug 20, 2009, 7:11:25 AM8/20/09
to mobicent...@googlegroups.com
That's exactly what is expected. And this is why in MSS for example we
dont use stun for private addesses.

Once you use STUN MSS advertises it's public addess and packets sent
to the internet will really appear like coming from that public
address.
However if MMS is not sending address to the internet but to some
private address and there is a network adapter associated with this
subnet the packets will go directly without going through the public
addess (outbound router).

All OSes have routing tables. For example
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.2 25
10.0.0.0 255.0.0.0 10.11.12.93 10.11.12.93 1
10.11.12.0 255.255.252.0 10.11.12.93 10.11.12.93 25

0.0.0.0 is usually the lowest priority (25) which means if an adapter
with higher priority is not found use this adapter.
Here you can see that 10.0.0.0 will go though 10.11.12.93 imeditately
without passing throug my default gateway to the internet(192.168.1.1)
because 10.11.12.93 has the highest priority (1). In all OSes it's the
same - local adapters have high priority(assumed very fast) and
internet adapters - low priority.

That said, i really doubt the packets from UA reach the MMS at all
(check with wireshark), which is a NAT issue. NATs keep track of the
remote clients and if they see a private address in a client that is
supposed to be remote they might drop the packets.

Sachin Parnami

unread,
Aug 20, 2009, 7:41:04 AM8/20/09
to mobicent...@googlegroups.com
Indeed nice explanation

So now when we have Scenario like
<--------------------------NAT------------------------->   <--------------Public IP---------->
 
UE1 <------------> Jain-Slee <---------------->MMS <-------------------------------------->UE2

What would be the work around of it?
--
Regards,
Sachin Parnami

Oleg Kulikov

unread,
Aug 20, 2009, 7:53:31 AM8/20/09
to mobicent...@googlegroups.com
In the RTP package there is a class TestStun. Can you run it and paste output. I think I have an idea but do not know is it true or no

Oleg

2009/8/20 Sachin Parnami <sachin...@gmail.com>
Indeed nice explanation

Vladimir Ralev

unread,
Aug 20, 2009, 8:18:19 AM8/20/09
to mobicent...@googlegroups.com
My suggestion is to use virtual machines to simulate NAT scenarios.
And if you have phones from different subnets, then in MMS we need to
implement the same we did in MSS. However, a I said earlier you
generally do not need to use STUN for SDP at all ever. Even xlite
doesn't use it and barely anyone notices it - me and may be this guy
here http://www.sipindex.com/viewtopic.php?f=6&t=14750

~90% of the PSTN gateways are asterisk and asterisk ignores the SDP IP
address by default, prett sure that's the case for other servers as
well and I am pushing it into our Media Server as well
http://code.google.com/p/mobicents/issues/detail?id=854

Sachin Parnami

unread,
Aug 20, 2009, 8:21:34 AM8/20/09
to mobicent...@googlegroups.com
Here it is

20 Aug, 2009 5:49:10 PM net.java.stun4j.stack.NetAccessPoint start
INFO: Bound a socket on ap: net.java.stun4j.stack.AccessPoint@/192.168.0.110:9201 status:  running
20 Aug, 2009 5:49:10 PM net.java.stun4j.client.NetworkConfigurationDiscoveryProcess doTestI 20 Aug, 2009 5:49:10 PM net.java.stun4j.client.NetworkConfigurationDiscoveryProcess determineAddress
INFO: mapped address is=/115.113.66.49:60275, name=115.113.66.49
20 Aug, 2009 5:49:10 PM net.java.stun4j.client.NetworkConfigurationDiscoveryProcess determineAddress

INFO: backup server address is=/69.0.209.22:3479, name=69.0.209.22
20 Aug, 2009 5:49:11 PM net.java.stun4j.client.NetworkConfigurationDiscoveryProcess doTestII

INFO: Test II res=/69.0.209.22:3479 - 69.0.209.22
Public address: 115.113.66.49
Stun report = The detected network configuration is: Full Cone NAT
Your mapped public address is: 115.113.66.49/115.113.66.49:60275
20 Aug, 2009 5:49:11 PM net.java.stun4j.stack.NetAccessManager shutDown
INFO: removing 1 access points.
20 Aug, 2009 5:49:11 PM net.java.stun4j.stack.NetAccessPoint stop
INFO: Closed socket on ap net.java.stun4j.stack.AccessPoint@/192.168.0.110:9201 status:  running
20 Aug, 2009 5:49:11 PM net.java.stun4j.stack.NetAccessManager shutDown
INFO: .
20 Aug, 2009 5:49:11 PM net.java.stun4j.stack.NetAccessManager shutDown
INFO: removed all access points
1
--
Regards,
Sachin Parnami

Oleg Kulikov

unread,
Aug 20, 2009, 8:37:57 AM8/20/09
to mobicent...@googlegroups.com
Vlad, I am not sure that this way will be helpfull. Depends from first packet.



2009/8/20 Vladimir Ralev <vladimi...@gmail.com>

Oleg Kulikov

unread,
Aug 20, 2009, 8:39:59 AM8/20/09
to mobicent...@googlegroups.com
This is a full cone NAT. I have port restricted cone. Can you perform one more test? Please, replace MMS with XLite and enable NAT on XLite side. Record wireshark trace and attach it.

Sachin Parnami

unread,
Aug 20, 2009, 9:20:43 AM8/20/09
to mobicent...@googlegroups.com
Oleg sorry, i didn't understand?

If i am correct, you want me test it with Xlite this time?
With Stun enabled on MMS? right?
--
Regards,
Sachin Parnami

Oleg Kulikov

unread,
Aug 20, 2009, 9:39:54 AM8/20/09
to mobicent...@googlegroups.com
Please make (or receive) call from your PSTN gateway using XLite instead ofg MMS. with NAT support enabled on XLite. What I want to see is a behavior of xlite and pstn gateway in case of your NAT. Will it use alt attribute or no and RTP traffic.

2009/8/20 Sachin Parnami <sachin...@gmail.com>

Sachin Parnami

unread,
Aug 25, 2009, 9:22:07 AM8/25/09
to mobicent...@googlegroups.com
Sorry for being delay, little messed up with credential details of VoIP GW to use PSTN flow will update here once i get new details :)
--
Regards,
Sachin Parnami

Sachin Parnami

unread,
Sep 9, 2009, 9:59:19 AM9/9/09
to mobicent...@googlegroups.com
Hi Oleg

Please find attached wireshark capture of interaction with PSTN.

I haven't used STUN any where, AFAIK mine VoIP GW picks up UDP address for Media server RTP while RPORT is set in Via

have added viaHeader.setParameter(Via.RPORT, "5060"); while building INVITE.

Here is the call flow which i have tried.


<--------------------------NAT------------------------->  <--------------Public IP---------->
 
UE1 <------------> Jain-Slee <---------------->MMS <-------------------------------------->UE2



--
Regards,
Sachin Parnami
PSTN-GW-Sep9.zip

Oleg Kulikov

unread,
Sep 9, 2009, 11:55:56 PM9/9/09
to mobicent...@googlegroups.com
Hi Sachin, thank you for this trace. But would be interetsted to make another test:

<--------------------------NAT------------------------->  <--------------Public IP---------->
XLite          ------------------------->                                      PSTN


Using your NAT configuration.

Oleg

2009/9/9 Sachin Parnami <sachin...@gmail.com>
Reply all
Reply to author
Forward
0 new messages