tropo / tropo-agitate

Script for Tropo that emulates the Asterisk AGI
http://tropo.com
MIT License
20 stars 15 forks source link

AGI "connection refused" handling doesn't work #5

Closed bklang closed 13 years ago

bklang commented 13 years ago

When trying a new Tropo outbound app, I set up click-to-call per the example and pointed it at my AGI server. Oops...I forgot to actually start my AGI server:

01989       00-1    03:49:26 AM     Call[Tropo->+14046955106] : Connection refused - Connection refused
01990       00-1    03:49:26 AM     Call[Tropo->+14046955106] : ====> We are unable to connect to the A G I server at this time, please try again later. <====
01991       00-1    03:49:26 AM     Call[Tropo->+14046955106] : Connection refused - Connection refused
01992       00-1    03:49:26 AM     ApplicationInstance[http://65.111.173.185/click-to-call.rb, sas_2-14-smoddano4008r8tropo] has unknown errors: null java.lang.StackOverflowError at org.jruby.runtime.ThreadContext.postMethodFrameAndScope(ThreadContext.java:1122) at org.jruby.internal.runtime.methods.CallConfiguration$1.post(CallConfiguration.java:30) at org.jruby.internal.runtime.methods.JittedMethod.post(JittedMethod.java:247) at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:151) at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:154) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:115) at $_lt_unknown_gt_.method__13$RUBY$answer(<unknown>:165) at $_lt_unknown_gt_Invokermethod__13$RUBY$answerOpt.call($_lt_unknown_gt_#answer) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:168) ...
jsgoecke commented 13 years ago

This should be handled and I was not able to reproduce. Here is how it works:

http://www.youtube.com/watch?v=PH0xj6aVCgw

Are you running the latest version of the AGItate script? Let me know if I missed something to recreate.

bklang commented 13 years ago

When you get back I'll show you what's happening. I can reproduce it 100% of the time.

jsgoecke commented 13 years ago

Thank you for walking me through this. This works if your AGI server is not connected but you have a valid SIP URI in line 10 here:

http://github.com/tropo/tropo-agitate/blob/master/tropo_agi_config/tropo_agi_config.yml

In this case your backup SIP URI was also failing, which I had not accounted for. First, I need to handle that error gracefully, then second allow an option to play/not play a message if both Ahn and your backup SIP URI fail.

jsgoecke commented 13 years ago

Resolved with this:

http://github.com/tropo/tropo-agitate/commit/939e1667fa605697e5b03497858cf1f86c5eb0bd

And updated comments here:

http://github.com/tropo/tropo-agitate/tree/9998bff1d886174fba18105b81f1eb2f6ffa5e78

Decided not to implement the secondary failover message, as it should just fail gracefully.