unispeech / asterisk-unimrcp

UniMRCP modules for Asterisk
http://www.unimrcp.org/asterisk
GNU General Public License v2.0
48 stars 36 forks source link

asterisk-unimrcp can't connect to MRCP server #20

Closed wavestudio closed 6 years ago

wavestudio commented 6 years ago

I have compiled and installed asterisk-unimrcp with asterisk 15.1.2 successfully after apply the patch unispeech/asterisk-unimrcp@a966452,asterisk can start successfully, i have setup unimrcp client and asterisk-unimrcp correctly,i can connect to MRCP server with umc,and run synth and recog in umc can work.But if i call MRCPRecog in dialplan, i get a error: Executing [59658008@internal:5] MRCPRecog("PJSIP/chatbot-00000000", "builtin:grammar/default, p=default&t=5000&b=1&ct=0.7&spl=zh-CN&sw=true&rm=normal&nit=8000&sct=300") in new stack [Nov 22 15:43:38] NOTICE[2783][C-00000001]: app_mrcprecog.c:1086 app_recog_exec: MRCPRecog() grammar: builtin:grammar/default [Nov 22 15:43:38] NOTICE[2783][C-00000001]: app_mrcprecog.c:1107 app_recog_exec: MRCPRecog() options: p=default&t=5000&b=1&ct=0.7&spl=zh-CN&sw=true&rm=normal&nit=8000&sct=300 [Nov 22 15:43:38] NOTICE[2783][C-00000001]: src/mrcp_application.c:117 : Create MRCP Handle 0x7f0000012cc8 [speech-nuance5-mrcp2] [Nov 22 15:43:38] NOTICE[2783][C-00000001]: src/mrcp_client_session.c:131 : Create Channel ASR-0 [Nov 22 15:43:38] NOTICE[2760]: src/mrcp_client_session.c:385 : Receive App Request ASR-0 [2] [Nov 22 15:43:38] WARNING[2760]: src/mrcp_client_session.c:1263 : Failed to Create Session ASR-0 [2] [Nov 22 15:43:38] NOTICE[2760]: src/mrcp_client_session.c:531 : Raise App Response ASR-0 [2] FAILURE [1] [Nov 22 15:43:38] ERROR[2760]: app_mrcprecog.c:294 speech_on_channel_add: (ASR-0) Channel error status=1, response code=0! [Nov 22 15:43:38] NOTICE[2760]: src/mrcp_client_session.c:385 : Receive App Request ASR-0 [1] [Nov 22 15:43:38] NOTICE[2760]: src/mrcp_client_session.c:453 : Raise App Response ASR-0 [1] SUCCESS [0] [Nov 22 15:43:38] NOTICE[2760]: src/mrcp_application.c:203 : Destroy MRCP Handle ASR-0 [Nov 22 15:43:38] NOTICE[2783][C-00000001]: app_mrcprecog.c:1047 mrcprecog_exit: MRCPRecog() exiting status: ERROR on PJSIP/chatbot-00000000

i cannot connect to MRCP server in dialplan.What's wrong with this?

wavestudio commented 6 years ago

otherwise i think my configuration of mrcp.conf is correctly because i have verified with asterisk 14.

achaloyan commented 6 years ago

The following warning is caused by a configuration error.

[Nov 22 15:43:38] WARNING[2760]: src/mrcp_client_session.c:1263 : Failed to Create Session ASR-0 [2]

I suppose there were other errors on loading of app_unimrcp module, which can point you to the right direction. Make sure the specified SIP port is not occupied.

wavestudio commented 6 years ago

i found that if i unload app_unimrcp.so and res_speech_unimrcp.so, and than load app_unimrcp.so first, and than load res_speech_unimrcp.so manually,asterisk can connect to MRCP server, so i think this is not a configuration error,it's a loading order error .

achaloyan commented 6 years ago

No, the order normally should not matter. At least, this is true for the issue you experienced.

Based on your description, I believe you specified/used the same local SIP port for both app_unimrcp and res_speech_unimrcp. That's why when you load app_unimrcp first, MRCPRecog works. The opposite would be also true. If you load res_speech_unimrcp first, then SpeechCreate() and friends would work.

To keep it short, use different SIP ports.

wavestudio commented 6 years ago

@achaloyan you are right,i set the same local SIP port in mrcp.conf and unimrcpclient.conf.I updated the SIP port configuration and tested again just now, i can connected to MRCP server this time.Thanks a lot.

By other word, if i only want to call applications like MRCPRecog and MRCPSynth, can i only load app_unimrcp.so and only set mrcp.conf(i means that set a noload => res_speech_unimrcp.so configuration in modules.conf)?I have also tested this, i found it works.

achaloyan commented 6 years ago

Yes, absolutely. You can even disable res_speech_unimrcp at configure time.

./configure --disable-res-speech-unimrcp

MrityunjoyS commented 4 years ago

Hi @wavestudio , I'm facing the same issue as you did. Can you kindly suggest where are you changing the SIP port, so that this error can be avoided. Thanks in advance.

achaloyan commented 4 years ago

If you have multiple profiles in mrcp.conf, then each should have a distinct local client SIP port configured. The ports should not be occupied by other processes either.