public bool HangUpCallEx() { ActionConfig config = new ActionConfig(); string strReleaseReason = string.Format("pttrelease;cause={0}", 64); config.addHeader("Ptt-Extension", strReleaseReason); return(this.mSession.hangup(config)); }
public bool Send(byte[] payload, string contentType) { bool result; if (payload != null && !string.IsNullOrEmpty(contentType)) { ActionConfig config = new ActionConfig(); config.addHeader("Content-Type", contentType); result = this.m_Session.send(payload, config); } else { result = this.m_Session.send(System.IntPtr.Zero, 0u); } return(result); }
public bool SendInfo(byte[] payload, string contentType) { bool result; if (payload != null && !string.IsNullOrEmpty(contentType)) { System.IntPtr payloadPtr = System.Runtime.InteropServices.Marshal.AllocHGlobal(payload.Length); ActionConfig config = new ActionConfig(); config.addHeader("Content-Type", contentType); System.Runtime.InteropServices.Marshal.Copy(payload, 0, payloadPtr, payload.Length); bool ret = this.mSession.sendInfo(payloadPtr, (uint)payload.Length, config); System.Runtime.InteropServices.Marshal.FreeHGlobal(payloadPtr); result = ret; } else { result = this.mSession.sendInfo(System.IntPtr.Zero, 0u); } return(result); }
public bool HangUpCall(TrunkCallReleaseReason reason) { ActionConfig config = new ActionConfig(); string strReleaseReason = string.Format("pttrelease;cause={0}", (byte)reason); config.addHeader("Ptt-Extension", strReleaseReason); bool result; if (this.connected) { result = this.mSession.hangup(config); } else if (base.IsOutgoing) { result = this.mSession.hangup(config); } else { result = this.mSession.reject(config); } return(result); }