]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 282430 via svnmerge from
authorTerry Wilson <twilson@digium.com>
Mon, 16 Aug 2010 17:32:01 +0000 (17:32 +0000)
committerTerry Wilson <twilson@digium.com>
Mon, 16 Aug 2010 17:32:01 +0000 (17:32 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r282430 | twilson | 2010-08-16 12:06:37 -0500 (Mon, 16 Aug 2010) | 16 lines

  Send a SRCCHANGE indication when we masquerade

  Masquerading a channel means that the src of the audio is potentially
  changing, so send a SRCCHANGE so that RTP-based media streams can get
  a new SSRC generated to reflect the change. Original patch by addix
  (along with lots of testing--thanks!).

  (closes issue #17007)
  Reported by: addix
  Patches:
        1001-reset-SSRC-original-channel.diff uploaded by addix (license 1006)
        srcchange.diff uploaded by twilson (license 396)
  Tested by: addix, twilson

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

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

main/channel.c

index 898d4738834c93989e097b595193fcd6cd68676e..3a4ba57a3038d47de4604995fd13e39084a33fb4 100644 (file)
@@ -4613,6 +4613,7 @@ int ast_do_masquerade(struct ast_channel *original)
        void *t_pvt;
        struct ast_callerid tmpcid;
        struct ast_channel *clonechan = original->masq;
+       struct ast_channel *bridged;
        struct ast_cdr *cdr;
        int rformat = original->readformat;
        int wformat = original->writeformat;
@@ -4877,6 +4878,15 @@ int ast_do_masquerade(struct ast_channel *original)
        if (ast_test_flag(original, AST_FLAG_BLOCKING))
                pthread_kill(original->blocker, SIGURG);
        ast_debug(1, "Done Masquerading %s (%d)\n", original->name, original->_state);
+
+       if ((bridged = ast_bridged_channel(original))) {
+               ast_channel_lock(bridged);
+               ast_indicate(bridged, AST_CONTROL_SRCCHANGE);
+               ast_channel_unlock(bridged);
+       }
+
+       ast_indicate(original, AST_CONTROL_SRCCHANGE);
+
        return 0;
 }