Service type

Smpp v3.4 client

Moderator: alt

Locked
piscui
Posts: 2
Joined: Thu Jun 26, 2008 1:37 pm

Service type

Post by piscui » Thu Jun 26, 2008 1:41 pm

Hi,

Is there any way to retrieve the ServiceType field from a DeliverSm object (just like in SubmitSm)?

Thanks.
alt
Site Admin
Posts: 988
Joined: Tue Apr 25, 2006 9:45 am

Post by alt » Fri Jun 27, 2008 6:16 am

ServiceType property has been added.
Please download http://www.inetlab.ru/Download/SmppClient.zip
piscui
Posts: 2
Joined: Thu Jun 26, 2008 1:37 pm

Post by piscui » Fri Jun 27, 2008 5:43 pm

Thanks very much.

I had found a workaround (posted below in case it's useful to anyone), but having it on the library is much handier.

Code: Select all

string serviceType = GetServiceType(data.PacketBytes);

...

private string GetServiceType( byte[] data ) 
{
	System.Text.StringBuilder sb = new System.Text.StringBuilder();

	for(int i = 16; i < data.Length; i++) 
	{
		if(data[i] == 0x00) break;
		sb.Append(System.Text.Encoding.Default.GetString(data, i, 1));
	}
	
	return sb.ToString();
}
Locked