#39 ✓resolved
ronin-9952 (at lighthouseapp)

dial()'s normal response is considered an error?() within execute()

Reported by ronin-9952 (at lighthouseapp) | November 22nd, 2008 @ 06:41 PM | in 0.8.5

Although AGI returns different statuses for answered-and-hung-up(-1) versus timed out(0), dial() just returns false.

This code in a context:

    r = dial @destination, :caller_id => '5125381529', :name => 'Wayne Walker', :for => 20.seconds
    puts "Dial return code: #{r.inspect}"

Yields this if the call is answered and then subsequently hung up:

DEBUG agi: >>> EXEC Dial SIP/+15123887308@voicepulse-primary|20| DEBUG agi: <<< 200 result=-1 Dial return code: falseDB - vendor answered

And yields this if the call is allowed to time out:

DEBUG agi: >>> EXEC Dial SIP/+15123887308@voicepulse-primary|20| DEBUG agi: <<< 200 result=0 Dial return code: false

Comments and changes to this ticket

  • ronin-9952 (at lighthouseapp)

    ronin-9952 (at lighthouseapp) November 23rd, 2008 @ 06:07 PM

    I find that in line 98 of lib/adhearsion/voip/asterisk/commands.rb we are purposely returning false, but we don't raise, nor do we return result, so there is no way to get the error information from the result.

    My opinion would be that it would be better to return result and let the caller (dial()) handle it more intelligently. But I suspect this might require a lot of fixes to the callers of execute().

  • ronin-9952 (at lighthouseapp)

    ronin-9952 (at lighthouseapp) November 28th, 2008 @ 10:46 AM

    Upon further investigation, Maybe dial should be changed to return something based on get_variable('DIALSTATUS')

  • Jay Phillips

    Jay Phillips December 7th, 2008 @ 09:58 PM

    • State changed from “new” to “open”

    Hmm, I didn't realize the error?() method catches normal dial() responses. That's a bug, for sure.

    With respect to returning the DIALSTATUS, I'm going to hold off on that for 0.8.0. If the caller hangs up, I won't be able to execute an application on the channel (e.g. get_variable("DIALSTATUS")) unless extensions.conf invokes Adhearsion with DeadAGI

    In the future, I may make it required that Adhearsion users use DeadAGI. For now, I'll defer that decision later.

    I'm going to make dial() return true or false depending on whether -1 or 0 was returned respectively. Would that help, Wayne?

  • Jay Phillips

    Jay Phillips December 7th, 2008 @ 09:59 PM

    • Title changed from “Dial always return false” to “dial()'s normal response is considered an error?() within execute()”
  • Jay Phillips

    Jay Phillips March 24th, 2009 @ 06:41 PM

    • Milestone cleared.
    • Tag cleared.
  • Ben Klang

    Ben Klang July 28th, 2010 @ 10:26 PM

    • Assigned user changed from “Jay Phillips” to “Ben Klang”
    • Milestone order changed from “0” to “0”

    Documentation update. This issue still exists. Starting in Asterisk 1.6, the 3 AGI applications have been merged, including the behavior of DeadAGI. Even though the channel is dead, we still can't get DIALSTATUS as GET VARIABLE does not seem to work on dead channels. Perhaps we do something by looking at AMI events and correlating with active calls?

    Wayne: Is the return code of dial important? What kind of status are you looking to check? If the channel has hungup Adhearsion will throw a Hangup exception. Otherwise you will be able to query for DIALSTATUS. Does this issue need to remain open?

  • Ben Klang

    Ben Klang August 2nd, 2010 @ 12:10 PM

    • Tag set to agi, error
    • State changed from “open” to “fixcommitted”
    • Milestone set to 0.8.5
    • Milestone order changed from “2981” to “0”

    This is at least partially related to ticket #53. The fix pushed just now should at least make the dial command itself no longer return false. Given the problems checking DIALSTATUS, I'm inclined to leave it as-is and allow the end-user to check for DIALSTATUS themselves. Any objections?

    Here is the related commit:
    http://github.com/adhearsion/adhearsion/commit/53aab23f2e18caae14bd...

  • Ben Klang

    Ben Klang August 24th, 2010 @ 01:56 PM

    • State changed from “fixcommitted” to “resolved”

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Shared Ticket Bins

People watching this ticket

Tags

Referenced by

Pages