]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
automerge commit
authorAutomerge script <automerge@asterisk.org>
Fri, 13 Oct 2006 17:02:15 +0000 (17:02 +0000)
committerAutomerge script <automerge@asterisk.org>
Fri, 13 Oct 2006 17:02:15 +0000 (17:02 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@45065 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_chanspy.c
channels/chan_iax2.c

index 873813aa3fc2de8c918045cc5868b1646fcfddaa..fcb931d3281d5cad0e832d3739403e610f9027bc 100644 (file)
@@ -259,8 +259,12 @@ static int channel_spy(struct ast_channel *chan, struct ast_channel *spyee, int
        ast_mutex_init(&csth.spy.lock);
        csth.volfactor = *volfactor;
        set_volume(chan, &csth);
-       csth.spy.read_vol_adjustment = csth.volfactor;
-       csth.spy.write_vol_adjustment = csth.volfactor;
+       if (csth.volfactor) {
+               ast_set_flag(&csth.spy, CHANSPY_READ_VOLADJUST);
+               csth.spy.read_vol_adjustment = csth.volfactor;
+               ast_set_flag(&csth.spy, CHANSPY_WRITE_VOLADJUST);
+               csth.spy.write_vol_adjustment = csth.volfactor;
+       }
        csth.fd = fd;
 
        if (start_spying(spyee, chan, &csth.spy)) {
@@ -306,8 +310,15 @@ static int channel_spy(struct ast_channel *chan, struct ast_channel *spyee, int
                                        ast_verbose(VERBOSE_PREFIX_3 "Setting spy volume on %s to %d\n", chan->name, *volfactor);
                                csth.volfactor = *volfactor;
                                set_volume(chan, &csth);
-                               csth.spy.read_vol_adjustment = csth.volfactor;
-                               csth.spy.write_vol_adjustment = csth.volfactor;
+                               if (csth.volfactor) {
+                                       ast_set_flag(&csth.spy, CHANSPY_READ_VOLADJUST);
+                                       csth.spy.read_vol_adjustment = csth.volfactor;
+                                       ast_set_flag(&csth.spy, CHANSPY_WRITE_VOLADJUST);
+                                       csth.spy.write_vol_adjustment = csth.volfactor;
+                               } else {
+                                       ast_clear_flag(&csth.spy, CHANSPY_READ_VOLADJUST);
+                                       ast_clear_flag(&csth.spy, CHANSPY_WRITE_VOLADJUST);
+                               }
                        }
                } else if (res == '*') {
                        break;
index 701e21e35a16eef12aa3178ff4720b1e3ad58e3b..5e4648f377fba2e59db1727102c5f4634115a577 100644 (file)
@@ -3081,6 +3081,9 @@ static int iax2_call(struct ast_channel *c, char *dest, int timeout)
                iaxs[callno]->initid = ast_sched_add(sched, autokill * 2, auto_congest, CALLNO_TO_PTR(callno));
        }
 
+       /* send the command using the appropriate socket for this peer */
+       iaxs[callno]->sockfd = cai.sockfd;
+
        /* Transmit the string in a "NEW" request */
        send_command(iaxs[callno], AST_FRAME_IAX, IAX_COMMAND_NEW, 0, ied.buf, ied.pos, -1);