]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
automerge commit
authorAutomerge Script <automerge@asterisk.org>
Tue, 19 Jun 2007 17:29:28 +0000 (17:29 +0000)
committerAutomerge Script <automerge@asterisk.org>
Tue, 19 Jun 2007 17:29:28 +0000 (17:29 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@70043 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channel.c
channels/chan_sip.c
rtp.c

index 628e0614fa7593d661d8c3f1a36559c42568c826..5a3afcf2abfa23cb0ca4a1f087527ae085711247 100644 (file)
--- a/channel.c
+++ b/channel.c
@@ -3596,6 +3596,12 @@ enum ast_bridge_result ast_channel_bridge(struct ast_channel *c0, struct ast_cha
                        break;
                }
 
+               /* See if the BRIDGEPEER variable needs to be updated */
+               if (!ast_strlen_zero(pbx_builtin_getvar_helper(c0, "BRIDGEPEER")))
+                       pbx_builtin_setvar_helper(c0, "BRIDGEPEER", c1->name);
+               if (!ast_strlen_zero(pbx_builtin_getvar_helper(c1, "BRIDGEPEER")))
+                       pbx_builtin_setvar_helper(c1, "BRIDGEPEER", c0->name);
+
                if (c0->tech->bridge &&
                    (config->timelimit == 0) &&
                    (c0->tech->bridge == c1->tech->bridge) &&
index 2d5f4b296995d659bfcd160b8f40460cf6e2aa18..0e180429b15cb8135d5599db61dc8e10f91a08ff 100644 (file)
@@ -6644,6 +6644,8 @@ static int cb_extensionstate(char *context, char* exten, int state, void *data)
 {
        struct sip_pvt *p = data;
 
+       ast_mutex_lock(&p->lock);
+
        switch(state) {
        case AST_EXTENSION_DEACTIVATED: /* Retry after a while */
        case AST_EXTENSION_REMOVED:     /* Extension is gone */
@@ -6663,6 +6665,9 @@ static int cb_extensionstate(char *context, char* exten, int state, void *data)
 
        if (option_verbose > 1)
                ast_verbose(VERBOSE_PREFIX_1 "Extension Changed %s new state %s for Notify User %s\n", exten, ast_extension_state2str(state), p->username);
+
+       ast_mutex_unlock(&p->lock);
+
        return 0;
 }
 
diff --git a/rtp.c b/rtp.c
index cd7acc67486551a47150125b828ed3006da14215..315e75a0cb4694c7db9f445a0630210402ac07cb 100644 (file)
--- a/rtp.c
+++ b/rtp.c
@@ -441,6 +441,7 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
        int padding;
        int mark;
        int ext;
+       int cc;
        int x;
        char iabuf[INET_ADDRSTRLEN];
        unsigned int ssrc;
@@ -501,6 +502,7 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
        padding = seqno & (1 << 29);
        mark = seqno & (1 << 23);
        ext = seqno & (1 << 28);
+       cc = (seqno & 0xF000000) >> 24;
        seqno &= 0xffff;
        timestamp = ntohl(rtpheader[1]);
        ssrc = ntohl(rtpheader[2]);
@@ -518,10 +520,15 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
                res -= rtp->rawdata[AST_FRIENDLY_OFFSET + res - 1];
        }
        
+       if (cc) {
+               /* CSRC fields present */
+               hdrlen += cc*4;
+       }
+
        if (ext) {
                /* RTP Extension present */
+               hdrlen += (ntohl(rtpheader[hdrlen/4]) & 0xffff) << 2;
                hdrlen += 4;
-               hdrlen += (ntohl(rtpheader[3]) & 0xffff) << 2;
        }
 
        if (res < hdrlen) {