I am using the OnlineCity SMPP client lib for sending SMS. It was working fine. But as per the new guideline of TRAI, we need to add the following new TLV parameters while sending SMS
group = smpp-tlv
name = EntityID
tag = 0x1400
type = octetstring
length = 30
smsc-id = ***
I tried this
// Prepare message
$ENTITY_ID = new SmppTag(0x1400, '****************');
$tags = array($ENTITY_ID);
$from = new SmppAddress($SMS_Params['senderid'],SMPP::TON_ALPHANUMERIC);
$to = new SmppAddress($SMS_Params['phone'],SMPP::TON_INTERNATIONAL,SMPP::NPI_E164);
$encodedMessage = utf8_encode($SMS_Params['message']);
// Send
$return_data = $smpp->sendSMS($from,$to,$encodedMessage,$tags);
I got the success response but didn't get any SMS. I checked with my smpp provider. They said that the additional TLV parameter is not there and that's why the SMS is not sent.
Do you guys have any idea, can we do it in my current code based on onlinecity library or should I do something else?.
Remove "+(self::$sms_null_terminate_octetstrings ? 1 : 0)" from smppclient.class.php file
Actual Code : $pdu = pack('a1cca'.(strlen($source->value)+1).'cca'.(strlen($destination->value)+1).'ccc'.($scheduleDeliveryTime ? 'a16x' : 'a1').($validityPeriod ? 'a16x' : 'a1').'ccccca'.(strlen($short_message)+(self::$sms_null_terminate_octetstrings ? 1 : 0))
Updated Code :
$pdu = pack('a1cca'.(strlen($source->value)+1).'cca'.(strlen($destination->value)+1).'ccc'.($scheduleDeliveryTime ? 'a16x' : 'a1').($validityPeriod ? 'a16x' : 'a1').'ccccca'.(strlen($short_message))