Asterisk
  1. Asterisk
  2. ASTERISK-9207

[PATCH] SIP Redirect through Transfer() app does not work properly

    Details

    • Type: Bug Bug
    • Status: Closed
    • Severity: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Target Release Version/s: None
    • Labels:
      None
    • SVN Revision Number:
      60319
    • Mantis ID:
      9483
    • Regression:
      No

      Description

      There are two problems 1) TRANSFERSTATUS always reports a failure after Transfer() is called from the dialplan and 2) after Transfer completes the dialplan continues and when Hangup is called (or autofallthrough happens) additional SIP messages are sent after the 302 Redirect, which isn't RFC compliant (603 in the case of a Hangup) and cuasing lots of retransmissions.

                • STEPS TO REPRODUCE ******

      Register a device to asterisk with following dialplan
      [default]
      exten => 123,1,Transfer(SIP/$

      {EXTEN}

      @192.168.1.62)
      exten => 123,n,NoOp(After Transfer: $

      {TRANSFERSTATUS}

      )
      exten => 123.,n,Hangup

      Set up a second asterisk box (in this example @ 192.168.1.62) that Answers and plays back a message

      Do 'sip set debug' and watch the errors and also notice that TRANSFERSTATUS is FAILED.

                • ADDITIONAL INFORMATION ******

      Attatched is a patch that fixes both problems. sip_sipredirect is only called in the case of the Transfer app from what I can tell, and app_transfer takes a negative return and converts it to a 0 so it won't cause a hangup anyway, so this change shouldn't cause any other problems.

        Activity

        Hide
        Leif Madsen added a comment -

        Confirmed and tested by me.

        Show
        Leif Madsen added a comment - Confirmed and tested by me.
        Hide
        Terry Wilson added a comment -

        Anyone need anything else from me?

        Show
        Terry Wilson added a comment - Anyone need anything else from me?
        Hide
        Olle Johansson added a comment -

        ANother issue is that the transfer() dialplan app is broken, there's no way to signal an error back if the REFER was declined.

        Will look into this.

        Show
        Olle Johansson added a comment - ANother issue is that the transfer() dialplan app is broken, there's no way to signal an error back if the REFER was declined. Will look into this.
        Hide
        Terry Wilson added a comment -

        Yeah, but this part doesn't do anything with the REFER part of the code, just the 302 stuff. Since there is no way to signal a failure, this code basically tells asterisk to assume that it succeeded, since always assuming failure is a bad thing.

        Show
        Terry Wilson added a comment - Yeah, but this part doesn't do anything with the REFER part of the code, just the 302 stuff. Since there is no way to signal a failure, this code basically tells asterisk to assume that it succeeded, since always assuming failure is a bad thing.
        Hide
        Terry Wilson added a comment -

        Any chance of getting this committed as it at least fixes one problem with the chan_sip interfacing with the Transfer() app that is completely broken in the released code? Especially since it might be a lot more common for people to use the Transfer app for redirection (what this patch fixes) than with REFERs anyway since nearly all SIP phones have native ability to transfer anyway.

        Show
        Terry Wilson added a comment - Any chance of getting this committed as it at least fixes one problem with the chan_sip interfacing with the Transfer() app that is completely broken in the released code? Especially since it might be a lot more common for people to use the Transfer app for redirection (what this patch fixes) than with REFERs anyway since nearly all SIP phones have native ability to transfer anyway.
        Hide
        Olle Johansson added a comment -

        Why the "sip_alreadygone" ?

        Show
        Olle Johansson added a comment - Why the "sip_alreadygone" ?
        Hide
        Terry Wilson added a comment -

        Because if we don't mark sip_alreadygone, then we try to send a 603 after we complete the transfer. You don't want to send any other messages to a phone after you send it a 302.

        Show
        Terry Wilson added a comment - Because if we don't mark sip_alreadygone, then we try to send a 603 after we complete the transfer. You don't want to send any other messages to a phone after you send it a 302.
        Hide
        Olle Johansson added a comment -

        Committed to 1.4 rev 64578, thanks!

        Show
        Olle Johansson added a comment - Committed to 1.4 rev 64578, thanks!

          People

          • Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development