/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.39
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */


using System;
using System.Runtime.InteropServices;

public class SubscriptionSession : SipSession {
  private HandleRef swigCPtr;

  internal SubscriptionSession(IntPtr cPtr, bool cMemoryOwn) : base(tinyWRAPPINVOKE.SubscriptionSessionUpcast(cPtr), cMemoryOwn) {
    swigCPtr = new HandleRef(this, cPtr);
  }

  internal static HandleRef getCPtr(SubscriptionSession obj) {
    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  }

  ~SubscriptionSession() {
    Dispose();
  }

  public override void Dispose() {
    lock(this) {
      if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
        swigCMemOwn = false;
        tinyWRAPPINVOKE.delete_SubscriptionSession(swigCPtr);
      }
      swigCPtr = new HandleRef(null, IntPtr.Zero);
      GC.SuppressFinalize(this);
      base.Dispose();
    }
  }

  public SubscriptionSession(SipStack Stack) : this(tinyWRAPPINVOKE.new_SubscriptionSession(SipStack.getCPtr(Stack)), true) {
  }

  public bool Subscribe() {
    bool ret = tinyWRAPPINVOKE.SubscriptionSession_Subscribe(swigCPtr);
    return ret;
  }

  public bool UnSubscribe() {
    bool ret = tinyWRAPPINVOKE.SubscriptionSession_UnSubscribe(swigCPtr);
    return ret;
  }

}
