summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Duedal <hd@onlinecity.dk>2011-07-08 16:03:49 +0200
committerHans Duedal <hd@onlinecity.dk>2011-07-08 16:03:49 +0200
commit5dc4d005549bb51d6d7fa1532a3be142f301cc73 (patch)
tree43f670493e9f00f7e8fa89f544fb461603da2edc
parent3135000d915871450613b90be8cdff761d46e384 (diff)
downloadphp-smpp-5dc4d005549bb51d6d7fa1532a3be142f301cc73.zip
php-smpp-5dc4d005549bb51d6d7fa1532a3be142f301cc73.tar.gz
php-smpp-5dc4d005549bb51d6d7fa1532a3be142f301cc73.tar.bz2
More porting from namespaced code
-rw-r--r--README.md4
-rw-r--r--protocol/smppclient.class.php5
2 files changed, 5 insertions, 4 deletions
diff --git a/README.md b/README.md
index b015a18..cb4c0fb 100644
--- a/README.md
+++ b/README.md
@@ -41,8 +41,8 @@ $smpp->bindTransmitter("USERNAME","PASSWORD");
// Prepare message
$message = 'H€llo world';
$encodedMessage = GsmEncoder::utf8_to_gsm0338($message);
-$from = new \SMPP\Address(GsmEncoder::utf8_to_gsm0338('SMPP Tést'),SMPP\TON_ALPHANUMERIC);
-$to = new \SMPP\Address(4512345678,SMPP\TON_INTERNATIONAL,SMPP\NPI_E164);
+$from = new SmppAddress(GsmEncoder::utf8_to_gsm0338('SMPP Tést'),SMPP::TON_ALPHANUMERIC);
+$to = new SmppAddress(4512345678,SMPP::TON_INTERNATIONAL,SMPP::NPI_E164);
// Send
$smpp->sendSMS($from,$to,$encodedMessage,$tags);
diff --git a/protocol/smppclient.class.php b/protocol/smppclient.class.php
index 4c552f5..4e083e4 100644
--- a/protocol/smppclient.class.php
+++ b/protocol/smppclient.class.php
@@ -163,7 +163,8 @@ class SmppClient
if ($pdu === false) return false; // TSocket v. 0.6.0+ returns false on timeout
//check for enquire link command
if($pdu->id==SMPP::ENQUIRE_LINK){
- $this->sendPDU(SMPP::ENQUIRE_LINK_RESP, "", $pdu->sequence);
+ $response = new SmppPdu(SMPP::ENQUIRE_LINK_RESP, SMPP::ESME_ROK, $pdu->sequence, "\x00");
+ $this->sendPDU($response);
return false;
}
array_push($this->pdu_queue, $pdu);
@@ -264,7 +265,7 @@ class SmppClient
protected function submit_sm(SmppAddress $source, SmppAddress $destination, $short_message=null, $tags=null, $dataCoding=SMPP::DATA_CODING_DEFAULT, $priority=0x00, $scheduleDeliveryTime=null, $validityPeriod=null)
{
// Construct PDU with mandatory fields
- $pdu = pack('a1cca'.(strlen($source->value)+1).'cca'.(strlen($destination->value)+1).'ccc'.(self::$sms_schedule_delivery_time ? 'a16x' : 'a1').(self::$sms_validity_period ? 'a16x' : 'a1').'ccccca'.(strlen($short_message)+(self::$sms_null_terminate_octetstrings ? 1 : 0)),
+ $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)),
self::$sms_service_type,
$source->ton,
$source->npi,