Search in sources :

Example 1 with SmsDeliverTpduImpl

use of org.mobicents.protocols.ss7.map.smstpdu.SmsDeliverTpduImpl in project smscgateway by RestComm.

the class MtTest2 method Ucs2Test.

@Test(groups = { "Mt" })
public void Ucs2Test() throws Exception {
    // Long msgId = 15L;
    // String s1 = msgId.toString(10);
    // String sss2 = String.format("%010d", 15L);
    String s11 = "زمانیکه بررسی";
    Charset ucs2Charset = Charset.forName("UTF-16BE");
    Charset utf8 = Charset.forName("UTF-8");
    // ByteBuffer bb = ByteBuffer.wrap(textPart);
    // CharBuffer bf = ucs2Charset.decode(bb);
    // msg = bf.toString();
    ByteBuffer bb = utf8.encode(s11);
    byte[] buf = new byte[bb.limit()];
    bb.get(buf, 0, bb.limit());
    String s2 = new String(buf);
    UserDataImpl ud = new UserDataImpl(s2, new DataCodingSchemeImpl(8), null, null);
    AddressField originatingAddress = new AddressFieldImpl(TypeOfNumber.InternationalNumber, NumberingPlanIdentification.ISDNTelephoneNumberingPlan, "123456");
    ProtocolIdentifier pi = new ProtocolIdentifierImpl(0);
    AbsoluteTimeStamp serviceCentreTimeStamp = new AbsoluteTimeStampImpl(05, 3, 4, 5, 6, 7, 0);
    SmsDeliverTpduImpl smsDeliverTpduImpl = new SmsDeliverTpduImpl(false, false, false, true, originatingAddress, pi, serviceCentreTimeStamp, ud);
    SmsSignalInfoImpl SmsSignalInfoImpl = new SmsSignalInfoImpl(smsDeliverTpduImpl, null);
    int gg = 0;
    gg++;
}
Also used : AddressField(org.mobicents.protocols.ss7.map.api.smstpdu.AddressField) AbsoluteTimeStamp(org.mobicents.protocols.ss7.map.api.smstpdu.AbsoluteTimeStamp) AddressFieldImpl(org.mobicents.protocols.ss7.map.smstpdu.AddressFieldImpl) Charset(java.nio.charset.Charset) SmsSignalInfoImpl(org.mobicents.protocols.ss7.map.service.sms.SmsSignalInfoImpl) DataCodingSchemeImpl(org.mobicents.protocols.ss7.map.smstpdu.DataCodingSchemeImpl) ByteBuffer(java.nio.ByteBuffer) ProtocolIdentifierImpl(org.mobicents.protocols.ss7.map.smstpdu.ProtocolIdentifierImpl) AbsoluteTimeStampImpl(org.mobicents.protocols.ss7.map.smstpdu.AbsoluteTimeStampImpl) UserDataImpl(org.mobicents.protocols.ss7.map.smstpdu.UserDataImpl) ProtocolIdentifier(org.mobicents.protocols.ss7.map.api.smstpdu.ProtocolIdentifier) SmsDeliverTpduImpl(org.mobicents.protocols.ss7.map.smstpdu.SmsDeliverTpduImpl) Test(org.testng.annotations.Test)

Example 2 with SmsDeliverTpduImpl

use of org.mobicents.protocols.ss7.map.smstpdu.SmsDeliverTpduImpl in project smscgateway by RestComm.

the class MtTest2 method Ucs2Test3.

@Test(groups = { "Mt" })
public void Ucs2Test3() throws Exception {
    String s11 = "ura nus";
    byte[] buf = s11.getBytes();
    UserDataImpl ud = new UserDataImpl(s11, new DataCodingSchemeImpl(16), null, null);
    AddressField originatingAddress = new AddressFieldImpl(TypeOfNumber.InternationalNumber, NumberingPlanIdentification.ISDNTelephoneNumberingPlan, "123456");
    ProtocolIdentifier pi = new ProtocolIdentifierImpl(0);
    AbsoluteTimeStamp serviceCentreTimeStamp = new AbsoluteTimeStampImpl(05, 3, 4, 5, 6, 7, 0);
    SmsDeliverTpduImpl smsDeliverTpduImpl = new SmsDeliverTpduImpl(false, false, false, true, originatingAddress, pi, serviceCentreTimeStamp, ud);
    SmsSignalInfoImpl SmsSignalInfoImpl = new SmsSignalInfoImpl(smsDeliverTpduImpl, null);
    int gg = 0;
    gg++;
}
Also used : AddressField(org.mobicents.protocols.ss7.map.api.smstpdu.AddressField) AbsoluteTimeStamp(org.mobicents.protocols.ss7.map.api.smstpdu.AbsoluteTimeStamp) AddressFieldImpl(org.mobicents.protocols.ss7.map.smstpdu.AddressFieldImpl) SmsSignalInfoImpl(org.mobicents.protocols.ss7.map.service.sms.SmsSignalInfoImpl) DataCodingSchemeImpl(org.mobicents.protocols.ss7.map.smstpdu.DataCodingSchemeImpl) ProtocolIdentifierImpl(org.mobicents.protocols.ss7.map.smstpdu.ProtocolIdentifierImpl) AbsoluteTimeStampImpl(org.mobicents.protocols.ss7.map.smstpdu.AbsoluteTimeStampImpl) UserDataImpl(org.mobicents.protocols.ss7.map.smstpdu.UserDataImpl) ProtocolIdentifier(org.mobicents.protocols.ss7.map.api.smstpdu.ProtocolIdentifier) SmsDeliverTpduImpl(org.mobicents.protocols.ss7.map.smstpdu.SmsDeliverTpduImpl) Test(org.testng.annotations.Test)

Aggregations

AbsoluteTimeStamp (org.mobicents.protocols.ss7.map.api.smstpdu.AbsoluteTimeStamp)2 AddressField (org.mobicents.protocols.ss7.map.api.smstpdu.AddressField)2 ProtocolIdentifier (org.mobicents.protocols.ss7.map.api.smstpdu.ProtocolIdentifier)2 SmsSignalInfoImpl (org.mobicents.protocols.ss7.map.service.sms.SmsSignalInfoImpl)2 AbsoluteTimeStampImpl (org.mobicents.protocols.ss7.map.smstpdu.AbsoluteTimeStampImpl)2 AddressFieldImpl (org.mobicents.protocols.ss7.map.smstpdu.AddressFieldImpl)2 DataCodingSchemeImpl (org.mobicents.protocols.ss7.map.smstpdu.DataCodingSchemeImpl)2 ProtocolIdentifierImpl (org.mobicents.protocols.ss7.map.smstpdu.ProtocolIdentifierImpl)2 SmsDeliverTpduImpl (org.mobicents.protocols.ss7.map.smstpdu.SmsDeliverTpduImpl)2 UserDataImpl (org.mobicents.protocols.ss7.map.smstpdu.UserDataImpl)2 Test (org.testng.annotations.Test)2 ByteBuffer (java.nio.ByteBuffer)1 Charset (java.nio.charset.Charset)1