Asterisk
  1. Asterisk
  2. ASTERISK-5509

[branch] Patch to allow Dial() to ignore call forward

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Severity: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Target Release Version/s: None
    • Component/s: Core/NewFeature
    • Labels:
      None
    • SVN Revision Number:
      27270
    • Mantis ID:
      5657
    • Regression:
      No

      Description

      When dialing a group of phones it is often desirable to have Asterisk ignore any "302 Redirect" requests it might receive.

      For example: after hours a business may want the general number to ring multiple extensions so that anyone thats still around can answer it. However, one of those people may have set their phone to call-forward to their voicemail or cell phone.

      The following patch applies against 1.0.9 and adds another option to the Dial command.

      "i" tells asterisk to ignore any 302 Redirects and continue on dialing the rest of the extensions.

      Brief example: phone at 2000 is set to forward.

      extensions.conf:

      exten => 2000,1,Dial(SIP/2000&SIP/2002,20,i)

      CLI output:

      – Executing Dial("SIP/2001-eece", "SIP/2000&SIP/2002|20|i") in new stack
      – Called 2000
      – Called 2002
      – SIP/2002-d46a is ringing
      – Got SIP response 302 "Moved Temporarily" back from 192.168.1.101
      – Now forwarding SIP/2001-eece to 'Local/8850872@from-sip' (thanks to SIP/2000-d08d)
      – Forwarding SIP/2001-eece to 'Local/8850872@from-sip' prevented by dial option 'i'
      Nov 8 11:34:19 NOTICE[27509]: app_dial.c:240 wait_for_answer: Unable to create local channel for call forward to 'Local/8850872@from-sip'
      == Spawn extension (from-sip, 2000, 1) exited non-zero on 'SIP/2001-eece'

        Activity

        Hide
        John Laur added a comment -

        I have tested this patch and verified that it works as expected. From reading the code I cannot see any possibility of it causing problems and have encountered no issues using it. It works as expected and will cause Dial to fail whenever there are SIP redirects or Zaptel forwards (and presumably any other channel drivers that have a forward/redirect mechanism as well, though I only have SIP and zap to test).

        The patch does need to document the 'i' option in the Dial command, though. I have backported the patch to 1.2 for anyone interested. I am out of town for the weekend and do not have access to my work from here, but I will post the patch Monday or Tuesday. My backport does include some simple documentation in the 'show application Dial' help t hat we are welcome to use for the trunk patch if you like it. I am disclaimed as well.

        Show
        John Laur added a comment - I have tested this patch and verified that it works as expected. From reading the code I cannot see any possibility of it causing problems and have encountered no issues using it. It works as expected and will cause Dial to fail whenever there are SIP redirects or Zaptel forwards (and presumably any other channel drivers that have a forward/redirect mechanism as well, though I only have SIP and zap to test). The patch does need to document the 'i' option in the Dial command, though. I have backported the patch to 1.2 for anyone interested. I am out of town for the weekend and do not have access to my work from here, but I will post the patch Monday or Tuesday. My backport does include some simple documentation in the 'show application Dial' help t hat we are welcome to use for the trunk patch if you like it. I am disclaimed as well.
        Hide
        BJ Weschke added a comment -

        Committed to /trunk. Thanks!

        Show
        BJ Weschke added a comment - Committed to /trunk. Thanks!
        Hide
        Serge Vecher added a comment -

        bweschke: don't forget to delete the branch too

        Show
        Serge Vecher added a comment - bweschke: don't forget to delete the branch too
        Hide
        Digium Subversion added a comment -

        Repository: asterisk
        Revision: 7454

        U team/bweschke/bug_5657/apps/app_dial.c

        ------------------------------------------------------------------------
        r7454 | bweschke | 2008-01-15 16:06:22 -0600 (Tue, 15 Jan 2008) | 1 line

        Code update/import for this issue. Original bug ASTERISK-5509. Objective: provide an additional option in Dial to prevent Asterisk upon acting on call forward requests when it receives them.
        ------------------------------------------------------------------------

        http://svn.digium.com/view/asterisk?view=rev&revision=7454

        Show
        Digium Subversion added a comment - Repository: asterisk Revision: 7454 U team/bweschke/bug_5657/apps/app_dial.c ------------------------------------------------------------------------ r7454 | bweschke | 2008-01-15 16:06:22 -0600 (Tue, 15 Jan 2008) | 1 line Code update/import for this issue. Original bug ASTERISK-5509 . Objective: provide an additional option in Dial to prevent Asterisk upon acting on call forward requests when it receives them. ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=7454
        Hide
        David Cunningham added a comment -

        Trace attached.

        Show
        David Cunningham added a comment - Trace attached.

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development