| 110 | } |
| 111 | |
| 112 | TLMessage *SMS::parseTPDU(const TLFrame& TPDU, bool directionUplink) |
| 113 | { |
| 114 | LOG(DEBUG) << "SMS: parseTPDU MTI=" << TPDU.MTI(); |
| 115 | if (directionUplink) { |
| 116 | // Handle just the uplink cases. |
| 117 | switch ((TLMessage::MessageType)TPDU.MTI()) { |
| 118 | case TLMessage::DELIVER_REPORT: |
| 119 | case TLMessage::STATUS_REPORT: |
| 120 | // FIXME -- Not implemented yet. |
| 121 | LOG(WARNING) << "Unsupported TPDU type: " << (TLMessage::MessageType)TPDU.MTI(); |
| 122 | return NULL; |
| 123 | case TLMessage::SUBMIT: { |
| 124 | TLSubmit *submit = new TLSubmit; |
| 125 | submit->parse(TPDU); |
| 126 | LOG(INFO) << "SMS SMS-SUBMIT " << *submit; |
| 127 | return submit; |
| 128 | } |
| 129 | default: |
| 130 | return NULL; |
| 131 | } |
| 132 | } else { |
| 133 | switch ((TLMessage::MessageType)TPDU.MTI()) { |
| 134 | // 10-2013: Pat added the DELIVER which is the downlink message so we can parse it for reporting purposes. |
| 135 | case TLMessage::DELIVER: { |
| 136 | TLDeliver *deliver = new TLDeliver(TPDU); |
| 137 | return deliver; |
| 138 | } |
| 139 | default: |
| 140 | LOG(WARNING) << "parsing unsupported TPDU type: " << (TLMessage::MessageType)TPDU.MTI(); |
| 141 | return NULL; |
| 142 | } |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | void CPMessage::text(ostream& os) const |
| 147 | { |