cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1431
Views
10
Helpful
9
Replies

CVP Custom element: Twilio

halljl2007
Level 1
Level 1

I've got a Netbeans project that runs fine in the IDE (sends sms message via Twilio).  I've got no idea how to get that imported into a custom element though.  Is there a guide for how to do this?  Some example "hello world" type script from Cisco to show you how to build custom elements? 

 

9 Replies 9

ptindall
Cisco Employee
Cisco Employee

Start here on Cisco Devnet https://developer.cisco.com/docs/customer-voice-portal/
You will find custom element templates and some samples here https://developer.cisco.com/docs/customer-voice-portal/#!sample-code/java-sample-code

Using Netbeans, just code your Java class using the CVP custom Action Element template as the starting point.  Deploy as a JAR onto CVP Studio C:\Cisco\CallStudio\eclipse\plugins\com.audiumcorp.studio.library.common\lib to appear in the palette and onto the VoiceXML server C:\Cisco\CVP\VXMLServer\common\lib for run-time.   Doesn't have to be a JAR; you can deploy into /classes at those locations also if preferred. 

Thanks so much for the reply.  I've been looking through them.  In netbeans I was able to add a class and dependency for Twilio so I could do the import statements and subsequent code.  Where do i get the audium sdk or I need to find the .jars somewhere?  Group ID, artifact ID, version?

 

 

import com.audium.server.AudiumException;
import com.audium.server.voiceElement.ActionElementBase;
import com.audium.server.session.ActionElementData;

 

**Working**

import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.Call;
import com.twilio.type.PhoneNumber;
import com.twilio.rest.api.v2010.account.Message;

Main thing you'll need is framework.jar.  Sounds like you're using Maven, so copy the JAR from your CVP Studio or server and add it to your local Maven repo.  Should then be able to locate dependency.

Thanks. You are correct on the Maven.  I updated the pom file and now import statements look good and the code compiles fine.  Can't get it to show up as a local element though.  I moved the Arithmetics.jar over from devNet and that showed up just fine. 

 

 

 

I've tried clean build, build with dependencies....uploading .jar and .class.  Any thoughts?

I'd need to see the code.    Check the Studio startup log.   Also, did you build on Java 8 or lower?

 

Where are the startup logs for Studio?

 

Capture.PNG

You'll find some logging under Help --> About Studio --> Installation Details  --> Configuration --> View Error Log

 

It working now.  It was the JDK version. 

Good to know you're over the hurdle.  First custom element gets you on the right path to integrate pretty much anything now.

 

Paul