]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
channels/chan_sip: Respect outboundproxy setting when sending qualify requests
authorMatthew Jordan <mjordan@digium.com>
Fri, 17 Oct 2014 13:10:08 +0000 (13:10 +0000)
committerMatthew Jordan <mjordan@digium.com>
Fri, 17 Oct 2014 13:10:08 +0000 (13:10 +0000)
The outboundproxy setting is currently ignored when sending OPTIONS requests
as a result of the qualify setting. This means that if an Asterisk server is
unable to send the packet directly to a peer, it is unable to qualify any
non-inbound registered peer (e.g. a peer SIP Trunk).

This patch grabs the outboundproxy information for a peer when a qualify
attempt is being constructed and, if it finds the information, uses it
when sending the OPTIONS request.

Review: https://reviewboard.asterisk.org/r/3948

ASTERISK-24063 #close
Reported by: Damian Ivereigh
patches:
  outboundproxy-dai.patch uploaded by Damian Ivereigh (License 6632)
........

Merged revisions 425818 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 425819 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@425820 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 4bf2cda4cb4a6d63e01e7dc61db9e64a8e628ad4..6d449b8ce19d45b3279711fd5e239005773386ad 100644 (file)
@@ -29543,6 +29543,9 @@ static int sip_poke_peer(struct sip_peer *peer, int force)
                __set_address_from_contact(p->route->hop, &p->sa, p->socket.type == AST_TRANSPORT_TLS ? 1 : 0);
        }
 
+       /* Get the outbound proxy information */
+       ref_proxy(p, obproxy_get(p, peer));
+
        /* Send OPTIONs to peer's fullcontact */
        if (!ast_strlen_zero(peer->fullcontact)) {
                ast_string_field_set(p, fullcontact, peer->fullcontact);