multiple receiptient

.NET library for SMPP protocol
Locked
mobilyws
Posts: 14
Joined: Sat Jan 14, 2012 1:25 pm

multiple receiptient

Post by mobilyws » Wed Feb 15, 2012 1:41 pm

I try to send multi messages using SubmitMulti but it did not work correctly
My code

Dim coding As DataCodings = GetDataCoding()
Dim mode As SubmitMode = GetSubmitMode()


Dim a As List(Of DestinationAddress) = New List(Of DestinationAddress)
Dim ab As DestinationAddress
ab = New DestinationAddress
ab.Address = "962799999999"
ab.Npi = Byte.Parse(tbSrcAdrNPI.Text)
ab.Ton = Byte.Parse(tbSrcAdrTON.Text)
a.Add(ab)

ab = Nothing
ab = New DestinationAddress
ab.Npi = Byte.Parse(tbSrcAdrNPI.Text)
ab.Ton = Byte.Parse(tbSrcAdrTON.Text)
ab.Address = "962788888888"

a.Add(ab)

Dim req As List(Of SubmitMulti) = client.PrepareSubmit(mode, Byte.Parse(tbSrcAdrTON.Text), Byte.Parse(tbSrcAdrNPI.Text), "daoud", a, coding, "test")


'Dim resp As List(Of SubmitMultiResp) = client.Submit (req)

client.SubmitAsync(req)


any suggestion,

and also please when I send multi messages, could I check the delivery status for each number
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Re: multiple receiptient

Post by alt » Mon Feb 27, 2012 8:16 pm

Does your SMPP provider support SubmitMulti?
What SMPP server responses?

You can trace transfered data with code

Code: Select all

SmppClient client = new SmppClient();
client.evReceiveData += new ReceiveDataEventHandler(client_evReceiveData);
client.evSendData += new SendDataEventHandler(client_evSendData);

void client_evSendData(object sender, byte[] data)
{
    Console.WriteLine(string.Format("Sent to Server: {0}", ToHexString(data)));
}

void client_evReceiveData(object sender, byte[] data)
{
    Console.WriteLine(string.Format("Received from Server: {0}", ToHexString(data)));
}

public static string ToHexString(byte[] buf)
{
    if (buf == null) return "";

    System.Text.StringBuilder sb = new System.Text.StringBuilder(buf.Length * 2 + 2);
    for (int i = 0; i < buf.Length; i++)
    {
        sb.Append(buf[i].ToString("x2"));
    }
    return sb.ToString();
}

mobilyws
Posts: 14
Joined: Sat Jan 14, 2012 1:25 pm

Re: multiple receiptient

Post by mobilyws » Tue Feb 28, 2012 12:58 pm

Dear alt,

thanks for your answer

my smpp server support multi
i try to send to multireciepient using the last code and this is the response

03:28:05 م: SmppClient connected
03:28:05 م: Binding SmppClient for SystemId: Bulk
03:28:05 م: Sending Data: 9020000002d0000000900000000246fd29842756c6b37313731370050503731377000534d53313731370034000000
03:28:05 م: Sent to Server: 0000002d0000000900000000246fd29842756c6b37313731370050503731377000534d53313731370034000000
03:28:05 م: Received Data: 6220000001f8000000900000000246fd29842756c6b3731373137000210000134
03:28:05 م: Received from Server: 0000001f8000000900000000246fd29842756c6b3731373137000210000134
03:28:05 م: SmppClient bound
03:28:05 م: Bind result : system is Bulk with status ESME_ROK
03:28:18 م: Sending Data: 15420000004d0000002100000000246fd29900050164616f75640002020501393636353335313638333237000205013936363535313531393438340000000000000000000009746573747777777777
03:28:18 م: Sent to Server: 0000004d0000002100000000246fd29900050164616f75640002020501393636353335313638333237000205013936363535313531393438340000000000000000000009746573747777777777
03:28:18 م: Received Data: 322000000108000002100000044246fd299
03:28:18 م: Received from Server: 000000108000002100000044246fd299

but the messages dose not arrive?

is there is another way to send to multi reciepint different from the way that i use

best regards
mobilyws
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Re: multiple receiptient

Post by alt » Wed Feb 29, 2012 2:49 pm

could you check in debug what value has property ab.DestType?
By default it is SMEAddress = 01, but in your log it is DistributionListName = 02
mobilyws
Posts: 14
Joined: Sat Jan 14, 2012 1:25 pm

Re: multiple receiptient

Post by mobilyws » Sat Mar 03, 2012 2:06 pm

dear alt,

i have changed the desttype to DestinationAddressType.SMEAddress
and still i donot receive any thing

this the log

05:01:49 م: SmppClient connected
05:01:49 م: Binding SmppClient for SystemId: Bulk
05:01:49 م: Sending Data: 9020000002d0000000900000000583a485542756c6b37313731370050503731377000534d53313731370034000000
05:01:50 م: Received Data: 6220000001f8000000900000000583a485542756c6b3731373137000210000134
05:01:50 م: SmppClient bound
05:01:50 م: Bind result : system is Bulk with status ESME_ROK
05:01:56 م: Sending Data: 15420000004d0000002100000000583a485600050164616f75640002010501393636353335313638333237000105013936363535313531393438340000000000000000000009746573747777777777
05:01:56 م: Received Data: 322000000108000002100000045583a4856

dose i should change the the message type or submit mode
any suggestion

best regards
mobilyws
mobilyws
Posts: 14
Joined: Sat Jan 14, 2012 1:25 pm

Re: multiple receiptient

Post by mobilyws » Tue Mar 06, 2012 1:31 pm

Dear alt,

how could i query message status when i send using SubmitMulti
like this
Dim req As List(Of SubmitMulti) = client.PrepareSubmit(mode, Byte.Parse(tbSrcAdrTON.Text), Byte.Parse(tbSrcAdrNPI.Text), "daoud", a, coding, "testwwwww")

Dim resp As List(Of SubmitMultiResp) = client.Submit(req)

i try to use
Dim qresp As QuerySmResp = client.Query(resp(0).MessageId, Byte.Parse(tbSrcAdrTON.Text), Byte.Parse(tbSrcAdrNPI.Text), "sender")

but i could not handle the sender (srcadr) to use it in function Query

any suggestions

best regards
daoud
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Re: multiple receiptient

Post by alt » Tue Mar 13, 2012 7:49 pm

try to query with
client.Query(resp(0).MessageId, 0, 0, null);

also you need to handle UnsuccessAddresses in SubmitMultiResp.
Locked