adhearsion / punchblock

Telephony middleware library for Ruby
adhearsion.com/punchblock
MIT License
40 stars 34 forks source link

AGI return codes are not properly checked for failure #144

Closed benlangfeld closed 10 years ago

benlangfeld commented 11 years ago
[2013-04-25 23:15:21] TRACE Punchblock::Connection::Asterisk: [SEND] Action: agi
ActionID: 76aaa0cb-978f-4dc8-bae2-ef6407601f85
Channel: SIP/usera-00000003
Command: EXEC MRCPSynth "<speak xmlns=\\\"http://www.w3.org/2001/10/synthesis\\\" version=\\\"1.0\\\" xml:lang=\\\"en-US\\\">Choose a test from 1 to 7</speak>" ""
CommandID: 70e8e349-0bf1-4db3-ae9b-b52218b01378

[2013-04-25 23:15:21] TRACE Punchblock::Connection::Asterisk: [RECV] Response: Success

[2013-04-25 23:15:21] TRACE Punchblock::Connection::Asterisk: [RECV] ActionID: 76aaa0cb-978f-4dc8-bae2-ef6407601f85
Message: Added AGI command to queue

[2013-04-25 23:15:21] TRACE Punchblock::Connection::Asterisk: [RECV] #<RubyAMI::Response headers={"ActionID"=>"76aaa0cb-978f-4dc8-bae2-ef6407601f85", "Message"=>"Added AGI command to queue"}, text_body=nil, events=[]>
[2013-04-25 23:15:21] TRACE Punchblock::Connection::Asterisk: [RECV] Event: AGIExec
Privilege: agi,all
Timestamp: 1366942521.213486
SubEvent: Start
Channel: SIP/usera-00000003
CommandId: 2094413542
Command: EXEC MRCPSynth "<speak xmlns=\\\"http://www.w3.org/2001/10/synthesis\\\" version=\\\"1.0\\\" xml:lang=\\\"en-US\\\">Choose a test from 1 to 7</speak>" ""

Event: AGIExec
Privilege: agi,all
Timestamp: 1366942521.213625
SubEvent: End
Channel: SIP/usera-00000003
CommandId: 2094413542
Command: EXEC MRCPSynth "<speak xmlns=\\\"http://www.w3.org/2001/10/synthesis\\\" version=\\\"1.0\\\" xml:lang=\\\"en-US\\\">Choose a test from 1 to 7</speak>" ""
ResultCode: 200
Result: Unknown Result

[2013-04-25 23:15:21] TRACE Punchblock::Connection::Asterisk: [RECV] #<RubyAMI::Event name="AGIExec", headers={"Privilege"=>"agi,all", "Timestamp"=>"1366942521.213486", "SubEvent"=>"Start", "Channel"=>"SIP/usera-00000003", "CommandId"=>"2094413542", "Command"=>"EXEC MRCPSynth \"<speak xmlns=\\\\\\\"http://www.w3.org/2001/10/synthesis\\\\\\\" version=\\\\\\\"1.0\\\\\\\" xml:lang=\\\\\\\"en-US\\\\\\\">Choose a test from 1 to 7</speak>\" \"\""}, text_body=nil, events=[]>
[2013-04-25 23:15:21] TRACE Punchblock::Connection::Asterisk: [RECV] #<RubyAMI::Event name="AGIExec", headers={"Privilege"=>"agi,all", "Timestamp"=>"1366942521.213625", "SubEvent"=>"End", "Channel"=>"SIP/usera-00000003", "CommandId"=>"2094413542", "Command"=>"EXEC MRCPSynth \"<speak xmlns=\\\\\\\"http://www.w3.org/2001/10/synthesis\\\\\\\" version=\\\\\\\"1.0\\\\\\\" xml:lang=\\\\\\\"en-US\\\\\\\">Choose a test from 1 to 7</speak>\" \"\"", "ResultCode"=>"200", "Result"=>"Unknown Result"}, text_body=nil, events=[]>
[2013-04-25 23:15:21] TRACE Punchblock::Connection::Asterisk: [RECV] Event: AsyncAGI
Privilege: agi,all
Timestamp: 1366942521.213798
SubEvent: Exec
Channel: SIP/usera-00000003
CommandID: 70e8e349-0bf1-4db3-ae9b-b52218b01378
Result: 200%20result%3D-2%0A

[2013-04-25 23:15:21] TRACE Punchblock::Connection::Asterisk: [RECV] #<RubyAMI::Event name="AsyncAGI", headers={"Privilege"=>"agi,all", "Timestamp"=>"1366942521.213798", "SubEvent"=>"Exec", "Channel"=>"SIP/usera-00000003", "CommandID"=>"70e8e349-0bf1-4db3-ae9b-b52218b01378", "Result"=>"200%20result%3D-2%0A"}, text_body=nil, events=[]>
[2013-04-25 23:15:21] DEBUG Adhearsion::Call: 1a0e9034-fdb3-4797-a4a9-015e73a84a09: Receiving message: #<Punchblock::Event::Asterisk::AMI::Event name="AGIExec", attributes_hash={:privilege=>"agi,all", :timestamp=>"1366942521.213486", :subevent=>"Start", :channel=>"SIP/usera-00000003", :commandid=>"2094413542", :command=>"EXEC MRCPSynth \"<speak xmlns=\\\\\\\"http://www.w3.org/2001/10/synthesis\\\\\\\" version=\\\\\\\"1.0\\\\\\\" xml:lang=\\\\\\\"en-US\\\\\\\">Choose a test from 1 to 7</speak>\" \"\""}, target_call_id="1a0e9034-fdb3-4797-a4a9-015e73a84a09", component_id=nil, target_mixer_name=nil>
[2013-04-25 23:15:21] DEBUG Adhearsion::Call: 1a0e9034-fdb3-4797-a4a9-015e73a84a09: Receiving message: #<Punchblock::Event::Asterisk::AMI::Event name="AGIExec", attributes_hash={:privilege=>"agi,all", :timestamp=>"1366942521.213625", :subevent=>"End", :channel=>"SIP/usera-00000003", :commandid=>"2094413542", :command=>"EXEC MRCPSynth \"<speak xmlns=\\\\\\\"http://www.w3.org/2001/10/synthesis\\\\\\\" version=\\\\\\\"1.0\\\\\\\" xml:lang=\\\\\\\"en-US\\\\\\\">Choose a test from 1 to 7</speak>\" \"\"", :resultcode=>"200", :result=>"Unknown Result"}, target_call_id="1a0e9034-fdb3-4797-a4a9-015e73a84a09", component_id=nil, target_mixer_name=nil>
[2013-04-25 23:15:21] DEBUG Adhearsion::Call: 1a0e9034-fdb3-4797-a4a9-015e73a84a09: Receiving message: #<Punchblock::Event::Asterisk::AMI::Event name="AsyncAGI", attributes_hash={:privilege=>"agi,all", :timestamp=>"1366942521.213798", :subevent=>"Exec", :channel=>"SIP/usera-00000003", :commandid=>"70e8e349-0bf1-4db3-ae9b-b52218b01378", :result=>"200%20result%3D-2%0A"}, target_call_id="1a0e9034-fdb3-4797-a4a9-015e73a84a09", component_id=nil, target_mixer_name=nil>
[2013-04-25 23:15:21] TRACE Punchblock::Connection::Asterisk: [SEND] Action: getvar
ActionID: 7df8d616-ff78-41b0-9e77-69860587de13
Channel: SIP/usera-00000003
Variable: SYNTHSTATUS

[2013-04-25 23:15:21] TRACE Punchblock::Connection::Asterisk: [RECV] Response: Success

[2013-04-25 23:15:21] TRACE Punchblock::Connection::Asterisk: [RECV] ActionID: 7df8d616-ff78-41b0-9e77-69860587de13
Variable: SYNTHSTATUS
Value:

[2013-04-25 23:15:21] TRACE Punchblock::Connection::Asterisk: [RECV] #<RubyAMI::Response headers={"ActionID"=>"7df8d616-ff78-41b0-9e77-69860587de13", "Variable"=>"SYNTHSTATUS", "Value"=>""}, text_body=nil, events=[]>
[2013-04-25 23:15:21] DEBUG Adhearsion::Call: 1a0e9034-fdb3-4797-a4a9-015e73a84a09: Receiving message: #<Punchblock::Event::Complete reason=#<Punchblock::Component::Output::Complete::Finish name=:finish, target_call_id="1a0e9034-fdb3-4797-a4a9-015e73a84a09", component_id="f404e599-50e7-4017-b4bc-466481d9d695", target_mixer_name=nil>, recording=nil, target_call_id="1a0e9034-fdb3-4797-a4a9-015e73a84a09", component_id="f404e599-50e7-4017-b4bc-466481d9d695", target_mixer_name=nil>
benlangfeld commented 10 years ago

SYNTHSTATUS is checked now. Calling this done.