Asterisk DTMF/Speech Recog

265 views
Skip to first unread message

Girish Gopinath

unread,
Nov 2, 2021, 1:08:22 PM11/2/21
to UniMRCP
Hello:

I have used Asterisk, UniMRCP and GSR plugins in the past for my projects. Currently, I am working on a project that requires me to detect DTMF or recognise utterances of digits. I am using MRCPRecog with Asterisk. I am facing a couple of issues. I tried changing the MRCPRecog parameters, but no luck. The issues are:

1. The audio file is not played completely. It breaks during play and waits for DTMF input. If I disable barge-in, the file is played completely, but we do not want the callers to wait until it is completed.

2. DTMF from the dial pad is detected, but it is not recognizing speech. Even if I say "two", it comes back with "one" as the utterance.

Here is the Asterisk dialplan:

exten => s,1(start),Set(DTMF_MAXDIGITS=${ARG2})

same=n,MRCPRecog(/etc/asterisk/grammars/digits.xml,p=mrcp2&i=none&t=5000&b=1&ct=0.7&spl=en-US&f=${ARG1})

same=n,Noop(dtmf: ${RECOG_DTMF} status: ${RECOG_STATUS}, completion-cause: ${RECOG_COMPLETION_CAUSE}, result: ${RECOG_RESULT})

Here are the Asterisk console logs:

    -- Executing [s@macro-readOption:1] Set("SIP/229000-0000003d", "DTMF_MAXDIGITS=1") in new stack

    -- Executing [s@macro-readOption:2] MRCPRecog("SIP/229000-0000003d", "/etc/asterisk/grammars/digits.xml,p=mrcp2&i=none&t=5000&b=1&ct=0.7&spl=en-US&f=custom/000085") in new stack

[2021-11-02 16:57:17] NOTICE[8378][C-00000042]: app_mrcprecog.c:1079 app_recog_exec: MRCPRecog() grammar: /etc/asterisk/grammars/digits.xml

[2021-11-02 16:57:17] NOTICE[8378][C-00000042]: app_mrcprecog.c:1100 app_recog_exec: MRCPRecog() options: p=mrcp2&i=none&t=5000&b=1&ct=0.7&spl=en-US&f=custom/000085

[2021-11-02 16:57:17] NOTICE[27371]: app_mrcprecog.c:287 speech_on_channel_add: (ASR-56) Channel ready codec=PCMU, sample rate=8000

[2021-11-02 16:57:17] NOTICE[8378][C-00000042]: app_mrcprecog.c:1311 app_recog_exec: (ASR-56) Recognizing, enable DTMFs: 2, start input timers: 0

[2021-11-02 16:57:17] NOTICE[8378][C-00000042]: speech_channel.c:755 astchan_stream_file: Stream file custom/000085 on SIP/229000-0000003d length:49600

[2021-11-02 16:57:17] WARNING[8378][C-00000042]: app_mrcprecog.c:1342 app_recog_exec: DTMF MAXDIGITS 1

[2021-11-02 16:57:30] NOTICE[8378][C-00000042]: app_mrcprecog.c:455 recog_channel_get_results: (ASR-56) Result:


<?xml version="1.0"?>

<result> 

  <interpretation grammar="session:requ...@form-level.store" confidence="0.97">

    <instance>one</instance>

    <input mode="speech">one</input>

  </interpretation>

</result>

[2021-11-02 16:57:30] NOTICE[8378][C-00000042]: app_mrcprecog.c:1040 mrcprecog_exit: MRCPRecog() exiting status: OK on SIP/229000-0000003d

    -- Executing [s@macro-readOption:3] NoOp("SIP/229000-0000003d", "dtmf:  status: , completion-cause: 000, result: <?xml version="1.0"?>

    -- <result> 

    --   <interpretation grammar="session:requ...@form-level.store" confidence="0.97">

    --     <instance>one</instance>

    --     <input mode="speech">one</input>

    --   </interpretation>

    -- </result>") in new stack


Appreciate any help to resolve this issue.

Thank you,
/Girish





Vahagn Kocharyan

unread,
Nov 3, 2021, 5:52:30 AM11/3/21
to uni...@googlegroups.com
Hi can you share your mrcp.conf? Your mrcp conf codecs must contain telephone-event like this example 
--
You received this message because you are subscribed to the Google Groups "UniMRCP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unimrcp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/unimrcp/0f348a2b-e8aa-45eb-916b-16d9b20613cbn%40googlegroups.com.

Girish Gopinath

unread,
Nov 9, 2021, 12:14:25 PM11/9/21
to UniMRCP
Hello:

Thank you for the reply, and apologies for the late response. My mrcp.conf is slightly different. I will make the changes and give it a try and post my findings here.

Regards,
Girish

Girish Gopinath

unread,
Nov 10, 2021, 4:23:03 AM11/10/21
to UniMRCP
Hello:

I have made the changes, still no joy. The audio file is cut off while playing. Below is my mrcp.conf. Is there any other change I need to make?

; General settings

;

[general]

; Default ASR and TTS profiles.

default-asr-profile = mrcp2

default-tts-profile = mrcp2

; UniMRCP logging level to appear in Asterisk logs.  Options are:

; EMERGENCY|ALERT|CRITICAL|ERROR|WARNING|NOTICE|INFO|DEBUG -->

log-level = DEBUG

max-connection-count = 100

max-shared-count = 100

offer-new-connection = 1

; rx-buffer-size = 1024

; tx-buffer-size = 1024

; request-timeout = 5000

; speech-channel-timeout = 30000


;

; Profile for UniMRCP Server [MRCPv2]

;

[mrcp2]

; MRCP settings

version = 2

;

; SIP settings

server-ip = 10.5.0.5

server-port = 5080

; SIP user agent

client-ip = 10.5.0.5

client-port = 5093

sip-transport = udp

;

; RTP factory

rtp-ip = 10.5.0.5

rtp-port-min = 28000

rtp-port-max = 29000

;

; Jitter buffer settings

playout-delay = 50

max-playout-delay = 200

; RTP settings

ptime = 20

codecs = PCMU PCMA L16/96/8000 telephone-event/101/8000

; RTCP settings

rtcp = 0


;

; Profile for UniMRCP Server [MRCPv1]

;

[mrcp1]

; MRCP settings

version = 1

;

; RTSP settings

server-ip = 10.5.0.5

server-port = 1554

resource-location = media

speechsynth = speechsynthesizer

speechrecog = speechrecognizer

;

; RTP factory

rtp-ip = 10.5.0.5

rtp-port-min = 27000

rtp-port-max = 28000

;

; Jitter buffer settings

playout-delay = 50

max-playout-delay = 200

; RTP settings

ptime = 20

codecs = PCMU PCMA L16/96/8000 telephone-event/101/8000

; RTCP settings

rtcp = 0


Thanks,
/Girish

Vahagn Kocharyan

unread,
Nov 10, 2021, 6:32:04 AM11/10/21
to UniMRCP
Hi 
Can you share logs?

Girish Gopinath

unread,
Nov 10, 2021, 7:09:06 AM11/10/21
to UniMRCP
Hello:

Logs from Asterisk console and UniMRCP server are attached. Please note that this is running on a Debian (stretch) machine. I'm not sure if that has got anything to do with this. I had compiled and installed UniMRCP and the Asterisk modules from the sources.

Thanks,
/Girish
unimrcpserver-log.txt
asterisk-log.txt

Arsen Chaloyan

unread,
Nov 13, 2021, 2:55:53 PM11/13/21
to UniMRCP
Hello Girish,

You are using the demo recog plugin, which simply returns "one" no matter what. Instead, you would need to load GSR.

Also, please do not attempt to use binaries compiled for Ubuntu on Debian. There were numerous hidden problems reported here and there related to binary incompatibilities in OpenSSL.



--
Arsen Chaloyan
Author of UniMRCP
http://www.unimrcp.org

Girish Gopinath

unread,
Nov 14, 2021, 3:20:39 AM11/14/21
to UniMRCP
Hello Arsen:

I've had success with UniMRCP and GSS/GSR in the past for the clients I had worked with. This new client already has a system in place that uses Nuance. My attempt is to replace Nuance with UniMRCP. 

I''ll setup another system with Ubuntu/CentOS and continue my tests. I'll post my findings here.

Thanks,
/Girish
Reply all
Reply to author
Forward
0 new messages