Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

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

#39

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

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

State: resolved
Milestone: 0.8.5
Assigned to: Ben Klang Ben Klang

Activity

  1. ronin-9952 (at lighthouseapp)
    ronin-9952 (at lighthouseapp)

    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().

    November 23rd, 2008 @ 06:07 PM

  2. ronin-9952 (at lighthouseapp)
    ronin-9952 (at lighthouseapp)

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

    November 28th, 2008 @ 10:46 AM

  3. Jay Phillips
    Jay Phillips
    • 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?

    December 7th, 2008 @ 09:58 PM

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

    December 7th, 2008 @ 09:59 PM

  5. Jay Phillips
    Jay Phillips
    • Milestone cleared.
    • Tag cleared.

    March 24th, 2009 @ 06:41 PM

  6. Ben Klang
    Ben Klang
    • 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?

    July 28th, 2010 @ 10:26 PM

  7. Ben Klang
    Ben Klang
    • 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 play(some_number) calls both saynumber and playback. 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...

    August 2nd, 2010 @ 12:10 PM

  8. Ben Klang
    Ben Klang
    • State changed from fixcommitted to resolved

    August 24th, 2010 @ 01:56 PM

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.