Running of dialplan is stopped if MRCP server is unavailable

985 views
Skip to first unread message

Mulai

unread,
Sep 21, 2015, 10:43:34 AM9/21/15
to UniMRCP
Hello Arsen,

I'm testing Asterisk 13 + UniMRCP connector 1.3.1 + VoiceNavigator.
It works perfect but I have found some feature which worked another way in previous versions.

Before if MRCP server is unavailable commands MRCPRecog or MRCPSynth were just skipped and running of dialplan was continuing.
And it was well for me. I could use few MRCP servers in dialplan and manage requests between them.

Current version works worse. If MRCP server is unavailable, running of dialplan is stopped and exit with error.

Example for MRCPSynth:
[Sep 21 18:18:24] NOTICE[9535][C-00000000]: src/mrcp_application.c:96 : Create MRCP Handle 0xb6a47888 [vn]
[Sep 21 18:18:24] NOTICE[9535][C-00000000]: src/mrcp_client_session.c:133 : Create Channel TTS-0 <new>
[Sep 21 18:18:24] NOTICE[9515]: src/mrcp_client_session.c:387 : Receive App Request TTS-0 <new> [2]
[Sep 21 18:18:24] NOTICE[9515]: src/rtsp_client.c:298 : Create RTSP Handle 0xa99d2f8
[Sep 21 18:18:24] NOTICE[9515]: src/mrcp_client.c:700 : Add MRCP Handle TTS-0 <new>
[Sep 21 18:18:24] NOTICE[9515]: src/mrcp_client_session.c:719 : Add Control Channel TTS-0 <new@speechsynth>
[Sep 21 18:18:24] NOTICE[9515]: src/mrcp_client_session.c:411 : Send Offer TTS-0 <new> [c:0 a:1 v:0] to 192.168.6.59:8000
[Sep 21 18:18:27] WARNING[9518]: src/rtsp_client.c:406 : Failed to Connect to RTSP Server 192.168.6.59:8000
[Sep 21 18:18:27] NOTICE[9515]: src/mrcp_client_session.c:151 : Receive Answer TTS-0 <new> [c:0 a:0 v:0] Status 0
[Sep 21 18:18:27] NOTICE[9515]: src/mrcp_client_session.c:455 : Raise App Response TTS-0 <new> [2] FAILURE [2]
[Sep 21 18:18:27] ERROR[9515]: app_mrcpsynth.c:209 speech_on_channel_add: (TTS-0) Channel error status=2, response code=0!
[Sep 21 18:18:27] NOTICE[9515]: src/mrcp_client_session.c:387 : Receive App Request TTS-0 <new> [1]
[Sep 21 18:18:27] NOTICE[9515]: src/mrcp_client_session.c:833 : Terminate Session TTS-0 <new>
[Sep 21 18:18:27] NOTICE[9518]: src/rtsp_client.c:305 : Destroy RTSP Handle 0xa99d2f8
[Sep 21 18:18:27] NOTICE[9515]: src/mrcp_client_session.c:209 : Session Terminated TTS-0 <new>
[Sep 21 18:18:27] NOTICE[9515]: src/mrcp_client.c:710 : Remove MRCP Handle TTS-0 <new>
[Sep 21 18:18:27] NOTICE[9515]: src/mrcp_client_session.c:455 : Raise App Response TTS-0 <new> [1] SUCCESS [0]
[Sep 21 18:18:27] NOTICE[9515]: src/mrcp_application.c:182 : Destroy MRCP Handle TTS-0
[Sep 21 18:18:27] NOTICE[9535][C-00000000]: app_mrcpsynth.c:486 mrcpsynth_exit: MRCPSynth() exiting status: ERROR on SIP/100-00000000
  == Spawn extension (public, 1111, 1) exited non-zero on 'SIP/100-00000000'

Example for MRCPRecog
[Sep 21 18:18:57] NOTICE[9538][C-00000001]: src/mrcp_application.c:96 : Create MRCP Handle 0xa9affd0 [vn]
[Sep 21 18:18:57] NOTICE[9538][C-00000001]: src/mrcp_client_session.c:133 : Create Channel ASR-1 <new>
[Sep 21 18:18:57] NOTICE[9515]: src/mrcp_client_session.c:387 : Receive App Request ASR-1 <new> [2]
[Sep 21 18:18:57] NOTICE[9515]: src/rtsp_client.c:298 : Create RTSP Handle 0xa9b1fd8
[Sep 21 18:18:57] NOTICE[9515]: src/mrcp_client.c:700 : Add MRCP Handle ASR-1 <new>
[Sep 21 18:18:57] NOTICE[9515]: src/mrcp_client_session.c:719 : Add Control Channel ASR-1 <new@speechrecog>
[Sep 21 18:18:57] NOTICE[9515]: src/mrcp_client_session.c:411 : Send Offer ASR-1 <new> [c:0 a:1 v:0] to 192.168.6.59:8000
[Sep 21 18:19:00] WARNING[9518]: src/rtsp_client.c:406 : Failed to Connect to RTSP Server 192.168.6.59:8000
[Sep 21 18:19:00] NOTICE[9515]: src/mrcp_client_session.c:151 : Receive Answer ASR-1 <new> [c:0 a:0 v:0] Status 0
[Sep 21 18:19:00] NOTICE[9515]: src/mrcp_client_session.c:455 : Raise App Response ASR-1 <new> [2] FAILURE [2]
[Sep 21 18:19:00] ERROR[9515]: app_mrcprecog.c:286 speech_on_channel_add: (ASR-1) Channel error status=2, response code=0!
[Sep 21 18:19:00] NOTICE[9515]: src/mrcp_client_session.c:387 : Receive App Request ASR-1 <new> [1]
[Sep 21 18:19:00] NOTICE[9515]: src/mrcp_client_session.c:833 : Terminate Session ASR-1 <new>
[Sep 21 18:19:00] NOTICE[9518]: src/rtsp_client.c:305 : Destroy RTSP Handle 0xa9b1fd8
[Sep 21 18:19:00] NOTICE[9515]: src/mrcp_client_session.c:209 : Session Terminated ASR-1 <new>
[Sep 21 18:19:00] NOTICE[9515]: src/mrcp_client.c:710 : Remove MRCP Handle ASR-1 <new>
[Sep 21 18:19:00] NOTICE[9515]: src/mrcp_client_session.c:455 : Raise App Response ASR-1 <new> [1] SUCCESS [0]
[Sep 21 18:19:00] NOTICE[9515]: src/mrcp_application.c:182 : Destroy MRCP Handle ASR-1
[Sep 21 18:19:00] NOTICE[9538][C-00000001]: app_mrcprecog.c:1027 mrcprecog_exit: MRCPRecog() exiting status: ERROR on SIP/100-00000001
  == Spawn extension (public, 2222, 1) exited non-zero on 'SIP/100-00000001'

Should it works like this? Or it some unsuspected behaviour?
How I can fix it to previous behaviour?

Thanks!

Arsen Chaloyan

unread,
Jan 12, 2016, 8:37:36 PM1/12/16
to UniMRCP
Hello Kirill,

This issue has been brought up several times. To keep it short, you can change the behavior and return 0 (success) to the Asterisk dialplan irregardless of the status of MRCP session/channel.

See mrcpsynth_exit() and mrcprecog_exit() functions respectably.

--
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.
For more options, visit https://groups.google.com/d/optout.



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

brebo brebu

unread,
Feb 17, 2017, 2:59:11 PM2/17/17
to UniMRCP
Hi Guys , I´m having the same trouble .
Did any one solve the problem ?


Follow logs of my asterisk CLI.


[Feb 17 17:10:30] NOTICE[5301][C-00000007]: app_mrcprecog.c:1067 app_recog_exec: MRCPRecog() grammar: builtin:grammar/boolean
[Feb 17 17:10:30] NOTICE[5301][C-00000007]: app_mrcprecog.c:1087 app_recog_exec: MRCPRecog() options: &f=beep
[Feb 17 17:10:30] DEBUG[5301][C-00000007]: app_mrcprecog.c:968 mrcprecog_options_parse: Apply option f: beep
[Feb 17 17:10:30] DEBUG[5301][C-00000007]: audio_queue.c:253 audio_queue_create: (ASR-3) Audio queue created
[Feb 17 17:10:30] DEBUG[5301][C-00000007]: speech_channel.c:257 speech_channel_create: Created speech channel: Name=ASR-3, Type=RECOGNIZER, Codec=L16, Rate=8000 on SIP/100-00000004
[Feb 17 17:10:30] NOTICE[5301][C-00000007]: src/mrcp_application.c:96 : Create MRCP Handle 0x7f5a2001cad8 [speech-nuance5-mrcp2]
[Feb 17 17:10:30] NOTICE[5301][C-00000007]: src/mrcp_client_session.c:133 : Create Channel ASR-3 <new>
[Feb 17 17:10:30] DEBUG[5301][C-00000007]: src/apt_task.c:265 : Signal Message to [MRCP Client] [0x7f5a2001f270;4;0]
[Feb 17 17:10:30] DEBUG[4804]: src/apt_task.c:337 : Process Message [MRCP Client] [0x7f5a2001f270;4;0]
[Feb 17 17:10:30] NOTICE[4804]: src/mrcp_client_session.c:387 : Receive App Request ASR-3 <new> [2]
[Feb 17 17:10:30] NOTICE[4804]: src/mrcp_client.c:700 : Add MRCP Handle ASR-3 <new>
[Feb 17 17:10:30] DEBUG[4804]: src/mrcp_client_session.c:1283 : Dispatch App Request ASR-3 <new> [2]
[Feb 17 17:10:30] DEBUG[4804]: src/apt_task.c:265 : Signal Message to [MRCPv2ConnectionAgent] [0x7f5a20006500;1;0]
[Feb 17 17:10:30] NOTICE[4804]: src/mrcp_client_session.c:719 : Add Control Channel ASR-3 <new@speechrecog>
[Feb 17 17:10:30] DEBUG[4804]: src/mrcp_client_session.c:745 : Add Media Termination ASR-3 <new@media-tm>
[Feb 17 17:10:30] DEBUG[4804]: src/mrcp_client_session.c:777 : Add Media Termination ASR-3 <new@rtp-tm>
[Feb 17 17:10:30] DEBUG[4804]: src/apt_task.c:265 : Signal Message to [MediaEngine] [0x7f5a2000ff70;1;0]
[Feb 17 17:10:30] DEBUG[4804]: src/apt_consumer_task.c:137 : Wait for Messages [MRCP Client]
[Feb 17 17:10:30] DEBUG[4805]: src/apt_poller_task.c:261 : Process Poller Wakeup [MRCPv2ConnectionAgent]
[Feb 17 17:10:30] DEBUG[4805]: src/apt_task.c:337 : Process Message [MRCPv2ConnectionAgent] [0x7f5a20006500;1;0]
[Feb 17 17:10:30] DEBUG[4805]: src/apt_task.c:265 : Signal Message to [MRCP Client] [0x7f5a24001720;2;0]
[Feb 17 17:10:30] DEBUG[4805]: src/apt_poller_task.c:251 : Wait for Messages [MRCPv2ConnectionAgent]
[Feb 17 17:10:30] DEBUG[4804]: src/apt_task.c:337 : Process Message [MRCP Client] [0x7f5a24001720;2;0]
[Feb 17 17:10:30] DEBUG[4804]: src/mrcp_client_session.c:294 : Control Channel Added ASR-3 <new@speechrecog>
[Feb 17 17:10:30] DEBUG[4804]: src/apt_consumer_task.c:137 : Wait for Messages [MRCP Client]
[Feb 17 17:10:30] DEBUG[4806]: src/apt_task.c:337 : Process Message [MediaEngine] [0x7f5a2000ff70;1;0]
[Feb 17 17:10:30] DEBUG[4806]: src/mpf_context.c:182 : Add Media Context ASR-3
[Feb 17 17:10:30] DEBUG[4806]: src/apt_task.c:265 : Signal Message to [MRCP Client] [0x7f5a180437d0;3;0]
[Feb 17 17:10:30] DEBUG[4804]: src/apt_task.c:337 : Process Message [MRCP Client] [0x7f5a180437d0;3;0]
[Feb 17 17:10:30] DEBUG[4804]: src/mrcp_client_session.c:944 : Media Termination Added ASR-3 <new@media-tm>
[Feb 17 17:10:30] DEBUG[4804]: src/mrcp_client_session.c:944 : Media Termination Added ASR-3 <new@rtp-tm>
[Feb 17 17:10:30] NOTICE[4804]: src/mrcp_client_session.c:411 : Send Offer ASR-3 <new> [c:1 a:1 v:0] to 10.10.1.158:5060
[Feb 17 17:10:30] NOTICE[4804]: src/mrcp_sofiasip_client_agent.c:354 : Local SDP ASR-3 <new>
v=0
o=Asterisk 0 0 IN IP4 10.10.1.158
s=-
c=IN IP4 10.10.1.158
t=0 0
m=application 9 TCP/MRCPv2 1
a=setup:active
a=connection:new
a=resource:speechrecog
a=cmid:1
m=audio 4006 RTP/AVP 0 8 96 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:96 L16/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendonly
a=ptime:20
a=mid:1

[Feb 17 17:10:30] DEBUG[4804]: src/apt_consumer_task.c:137 : Wait for Messages [MRCP Client]
[Feb 17 17:10:30] NOTICE[4773][C-00000008]: chan_sip.c:26273 handle_request_invite: Call from '' (10.10.1.158:5093) to extension '10.10.1.158:5060' rejected because extension not found in context 'default'.
[Feb 17 17:10:30] NOTICE[4808]: src/mrcp_sofiasip_client_agent.c:609 : Receive SIP Event [nua_i_state] Status 0 INVITE sent [speech-nuance5-mrcp2]
[Feb 17 17:10:30] NOTICE[4808]: src/mrcp_sofiasip_client_agent.c:547 : SIP Call State ASR-3 [calling]
[Feb 17 17:10:30] NOTICE[4808]: src/mrcp_sofiasip_client_agent.c:609 : Receive SIP Event [nua_r_invite] Status 404 Not Found [speech-nuance5-mrcp2]
[Feb 17 17:10:30] NOTICE[4808]: src/mrcp_sofiasip_client_agent.c:609 : Receive SIP Event [nua_i_state] Status 404 Not Found [speech-nuance5-mrcp2]
[Feb 17 17:10:30] NOTICE[4808]: src/mrcp_sofiasip_client_agent.c:547 : SIP Call State ASR-3 [terminated]
[Feb 17 17:10:30] DEBUG[4808]: src/apt_task.c:265 : Signal Message to [MRCP Client] [0x7f5a280120e0;1;0]
[Feb 17 17:10:30] DEBUG[4804]: src/apt_task.c:337 : Process Message [MRCP Client] [0x7f5a280120e0;1;0]
[Feb 17 17:10:30] NOTICE[4804]: src/mrcp_client_session.c:151 : Receive Answer ASR-3 <new> [c:0 a:0 v:0] Status 404
[Feb 17 17:10:30] NOTICE[4804]: src/mrcp_client_session.c:455 : Raise App Response ASR-3 <new> [2] FAILURE [2]
[Feb 17 17:10:30] DEBUG[4804]: app_mrcprecog.c:252 speech_on_channel_add: (ASR-3) speech_on_channel_add
[Feb 17 17:10:30] ERROR[4804]: app_mrcprecog.c:286 speech_on_channel_add: (ASR-3) Channel error status=2, response code=404!
[Feb 17 17:10:30] DEBUG[4804]: speech_channel.c:108 speech_channel_set_state_unlocked: (ASR-3) CLOSED ==> ERROR
[Feb 17 17:10:30] DEBUG[4804]: src/apt_consumer_task.c:137 : Wait for Messages [MRCP Client]
[Feb 17 17:10:30] DEBUG[5301][C-00000007]: speech_channel.c:515 speech_channel_open: (ASR-3) Terminating MRCP session
[Feb 17 17:10:30] DEBUG[5301][C-00000007]: src/apt_task.c:265 : Signal Message to [MRCP Client] [0x7f5a20005d20;4;0]
[Feb 17 17:10:30] DEBUG[4804]: src/apt_task.c:337 : Process Message [MRCP Client] [0x7f5a20005d20;4;0]
[Feb 17 17:10:30] NOTICE[4804]: src/mrcp_client_session.c:387 : Receive App Request ASR-3 <new> [1]
[Feb 17 17:10:30] DEBUG[4804]: src/mrcp_client_session.c:1283 : Dispatch App Request ASR-3 <new> [1]
[Feb 17 17:10:30] NOTICE[4804]: src/mrcp_client_session.c:833 : Terminate Session ASR-3 <new>
[Feb 17 17:10:30] DEBUG[4804]: src/mrcp_client_session.c:854 : Remove Control Channel ASR-3 <new>
[Feb 17 17:10:30] DEBUG[4804]: src/apt_task.c:265 : Signal Message to [MRCPv2ConnectionAgent] [0x7f5a2001c4d0;1;0]
[Feb 17 17:10:30] DEBUG[4804]: src/mrcp_client_session.c:864 : Subtract Media Termination ASR-3 <new@media-tm>
[Feb 17 17:10:30] DEBUG[4804]: src/mrcp_client_session.c:885 : Subtract Media Termination ASR-3 <new@rtp-tm>
[Feb 17 17:10:30] DEBUG[4804]: src/apt_task.c:265 : Signal Message to [MediaEngine] [0x7f5a2001efe0;1;0]
[Feb 17 17:10:30] DEBUG[4804]: src/apt_task.c:265 : Signal Message to [MRCP Client] [0x7f5a20000a80;1;1]
[Feb 17 17:10:30] DEBUG[4804]: src/apt_consumer_task.c:137 : Wait for Messages [MRCP Client]
[Feb 17 17:10:30] DEBUG[4804]: src/apt_task.c:337 : Process Message [MRCP Client] [0x7f5a20000a80;1;1]
[Feb 17 17:10:30] NOTICE[4804]: src/mrcp_client_session.c:209 : Session Terminated ASR-3 <new>
[Feb 17 17:10:30] DEBUG[4804]: src/apt_consumer_task.c:137 : Wait for Messages [MRCP Client]
[Feb 17 17:10:30] DEBUG[4805]: src/apt_poller_task.c:261 : Process Poller Wakeup [MRCPv2ConnectionAgent]
[Feb 17 17:10:30] DEBUG[4805]: src/apt_task.c:337 : Process Message [MRCPv2ConnectionAgent] [0x7f5a2001c4d0;1;0]
[Feb 17 17:10:30] DEBUG[4805]: src/apt_task.c:265 : Signal Message to [MRCP Client] [0x7f5a24001720;2;2]
[Feb 17 17:10:30] DEBUG[4805]: src/apt_poller_task.c:251 : Wait for Messages [MRCPv2ConnectionAgent]
[Feb 17 17:10:30] DEBUG[4804]: src/apt_task.c:337 : Process Message [MRCP Client] [0x7f5a24001720;2;2]
[Feb 17 17:10:30] DEBUG[4804]: src/mrcp_client_session.c:331 : Control Channel Removed ASR-3 <new@speechrecog>
[Feb 17 17:10:30] DEBUG[4804]: src/apt_consumer_task.c:137 : Wait for Messages [MRCP Client]
[Feb 17 17:10:31] DEBUG[4806]: src/apt_task.c:337 : Process Message [MediaEngine] [0x7f5a2001efe0;1;0]
[Feb 17 17:10:31] DEBUG[4806]: src/mpf_context.c:238 : Remove Media Context ASR-3
[Feb 17 17:10:31] DEBUG[4806]: src/apt_task.c:265 : Signal Message to [MRCP Client] [0x7f5a180443c0;3;0]
[Feb 17 17:10:31] DEBUG[4804]: src/apt_task.c:337 : Process Message [MRCP Client] [0x7f5a180443c0;3;0]
[Feb 17 17:10:31] DEBUG[4804]: src/mrcp_client_session.c:1014 : Media Termination Subtracted ASR-3 <new@media-tm>
[Feb 17 17:10:31] DEBUG[4804]: src/mrcp_client_session.c:1014 : Media Termination Subtracted ASR-3 <new@rtp-tm>
[Feb 17 17:10:31] NOTICE[4804]: src/mrcp_client.c:710 : Remove MRCP Handle ASR-3 <new>
[Feb 17 17:10:31] NOTICE[4804]: src/mrcp_client_session.c:455 : Raise App Response ASR-3 <new> [1] SUCCESS [0]
[Feb 17 17:10:31] DEBUG[4804]: app_mrcprecog.c:226 speech_on_session_terminate: (ASR-3) speech_on_session_terminate
[Feb 17 17:10:31] DEBUG[4804]: app_mrcprecog.c:234 speech_on_session_terminate: (ASR-3) Destroying MRCP session
[Feb 17 17:10:31] NOTICE[4804]: src/mrcp_application.c:182 : Destroy MRCP Handle ASR-3
[Feb 17 17:10:31] DEBUG[4804]: speech_channel.c:108 speech_channel_set_state_unlocked: (ASR-3) ERROR ==> CLOSED
[Feb 17 17:10:31] DEBUG[4804]: src/apt_consumer_task.c:137 : Wait for Messages [MRCP Client]
[Feb 17 17:10:31] DEBUG[5301][C-00000007]: speech_channel.c:353 speech_channel_destroy: Destroy speech channel: Name=ASR-3, Type=RECOGNIZER, Codec=L16, Rate=8000
[Feb 17 17:10:31] DEBUG[5301][C-00000007]: audio_queue.c:197 audio_queue_destroy: (ASR-3) Audio queue destroyed
[Feb 17 17:10:31] NOTICE[5301][C-00000007]: app_mrcprecog.c:1027 mrcprecog_exit: MRCPRecog() exiting status: ERROR on SIP/100-00000004

Thankssss!!!!!

Alexander Serebryany

unread,
Feb 20, 2017, 1:44:16 PM2/20/17
to UniMRCP
Hello Arsen! 

Is there any workaround without source code modification ?

If my speechpro server is dead or has not not enough licenses I want to start IVR without ASR/TTS. 
Now I get hangup during MRCPRecog.    

Arsen Chaloyan

unread,
Feb 28, 2017, 9:52:58 PM2/28/17
to UniMRCP
Hello Alexander!

Ideally, the behavior whether to return success or error to the Asterisk dialplan when session initiation fails, should be configurable/optional. If you can come up with such a patch, I'd gladly accept it. Otherwise, please log this issue not to be forgotten. I'll address it when have the time.

To unsubscribe from this group and stop receiving emails from it, send an email to unimrcp+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Alexander Serebryany

unread,
Mar 3, 2017, 8:36:25 AM3/3/17
to UniMRCP
Hello! 

I've found solution

TryExec(MRCPRecog(...))  

It works! 
Reply all
Reply to author
Forward
0 new messages