Ravi Inder Singh wrote:
Hi Benny,
I cannot be so sure that by adding Media Port this problem can be
resolved, as my requirement is for adding Answering Fax Machine, i.e. Media
port two functions, which both cannot resolve my issue.
a) get_frame () --> Conference bridge will get frames from this Media port.
Mem_player.c works like this only.
b) put_frame () --> This will save to PCM frames to a buffer but these PCM
frames will come from Sound Port i.e. MIC.
This is my understanding, please correct me if I am wrong on this.
My requirement is to detect
a) Answering Fax Machine detection --> which can be done by scanning
incoming Frames after they have been decoded in stream.c
b) Answering Machine detection --> This should be done only when 200 OK
has been received from other side. Is there any way to handle from
application, to enable Media port only when 200 Ok has been received.
The easiest is to implement a sink media port (like WAV capture),
thus implementing put_frame(). Then you connect the call's stream to
this media port, in the conference bridge, and at the same time you
also connect the call's stream to the sound device as usual. You can
control when exactly you want to connect them, as this is done in
application's code.
The drawback of this approach is you won't be able to remove the
tone signal from the stream's signal, since connection from stream
to sound device is independent from the connection from stream to
your tone detection port.
Another approach is to implement "dual-sided" media port. A
put_frame() on the upstream side will trigger put_frame() to be
called on the downstream side, and a get_frame() on the upstream
side will also trigger get_frame() on the downstream side. The
resample port is implemented this way, have a look at
resample_port.c for the details.
Then you can "insert" your tone detection media port between the
call's stream and the bridge. You'll need to modify pjsua-lib code
to do this since this kind of interconnection currently cannot be
done at application's code.
regards,
-benny
Regards,
Ravi Inder Singh.
Hi Benny,
Thanks for your kind response, I am able to port fax Media port like
resample port (dual sided Media port)as you have suggested. But for
Answering Machine detection, I need following information
a) Samples Per Second --> little confused over it, It is same as clock rate
??
b) Answering Machine detection --> this should be done only when 200 OK
has been received from other side. Is there any way to handle from
Application, to enable Media port only when 200 Ok has been received. -->
Reply waited not given last time also.
Thanks in advance
Regards,
Ravi Inder Singh
-----Original Message-----
From: pjsip-bounces@lists.pjsip.org [mailto:pjsip-bounces@lists.pjsip.org]
On Behalf Of Benny Prijono
Sent: Sunday, October 21, 2007 4:27 PM
To: pjsip embedded/DSP SIP discussion
Subject: Re: [pjsip] FW: Intergrating Answering Fax Tone Detection support
Ravi Inder Singh wrote:
Hi Benny,
I cannot be so sure that by adding Media Port this problem can be
resolved, as my requirement is for adding Answering Fax Machine, i.e.
Media
port two functions, which both cannot resolve my issue.
a) get_frame () --> Conference bridge will get frames from this Media
port.
Mem_player.c works like this only.
b) put_frame () --> This will save to PCM frames to a buffer but these PCM
frames will come from Sound Port i.e. MIC.
This is my understanding, please correct me if I am wrong on this.
My requirement is to detect
a) Answering Fax Machine detection --> which can be done by scanning
incoming Frames after they have been decoded in stream.c
b) Answering Machine detection --> This should be done only when 200 OK
has been received from other side. Is there any way to handle from
application, to enable Media port only when 200 Ok has been received.
The easiest is to implement a sink media port (like WAV capture),
thus implementing put_frame(). Then you connect the call's stream to
this media port, in the conference bridge, and at the same time you
also connect the call's stream to the sound device as usual. You can
control when exactly you want to connect them, as this is done in
application's code.
The drawback of this approach is you won't be able to remove the
tone signal from the stream's signal, since connection from stream
to sound device is independent from the connection from stream to
your tone detection port.
Another approach is to implement "dual-sided" media port. A
put_frame() on the upstream side will trigger put_frame() to be
called on the downstream side, and a get_frame() on the upstream
side will also trigger get_frame() on the downstream side. The
resample port is implemented this way, have a look at
resample_port.c for the details.
Then you can "insert" your tone detection media port between the
call's stream and the bridge. You'll need to modify pjsua-lib code
to do this since this kind of interconnection currently cannot be
done at application's code.
regards,
-benny
Regards,
Ravi Inder Singh.
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org