Search in sources :

Example 16 with Sms

use of org.mobicents.smsc.library.Sms in project smscgateway by RestComm.

the class MProcUtility method createNewEmptyMessage.

public static MProcNewMessage createNewEmptyMessage(int defaultValidityPeriodHours, int maxValidityPeriodHours, OriginationType originationType) {
    Sms sms = new Sms();
    sms.setDbId(UUID.randomUUID());
    sms.setOrigNetworkId(0);
    sms.setSourceAddr("111");
    sms.setSourceAddrNpi(1);
    sms.setSourceAddrTon(1);
    sms.setMessageId(0);
    sms.setShortMessageText("???");
    sms.setShortMessageBin(null);
    Date now = new Date();
    sms.setSubmitDate(now);
    sms.setValidityPeriod(addHours(now, defaultValidityPeriodHours));
    sms.setScheduleDeliveryTime(null);
    sms.setDataCoding(0);
    sms.setNationalLanguageLockingShift(0);
    sms.setNationalLanguageSingleShift(0);
    // datagram mode, normal message, no UDH
    sms.setEsmClass(1);
    sms.setPriority(0);
    sms.setRegisteredDelivery(0);
    sms.setOrigSystemId(null);
    sms.setOrigEsmeName(null);
    sms.setOriginationType(originationType);
    sms.setMoMessageRef(0);
    sms.setServiceType(null);
    sms.setProtocolId(0);
    sms.setReplaceIfPresent(0);
    sms.setDefaultMsgId(0);
    SmsSet smsSet = new SmsSet();
    smsSet.setDestAddr("222");
    smsSet.setDestAddrNpi(1);
    smsSet.setDestAddrTon(1);
    smsSet.setNetworkId(0);
    smsSet.setCorrelationId(null);
    smsSet.addSms(sms);
    return new MProcNewMessageImpl(sms, defaultValidityPeriodHours, maxValidityPeriodHours);
}
Also used : Sms(org.mobicents.smsc.library.Sms) Date(java.util.Date) SmsSet(org.mobicents.smsc.library.SmsSet)

Example 17 with Sms

use of org.mobicents.smsc.library.Sms in project smscgateway by RestComm.

the class PostArrivalProcessorImpl method updateMessageSourceAddrTon.

@Override
public void updateMessageSourceAddrTon(MProcMessage message, int newSourceTon) throws MProcRuleException {
    MProcUtility.checkSourceAddrTon(newSourceTon);
    MProcMessageImpl msg = (MProcMessageImpl) message;
    Sms sms = msg.getSmsContent();
    sms.setSourceAddrTon(newSourceTon);
}
Also used : Sms(org.mobicents.smsc.library.Sms)

Example 18 with Sms

use of org.mobicents.smsc.library.Sms in project smscgateway by RestComm.

the class PostArrivalProcessorImpl method updateMessageDestAddr.

@Override
public void updateMessageDestAddr(MProcMessage message, String newDigits) throws MProcRuleException {
    MProcUtility.checkDestAddr(newDigits);
    MProcMessageImpl msg = (MProcMessageImpl) message;
    Sms sms = msg.getSmsContent();
    sms.getSmsSet().setDestAddr(newDigits);
    sms.getSmsSet().setCorrelationId(null);
}
Also used : Sms(org.mobicents.smsc.library.Sms)

Example 19 with Sms

use of org.mobicents.smsc.library.Sms in project smscgateway by RestComm.

the class PostArrivalProcessorImpl method updateNationalLanguageLockingShift.

@Override
public void updateNationalLanguageLockingShift(MProcMessage message, int newNationalLanguageLockingShift) {
    MProcMessageImpl msg = (MProcMessageImpl) message;
    Sms sms = msg.getSmsContent();
    sms.setNationalLanguageLockingShift(newNationalLanguageLockingShift);
}
Also used : Sms(org.mobicents.smsc.library.Sms)

Example 20 with Sms

use of org.mobicents.smsc.library.Sms in project smscgateway by RestComm.

the class PostArrivalProcessorImpl method removeTlvParameter.

@Override
public void removeTlvParameter(MProcMessage message, short tag) {
    MProcMessageImpl msg = (MProcMessageImpl) message;
    Sms sms = msg.getSmsContent();
    TlvSet ts = sms.getTlvSet();
    ts.removeOptionalParameter(tag);
}
Also used : Sms(org.mobicents.smsc.library.Sms) TlvSet(org.restcomm.smpp.parameter.TlvSet)

Aggregations

Sms (org.mobicents.smsc.library.Sms)139 SmsSet (org.mobicents.smsc.library.SmsSet)62 Test (org.testng.annotations.Test)43 Date (java.util.Date)42 ArrayList (java.util.ArrayList)35 ISDNAddressString (org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString)33 TargetAddress (org.mobicents.smsc.library.TargetAddress)30 MAPDialogSmsProxy (org.mobicents.smsc.slee.resources.persistence.MAPDialogSmsProxy)27 MAPServiceSmsProxy (org.mobicents.smsc.slee.resources.persistence.MAPServiceSmsProxy)27 ISDNAddressStringImpl (org.restcomm.protocols.ss7.map.primitives.ISDNAddressStringImpl)26 AddressString (org.restcomm.protocols.ss7.map.api.primitives.AddressString)24 SmscPropertiesManagement (org.mobicents.smsc.domain.SmscPropertiesManagement)23 UUID (java.util.UUID)22 PreparedStatementCollection (org.mobicents.smsc.cassandra.PreparedStatementCollection)21 SmsSetEvent (org.mobicents.smsc.slee.services.smpp.server.events.SmsSetEvent)21 SmsProxy (org.mobicents.smsc.slee.resources.persistence.SmsProxy)20 SM_RP_DA (org.restcomm.protocols.ss7.map.api.service.sms.SM_RP_DA)19 SmsSignalInfo (org.restcomm.protocols.ss7.map.api.service.sms.SmsSignalInfo)19 MAPApplicationContextVersion (org.restcomm.protocols.ss7.map.api.MAPApplicationContextVersion)17 UserData (org.restcomm.protocols.ss7.map.api.smstpdu.UserData)17