collect DTMF and numbers in MRCPRecog and send custom params to unimrcp server

302 views
Skip to first unread message

Chan Qian

unread,
Jul 15, 2020, 12:36:15 PM7/15/20
to UniMRCP
hi,

i use unimrcp in asterisk version 11.17. 0. here are two question need support:

1. How to Send Custom ASR Parameters to UniMRCP Server ?

i need to send  Vendor-Specific-Parameters:SPEECH_CUSTOM_ID=ajh_1015   to unimrcp server. where to add this params? I write like this in dialplan:

exten => s,2, SynthAndRecog(Welcome to bot,builtin:grammar/number, SPEECH_CUSTOM_ID=ajh_1015&spl=en-US&p=speech-nuance5-mrcp2),  but seems doesn't work..is it need to add something in unimrcp.conf ?

 

2. problems with DTMF grammars expecting multiple DTMF digits

here is dialplan:

exten => s,n,SynthAndRecog(Please input a number,builtin:dtmf/number,t=5000&b=1&ct=0.7&spl=en-US), 

the cli show the dtmf digits.but when press digits,the voice do not interupte, and the result do not return back. i need to catch 18 number,and end with '#'...

wait for some advice,,thank you.

 

sin...@gmail.com

unread,
Jul 16, 2020, 2:29:35 AM7/16/20
to UniMRCP

[2020-07-16 14:25:15] NOTICE[18870][C-0000040a]: app_synthandrecog.c:1333 app_synthandrecog_exec: SynthAndRecog() prompt: 请问您需要什么帮助?
[2020-07-16 14:25:15] NOTICE[18870][C-0000040a]: app_synthandrecog.c:1341 app_synthandrecog_exec: SynthAndRecog() grammar: builtin:dtmf/digitsbuiltin:speech/transcribe
[2020-07-16 14:25:15] NOTICE[18870][C-0000040a]: app_synthandrecog.c:1372 app_synthandrecog_exec: SynthAndRecog() options: dttc=#&v=siyue&pv=15&pr=-200&t=20000&b=1&ct=0.5&&spl=zh-CN&uer=1
[2020-07-16 14:25:15] DEBUG[18870][C-0000040a]: app_synthandrecog.c:1161 synthandrecog_options_parse: Apply option dttc: #
[2020-07-16 14:25:15] DEBUG[18870][C-0000040a]: app_synthandrecog.c:1161 synthandrecog_options_parse: Apply option v: siyue
[2020-07-16 14:25:15] WARNING[18870][C-0000040a]: app_synthandrecog.c:1137 synthandrecog_option_apply: Unknown option: v
[2020-07-16 14:25:15] DEBUG[18870][C-0000040a]: app_synthandrecog.c:1161 synthandrecog_options_parse: Apply option pv: 15
[2020-07-16 14:25:15] DEBUG[18870][C-0000040a]: app_synthandrecog.c:1161 synthandrecog_options_parse: Apply option pr: -200
[2020-07-16 14:25:15] DEBUG[18870][C-0000040a]: app_synthandrecog.c:1161 synthandrecog_options_parse: Apply option t: 20000
[2020-07-16 14:25:15] DEBUG[18870][C-0000040a]: app_synthandrecog.c:1161 synthandrecog_options_parse: Apply option b: 1
[2020-07-16 14:25:15] DEBUG[18870][C-0000040a]: app_synthandrecog.c:1161 synthandrecog_options_parse: Apply option ct: 0.5
[2020-07-16 14:25:15] DEBUG[18870][C-0000040a]: app_synthandrecog.c:1161 synthandrecog_options_parse: Apply option spl: zh-CN
[2020-07-16 14:25:15] DEBUG[18870][C-0000040a]: app_synthandrecog.c:1161 synthandrecog_options_parse: Apply option uer: 1
[2020-07-16 14:25:15] DEBUG[18870][C-0000040a]: audio_queue.c:253 audio_queue_create: (ASR-12) Audio queue created
[2020-07-16 14:25:15] DEBUG[18870][C-0000040a]: speech_channel.c:252 speech_channel_create: Created speech channel: Name=ASR-12, Type=RECOGNIZER, Codec=LPCM, Rate=8000 on SIP/8001-00000809
[2020-07-16 14:25:15] DEBUG[20172]: app_synthandrecog.c:248 speech_on_channel_add: (ASR-12) speech_on_channel_add
[2020-07-16 14:25:15] DEBUG[20172]: app_synthandrecog.c:268 speech_on_channel_add: (ASR-12) DTMF generator created
[2020-07-16 14:25:15] NOTICE[20172]: app_synthandrecog.c:287 speech_on_channel_add: (ASR-12) Channel ready codec=LPCM, sample rate=8000
[2020-07-16 14:25:15] DEBUG[20172]: speech_channel.c:109 speech_channel_set_state_unlocked: (ASR-12) CLOSED ==> READY
[2020-07-16 14:25:15] DEBUG[18870][C-0000040a]: speech_channel.c:501 speech_channel_open: (ASR-12) channel is ready
[2020-07-16 14:25:15] DEBUG[18870][C-0000040a]: app_synthandrecog.c:1471 app_synthandrecog_exec: (ASR-12) Determine grammar type: builtin:dtmf/digitsbuiltin:speech/transcribe
[2020-07-16 14:25:15] DEBUG[18870][C-0000040a]: app_synthandrecog.c:849 recog_channel_load_grammar: (ASR-12) Loading grammar name=grammar-0, type=text/uri-list, data=builtin:dtmf/digitsbuiltin:speech/transcribe
[2020-07-16 14:25:15] DEBUG[18870][C-0000040a]: app_synthandrecog.c:1502 app_synthandrecog_exec: (ASR-12) Add prompt: 请问您需要什么帮助?
[2020-07-16 14:25:15] NOTICE[18870][C-0000040a]: app_synthandrecog.c:1601 app_synthandrecog_exec: (ASR-12) Recognizing, Start-Input-Timers: 0
[2020-07-16 14:25:15] DEBUG[18870][C-0000040a]: speech_channel.c:619 speech_channel_set_params: (ASR-12) Confidence-Threshold: 0.5
[2020-07-16 14:25:15] DEBUG[18870][C-0000040a]: speech_channel.c:619 speech_channel_set_params: (ASR-12) Speech-Language: zh-CN
[2020-07-16 14:25:15] DEBUG[18870][C-0000040a]: speech_channel.c:619 speech_channel_set_params: (ASR-12) Dtmf-Term-Char: #
[2020-07-16 14:25:15] DEBUG[18870][C-0000040a]: speech_channel.c:619 speech_channel_set_params: (ASR-12) Recognition-Timeout: 20000
[2020-07-16 14:25:15] DEBUG[20172]: app_synthandrecog.c:928 recog_on_message_receive: (ASR-12) RECOGNIZE IN PROGRESS
[2020-07-16 14:25:15] DEBUG[20172]: speech_channel.c:109 speech_channel_set_state_unlocked: (ASR-12) READY ==> PROCESSING
[2020-07-16 14:25:15] DEBUG[18870][C-0000040a]: audio_queue.c:253 audio_queue_create: (TTS-12) Audio queue created
[2020-07-16 14:25:15] DEBUG[18870][C-0000040a]: speech_channel.c:252 speech_channel_create: Created speech channel: Name=TTS-12, Type=SYNTHESIZER, Codec=LPCM, Rate=8000 on SIP/8001-00000809
[2020-07-16 14:25:15] DEBUG[20172]: app_synthandrecog.c:248 speech_on_channel_add: (TTS-12) speech_on_channel_add
[2020-07-16 14:25:15] NOTICE[20172]: app_synthandrecog.c:287 speech_on_channel_add: (TTS-12) Channel ready codec=LPCM, sample rate=8000
[2020-07-16 14:25:15] DEBUG[20172]: speech_channel.c:109 speech_channel_set_state_unlocked: (TTS-12) CLOSED ==> READY
[2020-07-16 14:25:15] DEBUG[18870][C-0000040a]: speech_channel.c:501 speech_channel_open: (TTS-12) channel is ready
[2020-07-16 14:25:15] DEBUG[18870][C-0000040a]: speech_channel.c:619 speech_channel_set_params: (TTS-12) Prosody-Volume: 15
[2020-07-16 14:25:15] DEBUG[18870][C-0000040a]: speech_channel.c:619 speech_channel_set_params: (TTS-12) Prosody-Rate: -200
[2020-07-16 14:25:15] DEBUG[18870][C-0000040a]: speech_channel.c:619 speech_channel_set_params: (TTS-12) Speech-Language: zh-CN
[2020-07-16 14:25:15] DEBUG[20172]: app_synthandrecog.c:329 synth_on_message_receive: (TTS-12) REQUEST IN PROGRESS
[2020-07-16 14:25:15] DEBUG[20172]: speech_channel.c:109 speech_channel_set_state_unlocked: (TTS-12) READY ==> PROCESSING
[2020-07-16 14:25:17] DTMF[18870][C-0000040a]: channel.c:4214 __ast_read: DTMF begin '8' received on SIP/8001-00000809
[2020-07-16 14:25:17] DTMF[18870][C-0000040a]: channel.c:4225 __ast_read: DTMF begin passthrough '8' on SIP/8001-00000809
[2020-07-16 14:25:18] DTMF[18870][C-0000040a]: channel.c:4128 __ast_read: DTMF end '8' received on SIP/8001-00000809, duration 200 ms
[2020-07-16 14:25:18] DTMF[18870][C-0000040a]: channel.c:4169 __ast_read: DTMF end accepted with begin '8' on SIP/8001-00000809
[2020-07-16 14:25:18] DTMF[18870][C-0000040a]: channel.c:4198 __ast_read: DTMF end passthrough '8' on SIP/8001-00000809
[2020-07-16 14:25:18] DEBUG[18870][C-0000040a]: app_synthandrecog.c:1719 app_synthandrecog_exec: (ASR-12) User pressed DTMF key (56)
[2020-07-16 14:25:18] NOTICE[18870][C-0000040a]: app_synthandrecog.c:1726 app_synthandrecog_exec: (ASR-12) DTMF digit queued (8)
[2020-07-16 14:25:18] DEBUG[20174]: app_synthandrecog.c:1038 recog_stream_read: (ASR-12) DTMF frame written

Arsen Chaloyan

unread,
Jul 20, 2020, 10:06:44 PM7/20/20
to UniMRCP
2. exten => s,2, SynthAndRecog(Welcome to bot,"builtin:speech/transcribe,builtin:dtmf/digits?length=16", spl=en-US)

--
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/cc06b06d-0670-4cfa-be0b-54f08d9ab081n%40googlegroups.com.


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

sin...@gmail.com

unread,
Jul 22, 2020, 10:51:06 PM7/22/20
to UniMRCP
thanks so much Arsen..
i download the new source and it's ok,,,

2. exten => s,2, SynthAndRecog(Welcome to bot,"builtin:speech/transcribe,builtin:dtmf/digits?length=16", spl=en-US)
still can not get the dtmf number, and the voice don't stop after i press the button.

this is my dialplan:
exten => s,2, SynthAndRecog(  Welcome to bot,  "builtin:speech/transcribe,builtin:dtmf/digits?length=18",dttc=#&vn=siyue&pv=15&pr=-200&t=20000&b=1&ct=0.5&&spl=zh-CN&uer=1

Arsen Chaloyan

unread,
Jul 24, 2020, 5:49:57 PM7/24/20
to UniMRCP
Hi Chan,

1. Glad it worked.
2. You would need to provide logs from both Asterisk and UniMRCP server.

sin...@gmail.com

unread,
Aug 7, 2020, 11:26:13 AM8/7/20
to UniMRCP
thanks Arsen .
i found it's hard to solve the dtmf collect ,so i use the default fuction.

Reply all
Reply to author
Forward
0 new messages