MS
Maarten Sander
Wed, Aug 20, 2008 12:43 PM
Hello,
I'm developing a call-center application using PJSIP (actually, mostly
PJSUA) and currently I'm trying to implement an inband-DTMF detector port
(I can't rely on SIP INFO messages).
Right now, I'm using SpanDSP for reading DTMF digits. However, it doesn't
seem to work (no digits are received). Has anyone tried to integrate
SpanDSP and PJSIP before?
Currently, I'm feeding the samples as-is to SpanDSP, and I'm relying on
SpanDSP's callback mechanism to receive the digits:
static pj_status_t dtmfdet_put_frame(pjmedia_port *this_port,
const pjmedia_frame frame)
{
struct dtmfdet_port dport = (struct dtmfdet_port) this_port;
dtmf_rx(&dport->state, (const pj_int16_t) frame->buf,
dport->base.info.samples_per_frame);
return PJ_SUCCESS;
}
static void dtmfdet_digits_rx(void *user_data, const char *digits,
int len)
{
struct dtmfdet_port dport = (struct dtmfdet_port) user_data;
int i;
if (dport->cfg.cb.on_dtmf_digit != NULL) {
for (i = 0; i < len; i++) {
dport->cfg.cb.on_dtmf_digit(dport->cfg.call_id, digits[i]);
}
}
}
Is this the right way to do it? Should I convert the samples? I'm
assuming the frame contains linear samples, and as far as I can tell,
SpanDSP expects them to be linear.
Thanks for your help.
Regards,
Maarten
P.S. I've also tried to implement the Goertzel algorithm
(http://en.wikipedia.org/wiki/Goertzel_algorithm) directly, but it didn't
work out, so I thought it would be wise to try integrating SpanDSP first.
Eventually, I'd like to get rid of the SpanDSP dependency, and use Goertzel
directly.
--
Privateer Software Development (www.privateer-software.nl)
- web usability, web accessibility, web development
- cross-platform software development
Hello,
I'm developing a call-center application using PJSIP (actually, mostly
PJSUA) and currently I'm trying to implement an inband-DTMF detector port
(I can't rely on SIP INFO messages).
Right now, I'm using SpanDSP for reading DTMF digits. However, it doesn't
seem to work (no digits are received). Has anyone tried to integrate
SpanDSP and PJSIP before?
Currently, I'm feeding the samples as-is to SpanDSP, and I'm relying on
SpanDSP's callback mechanism to receive the digits:
static pj_status_t dtmfdet_put_frame(pjmedia_port *this_port,
const pjmedia_frame *frame)
{
struct dtmfdet_port *dport = (struct dtmfdet_port*) this_port;
dtmf_rx(&dport->state, (const pj_int16_t*) frame->buf,
dport->base.info.samples_per_frame);
return PJ_SUCCESS;
}
static void dtmfdet_digits_rx(void *user_data, const char *digits,
int len)
{
struct dtmfdet_port *dport = (struct dtmfdet_port*) user_data;
int i;
if (dport->cfg.cb.on_dtmf_digit != NULL) {
for (i = 0; i < len; i++) {
dport->cfg.cb.on_dtmf_digit(dport->cfg.call_id, digits[i]);
}
}
}
Is this the right way to do it? Should I convert the samples? I'm
assuming the frame contains linear samples, and as far as I can tell,
SpanDSP expects them to be linear.
Thanks for your help.
Regards,
Maarten
P.S. I've also tried to implement the Goertzel algorithm
(http://en.wikipedia.org/wiki/Goertzel_algorithm) directly, but it didn't
work out, so I thought it would be wise to try integrating SpanDSP first.
Eventually, I'd like to get rid of the SpanDSP dependency, and use Goertzel
directly.
--
Privateer Software Development (www.privateer-software.nl)
* web usability, web accessibility, web development
* cross-platform software development
SI
Saúl Ibarra
Wed, Aug 20, 2008 3:52 PM
I don' know about integrating pjsip and spandsp, but why don't you use
rfc2833 or sip info? What codec are you using?
--
Saúl -- "Nunca subestimes el ancho de banda de un camión lleno de disketes."
http://www.saghul.net/
I don' know about integrating pjsip and spandsp, but why don't you use
rfc2833 or sip info? What codec are you using?
--
Saúl -- "Nunca subestimes el ancho de banda de un camión lleno de disketes."
----------------------------------------------------------------
http://www.saghul.net/
BP
Benny Prijono
Wed, Aug 20, 2008 8:35 PM
Hello,
I'm developing a call-center application using PJSIP (actually, mostly
PJSUA) and currently I'm trying to implement an inband-DTMF detector port
(I can't rely on SIP INFO messages).
Right now, I'm using SpanDSP for reading DTMF digits. However, it doesn't
seem to work (no digits are received). Has anyone tried to integrate
SpanDSP and PJSIP before?
Could you explain exactly what you mean by "doesn't work"?
Currently, I'm feeding the samples as-is to SpanDSP, and I'm relying on
SpanDSP's callback mechanism to receive the digits:
static pj_status_t dtmfdet_put_frame(pjmedia_port *this_port,
const pjmedia_frame frame)
{
struct dtmfdet_port dport = (struct dtmfdet_port) this_port;
dtmf_rx(&dport->state, (const pj_int16_t) frame->buf,
dport->base.info.samples_per_frame);
return PJ_SUCCESS;
}
Not knowing SpanDSP, that looks fine. But perhaps you'd want to handle the
case where frame->type is not FRAME_TYPE_AUDIO (i.e. just ignore them if
it's not audio).
static void dtmfdet_digits_rx(void *user_data, const char *digits,
int len)
{
struct dtmfdet_port dport = (struct dtmfdet_port) user_data;
int i;
if (dport->cfg.cb.on_dtmf_digit != NULL) {
for (i = 0; i < len; i++) {
dport->cfg.cb.on_dtmf_digit(dport->cfg.call_id, digits[i]);
}
}
}
Is this the right way to do it? Should I convert the samples? I'm
assuming the frame contains linear samples, and as far as I can tell,
SpanDSP expects them to be linear.
The frame should contain linear samples.
Cheers
Benny
On Wed, Aug 20, 2008 at 1:43 PM, Maarten Sander
<info@privateer-software.nl>wrote:
> Hello,
>
> I'm developing a call-center application using PJSIP (actually, mostly
> PJSUA) and currently I'm trying to implement an inband-DTMF detector port
> (I can't rely on SIP INFO messages).
>
> Right now, I'm using SpanDSP for reading DTMF digits. However, it doesn't
> seem to work (no digits are received). Has anyone tried to integrate
> SpanDSP and PJSIP before?
>
>
Could you explain exactly what you mean by "doesn't work"?
> Currently, I'm feeding the samples as-is to SpanDSP, and I'm relying on
> SpanDSP's callback mechanism to receive the digits:
>
> static pj_status_t dtmfdet_put_frame(pjmedia_port *this_port,
> const pjmedia_frame *frame)
> {
> struct dtmfdet_port *dport = (struct dtmfdet_port*) this_port;
> dtmf_rx(&dport->state, (const pj_int16_t*) frame->buf,
> dport->base.info.samples_per_frame);
> return PJ_SUCCESS;
> }
>
>
Not knowing SpanDSP, that looks fine. But perhaps you'd want to handle the
case where frame->type is not FRAME_TYPE_AUDIO (i.e. just ignore them if
it's not audio).
static void dtmfdet_digits_rx(void *user_data, const char *digits,
> int len)
> {
> struct dtmfdet_port *dport = (struct dtmfdet_port*) user_data;
> int i;
>
> if (dport->cfg.cb.on_dtmf_digit != NULL) {
> for (i = 0; i < len; i++) {
> dport->cfg.cb.on_dtmf_digit(dport->cfg.call_id, digits[i]);
> }
> }
> }
>
> Is this the right way to do it? Should I convert the samples? I'm
> assuming the frame contains linear samples, and as far as I can tell,
> SpanDSP expects them to be linear.
>
>
The frame should contain linear samples.
Cheers
Benny
> Thanks for your help.
>
> Regards,
>
> Maarten
>
> P.S. I've also tried to implement the Goertzel algorithm
> (http://en.wikipedia.org/wiki/Goertzel_algorithm) directly, but it didn't
> work out, so I thought it would be wise to try integrating SpanDSP first.
> Eventually, I'd like to get rid of the SpanDSP dependency, and use Goertzel
> directly.
>
> --
> Privateer Software Development (www.privateer-software.nl)
> * web usability, web accessibility, web development
> * cross-platform software development
>
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip@lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
MS
Maarten Sander
Thu, Aug 21, 2008 8:23 AM
On Wed, 2008-08-20 at 17:52 +0200, Saúl Ibarra wrote:
I don' know about integrating pjsip and spandsp, but why don't you use
rfc2833 or sip info? What codec are you using?
Locally, I'm using SIP INFO (and it works just fine). However, my
client told me that in the live environment, SIP INFO and RFC 2833 are
not available. The application will directly connect to a carrier, and
they won't do DTMF detection for us.
I'll verify if this is really true, but I thought it would be fairly
straightforward to integrate an existing DTMF detector.
I'm using the standard G.711 PCMU codec.
--
Privateer Software Development (www.privateer-software.nl)
- web usability, web accessibility, web development
- cross-platform software development
On Wed, 2008-08-20 at 17:52 +0200, Saúl Ibarra wrote:
> I don' know about integrating pjsip and spandsp, but why don't you use
> rfc2833 or sip info? What codec are you using?
Locally, I'm using SIP INFO (and it works just fine). However, my
client told me that in the live environment, SIP INFO and RFC 2833 are
not available. The application will directly connect to a carrier, and
they won't do DTMF detection for us.
I'll verify if this is really true, but I thought it would be fairly
straightforward to integrate an existing DTMF detector.
I'm using the standard G.711 PCMU codec.
--
Privateer Software Development (www.privateer-software.nl)
* web usability, web accessibility, web development
* cross-platform software development
MS
Maarten Sander
Thu, Aug 21, 2008 9:02 AM
Right now, I'm using SpanDSP for reading DTMF digits. However, it
doesn't
seem to work (no digits are received). Has anyone tried to integrate
SpanDSP and PJSIP before?
Could you explain exactly what you mean by "doesn't work"?
I'm sorry, I should have been more clear!
When I connect to an Asterisk server, and press the digits on my phone, my
application receives the digits properly using the callback I supplied to
PJSUA.
Now when I disable the callback, and use my own module, nothing happens.
I've verified that dtmfdet_put_frame() is called correctly. However,
SpanDSP doesn't seem to detect the digits, and the callback function
supplied to SpanDSP (dtmfdet_digits_rx()) is never called.
While typing this, I realized that something else could be happening:
perhaps the DTMF tones generated by my phone aren't in the stream at all.
I've Googled this, and found
http://www.experts-exchange.com/Networking/Telecommunications/IP_Telephony/Asterisk_/Q_23280368.html.
I guess I'll have to record the stream and find out.
Currently, I'm feeding the samples as-is to SpanDSP, and I'm relying on
SpanDSP's callback mechanism to receive the digits:
Not knowing SpanDSP, that looks fine. But perhaps you'd want to handle
case where frame->type is not FRAME_TYPE_AUDIO (i.e. just ignore them if
it's not audio).
Yes, good point, thanks.
Regards,
Maarten
--
Privateer Software Development (www.privateer-software.nl)
- web usability, web accessibility, web development
- cross-platform software development
On Wed, 20 Aug 2008 21:35:25 +0100, "Benny Prijono" <bennylp@pjsip.org>
wrote:
>> Right now, I'm using SpanDSP for reading DTMF digits. However, it
>> doesn't
>> seem to work (no digits are received). Has anyone tried to integrate
>> SpanDSP and PJSIP before?
>>
> Could you explain exactly what you mean by "doesn't work"?
I'm sorry, I should have been more clear!
When I connect to an Asterisk server, and press the digits on my phone, my
application receives the digits properly using the callback I supplied to
PJSUA.
Now when I disable the callback, and use my own module, nothing happens.
I've verified that dtmfdet_put_frame() is called correctly. However,
SpanDSP doesn't seem to detect the digits, and the callback function
supplied to SpanDSP (dtmfdet_digits_rx()) is never called.
While typing this, I realized that something else could be happening:
perhaps the DTMF tones generated by my phone aren't in the stream at all.
I've Googled this, and found
http://www.experts-exchange.com/Networking/Telecommunications/IP_Telephony/Asterisk_/Q_23280368.html.
I guess I'll have to record the stream and find out.
>> Currently, I'm feeding the samples as-is to SpanDSP, and I'm relying on
>> SpanDSP's callback mechanism to receive the digits:
>>
[snip]
>>
>>
> Not knowing SpanDSP, that looks fine. But perhaps you'd want to handle
the
> case where frame->type is not FRAME_TYPE_AUDIO (i.e. just ignore them if
> it's not audio).
Yes, good point, thanks.
Regards,
Maarten
--
Privateer Software Development (www.privateer-software.nl)
* web usability, web accessibility, web development
* cross-platform software development
MS
Maarten Sander
Thu, Aug 21, 2008 12:09 PM
I just recorded it, and indeed, Asterisk seems to filter out the tones
(probably to prevent double detection).
Thanks for your support though, without writing the e-mail to list I
probably wouldn't have thought of this :)
Regards,
Maarten
--
Privateer Software Development (www.privateer-software.nl)
- web usability, web accessibility, web development
- cross-platform software development
Hi,
> While typing this, I realized that something else could be happening:
> perhaps the DTMF tones generated by my phone aren't in the stream at all.
> I've Googled this, and found
> http://www.experts-exchange.com/Networking/Telecommunications/IP_Telephony/Asterisk_/Q_23280368.html.
>
> I guess I'll have to record the stream and find out.
I just recorded it, and indeed, Asterisk seems to filter out the tones
(probably to prevent double detection).
Thanks for your support though, without writing the e-mail to list I
probably wouldn't have thought of this :)
Regards,
Maarten
--
Privateer Software Development (www.privateer-software.nl)
* web usability, web accessibility, web development
* cross-platform software development
SI
Saúl Ibarra
Thu, Aug 21, 2008 10:54 PM
Locally, I'm using SIP INFO (and it works just fine). However, my
client told me that in the live environment, SIP INFO and RFC 2833 are
not available. The application will directly connect to a carrier, and
they won't do DTMF detection for us.
What do you mean with live environment? At least every sip-thing I
know supports info or rfc2833... And notice you can't use inband whith
compressed codecs...
--
Saúl -- "Nunca subestimes el ancho de banda de un camión lleno de disketes."
http://www.saghul.net/
> Locally, I'm using SIP INFO (and it works just fine). However, my
> client told me that in the live environment, SIP INFO and RFC 2833 are
> not available. The application will directly connect to a carrier, and
> they won't do DTMF detection for us.
What do you mean with live environment? At least every sip-thing I
know supports info or rfc2833... And notice you can't use inband whith
compressed codecs...
--
Saúl -- "Nunca subestimes el ancho de banda de un camión lleno de disketes."
----------------------------------------------------------------
http://www.saghul.net/
MS
Maarten Sander
Mon, Sep 8, 2008 1:01 PM
Locally, I'm using SIP INFO (and it works just fine). However, my
client told me that in the live environment, SIP INFO and RFC 2833 are
not available. The application will directly connect to a carrier, and
they won't do DTMF detection for us.
What do you mean with live environment? At least every sip-thing I
know supports info or rfc2833... And notice you can't use inband whith
compressed codecs...
After your e-mail I asked a few more questions, and it turned out my
client was just making an 'educated guess' and assumed all detections
should be done inband.
Anyway, if someone is interested in an (untested) inband DTMF detector,
just drop me a line. I've got two versions, one depending on SpanDSP
and one using the algorithm described in my first e-mail.
Sorry for bothering the list about this :)
--
Privateer Software Development (www.privateer-software.nl)
- web usability, web accessibility, web development
- cross-platform software development
Saúl Ibarra wrote:
>> Locally, I'm using SIP INFO (and it works just fine). However, my
>> client told me that in the live environment, SIP INFO and RFC 2833 are
>> not available. The application will directly connect to a carrier, and
>> they won't do DTMF detection for us.
>
> What do you mean with live environment? At least every sip-thing I
> know supports info or rfc2833... And notice you can't use inband whith
> compressed codecs...
After your e-mail I asked a few more questions, and it turned out my
client was just making an 'educated guess' and assumed all detections
should be done inband.
Anyway, if someone is interested in an (untested) inband DTMF detector,
just drop me a line. I've got two versions, one depending on SpanDSP
and one using the algorithm described in my first e-mail.
Sorry for bothering the list about this :)
--
Privateer Software Development (www.privateer-software.nl)
* web usability, web accessibility, web development
* cross-platform software development
AR
Archie Rosenblum
Sat, Aug 15, 2009 6:50 PM
Hi,
Does anyone have an in-band DTMF solution for pjsip? I know this question
has been raised in the past and I am hoping some crackerjack coder has
figured it out and would like to share it with the group. I've been seeing
more and more DTMF converted to in-band through various voip providers and I
just not savvy enough to understand how to code this detection in pjsip.
Any help is appreciated.
Sincerely,
Archie
Hi,
Does anyone have an in-band DTMF solution for pjsip? I know this question
has been raised in the past and I am hoping some crackerjack coder has
figured it out and would like to share it with the group. I've been seeing
more and more DTMF converted to in-band through various voip providers and I
just not savvy enough to understand how to code this detection in pjsip.
Any help is appreciated.
Sincerely,
Archie
DC
David Clark
Sat, Aug 15, 2009 11:17 PM
Ok I have not done inband but I have done FFT and they are similar in
terms of approach. For inband dtmf check out this algorithm.
http://en.wikipedia.org/wiki/Goertzel_algorithm
Now for how to get the audio data from the conference port source to
the detection algorithm. Do this.
Just a memory capture device and every time you get a packet of audio
data call this dedection function to determine what dtmf's are
present, then you can call your on_dtmf_callback function for a
seemless interface between inband and non-inband calls.
That is the short answer.
At 01:50 PM 8/15/2009, Archie Rosenblum wrote:
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_000B_01CA1DB7.BED967A0"
Content-Language: en-us
Hi,
Does anyone have an in-band DTMF solution for pjsip? I know this
question has been raised in the past and I am hoping some
crackerjack coder has figured it out and would like to share it with
the group. I've been seeing more and more DTMF converted to in-band
through various voip providers and I just not savvy enough to
understand how to code this detection in pjsip.
Any help is appreciated.
Sincerely,
Archie
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
Ok I have not done inband but I have done FFT and they are similar in
terms of approach. For inband dtmf check out this algorithm.
http://en.wikipedia.org/wiki/Goertzel_algorithm
Now for how to get the audio data from the conference port source to
the detection algorithm. Do this.
Just a memory capture device and every time you get a packet of audio
data call this dedection function to determine what dtmf's are
present, then you can call your on_dtmf_callback function for a
seemless interface between inband and non-inband calls.
That is the short answer.
At 01:50 PM 8/15/2009, Archie Rosenblum wrote:
>Content-Type: multipart/alternative;
> boundary="----=_NextPart_000_000B_01CA1DB7.BED967A0"
>Content-Language: en-us
>
>Hi,
>
>Does anyone have an in-band DTMF solution for pjsip? I know this
>question has been raised in the past and I am hoping some
>crackerjack coder has figured it out and would like to share it with
>the group. I've been seeing more and more DTMF converted to in-band
>through various voip providers and I just not savvy enough to
>understand how to code this detection in pjsip.
>
>Any help is appreciated.
>
>Sincerely,
>Archie
>_______________________________________________
>Visit our blog: http://blog.pjsip.org
>
>pjsip mailing list
>pjsip@lists.pjsip.org
>http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org