PAMI\Message\Action\VGSMSMSTxAction::setConcatTotalMsg PHP Method

setConcatTotalMsg() public method

Sets X-SMS-Concatenate-Total-Messages. Optional. Should be set with setConcatRefId and setConcatSeqNum
public setConcatTotalMsg ( $totalmsg ) : void
return void
    public function setConcatTotalMsg($totalmsg)
    {
        $this->setKey('X-SMS-Concatenate-Total-Messages', $totalmsg);
    }

Usage Example

Example #1
0
try {
    $options = array('host' => $argv[1], 'port' => $argv[2], 'username' => $argv[3], 'secret' => $argv[4], 'connect_timeout' => 60, 'read_timeout' => 60);
    $a = new ClientImpl($options);
    $a->registerEventListener(new A());
    $a->open();
    // SMS
    $sms = new VGSMSMSTxAction();
    $sms->setContentType('text/plain; charset=ASCII');
    $msg = $argv[5];
    $phone = $argv[6];
    $sms->setContent($msg);
    $sms->setTo($phone);
    // SMS multipart MSG - This is used to send 1 big message splitted in several parts, up to 255 messages
    if ($argv[7] == 1) {
        $sms->setConcatRefId('58');
        $sms->setConcatTotalMsg('2');
        $sms->setConcatSeqNum('1');
        $a->send($sms);
        $sms->setContent('---Testing Multipart message ');
        $sms->setTo($phone);
        $sms->setConcatRefId('58');
        $sms->setConcatTotalMsg('2');
        $sms->setConcatSeqNum('2');
    }
    $a->send($sms);
    $time = time();
    while (true) {
        usleep(1000);
        // 1ms delay
        // Since we declare(ticks=1) at the top, the following line is not necessary
        $a->process();