i'm using the lates version of smslib,advan model DT-81 and wavecom m1306B
modem. both can't give the same error.
the original message was
Dan mobil rental yg lg ada di parkiran ternyata ada sisa mesiunya. Log
gps pun di download, keliatan mobil ini udah jalan ke monas, cipanas,
cikeas, lap banteng. Skenario bisa panjang ini. orde represif mungkin
masih 20 atau 40 tahun lagi baru berakhir setelah lembaga seperti
densus 88 ini dibubarkan
i'm not using all part of sms lib, i'm using just to make pdu of sms
long/concatanated.
this is the code,
public String sendLMS(String to, String msg)
{
String temp="";
SmsSubmitPdu pdu = PduFactory.newSmsSubmitPdu();
//pdu.setSmscInfoLength(07);
setSMSC(pdu, "+6281100000");
pdu.setAddressType(PduUtils.ADDRESS_TYPE_INTERNATIONAL);
pdu.setAddress(to);
pdu.setValidityTimestamp(new Date());
pdu.setDecodedText(msg);
pdu.setDataCodingScheme(PduUtils.DCS_ENCODING_7BIT);
pdu.setValidityPeriod(8);
pdu.setProtocolIdentifier(0);
PduGenerator generator = new PduGenerator();
//System.out.println("mti: "+pdu.getTpMti());
//System.out.println("UDH/SMS LONG:"+pdu.getUDHData());
System.out.println("mp max: "+pdu.getMpMaxNo());
for (int i = 1; i <= pdu.getMpMaxNo(); i++)
{
String pduString = generator.generatePduString(pdu, 9, i);
System.out.println("string kirim : "+pduString);
toSMS(pduString); //code to send sms
}
System.out.println("");
return temp;
}
adding this code
protected void setSMSC(SmsSubmitPdu pdu, String smscNumber)
{
// smscInfo
// address type field + #octets for smscNumber
// NOTE: make sure the + is not present when computing the
smscInfoLength
String smscNumberForLengthCheck = smscNumber;
if (smscNumber.startsWith("+"))
{
smscNumberForLengthCheck = smscNumber.substring(1);
}
pdu.setSmscInfoLength(1+ (smscNumberForLengthCheck.length() / 2) +
((smscNumberForLengthCheck.length() % 2 == 1) ? 1 : 0));
//pdu.setSmscInfoLength(1 + (smscNumberForLengthCheck.length() / 2)
+ 2);
//encodedBody = "000100" + encodedBody;
// set address
pdu.setSmscAddress(smscNumber);
// set address type using the address (+ needs to be passed with
it, if present)
//pdu.setSmscAddressType(PduUtils.getAddressTypeFor(smscNumber));
}
adding setSMSC(SmsSubmitPdu pdu, String smscNumber) to make the PDU right.
before it, the message can only sent if i set
pdu.setDataCodingScheme(0xF6), but the message just received in modern
smartphone as flash message, in old phone nothing received.
did i wrong to use or set parameter in sms lib?
i just want to use the pdu factory part for send sms concatenated/long,
other part using own code. this code has succesfully to sent sms <160
character, and to read both sms <160 and sms concatenaned.
thanx for your help, really appreciated :)
On Monday, September 17, 2012 2:23:39 AM UTC+7, Thanasis wrote:
>
> Which smslib version are you using? Which modem?
>
> Can you send me the original message? (send it to my email if you require
> privacy).
>
> On 16 September 2012 17:43, SMSLib Discussion Group on behalf of id.py <
> smslib+noreply-apn2wqd8px1mtpgapgy2ot3zjf9bodcdlcg95y-vzazsp4...@googlegroups.com<javascript:>
> > wrote:
>
>> i'm trying to send sms concatenated/long using sms lib, the PDU 'look'
>> right, but it can't sent, CMS ERROR 304. below the sample PDU
>>
>> 0691261801000051000C9180830286737200005FA0050003090201886137A8FD16A7D92079
>> D94D0FB341F933887D0685C9611039**0D8287E5EBB43CEC06D1CB72773E4C**
>> 0F83C2E430689E9E8741
>> EDF23C5D77E7C32E10F37D069DE173**10BCEE0691D320F2FBEE66BFC36416**685D66A7C3F4B01BD47E
>>
>> 8BD36C50DA9D06D5C96134481D6687**DDA07519D47EBBC37316689C8687DD**
>> E1390B344EAFCBE1390B
>> C40EC341
>>
>> modem set the pdu mode, at+cmgf=0
>>
>> any idea how to fix it?
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "SMSLib Discussion Group" group.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> To unsubscribe from this group, send email to
>> [email protected] <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/smslib/-/WC6_j6H91NkJ.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
--
You received this message because you are subscribed to the Google Groups
"SMSLib Discussion Group" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
To view this discussion on the web visit
https://groups.google.com/d/msg/smslib/-/oizqyrbmp-MJ.
For more options, visit https://groups.google.com/groups/opt_out.