Some questions about MMS and the IVR-Recorder

27 views
Skip to first unread message

Jean-Baptiste Morin

unread,
Jun 5, 2008, 9:11:53 AM6/5/08
to mobicents-public
Hi,

I am using your Mobicents Media Server (#1878 from the SVN repo) in
JBoss for few times.
I have some questions:
a) First, is it possible to start the media server outside JBoss?
b) What is your "roadmap" concerning media codecs? // FMJ?
c) Playing IVR annoucements and DTMF detection (RFC2833) work fine.
Now, I am trying to use the PLAY_RECORD function. It plays well. But
recording does not work as I want.

My configuration is:
- jboss-4.0.3 with:
- Mobicents Media Server #1878
- Cipango 0.1 for now, more familiar with it.
- Phone: one SNOM 300 for now

1) Sometimes (with the version #1878, without any change) I have the
following error, few seconds after the connection has been released (I
release the connection on the reception of a sip-BYE))

....
11:07:27,109 INFO [STDOUT] read bytes=1, value=255, available=13346
11:07:27,109 INFO [STDOUT] read bytes=1, value=255, available=13345
11:07:27,109 INFO [STDOUT] read bytes=1, value=127, available=13344
11:07:27,140 ERROR [Recorder] Could not start recording
java.io.IOException: Write error
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(FileOutputStream.java:260)
at
com.sun.media.sound.WaveFileWriter.writeWaveFile(WaveFileWriter.java:
238)
at
com.sun.media.sound.WaveFileWriter.write(WaveFileWriter.java:117)
at javax.sound.sampled.AudioSystem.write(AudioSystem.java:
1297)
at
org.mobicents.media.server.impl.jmf.recorder.Recorder.record(Recorder.java:
71)
at
org.mobicents.media.server.impl.jmf.recorder.Recorder.start(Recorder.java:
76)
at
org.mobicents.media.server.impl.ivr.PlayRecordSignal.start(PlayRecordSignal.java:
78)
at
org.mobicents.media.server.impl.ivr.IVREndpointImpl.play(IVREndpointImpl.java:
126)
at org.mobicents.mscontrol.impl.MsSignalGeneratorImpl
$PlayTx.run(MsSignalGeneratorImpl.java:125)
at java.lang.Thread.run(Thread.java:595)

The file is all the same created and filled.

Xx What could provoke that? A too early release of the connection?

2) Otherwise, recording starts and stops but:

My "record.wav" file is well created but I had a problem with it: it
was readable (with VLC) but not audible; the incoming stream is
encoded in ULAW/RTP;
I quickly compared the ULAW content of the RTP packets in ethereal and
the PCM content of "record.wav" with a hexadecimal editor and data
appeared to be the same.

Xx Do you plan to add decoding in the recorder?

Otherwise, I found a solution by changing the RecorderStream.java
(expecially the method transferData(PushBufferStream stream)) and I
added decoders (ulaw, alaw or no decoder, depending on the RTP
stream).
The other problem I met is that the SplitterOutputStream format does
not always match with the format of the incoming stream (i.e.
ReceiveStream) (due to the default value in the constructor).
I changed this by using the buffers' format in the push() method of
the SplitterOutputStream, but it is not very high-performing.
But it works fine, the appropriate decoder is used for a given RTP
stream (ULAW in my case). And the resulting wave file is readable,
audible... but not complete, few seconds are missing. The file seems
to be flushed and closed whereas some packets/buffers are not written.

Xx Did you already have the same problem? How can I fix it?

I savagely change the dispose() method of the Recorder to wait until
the "available" field of the RecorderStream is 0. It works, but it
could take a loooong time to complete the write in the file (A problem
probably linked with my changes anyway). But I don't have the first
error anymore. And the file is complete.

Thanks for your answer.

Bests Regards,

Jean-Baptiste Morin

Amit Bhayani

unread,
Jun 5, 2008, 9:33:51 AM6/5/08
to mobicent...@googlegroups.com
answers inline

On Thu, Jun 5, 2008 at 6:41 PM, Jean-Baptiste Morin <jb.m...@gmail.com> wrote:

Hi,

I am using your Mobicents Media Server (#1878 from the SVN repo) in
JBoss for few times.
I have some questions:
a) First, is it possible to start the media server outside JBoss?
No as of now thats not possible. And we don't have that in road map.
 

b) What is your "roadmap" concerning media codecs? // FMJ?
We have moved away from JMF and used some of the API (Interfaces) of FMJ with our own implementation of Recorder and Player. Regarding codecs, yes we do have in roadmap to add more codecs
 

c) Playing IVR annoucements and DTMF detection (RFC2833) work fine.
Now, I am trying to use the PLAY_RECORD function. It plays well. But
recording does not work as I want.

My configuration is:
- jboss-4.0.3 with:
       - Mobicents Media Server #1878
       - Cipango 0.1 for now, more familiar with it.
- Phone: one SNOM 300 for now
Please use JBoss AS 4.2.2.GA. JBoss 4.0.3 should also work but we haven't tested that.
 

Amit Bhayani

unread,
Jun 5, 2008, 9:41:13 AM6/5/08
to mobicent...@googlegroups.com
phew only half message was posted.
Again inline

Yes we do. 


Otherwise, I found a solution by changing the RecorderStream.java
(expecially the method transferData(PushBufferStream stream)) and I
added decoders (ulaw, alaw or no decoder, depending on the RTP
stream).
The other problem I met is that the SplitterOutputStream format does
not always match with the format of the incoming stream (i.e.
ReceiveStream) (due to the default value in the constructor).
I changed this by using the buffers' format in the push() method of
the SplitterOutputStream, but it is not very high-performing.
But it works fine, the appropriate decoder is used for a given RTP
stream (ULAW in my case). And the resulting wave file is readable,
audible... but not complete, few seconds are missing. The file seems
to be flushed and closed whereas some packets/buffers are not written.

Xx Did you already have the same problem? How can I fix it?
Can you please attach the patch for the decoder that you have written? Probably Oleg can comment on it.

Jean-Baptiste Morin

unread,
Jun 5, 2008, 10:55:10 AM6/5/08
to mobicents-public
Thanks for your response. I moved under JBoss 4.2.2.
I'm going to send you the two classes I changed by mail, I read my
messages through Google Group and I'm not able to attach files.

Otherwise, concerning my "record not complete" issue, I removed the
changes in the Recorder; in fact, too many "System.out.println" seems
to slow down the recording and to provoke some troubles.

On 5 juin, 15:41, "Amit Bhayani" <amit.bhay...@gmail.com> wrote:
> phew only half message was posted.
> Again inline
>
>
>
> On Thu, Jun 5, 2008 at 7:03 PM, Amit Bhayani <amit.bhay...@gmail.com> wrote:
> > answers inline
>
> > On Thu, Jun 5, 2008 at 6:41 PM, Jean-Baptiste Morin <jb.mo...@gmail.com>

Jean-Baptiste Morin

unread,
Jun 9, 2008, 5:57:15 AM6/9/08
to mobicents-public
Hi!

I have few new questions:
- In the documentation, I read that 1 endpoint = 1 IVR media
connection. Is there a way to get an "available" (i.e. no connection
attached) endpoint without knowing the name of the endpoint?
- If I have a set/list/table of audiofiles to play, is there a way to
set the whole list/set/table of files to the SignalGenerator (and not
to play files one-by-one)?
- Why is there no "removeResourceListener" in the MsResource interface
(for now?) ?
- I noticed that a SignalGenerator is able to PLAY and PLAY_RECORD at
the "same time" (e.g. a PLAY is "apply"ed and before the END_OF_MEDIA
event is raised, a PLAY_RECORD is "apply"ed). The two streams are
overlaid. Is it, full-term, allowed to design an app using the
mscontrol like that?

Thank you for your answer.

Bests Regards,

Jean-Baptiste

Amit Bhayani

unread,
Jun 9, 2008, 7:27:16 AM6/9/08
to mobicent...@googlegroups.com
Hi Jean,

If you want to get the endpoint without passing name you can pass any attribute '$'
For example media/endpoint/IVR/$, this will do the lookup of available endpoint and return you the actual one for example media/endpoint/IVR/5

I believe you want to play multiple files at same time? I would suggest you can use Conference Endpoint. Look at MMSDemo and see how we play multiple files there at same time.

"removeResourceListener" will be added. Thanks for pointing out.

Nope I suggest you shouldn't use the same MsSignalGenerator for recording as well as playing. However you can use two different instances and let them do the Play, play_record at same time.

Jean-Baptiste Morin

unread,
Jun 9, 2008, 8:11:03 AM6/9/08
to mobicents-public
Okay, thx for your answer.
Concerning the third question, the idea is to play audiofiles
following one another (e.g. an answering machine that will say
(3 .waves) "You have" "3" "new messages").
I was wondering if there is a way ("apply" params?) to directly play n-
files one after the other, whereas one by one.


On 9 juin, 13:27, "Amit Bhayani" <amit.bhay...@gmail.com> wrote:
> Hi Jean,
>
> If you want to get the endpoint without passing name you can pass any
> attribute '$'
> For example media/endpoint/IVR/$, this will do the lookup of available
> endpoint and return you the actual one for example media/endpoint/IVR/5
>
> I believe you want to play multiple files at same time? I would suggest you
> can use Conference Endpoint. Look at MMSDemo and see how we play multiple
> files there at same time.
>
> "removeResourceListener" will be added. Thanks for pointing out.
>
> Nope I suggest you shouldn't use the same MsSignalGenerator for recording as
> well as playing. However you can use two different instances and let them do
> the Play, play_record at same time.
>
> On Mon, Jun 9, 2008 at 3:27 PM, Jean-Baptiste Morin <jb.mo...@gmail.com>
Reply all
Reply to author
Forward
0 new messages