- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
While setting up my first AI Voice Agent I ran into a problem which forced me to open a support case. Normally you would think that this is something bad but in retrospect I would say I am glad that I ran into this problem because this forced me to dig deeper into technology and gave me a better understanding of it.
Initially I planned to write an article on how to configure an AI Voice Agent, but this is already well documented in the docs, so I decided to write about the problem I ran into and the troubleshooting process. This provides more value than repeating the docs.
On a high level, what do you need to configure?
Create an AI Voice Assistant: The Voice Assistant is where you configure the basic stuff like language settings, authentication methods, voice personality and the telephony provider. This is also the place where you add the AI Agents which can be used by this Voice Assistant. You can find this in the docs here: https://www.servicenow.com/docs/bundle/zurich-intelligent-experiences/page/administer/now-assist-ai-...
Create one or more AI Voice Agents: These are AI Agents from type Voice and can be created in the AI Agent Studio just like do it with chat AI Agents. See docs: https://www.servicenow.com/docs/bundle/zurich-intelligent-experiences/page/administer/now-assist-ai-...
Integration with a CCaaS Provider:
Once you have an AI Voice Assistant with one more AI Voice Agents configured the last step is to configure a webhook URL within your telephony provider.
And that’s where I ran into a problem because the needed URL should be provided on the Telephony Provider tab on the Voice Assistant configuration. But for me the URL was just a “-“.
According to the docs, I have done everything correctly. This is where the fun began.
Let’s start troubleshooting.
Step 1 – Where is the provider URL generated?
According to the URL of the current page, we are in the Conversational Studio Experience. But there is a surprise waiting for you when you open the Conversational Studio Experience in UI Builder. The Experience consists only of one page and that is a 404 page.
When you open this page anyway you will see that there is only one component on the page, the Conversational Studio Main Appshell. This does not help.
So back to the Assistant Designer. When inspecting the source of the page you see that the page contains a iframe loding a page from the Now Assist with VA Experience.
Back in the UI Builder we see that the Now Assist with VA Experience contains the Telephony Provider page.
Part of this page is the Generate provider url data resource. This transform data resource is the place where the URL is generated. A transform data resource is basically just a server-side script. If we follow the script includes, we find the code where the URL is generated.
Now we know what the URL should be.
Step 2 Test the correct URL
I still don’t know exactly why the URL is not available in the UI, but I know the correct URL and can test it. Entering the URL as webhook when a call comes in is everything there is to do on Twilio side.
Calling the number…
Connection gets established…
Waiting to hear something…
4 seconds later the connection gets terminated.
When troubleshooting a process, it is always good to know what is happening in the background.
On a high level, when calling my Twilio number, Twilio will call the URL of the AI Voice Service that is running in a ServiceNow Compute Hub. This is the place where the Voice Orchestrator lives and all the voice2text and text2voice is happening. The Voice Orchestrator will use the AI Voice REST API of the ServiceNow instance to fetch the meta data of the Voice Agent so that it can decide which agent and tool to execute on the instance.
Step 3 Check Twilio logs
The Twilio logs indicate that the connection from Twilio to the AI Voice Service was successful. But then the WebSocket was closed. That’s everything there is on the Twilio side.
Step 4 Check transaction logs.
Because we don’t have access to the AI Voice Service next step is to check whether we can find any communication on the ServiceNow instance.
Starting with the transaction logs we see that the AI voice agent REST API was invoked by the AI Voice Orchestrator.
These calls are to fetch the voice system config, the agent meta data, and to start a conversation.
In addition to that there is also a error message in the system log:
Logs: *** Script: Error in AI Voice Agent conversation Rest API: "Request signature validation failed"
Step 5 debug AI Voice REST API
While stepping through the Create Conversation REST API, I was able to locate the error.
When creating a conversation, the system loads the configuration of the Voice Assistant and does some checks. This also includes the provider URL configured in ServiceNow. Because this is still “-“, the verification fails, no conversation is created and the phone call gets terminated.
In the meantime, I created a support case for my problem. ServiceNow Support confirmed that already a problem exists for the missing provider URL and that it should be fixed in the next release. They also provided a workaround. If you run into the same problem, see the workaround at the end of this article.
After applying the workaround, I was able to see the correct URL in the Assistant Designer for my Voice Assistant I created before. But it was still not working. That’s because the URL is generated when the UI gets loaded. The URL is not loaded from the configuration. Therefore, you need to change an attribute so that you can save the Assistant again or manually change the Now Assist Deployment Config Attribute [sys_now_assist_deployment_config_attributes] with the name provider_url.
After this small correction, everything was working fine. If you want to see a short demo video you can find it here: https://www.linkedin.com/posts/martin-rudack-4b4baa186_servicenow-ai-voiceagent-activity-74166623477...
Workaround:
update the _getServiceEndpointUrl function in the VoiceServiceConfigurationSNC script include to this:
_getServiceEndpointUrl: function(serviceId) {
const url = sn_one_extend.GenerativeAIUtility.getServiceRecordURL(serviceId);
if (!url || !url.trim()) {
gs.error(gs.getMessage('VoiceServiceConfigurationSNC: Invalid URL for service endpoint: {0}', [serviceId]));
return null;
}
const urlWithoutProtocol = url.includes('//') ? url.split('//')[1] : url;
return urlWithoutProtocol;
},
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
