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.
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.
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();
}
}