tropo/tropo-webapi-grails — Issue #9: TropoBuilder calling problem
Author: cloudshoring
Created: 2011-11-11 11:17:05+00:00
State: open

Hi Martin,

For the simple test code to make an outbound call from Grails (I use skype to call tropo's skype no.)

Below is the code snippet and the section of error from tropo debugger. your feedback would be greatly appreciated.

I am also not very clear on how to invoke an outbound call (to an external #) from the TropoBuilder object . I have tried the say and transfer methods, which work.....

Thanks
Sankar

---------------- Grails controller code----------------------------------------------------

package tropo.test

import com.tropo.grails.TropoBuilder

class TropoController {

def index = {

def json = request.JSON
println json

TropoBuilder builder = new TropoBuilder()

builder.call(to: '+18506150378', from: '', network: '', channel: 'VOICE', timeout: 20, answerOnMedia: false) {
say( "This call is from Sankar")}

builder.render response

}
}

---------------------------------------
Tropo debugger output - error section
-----------------------------------------

00025	6fb8 10:55:03 AM	Received new TropoML document on Tropo-Thread-b03c9283e50d6ace5f37bd81b6f6f180: {"tropo":[{"call":{"to":"+18506150378","from":"","network":"","channel":"VOICE","timeout":20,"answerOnMedia":false,"say":[{"value":"This call is from Sankar"}]}}]}
00026	6fb8

10:55:03 AM	Processing document http://tropo-test.cloudfoundry.com/tropo/index for instance b03c9283e50d6ace5f37bd81b6f6f180 callFactory for instance b03c9283e50d6ace5f37bd81b6f6f180
00027	6fb8

10:55:03 AM	Error processing TropoML java.lang.IllegalStateException: Call already in progress at sun.reflect.GeneratedConstructorAccessor446.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77) at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:107) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:200) at com.tropo.rest.handler.CallHandler.handle(CallHandler.groovy:22) at com.tropo.rest.handler.ActionHandler$handle$2.call(Unknown Source) ...
00028	6fb8

10:55:03 AM	Processing events: error
00029	6fb8	10:55:03 AM	SimpleIncomingCall[nsankar009/nsankar009->9996151653/990009369996151653]->hangup(), headers ={}
00030	6fb8	10:55:03 AM	Attribute com.voxeo.tropo.core.call.inst removed from Sip Session ss_329i8ql7vimj in state TERMINATED
00031	6fb8	10:55:03 AM	SimpleIncomingCall[nsankar009/nsankar009->9996151653/990009369996151653] state is changed: RINGING->DISCONNECTED
00032	6fb8	10:55:03 AM	Call c2a4dcf6129cb77ada3e2e40ac144b59 state changed from RINGING to DISCONNECTED on thread Tropo-Thread-b03c9283e50d6ace5f37bd81b6f6f180
00033	6fb8	10:55:03 AM	Stopping MRCP
00034	6fb8	10:55:03 AM	MRCP stopped
00035	6fb8	10:55:03 AM	Disconnect processed
00036	6fb8	10:55:03 AM	Processing events: hangup
00037	6fb8	10:55:03 AM	Thread Tropo-Thread-b03c9283e50d6ace5f37bd81b6f6f180 returned engine com.tropo.rest.engine.TropoScriptEngine@3e41bec3 of type tropo-web, activeEngines = 1
00038	6fb8	10:55:03 AM	ApplicationInstance[http://tropo-test.cloudfoundry.com/tropo/index , sas_2-15-sm1ekebn2je4csotropo] ends execution on Thread Tropo-Thread-b03c9283e50d6ace5f37bd81b6f6f180
00039	6fb8	10:55:03 AM	sas_2-15-sm1ekebn2je4csotropo invalidated
00040	6fb8	10:55:03 AM	Instance b03c9283e50d6ace5f37bd81b6f6f180 removed

------------------------------------------------------------------------------------------------------------------------

STS Console output

Only the json (prinln) as per above code is logged...