using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Independentsoft.Sip.Methods;
using Independentsoft.Sip;
namespace SipComponent.Simoco
{
///
/// Class that generates Sip messages used for Simoco
///
internal class SimocoSipMessageGenerator : SipMessageGenerator
{
///
/// Generates a Sip message using the specified parameters
///
///
///
///
///
///
///
public override Message Generate(string destinationID, string senderID, string sipServer, int sipServerPort, string text, bool groupSms = false)
{
Message sipMessage = base.Generate(destinationID, senderID, sipServer, sipServerPort, text);
sipMessage.ContentType = "application/octet-stream";
// Softul de pe AIS are nevoie de punct si virgula (;) dupa short-data
sipMessage.Header.Add("Ais-Service", "short-data;");
sipMessage.Header.Add("Ais-Options", "service-attributes; coding=unicode-16");
sipMessage.Header.Add("Content-Transfer-Encoding", "base64");
sipMessage.Body = Convert.ToBase64String(Encoding.BigEndianUnicode.GetBytes(text));
return sipMessage;
}
}
}