code: public void masquerade(Channel channel)
      {
          // If the channel doesn't have a caller id
          // preserve the existing one (as given this is a clone they should be
          // identical).
          // Asterisk doesn't always pass the caller ID on the channel hence this
          // protects us from Asterisk accidentally clearing the caller id.
          if (channel.hasCallerID())
          {
              this._callerID = channel.getCallerID();
          }
          else if (this._callerID != null && ((ChannelImpl) channel)._callerID != null)
          {
              // Force the caller id back into the channel so it has one as well.
              PBX pbx = PBXFactory.getActivePBX();
              if (this._callerID != null)
              {
                  ((ChannelImpl) channel)._callerID = pbx.buildCallerID(this._callerID.getNumber(), this._callerID.getName());
              }
          }
  
          this._muted = channel.isMute();
  
          this._parked = channel.isParked();
  
          // just in case the original channel is part way through a sweep by the
          // PeerMonitor
          // marking the sweep as true will stop the new clone being hungup as it
          // may not have been around when the sweep started.
          this._marked = true;
          this._sweepStartTime = null;
      }
docs: designed for use by the ChannelProxy when a channel is being cloned as a
  result of Asterisk undertaking an Masquerade. This is not intended to be
  a complete clone just the key elements that we generally track on our
  side rather than getting directly from asterisk.