Help with extracting fulfillment_text from Dialogflow XML response via UniMRCP in Asterisk

23 views
Skip to first unread message

Ciprian Gherghe

unread,
May 22, 2025, 6:30:54 AMMay 22
to UniMRCP

Hello everyone,

I have a UniMRCP license for Dialogflow integration. When I receive the Dialogflow response in Asterisk, it comes as a large XML string converted by UniMRCP.

I need to extract the fulfillment_text field from this XML inside Asterisk. I tried to do this using an AGI script, but the XML is too long and I get parsing errors like:


EndTag: '</' not found

Does anyone have experience or suggestions on how to properly parse or extract the fulfillment_text from this large XML in Asterisk?
Is there a better method to handle or simplify this process?

Thanks in advance for any advice!


Simone Palomba

unread,
May 22, 2025, 6:50:29 AMMay 22
to UniMRCP
Try this..

#!/bin/sh

 awk 'BEGIN{ RS="</fulfillment_text>"}{gsub(/.*<fulfillment_text>/,"")}1{print $RS;exit}' $1

Vahagn Kocharyan

unread,
Jul 7, 2025, 1:06:26 PMJul 7
to UniMRCP
HI
  You must use the Asterisk app_unimrcp built-in function to retrieve any value from the NLSML result. Use this as a reference. If you experience any issues, feel free to get in touch  

Reply all
Reply to author
Forward
0 new messages