I'm trying to implement a simple conference service with sip servlets
and standalone mms beta 2. The mms works fine in case of playing
annoucements and recording calls, but I cannot manage to establish a
proper conference call. The SIP flows (with the included SDP) look
fine but when two partys join the conference ther's no sound at all. I
would really appreciate some help in this situation (some working
example perhaps?). I enclose SipServlet code and mms logs.
Best Regards,
Krzysiek
SimpleConference.java
import java.io.IOException;
import java.util.Properties;
import javax.media.mscontrol.MediaEventListener;
import javax.media.mscontrol.MediaSession;
import javax.media.mscontrol.MsControlFactory;
import javax.media.mscontrol.join.JoinEvent;
import javax.media.mscontrol.join.JoinEventListener;
import javax.media.mscontrol.join.Joinable;
import javax.media.mscontrol.mixer.MediaMixer;
import javax.media.mscontrol.networkconnection.NetworkConnection;
import javax.media.mscontrol.networkconnection.SdpPortManager;
import javax.media.mscontrol.networkconnection.SdpPortManagerEvent;
import javax.media.mscontrol.spi.DriverManager;
import javax.servlet.ServletException;
import javax.servlet.sip.SipServlet;
import javax.servlet.sip.SipServletMessage;
import javax.servlet.sip.SipServletRequest;
@SuppressWarnings("serial")
public class SimpleConference extends SipServlet implements
JoinEventListener{
MediaSession theMediaSession;
MediaMixer theMixer;
@Override
public void init() throws ServletException {
super.init();
MsControlFactory theMsControlFactory = null;
Properties property = new Properties();
property.setProperty(Const.MGCP_STACK_NAME, "SipServlets");
property.setProperty(Const.MGCP_PEER_IP, Const.PEER_ADDRESS);
property.setProperty(Const.MGCP_PEER_PORT, Const.MGW_PORT);
property.setProperty(Const.MGCP_STACK_IP,
Const.LOCAL_ADDRESS);
property.setProperty(Const.MGCP_STACK_PORT, Const.CA_PORT);
try {
theMsControlFactory = DriverManager.getDrivers().next
().getFactory(property);
theMediaSession = theMsControlFactory.createMediaSession();
theMixer = theMediaSession.createMediaMixer(MediaMixer.AUDIO);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
protected void doInvite(final SipServletRequest req) throws
ServletException, IOException {
try {
req.createResponse(180).send();
final NetworkConnection myNetworkConnection =
theMediaSession.createNetworkConnection(NetworkConnection.BASIC);
req.getSession().setAttribute("media-connection",
myNetworkConnection);
theMixer.addListener(this);
theMixer.joinInitiate(Joinable.Direction.DUPLEX ,
myNetworkConnection,null );
final SdpPortManager mySDPPortSet =
myNetworkConnection.getSdpPortManager();
MediaEventListener<SdpPortManagerEvent> sdpPortListener = new
MediaEventListener<SdpPortManagerEvent>() {
public void onEvent(SdpPortManagerEvent event) {
try {
if (event.getEventType().equals
(SdpPortManagerEvent.ANSWER_GENERATED)) {
byte[] sdpAnswer = event.getMediaServerSdp();
SipServletMessage msg = req.createResponse(200, "OK");
msg.setContent(sdpAnswer, "application/sdp");
msg.send();
} else {
req.createResponse(500, "Unsupported Media Type").send();
myNetworkConnection.release();
}
} catch (Exception e) {
myNetworkConnection.release();
}
}
};
mySDPPortSet.addListener(sdpPortListener);
mySDPPortSet.processSdpOffer(req.getRawContent());
} catch (Exception e) {
throw new ServletException(e);
}
}
@Override
protected void doBye(SipServletRequest req) throws ServletException,
IOException {
final NetworkConnection myNetworkConnection = (NetworkConnection)
req.getSession().getAttribute("media-connection");
myNetworkConnection.release();
req.createResponse(200).send();
}
@Override
public void destroy() {
theMediaSession.release();
super.destroy();
}
public void onEvent(JoinEvent arg0) {
;
}
}
MMS log
1930 [main] INFO org.mobicents.media.server.bootstrap.MainDeployer -
[[[[[[[[[ Mobicents Media Server: release.version=2.0.0.BETA2
Started ]]]]]]]]]
Set endpoint null
36549 [Thread-4] WARN
org.mobicents.media.server.impl.resource.cnf.MixerOutput - AudioMixer
[Output] (endpoint=unknown, connection=0) fmt={LINEAR, 8000, 16, 1, 0,
1} is not acceptable by Endpoint[output] (endpoint=/mobicents/media/
cnf/local/6, connection=0)supported formats: []
36627 [JainMgcpStackImpl-FixedThreadPool-thread-1] INFO
org.mobicents.media.server.ctrl.mgcp.CreateConnectionAction -
Response TX = 1, Response: 200 The requested transaction was executed
normally.
36743 [Thread-4] WARN
org.mobicents.media.server.impl.resource.audio.EndpointTransmittor
$Output - Endpoint[output] (endpoint=/mobicents/media/packetrelay/4,
connection=0) fmt={LINEAR, 8000, 16, 1, 0, 1} is not acceptable by
Processor.Input[audio.processor.input]supported formats: []
37015 [JainMgcpStackImpl-FixedThreadPool-thread-2] INFO
org.mobicents.media.server.ctrl.mgcp.CreateConnectionAction -
Response TX = 2, Response: 200 The requested transaction was executed
normally.
Set endpoint null
69401 [JainMgcpStackImpl-FixedThreadPool-thread-1] INFO
org.mobicents.media.server.ctrl.mgcp.CreateConnectionAction -
Response TX = 3, Response: 200 The requested transaction was executed
normally.
69406 [JainMgcpStackImpl-FixedThreadPool-thread-1] INFO
org.mobicents.media.server.ctrl.mgcp.CreateConnectionAction -
Response TX = 4, Response: 200 The requested transaction was executed
normally.
On 25 Sty, 18:29, Amit Bhayani <amit.bhay...@gmail.com> wrote:
> Yes its JSR309 + Sip Servlets.
>
> Will check this out
>
> On Mon, Jan 25, 2010 at 10:58 PM, Oleg Kulikov <oleg.kulik...@gmail.com>wrote:
>
>
>
> > Are you using JSR-309?
>
> > 2010/1/25 Bartosz Baranowski <baran...@gmail.com>
>
> > Please try with B3 to ensure its not mms bug.
>
With the latest JSR309 mms B3 handles my old playback and recording
apps very well. But still no luck with the conference - ther's no
sound at all. I've also tried to start the conference by invoking
joinIntiate on the connection instead of mixer. I enclose the log from
mms B3. The Null pointer exceptions occure when the user leaves the
conference ( myNetworkConnection.release() is invoked in doBye
method). Any ideas what can be wrong? (the servlet is based on an
example from jsr309 final spec)
Cheers,
Krzysiek
17:11:07,156 INFO [MainDeployer] [[[[[[[[[ Mobicents Media Server:
release.version=2.0.0.BETA3 Started ]]]]]]]]]
17:12:29,912 INFO [CreateConnectionAction] Response TX = 1, Response:
200 The requested transaction was executed normally.
17:12:29,981 INFO [RtpConnectionImpl] RTP format=ALAW, 8000, 8, 1
17:12:29,983 INFO [CreateConnectionAction] Response TX = 2, Response:
200 The requested transaction was executed normally.
17:12:48,886 INFO [CreateConnectionAction] Response TX = 3, Response:
200 The requested transaction was executed normally.
17:12:48,891 INFO [RtpConnectionImpl] RTP format=ALAW, 8000, 8, 1
17:12:48,892 INFO [CreateConnectionAction] Response TX = 4, Response:
200 The requested transaction was executed normally.
17:13:46,230 INFO [DeleteConnectionAction] Request TX= 7, CallID = 9,
Endpoint = /mobicents/media/cnf/1...@127.0.0.1:2427, Connection = 1
17:13:46,232 ERROR [MgcpController] Unexpected error during
processing,Caused by
java.lang.NullPointerException
at
org.mobicents.media.server.ctrl.mgcp.DeleteConnectionAction.deleteConnection
(DeleteConnectionAction.java:104)
at org.mobicents.media.server.ctrl.mgcp.DeleteConnectionAction.call
(DeleteConnectionAction.java:129)
at org.mobicents.media.server.ctrl.mgcp.DeleteConnectionAction.call
(DeleteConnectionAction.java:47)
at
org.mobicents.media.server.ctrl.mgcp.MgcpController.processMgcpCommandEvent
(MgcpController.java:217)
at
org.mobicents.mgcp.stack.JainMgcpStackProviderImpl.processMgcpCommandEvent
(JainMgcpStackProviderImpl.java:267)
at org.mobicents.mgcp.stack.TransactionHandler
$ScheduleRequestReceival.perform(TransactionHandler.java:731)
at org.mobicents.mgcp.stack.TransactionHandler.run
(TransactionHandler.java:400)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
17:13:46,233 INFO [DeleteConnectionAction] Request TX= 5, CallID = 9,
Endpoint = /mobicents/media/packetrelay/1...@127.0.0.1:2427, Connection
= 3
17:13:46,235 INFO [DeleteConnectionAction] Response TX=5,
response=200 The requested transaction was executed normally.
17:13:46,235 INFO [DeleteConnectionAction] Request TX= 6, CallID = 9,
Endpoint = /mobicents/media/packetrelay/1...@127.0.0.1:2427, Connection
= 2
17:13:46,235 ERROR [MgcpController] Unexpected error during
processing,Caused by
java.lang.NullPointerException
at
org.mobicents.media.server.ctrl.mgcp.DeleteConnectionAction.deleteConnection
(DeleteConnectionAction.java:104)
at org.mobicents.media.server.ctrl.mgcp.DeleteConnectionAction.call
(DeleteConnectionAction.java:129)
at org.mobicents.media.server.ctrl.mgcp.DeleteConnectionAction.call
(DeleteConnectionAction.java:47)
at
org.mobicents.media.server.ctrl.mgcp.MgcpController.processMgcpCommandEvent
(MgcpController.java:217)
at
org.mobicents.mgcp.stack.JainMgcpStackProviderImpl.processMgcpCommandEvent
(JainMgcpStackProviderImpl.java:267)
at org.mobicents.mgcp.stack.TransactionHandler
$ScheduleRequestReceival.perform(TransactionHandler.java:731)
at org.mobicents.mgcp.stack.TransactionHandler.run
(TransactionHandler.java:400)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
17:13:48,285 INFO [DeleteConnectionAction] Request TX= 8, CallID = 9,
Endpoint = /mobicents/media/packetrelay/2...@127.0.0.1:2427, Connection =
6
17:13:48,286 INFO [DeleteConnectionAction] Response TX=8,
response=200 The requested transaction was executed normally.
17:13:48,286 INFO [DeleteConnectionAction] Request TX= 9, CallID = 9,
Endpoint = /mobicents/media/packetrelay/2...@127.0.0.1:2427, Connection =
5
17:13:48,286 ERROR [MgcpController] Unexpected error during
processing,Caused by
java.lang.NullPointerException
at
org.mobicents.media.server.ctrl.mgcp.DeleteConnectionAction.deleteConnection
(DeleteConnectionAction.java:104)
at org.mobicents.media.server.ctrl.mgcp.DeleteConnectionAction.call
(DeleteConnectionAction.java:129)
at org.mobicents.media.server.ctrl.mgcp.DeleteConnectionAction.call
(DeleteConnectionAction.java:47)
at
org.mobicents.media.server.ctrl.mgcp.MgcpController.processMgcpCommandEvent
(MgcpController.java:217)
at
org.mobicents.mgcp.stack.JainMgcpStackProviderImpl.processMgcpCommandEvent
(JainMgcpStackProviderImpl.java:267)
at org.mobicents.mgcp.stack.TransactionHandler
$ScheduleRequestReceival.perform(TransactionHandler.java:731)
at org.mobicents.mgcp.stack.TransactionHandler.run
(TransactionHandler.java:400)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
17:13:48,288 INFO [DeleteConnectionAction] Request TX= 10, CallID =
9, Endpoint = /mobicents/media/cnf/1...@127.0.0.1:2427, Connection = 4
17:13:48,288 INFO [DeleteConnectionAction] Response TX=10,
response=200 The requested transaction was executed normally.
17:13:55,225 ERROR [JainMgcpStackProviderImpl] The TransactionHandler
not found for TransactionHandle 7 May be the Tx timed out. Event = 400
0The transaction could not be executed due to a transient error.
17:13:55,226 ERROR [JainMgcpStackProviderImpl] The TransactionHandler
not found for TransactionHandle 6 May be the Tx timed out. Event = 400
0The transaction could not be executed due to a transient error.
17:13:57,285 ERROR [JainMgcpStackProviderImpl] The TransactionHandler
not found for TransactionHandle 9 May be the Tx timed out. Event = 400
0The transaction could not be executed due to a transient error.
On 26 Sty, 03:36, Amit Bhayani <amit.bhay...@gmail.com> wrote:
> For MMS B3, you will have to use the latest JSR309 release which is also B3.
> Here is the linkhttp://mobicents-media-server.blogspot.com/2010/01/mobicents-jsr-309-...
>
> There is a very small change of firing the MGCP Signals/Events on Connection
> instead of Endpoints which can also be configured on XML for JSR309 - B2.
> But you can try B3 which has this by default.
>
16:32:53,551 INFO [CreateConnectionAction] Response TX = 1,
Response: 200 The requested transaction was executed normally.
16:33:05,189 ERROR [MgcpController] Unexpected error during
processing,Caused by
java.util.NoSuchElementException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:796)
at java.util.HashMap$KeyIterator.next(HashMap.java:828)
at org.mobicents.media.server.RtpConnectionImpl.setRemoteDescriptor
(RtpConnectionImpl.java:308)
at org.mobicents.media.server.ctrl.mgcp.ModifyConnectionAction.call
(ModifyConnectionAction.java:77)
at org.mobicents.media.server.ctrl.mgcp.ModifyConnectionAction.call
(ModifyConnectionAction.java:24)
at
org.mobicents.media.server.ctrl.mgcp.MgcpController.processMgcpCommandEvent
(MgcpController.java:217)
at
org.mobicents.mgcp.stack.JainMgcpStackProviderImpl.processMgcpCommandEvent
(JainMgcpStackProviderImpl.java:267)
at org.mobicents.mgcp.stack.TransactionHandler
$ScheduleRequestReceival.perform(TransactionHandler.java:731)
at org.mobicents.mgcp.stack.TransactionHandler.run
(TransactionHandler.java:400)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
16:33:14,142 ERROR [JainMgcpStackProviderImpl] The TransactionHandler
not found for TransactionHandle 2 May be the Tx timed out. Event = 400
0The transaction could not be executed due to a transient error.
)
> Endpoint = /mobicents/media/cnf...@127.0.0.1:2427, Connection = 1
> Endpoint = /mobicents/media/packetrelay...@127.0.0.1:2427, Connection
> = 3
> 17:13:46,235 INFO [DeleteConnectionAction] Response TX=5,
> response=200 The requested transaction was executed normally.
> 17:13:46,235 INFO [DeleteConnectionAction] Request TX= 6, CallID = 9,
> Endpoint = /mobicents/media/packetrelay...@127.0.0.1:2427, Connection
> Endpoint = /mobicents/media/packetrela...@127.0.0.1:2427, Connection =
> 6
> 17:13:48,286 INFO [DeleteConnectionAction] Response TX=8,
> response=200 The requested transaction was executed normally.
> 17:13:48,286 INFO [DeleteConnectionAction] Request TX= 9, CallID = 9,
> Endpoint = /mobicents/media/packetrela...@127.0.0.1:2427, Connection =
> 9, Endpoint = /mobicents/media/cnf...@127.0.0.1:2427, Connection = 4
> ...
>
> więcej >>
Establishing a proper conference has lately became a really urgent
matter for me. Is somebody investigating this issue, can i still hope
for some solution?
Best Regards,
Krzysiek
> ...
>
> więcej >>