Cisco 可视消息等待指示器(VMWI 或 MVI) [英] Cisco visual message waiting indicator ( VMWI or MVI )

查看:33
本文介绍了Cisco 可视消息等待指示器(VMWI 或 MVI)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何以编程方式点亮 Cisco IP 电话可视消息等待指示灯(VMWI 或 MWI)?

How can I programatically illuminate Cisco IP Phones Visual message waiting indicator (VMWI or MWI) ?

对于 sipwiz 答案:

IP 地址 10.1.1.2 => 是本地 IP,我将在其中发送 SIP 通知消息

IP Adress 10.1.1.2 => is local IP in which I will send SIP Notify Message

IP 地址 10.1.1.9 => 是我将发送 SIP 消息的 Cisco Phone 的 IP 地址

IP Address 10.1.1.9 => is IP Address of Cisco Phone that I will send SIP Message

我发送 SIP 消息的 Cisco Phone 确实关心"我的消息,而我当我尝试从 Cisco Phone 获取响应消息时出现异常:An现有连接被远程主机强行关闭".

The Cisco Phone that I send SIP Message does "care" my messages, and I got exception while i try to get response messge from Cisco Phone :"An existing connection was forcibly closed by the remote host".

实际上,直接向 Cisco Phone 发送 SIP 消息以改变其行为似乎是不对的.因为它对许多安全违规行为持开放态度.而且我认为 Cisco 不会允许这样做.

Actully it does not seem to right to directly send an SIP message to Cisco Phone to change its behaviour.Because it is open to many security violations.And I think Cisco will not allow this.

"sipwiz" 我需要在 Cisco Phone 上做额外的配置才能使这个功能有用吗?你真的能够让它在真实的环境中工作吗?思科电话?如果是这样,你在手机上做了什么样的额外配置?

"sipwiz" do I need to do extra configuration on Cisco Phone to make this feature work? Do you actually able to make it work on a real Cisco Phone? If so, what kind of extra config yo do on the Phone?

推荐答案

下面是一些粗略的代码,用于构建一个虚拟的 SIP NOTIFY 请求,该请求可以发送到 Cisco IP 电话(仅使用 Cisco 7960 测试),允许要设置和取消设置的可视消息等待指示器.

Below is some crude code that constructs a dummy SIP NOTIFY request that can be sent to a Cisco IP Phone (only tested with a Cisco 7960) that will allow the visual Message Waiting Indicator to be set and unset.

您需要将 sip:user@server.com 更改为您的 Cisco 电话可识别的 SIP URI.当然也可以根据需要调整IP地址和端口.

You will need to change the sip:user@server.com to a SIP URI that your Cisco phone recognises. And also of course adjust the IP addresses and ports as required.

更新:更新了代码示例,使 IP 地址需要在 SIP 请求中的位置更加清晰.

Update: Updated the code sample to make it a bit clearer where the IP addresses need to go in the SIP request.

using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine("Cisco MWI Test Console:");

        string setMWIRequest =
            "NOTIFY {0} SIP/2.0\r\n" +
            "Via: SIP/2.0/UDP {1}:{2};branch=z9hG4bK{3}\r\n" +
            "To: <{0}>\r\n" +
            "From: <{0}>\r\n" +
            "Call-ID: {4}\r\n" +
            "CSeq: 1 NOTIFY\r\n" +
            "Max-Forwards: 70\r\n" +
            "Contact: {1}:{2}\r\n" +
            "Content-Length: {5}\r\n" +
            "Content-Type: application/simple-message-summary\r\n" +
            "Event: message-summary\r\n" +
            "\r\n" +
            "{6}";

        string mwiBody = "Messages-Waiting: no"; // Change to no to unset MWI.

        var localSIPEP = new IPEndPoint(IPAddress.Parse("192.168.33.116"), 5091);
        Socket udpSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
        udpSocket.Bind(localSIPEP);

        setMWIRequest = String.Format(setMWIRequest, "sip:user@server.com", localSIPEP.Address.ToString(), localSIPEP.Port, Guid.NewGuid().ToString().Replace("-", ""), Guid.NewGuid().ToString().Replace("-", ""), mwiBody.Length, mwiBody);

        byte[] buffer = Encoding.UTF8.GetBytes(setMWIRequest);

        Console.WriteLine("Sending to Cisco:");
        Console.WriteLine(setMWIRequest);

        udpSocket.SendTo(buffer, new IPEndPoint(IPAddress.Parse("192.168.33.155"), 5060));

        byte[] recvBuffer = new byte[4096];
        int bytesRead = udpSocket.Receive(recvBuffer);

        Console.WriteLine(Encoding.UTF8.GetString(recvBuffer.Take(bytesRead).ToArray()));

        Console.ReadLine();
    }
}

这篇关于Cisco 可视消息等待指示器(VMWI 或 MVI)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆