Getting Started with MM7Client
MM7 is the interface between MMSC and a value-added service provider (VASP). The MM7 interface is used to send MMS from 3rd party providers (e.g., a bank sending a statement or an advertiser sending publicity).
Send MMS from SMIL file
_client = new MM7Client(mmscUrl);
_client.AuthId = authId;
_client.AuthSecret = authSecret;
_client.VASPID = vaspid;
_client.VASID = vasid;
_client.SenderAddress = senderAddress;
_client.ServiceCode = serviceCode;
- url - http or https URL of MMSC
- authId - username for Basic authentication on the remote MMS Relay/Server.
- authSecret - password for Basic authentication on the remote MMS Relay/Server.
- vaspid - your identifier as VASP (Value Added Service Provider)
- vasid - identifier of your application
- senderAddress - the address of the message originator.
- serviceCode - information supplied for billing purposes
SubmitRequest req = _client.CreateSubmitRequest();
req.Recipients.To.Add("+79171234567");
req.MessageClass = MessageClass.Personal;
req.DeliveryReport = true;
req.Subject = "Test";
req.Priority = Priorities.Normal;
req.ChargedParty = ChargedParty.Sender;
req.ContentHref = "/mms/mm7/mm7client";
req.TransactionID = DateTime.Now.Ticks.ToString();
try
{
// Submit MMS Message as VASP
SubmitResponse resp = await _client.Submit(smilFilePath, req);
// Check response status
if (resp.Status.StatusCode == 1000)
{
Console.WriteLine("MMS message has been sent successfully");
}
}
catch (MM7Exception ex)
{
Console.Error.WriteLine(ex.Message);
Console.Error.WriteLine(ex.Status.Details);
}
catch (WebException ex)
{
Console.Error.WriteLine(ex.Message);
}