/sipsorcery-core/SIPSorcery.SIP.App/SIPUserAgents/ISIPServerUserAgent.cs

https://github.com/thecc4re/sipsorcery-mono · C# · 71 lines · 34 code · 6 blank · 31 comment · 0 complexity · d5ad4a57d19fd464d2de86680254c07e MD5 · raw file

  1. //-----------------------------------------------------------------------------
  2. // Filename: ISIPServerUserAgent.cs
  3. //
  4. // Description: The interface definition for SIP Server User Agents (UAC).
  5. //
  6. // History:
  7. // 30 Aug 2009 Aaron Clauson Created.
  8. //
  9. // License:
  10. // This software is licensed under the BSD License http://www.opensource.org/licenses/bsd-license.php
  11. //
  12. // Copyright (c) 2009 Aaron Clauson (aaron@sipsorcery.com), SIP Sorcery Ltd, London, UK (www.sipsorcery.com)
  13. // All rights reserved.
  14. //
  15. // Redistribution and use in source and binary forms, with or without modification, are permitted provided that
  16. // the following conditions are met:
  17. //
  18. // Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  19. // Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
  20. // disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of Blue Face Ltd.
  21. // nor the names of its contributors may be used to endorse or promote products derived from this software without specific
  22. // prior written permission.
  23. //
  24. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
  25. // BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  26. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
  27. // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
  28. // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  29. // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  30. // POSSIBILITY OF SUCH DAMAGE.
  31. //-----------------------------------------------------------------------------
  32. using System;
  33. using System.Collections.Generic;
  34. using System.Linq;
  35. using System.Text;
  36. namespace SIPSorcery.SIP.App
  37. {
  38. public delegate void SIPUASDelegate(ISIPServerUserAgent uas);
  39. public interface ISIPServerUserAgent
  40. {
  41. SIPCallDirection CallDirection { get; }
  42. SIPDialogue SIPDialogue { get; }
  43. SIPAccount SIPAccount { get; set; }
  44. bool IsAuthenticated { get; set; }
  45. bool IsB2B { get; }
  46. SIPRequest CallRequest { get; }
  47. string CallDestination { get; }
  48. bool IsUASAnswered { get; }
  49. string Owner { get; }
  50. event SIPUASDelegate CallCancelled;
  51. event SIPUASDelegate NoRingTimeout;
  52. event SIPUASDelegate TransactionComplete;
  53. event SIPUASStateChangedDelegate UASStateChanged;
  54. bool LoadSIPAccountForIncomingCall();
  55. bool AuthenticateCall();
  56. void Progress(SIPResponseStatusCodesEnum progressStatus, string reasonPhrase, string[] customHeaders, string progressContentType, string progressBody);
  57. SIPDialogue Answer(string contentType, string body, SIPDialogue answeredDialogue, SIPDialogueTransferModesEnum transferMode);
  58. SIPDialogue Answer(string contentType, string body, string toTag, SIPDialogue answeredDialogue, SIPDialogueTransferModesEnum transferMode);
  59. void Reject(SIPResponseStatusCodesEnum failureStatus, string reasonPhrase, string[] customHeaders);
  60. void Redirect(SIPResponseStatusCodesEnum redirectCode, SIPURI redirectURI);
  61. void NoCDR();
  62. void SetTraceDelegate(SIPTransactionTraceMessageDelegate traceDelegate);
  63. void SetOwner(string owner, string adminMemberId);
  64. }
  65. }