Clarification on use of Recognition and Synthesiser plugins

147 views
Skip to first unread message

Chris Franklin

unread,
Sep 1, 2021, 11:11:11 AM9/1/21
to UniMRCP

Hi All,

 

As part of an upgraded project internally we were looking at including Azure plugins as well as Google plugins.

 

Reading the installation scripts we see the following: “Disable other synthesizer plugins, if available.” Are we correct in understanding there is a 1:1 correspondence between our uniMRCP server install and the endpoint targeted by the plugins. Therefore if we are running both Google and Azure plugins for the same purpose these should be running on different uniMRCP servers?

 

Thanks & Regards,

Chris

Arsen Chaloyan

unread,
Sep 1, 2021, 10:24:10 PM9/1/21
to UniMRCP
Hi Chris,

Please check this post for detailed description of the issue and possible approaches.


--
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/24af519e-33b5-431f-ada3-f9fc4aee074fn%40googlegroups.com.


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

Ed James

unread,
Sep 2, 2021, 6:00:04 AM9/2/21
to UniMRCP
Hi Arsen, 
Thanks for the reference. On the two approaches:

1. Using Accept-Contact: How do I set this from my client code ? We are using unimrcp client and server 1.7 and I can't see how to specify this from our code that calls the unimrcp client code. Presumably we have to pass something into the unimrcp client so that SofiaSIP can add it to the INVITE, is that correct ? Do you have an example of how to do this?

2. Multiple Server Profiles: If you have multiple profiles on the server then how do you target a specific server profile from the client ? Looking at our code we specify the server profile to use in the configuration we pass into unimrcp_client_create2 to create the client but we wouldn't want to create a new client for every ASR/TTS session with the server.

Thanks
Ed James

Arsen Chaloyan

unread,
Sep 2, 2021, 11:02:14 PM9/2/21
to UniMRCP
Hi Ed,

1. Using Accept-Contact: How do I set this from my client code ? We are using unimrcp client and server 1.7 and I can't see how to specify this from our code that calls the unimrcp client code. Presumably we have to pass something into the unimrcp client so that SofiaSIP can add it to the INVITE, is that correct ? Do you have an example of how to do this?

You can set the feature tags from the client configuration per sip-settings/profile. This option has been available for a while, and it was used with Nuance but for a different purpose.


2. Multiple Server Profiles: If you have multiple profiles on the server then how do you target a specific server profile from the client ? Looking at our code we specify the server profile to use in the configuration we pass into unimrcp_client_create2 to create the client but we wouldn't want to create a new client for every ASR/TTS session with the server.

You can and should use a single instance of the client stack. Define two different client profiles/sip-settings: one pointing to 8060, which, let's say, is mapped to Google, and the other to 8070, which is mapped to Azure. In other words, the mapping/profiling is done by port SIP port numbers the server is listening on.

Please let me know if further clarifications are required.

Ed James

unread,
Sep 3, 2021, 12:36:01 PM9/3/21
to UniMRCP
Hi Arsen,
Thanks but it's still not clear to me what changes I actually need to make to the config. 

Suppose we were going for the feature-tags option then in the client config I'd need the following:

<sip-settings id="UniMRCP-Google-SIP-Settings">
      <server-ip>10.10.0.1</server-ip>
      <server-port>5060</server-port>
      <feature-tags>speechrecog.engine="GSR-1";speechsynth.engine="GSS-1"</feature-tags>
</sip-settings>

<sip-settings id="UniMRCP-Azure-SIP-Settings">
      <server-ip>10.10.0.1</server-ip>
      <server-port>5060</server-port>
      <feature-tags>speechrecog.engine="ASR-1";speechsynth.engine="ASS-1"</feature-tags>
</sip-settings>

Then I'd need two profiles as follows:

<mrcpv2-profile id="uniGoogle">
      <sip-uac>SIP-Agent-1</sip-uac>
      <mrcpv2-uac>MRCPv2-Agent-1</mrcpv2-uac>
      <media-engine>Media-Engine-1</media-engine>
      <rtp-factory>RTP-Factory-1</rtp-factory>
      <sip-settings>UniMRCP-Google-SIP-Settings</sip-settings>
      <rtp-settings>RTP-Settings-1</rtp-settings>
</mrcpv2-profile>

<mrcpv2-profile id="uniAzure">
      <sip-uac>SIP-Agent-1</sip-uac>
      <mrcpv2-uac>MRCPv2-Agent-1</mrcpv2-uac>
      <media-engine>Media-Engine-1</media-engine>
      <rtp-factory>RTP-Factory-1</rtp-factory>
      <sip-settings>UniMRCP-Azure-SIP-Settings</sip-settings>
      <rtp-settings>RTP-Settings-1</rtp-settings>
</mrcpv2-profile>

Then I either pass "uniGoogle" or "uniAzure" profile into mrcp_application_session_create, is that correct ?

In the server unimrcpserver.xml config file I'd need the following:

<mrcpv2-profile id="uniGoogle">
      <sip-uas>SIP-Agent-1</sip-uas>
      <mrcpv2-uas>MRCPv2-Agent-1</mrcpv2-uas>
      <media-engine>Media-Engine-1</media-engine>
      <rtp-factory>RTP-Factory-1</rtp-factory>
      <rtp-settings>RTP-Settings-1</rtp-settings>

      <!--
        Profile-based association of engines to resources. For example:
      -->
      <resource-engine-map>
        <param name="speechsynth" value="GSS-1"/>
        <param name="speechrecog" value="GSR-1"/>
      </resource-engine-map>
</mrcpv2-profile>

<mrcpv2-profile id="uniAzure">
      <sip-uas>SIP-Agent-1</sip-uas>
      <mrcpv2-uas>MRCPv2-Agent-1</mrcpv2-uas>
      <media-engine>Media-Engine-1</media-engine>
      <rtp-factory>RTP-Factory-1</rtp-factory>
      <rtp-settings>RTP-Settings-1</rtp-settings>

      <!--
        Profile-based association of engines to resources. For example:
      -->
      <resource-engine-map>
        <param name="speechsynth" value="ASS-1"/>
        <param name="speechrecog" value="ASR-1"/>
      </resource-engine-map>
</mrcpv2-profile>

So apart from the different resource-engine-map entries these two profiles would be the same, is that correct ?

I'd also need to have ASS-1 and ASR-1 defined in the <plugin-factory> section of the server config.

Does that all look correct to you ?

Arsen Chaloyan

unread,
Sep 3, 2021, 1:24:24 PM9/3/21
to UniMRCP
Hi Ed,

Please see my comments inline.

On Fri, Sep 3, 2021 at 9:36 AM 'Ed James' via UniMRCP <uni...@googlegroups.com> wrote:
Hi Arsen,

Up to this point, everything looks exactly right.
With the use of feature tags, you do not need to have different profiles defined for the server with any specific resource/engine mappings. So, basically, skip the above and use the default profile.


I'd also need to have ASS-1 and ASR-1 defined in the <plugin-factory> section of the server config.

Right, load all the plugins which you intend to use. The name of the plugin/engine to be used for a particular session can be passed via the feature tag. If no feature tag is specified, then the first engine will be picked up.

Ed James

unread,
Sep 20, 2021, 6:38:33 AM9/20/21
to UniMRCP
Thanks very much, that makes sense, we'll give it a go asap.

Ed James

unread,
Oct 19, 2021, 7:18:57 AM10/19/21
to UniMRCP
Hi Arsen,
I've got Azure working for TTS using feature tags so that's good news and thanks for your help. We just have an issue with the default engine on the server. So we've now got the following server config:

    <!-- Factory of plugins (MRCP engines) -->
    <plugin-factory>
      <engine id="Demo-Synth-1" name="demosynth" enable="false"/>
      <engine id="Demo-Recog-1" name="demorecog" enable="false"/>
      <engine id="Demo-Verifier-1" name="demoverifier" enable="false"/>
      <engine id="Recorder-1" name="mrcprecorder" enable="false"/>
      <engine id="GSS-1" name="umsgss" enable="true"/> 
      <engine id="GSR-1" name="umsgsr" enable="true"/>
      <engine id="Azure-SS-1" name="umsazuress" enable="true"/>
      <engine id="Azure-SR-1" name="umsazuresr" enable="true"/>

What's happening is that the existing version of our software (which doesn't use feature tags) and which previously (without the Azure entries above) would have found Google is now finding Azure by default and failing (as it has Google specific voice names etc..). Previously you said this:

"If no feature tag is specified, then the first engine will be picked up"

So I was expecting that no feature tags would load Google (given it's the first engine in the config) but it seems to be loading Azure. So how do I get the server to load Google by default if no feature tags are present ? If this isn't possible then as soon as we enabled Azure on the unimrcp servers then all the existing client engines (with no feature tags) will try and use it and all suddenly fail as they should continue to be using Google. We'd have to upgrade our software on all our servers (so that they used feature tags) before we enabled Azure on the uniMRCP server which would be a more difficult roll out.

Thanks
Ed 

Ed James

unread,
Oct 26, 2021, 11:39:20 AM10/26/21
to UniMRCP
Hi Arsen,
Do you have any feedback on this issue as we're approaching the point where we have to decide how to roll out our changes across the platform. The ask is to set Google as the internal server default so it's used by all requests which don't use feature tags. Is that possible ?
Thanks
Ed

Arsen Chaloyan

unread,
Oct 26, 2021, 11:19:05 PM10/26/21
to UniMRCP
Hi Ed,

This behavior is a bit tricky. My statement regarding the first engine is true. The question is how the order is determined, which is not very intuitive.

The engines are stored internally in an APR hash, where the key is the engine name. The catch is, while the APR hash allows to properly set and get the objects based on a key, we cannot rely on the order of objects, as the key is actually a pointer dynamically allocated upon loading. In other words, the order would be inconsistent.

What you can do to achieve the described behavior is the following.

1. Load all the plugins as you would normally do.

    <plugin-factory>

      <engine id="GSS-1" name="umsgss" enable="true"/>
      <engine id="GSR-1" name="umsgsr" enable="true"/>      
      <engine id="Azure-SS-1" name="umsazuress" enable="true"/>
      <engine id="Azure-SR-1" name="umsazuresr" enable="true"/>

2. Under the server profile, set the default engines per resource based on your preference.

    <mrcpv2-profile id="uni2">
      <resource-engine-map>
        <resource id="speechsynth" engine="GSS-1"/>
        <resource id="speechrecog" engine="GSR-1"/>
      </resource-engine-map>

3. Override the default engine using the feature tags per MRCP session, when/if needed.

Please note I have not had the time to test the above, but it should work.

Ed James

unread,
Oct 27, 2021, 6:51:35 AM10/27/21
to UniMRCP
Hi Arsen, that's worked perfectly so thanks for your help, it'll make our roll out much easier. 
Cheers
Ed

Reply all
Reply to author
Forward
0 new messages