SipMessage.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /* ----------------------------------------------------------------------------
  2. * This file was automatically generated by SWIG (http://www.swig.org).
  3. * Version 2.0.9
  4. *
  5. * Do not make changes to this file unless you know what you are doing--modify
  6. * the SWIG interface file instead.
  7. * ----------------------------------------------------------------------------- */
  8. namespace org.doubango.tinyWRAP {
  9. using System;
  10. using System.Runtime.InteropServices;
  11. public class SipMessage : IDisposable {
  12. private HandleRef swigCPtr;
  13. protected bool swigCMemOwn;
  14. internal SipMessage(IntPtr cPtr, bool cMemoryOwn) {
  15. swigCMemOwn = cMemoryOwn;
  16. swigCPtr = new HandleRef(this, cPtr);
  17. }
  18. internal static HandleRef getCPtr(SipMessage obj) {
  19. return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  20. }
  21. ~SipMessage() {
  22. Dispose();
  23. }
  24. public virtual void Dispose() {
  25. lock(this) {
  26. if (swigCPtr.Handle != IntPtr.Zero) {
  27. if (swigCMemOwn) {
  28. swigCMemOwn = false;
  29. tinyWRAPPINVOKE.delete_SipMessage(swigCPtr);
  30. }
  31. swigCPtr = new HandleRef(null, IntPtr.Zero);
  32. }
  33. GC.SuppressFinalize(this);
  34. }
  35. }
  36. public byte[] getSipContent() {
  37. uint clen = this.getSipContentLength();
  38. if(clen>0){
  39. IntPtr ptr = Marshal.AllocHGlobal((int)clen);
  40. this.getSipContent(ptr, clen);
  41. byte[] bytes = new byte[clen];
  42. Marshal.Copy(ptr, bytes, 0, bytes.Length);
  43. Marshal.FreeHGlobal(ptr);
  44. return bytes;
  45. }
  46. return null;
  47. }
  48. public SipMessage() : this(tinyWRAPPINVOKE.new_SipMessage(), true) {
  49. }
  50. public bool isResponse() {
  51. bool ret = tinyWRAPPINVOKE.SipMessage_isResponse(swigCPtr);
  52. return ret;
  53. }
  54. public tsip_request_type_t getRequestType() {
  55. tsip_request_type_t ret = (tsip_request_type_t)tinyWRAPPINVOKE.SipMessage_getRequestType(swigCPtr);
  56. return ret;
  57. }
  58. public short getResponseCode() {
  59. short ret = tinyWRAPPINVOKE.SipMessage_getResponseCode(swigCPtr);
  60. return ret;
  61. }
  62. public string getResponsePhrase() {
  63. string ret = tinyWRAPPINVOKE.SipMessage_getResponsePhrase(swigCPtr);
  64. return ret;
  65. }
  66. public string getSipHeaderValue(string name, uint index) {
  67. string ret = tinyWRAPPINVOKE.SipMessage_getSipHeaderValue__SWIG_0(swigCPtr, name, index);
  68. return ret;
  69. }
  70. public string getSipHeaderValue(string name) {
  71. string ret = tinyWRAPPINVOKE.SipMessage_getSipHeaderValue__SWIG_1(swigCPtr, name);
  72. return ret;
  73. }
  74. public string getSipHeaderParamValue(string name, string param, uint index) {
  75. string ret = tinyWRAPPINVOKE.SipMessage_getSipHeaderParamValue__SWIG_0(swigCPtr, name, param, index);
  76. return ret;
  77. }
  78. public string getSipHeaderParamValue(string name, string param) {
  79. string ret = tinyWRAPPINVOKE.SipMessage_getSipHeaderParamValue__SWIG_1(swigCPtr, name, param);
  80. return ret;
  81. }
  82. public uint getSipContentLength() {
  83. uint ret = tinyWRAPPINVOKE.SipMessage_getSipContentLength(swigCPtr);
  84. return ret;
  85. }
  86. public uint getSipContent(IntPtr output, uint maxsize) {
  87. uint ret = tinyWRAPPINVOKE.SipMessage_getSipContent(swigCPtr, output, maxsize);
  88. return ret;
  89. }
  90. public SdpMessage getSdpMessage() {
  91. IntPtr cPtr = tinyWRAPPINVOKE.SipMessage_getSdpMessage(swigCPtr);
  92. SdpMessage ret = (cPtr == IntPtr.Zero) ? null : new SdpMessage(cPtr, false);
  93. return ret;
  94. }
  95. }
  96. }