• .net调用skypeAPI


    公司有呼叫中心,闲来无事。看看SKPYE有没有API,竟然真有。

    做了个调用API的例子

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using SKYPE4COMLib;
    
    public partial class _Default : System.Web.UI.Page
    {
        SKYPE4COMLib.Skype oSkype = new SKYPE4COMLib.Skype();  
        protected void Page_Load(object sender, EventArgs e)
        {
            UserCollection tFriends = oSkype.Friends;  
            foreach (User tUser in oSkype.Friends)  
            {  
    
                 if(tUser.FullName.Trim() != "")
    
                     ListBox1.Items.Add(tUser.FullName+"--"+tUser.OnlineStatus); 
                
            } 
    
    
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            SKYPE4COMLib.SkypeClass skype = new SkypeClass();
            skype.SmsTargetStatusChanged += new _ISkypeEvents_SmsTargetStatusChangedEventHandler(skype_SmsTargetStatusChanged);
            skype.SmsMessageStatusChanged += new _ISkypeEvents_SmsMessageStatusChangedEventHandler(skype_SmsMessageStatusChanged);
            SmsMessage message = skype.CreateSms(TSmsMessageType.smsMessageTypeOutgoing, "*18611295575");
            message.Body = "測試內容";
            message.Send();
    
        }
    
        void skype_SmsMessageStatusChanged(SmsMessage pMessage, TSmsMessageStatus Status)
        {
            switch (Status)
            {
                case TSmsMessageStatus.smsMessageStatusComposing:
                    break;
                case TSmsMessageStatus.smsMessageStatusDelivered:
                    break;
                case TSmsMessageStatus.smsMessageStatusFailed:
                    break;
                case TSmsMessageStatus.smsMessageStatusRead:
                    break;
                case TSmsMessageStatus.smsMessageStatusReceived:
                    break;
                case TSmsMessageStatus.smsMessageStatusSendingToServer:
                    break;
                case TSmsMessageStatus.smsMessageStatusSentToServer:
                    break;
                case TSmsMessageStatus.smsMessageStatusSomeTargetsFailed:
                    break;
                case TSmsMessageStatus.smsMessageStatusUnknown:
                    break;
                default:
                    break;
            }
        }
    
        void skype_SmsTargetStatusChanged(SmsTarget pTarget, TSmsTargetStatus Status)
        {
            switch (Status)
            {
                case TSmsTargetStatus.smsTargetStatusAcceptable:
                    break;
                case TSmsTargetStatus.smsTargetStatusAnalyzing:
                    break;
                case TSmsTargetStatus.smsTargetStatusDeliveryFailed:
                    break;
                case TSmsTargetStatus.smsTargetStatusDeliveryPending:
                    break;
                case TSmsTargetStatus.smsTargetStatusDeliverySuccessful:
                    break;
                case TSmsTargetStatus.smsTargetStatusNotRoutable:
                    break;
                case TSmsTargetStatus.smsTargetStatusUndefined:
                    break;
                case TSmsTargetStatus.smsTargetStatusUnknown:
                    break;
                default:
                    break;
            }
        }
    
        protected void Button2_Click(object sender, EventArgs e)
        {
            Call call = oSkype.Call;
    
            
            SkypeClass skype = new SkypeClass();
            CommandClass cmd = new CommandClass();
            //skype._ISkypeEvents_Event_Command += new _ISkypeEvents_CommandEventHandler(skype__ISkypeEvents_Event_Command);
            cmd.Command = "OPEN IM " + "*186********";
            //skype.SendCommand(cmd);
    
            cmd.Command = "CALL " + "*186********";
            //skype.SendCommand(cmd);
        }
    
        void skype__ISkypeEvents_Event_Command(Command pCommand)
        {
    
        }
    }
  • 相关阅读:
    ElasticSearch已经配置好ik分词和mmseg分词(转)
    Java:Cookie实现记住用户名、密码
    (转)10大H5前端框架
    msysGit在GitHub代码托管
    mongodb 语句和SQL语句对应(SQL to Aggregation Mapping Chart)
    centos 7 安装redis
    mac下idea卡顿问题解决
    在linux系统中,使用tomcat的shutdown.sh脚本停止应用,但是进程还在的解决办法
    centOS 7.4 安装配置jdk1.8
    CentOS6 在线安装PostgreSQL10
  • 原文地址:https://www.cnblogs.com/iverson3/p/2664823.html
Copyright © 2020-2023  润新知