当前位置: 首页>>代码示例>>C#>>正文


C# SIP.UserAgent类代码示例

本文整理汇总了C#中SIPLib.SIP.UserAgent的典型用法代码示例。如果您正苦于以下问题:C# UserAgent类的具体用法?C# UserAgent怎么用?C# UserAgent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


UserAgent类属于SIPLib.SIP命名空间,在下文中一共展示了UserAgent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Cancelled

 /// <summary>
 /// Stub to alert on cancellation.
 /// </summary>
 /// <param name="ua">The ua.</param>
 /// <param name="request">The request.</param>
 /// <param name="sipStack">The sip stack.</param>
 public abstract void Cancelled(UserAgent ua, Message request, SIPStack sipStack);
开发者ID:xorcrud,项目名称:C-Sharp-Sip-Lib,代码行数:7,代码来源:SIPApp.cs

示例2: SendMessage

 public void SendMessage(string uri, string message, string contentType = "text/plain")
 {
     uri = checkURI(uri);
     UserAgent mua = new UserAgent(Stack) { LocalParty = PublicServiceIdentity, RemoteParty = new Address(uri) };
     Useragents.Add(mua);
     Message m = mua.CreateRequest("MESSAGE", message);
     m.InsertHeader(new Header(contentType, "Content-Type"));
     mua.SendRequest(m);
 }
开发者ID:CivilPol,项目名称:IMS-Services,代码行数:9,代码来源:SIPApp.cs

示例3: Authenticate

 public override string[] Authenticate(UserAgent ua, Header header, SIPStack sipStack)
 {
     throw new NotImplementedException();
 }
开发者ID:CivilPol,项目名称:IMS-Services,代码行数:4,代码来源:SIPApp.cs

示例4: ReceivedResponse

 public override void ReceivedResponse(UserAgent ua, Message response, SIPStack stack)
 {
     Log.Info("Received response with code " + response.ResponseCode + " " + response.ResponseText);
     Log.Debug("\n\n" + response.ToString());
     if (ResponseRecvEvent != null)
     {
         ResponseRecvEvent(this, new SipMessageEventArgs(response));
     }
 }
开发者ID:CivilPol,项目名称:IMS-Services,代码行数:9,代码来源:SIPApp.cs

示例5: SendInvite

 public void SendInvite(string uri)
 {
     uri = checkURI(uri);
     UserAgent cua = new UserAgent(Stack) { LocalParty = PublicServiceIdentity, RemoteParty = new Address(uri) };
     Useragents.Add(cua);
     Message invite = cua.CreateRequest("INVITE");
     cua.SendRequest(invite);
 }
开发者ID:CivilPol,项目名称:IMS-Services,代码行数:8,代码来源:SIPApp.cs

示例6: UpdateServiceMetrics

        private static void UpdateServiceMetrics(Dictionary<string, float> metrics)
        {
            UserAgent pua = new UserAgent(_app.Stack)
            {
                RemoteParty = new Address("<sip:" + ServerURI + ">"),
                LocalParty = _localParty
            };
            Message request = pua.CreateRequest("PUBLISH");
            request.InsertHeader(new Header("service-description", "Event"));
            request.InsertHeader(new Header("application/SERV_DESC+xml", "Content-Type"));
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load("Resources/ServiceDescription.xml");
            XmlNode node = xmlDoc.SelectSingleNode("Service/Metrics/TotalCPU");
            node.InnerText = String.Format("{0:0.##}", metrics["totalCPU"]);

            node = xmlDoc.SelectSingleNode("Service/Metrics/CPU");
            node.InnerText = String.Format("{0:0.##}", metrics["cpu"]);

            node = xmlDoc.SelectSingleNode("Service/Metrics/TotalMemory");
            node.InnerText = String.Format("{0:0.##}", metrics["memAvailable"]) + " MB";

            node = xmlDoc.SelectSingleNode("Service/Metrics/Memory");
            node.InnerText = String.Format("{0:0.##}", ((metrics["memUsed"] / 1024) / 1024)) + " MB";

            request.Body = xmlDoc.OuterXml;
            pua.SendRequest(request);
        }
开发者ID:CivilPol,项目名称:IMS-Services,代码行数:27,代码来源:Server.cs

示例7: DialogCreated

 public override void DialogCreated(Dialog dialog, UserAgent ua, SIPStack stack)
 {
     Useragents.Remove(ua);
     Useragents.Add(dialog);
     Log.Info("New dialog created");
 }
开发者ID:CivilPol,项目名称:IMS-Services,代码行数:6,代码来源:SIPApp.cs

示例8: ReceivedRequest

 /// <summary>
 /// Passes a received request to the associated SIP application.
 /// </summary>
 /// <param name="ua">The ua.</param>
 /// <param name="request">The request.</param>
 public void ReceivedRequest(UserAgent ua, Message request)
 {
     App.ReceivedRequest(ua, request, this);
 }
开发者ID:xorcrud,项目名称:C-Sharp-Sip-Lib,代码行数:9,代码来源:SIPStack.cs

示例9: ReceivedResponse

 /// <summary>
 /// Passes a received response to the associated SIP application.
 /// </summary>
 /// <param name="ua">The ua.</param>
 /// <param name="response">The response.</param>
 public void ReceivedResponse(UserAgent ua, Message response)
 {
     App.ReceivedResponse(ua, response, this);
 }
开发者ID:xorcrud,项目名称:C-Sharp-Sip-Lib,代码行数:9,代码来源:SIPStack.cs

示例10: CreateTimer

 /// <summary>
 /// Creates a timer on the associated SIP application.
 /// </summary>
 /// <param name="obj">The obj.</param>
 /// <returns>Timer.</returns>
 public Timer CreateTimer(UserAgent obj)
 {
     return App.CreateTimer(obj, this);
 }
开发者ID:xorcrud,项目名称:C-Sharp-Sip-Lib,代码行数:9,代码来源:SIPStack.cs

示例11: DialogCreated

 /// <summary>
 /// Notifies the associated SIP application that a dialog has been created.
 /// </summary>
 /// <param name="dialog">The dialog.</param>
 /// <param name="ua">The ua.</param>
 public void DialogCreated(Dialog dialog, UserAgent ua)
 {
     App.DialogCreated(dialog, ua, this);
 }
开发者ID:xorcrud,项目名称:C-Sharp-Sip-Lib,代码行数:9,代码来源:SIPStack.cs

示例12: Cancelled

 /// <summary>
 /// Passes the notification of a cancellation to the associated SIP application.
 /// </summary>
 /// <param name="ua">The ua.</param>
 /// <param name="request">The request.</param>
 public void Cancelled(UserAgent ua, Message request)
 {
     App.Cancelled(ua, request, this);
 }
开发者ID:xorcrud,项目名称:C-Sharp-Sip-Lib,代码行数:9,代码来源:SIPStack.cs

示例13: Authenticate

 /// <summary>
 /// Authenticates through the associated SIP application.
 /// </summary>
 /// <param name="ua">The ua.</param>
 /// <param name="header">The header.</param>
 /// <returns>System.String[][].</returns>
 public string[] Authenticate(UserAgent ua, Header header)
 {
     return App.Authenticate(ua, header, this);
 }
开发者ID:xorcrud,项目名称:C-Sharp-Sip-Lib,代码行数:10,代码来源:SIPStack.cs

示例14: CreateTimer

 /// <summary>
 /// Stub to create timers.
 /// </summary>
 /// <param name="obj">The obj.</param>
 /// <param name="sipStack">The sip stack.</param>
 /// <returns>Timer.</returns>
 public abstract Timer CreateTimer(UserAgent obj, SIPStack sipStack);
开发者ID:xorcrud,项目名称:C-Sharp-Sip-Lib,代码行数:7,代码来源:SIPApp.cs

示例15: SendIM

        public void SendIM(string uri, string message,string contentType = "text/plain")
        {
            uri = checkURI(uri);
            if (IsRegistered())
            {

                UserAgent mua = new UserAgent(Stack) {LocalParty = RegisterUA.LocalParty, RemoteParty = new Address(uri)};
                Useragents.Add(mua);
                Message m = mua.CreateRequest("MESSAGE", message);
                m.InsertHeader(new Header(contentType, "Content-Type"));
                mua.SendRequest(m);
            }
        }
开发者ID:CivilPol,项目名称:Sharp-IMS-Client,代码行数:13,代码来源:SIPApp.cs


注:本文中的SIPLib.SIP.UserAgent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。