SafeDispatch/SipComponent/SipMessageGenerator.cs

25 lines
823 B
C#
Raw Permalink Normal View History

2024-02-22 16:43:59 +00:00
using Independentsoft.Sip;
using Independentsoft.Sip.Methods;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SipComponent
{
public abstract class SipMessageGenerator
{
public virtual Message Generate(string destinationID, string senderID, string sipServer,
int sipServerPort, string text, bool groupSms = false)
{
Message sipMessage = new Message();
sipMessage.Uri = "sip:" + destinationID + "@" + sipServer + ":" + sipServerPort;
sipMessage.From = new ContactInfo(string.Format("sip:{0}@{1}", senderID, sipServer));
sipMessage.To = new ContactInfo(string.Format("sip:{0}@{1}", destinationID, sipServer));
return sipMessage;
}
}
}