]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 369215 via svnmerge from
authorAutomerge script <automerge@asterisk.org>
Fri, 22 Jun 2012 20:22:26 +0000 (20:22 +0000)
committerAutomerge script <automerge@asterisk.org>
Fri, 22 Jun 2012 20:22:26 +0000 (20:22 +0000)
file:///srv/subversion/repos/asterisk/branches/10

................
  r369215 | twilson | 2012-06-22 14:34:59 -0500 (Fri, 22 Jun 2012) | 9 lines

  Don't crash on a guest directmedia call

  A sip_pvt may not have relatedpeer set if a call doesn't match up
  with a peer. If there is no relatedpeer, there is no direct media
  ACL to apply, so just return that it is allowed.
  ........

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

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

channels/chan_sip.c

index dc5e1eaef4c83e96e0e8020a07a272e3a9680464..bce2ad5bdd306fc7621cdca0f6c36610adb46741 100644 (file)
@@ -30243,6 +30243,12 @@ static int apply_directmedia_ha(struct sip_pvt *p1, struct sip_pvt *p2, const ch
        ast_rtp_instance_get_remote_address(p1->rtp, &them);
        ast_rtp_instance_get_local_address(p1->rtp, &us);
 
+       /* If p2 is a guest call, there will be no peer. If there is no peer, there
+        * is no directmediaha, so go ahead and allow it */
+       if (!p2->relatedpeer) {
+               return res;
+       }
+
        if ((res = ast_apply_ha(p2->relatedpeer->directmediaha, &them)) == AST_SENSE_DENY) {
                const char *us_addr = ast_strdupa(ast_sockaddr_stringify(&us));
                const char *them_addr = ast_strdupa(ast_sockaddr_stringify(&them));