2386
|
0 |
0 |
{1 => {cmd => 'bind_receiver', decode => sub {
package Net::SMPP;
my $pdu = shift();
my $me = shift();
($$pdu{'system_id'}) = unpack('Z*', $$pdu{'data'});
my $len = length($$pdu{'system_id'}) + 1;
($$pdu{'password'}) = unpack('Z*', substr($$pdu{'data'}, $len));
$len += length($$pdu{'password'}) + 1;
($$pdu{'system_type'}) = unpack('Z*', substr($$pdu{'data'}, $len));
$len += length($$pdu{'system_type'}) + 1;
($$pdu{'interface_version'}, $$pdu{'addr_ton'}, $$pdu{'addr_npi'}, $$pdu{'address_range'}) = unpack('CCCZ*', substr($$pdu{'data'}, $len));
$len += 3 + length($$pdu{'address_range'}) + 1;
if (${*$me;}{'smpp_version'} == 64) {
($$pdu{'facilities_mask'}) = unpack('N', substr($$pdu{'data'}, $len));
$len += 4;
};
return $len;
}
}, 11 => {cmd => 'outbind', decode => sub {
package Net::SMPP;
my $pdu = shift();
my $me = shift();
($$pdu{'system_id'}) = unpack('Z*', $$pdu{'data'});
my $len = length($$pdu{'system_id'}) + 1;
($$pdu{'password'}) = unpack('Z*', substr($$pdu{'data'}, $len));
return $len + length($$pdu{'password'}) + 1;
}
}, 2 => {cmd => 'bind_transmitter', decode => sub {
package Net::SMPP;
my $pdu = shift();
my $me = shift();
($$pdu{'system_id'}) = unpack('Z*', $$pdu{'data'});
my $len = length($$pdu{'system_id'}) + 1;
($$pdu{'password'}) = unpack('Z*', substr($$pdu{'data'}, $len));
$len += length($$pdu{'password'}) + 1;
($$pdu{'system_type'}) = unpack('Z*', substr($$pdu{'data'}, $len));
$len += length($$pdu{'system_type'}) + 1;
($$pdu{'interface_version'}, $$pdu{'addr_ton'}, $$pdu{'addr_npi'}, $$pdu{'address_range'}) = unpack('CCCZ*', substr($$pdu{'data'}, $len));
$len += 3 + length($$pdu{'address_range'}) + 1;
if (${*$me;}{'smpp_version'} == 64) {
($$pdu{'facilities_mask'}) = unpack('N', substr($$pdu{'data'}, $len));
$len += 4;
};
return $len;
}
}, 21 => {cmd => 'enquire_link', decode => sub {
package Net::SMPP;
return 0;
}
}, 2147483648 => {cmd => 'generic_nack', decode => sub {
package Net::SMPP;
return 0;
}
}, 2147483649 => {cmd => 'bind_receiver_resp', decode => sub {
package Net::SMPP;
my $pdu = shift();
my $me = shift();
($$pdu{'system_id'}) = unpack('Z*', $$pdu{'data'});
return length($$pdu{'system_id'}) + 1;
}
}, 2147483650 => {cmd => 'bind_transmitter_resp', decode => sub {
package Net::SMPP;
my $pdu = shift();
my $me = shift();
($$pdu{'system_id'}) = unpack('Z*', $$pdu{'data'});
return length($$pdu{'system_id'}) + 1;
}
}, 2147483651 => {cmd => 'query_sm_resp', decode => sub {
package Net::SMPP;
my $pdu = shift();
($$pdu{'message_id'}) = unpack('Z*', $$pdu{'data'});
my $len = length($$pdu{'message_id'}) + 1;
($$pdu{'final_date'}) = unpack('Z*', substr($$pdu{'data'}, $len));
$len += length($$pdu{'final_date'}) + 1;
($$pdu{'message_state'}, $$pdu{'error_code'}) = unpack('CC', substr($$pdu{'data'}, $len));
return $len + 1 + 1;
}
}, 2147483652 => {cmd => 'submit_sm_resp', decode => sub {
package Net::SMPP;
my $pdu = shift();
($$pdu{'message_id'}) = unpack('Z*', $$pdu{'data'});
return length($$pdu{'message_id'}) + 1;
}
}, 2147483653 => {cmd => 'deliver_sm_resp', decode => sub {
package Net::SMPP;
my $pdu = shift();
($$pdu{'message_id'}) = unpack('Z*', $$pdu{'data'});
return length($$pdu{'message_id'}) + 1;
}
}, 2147483654 => {cmd => 'unbind_resp', decode => sub {
package Net::SMPP;
return 0;
}
}, 2147483655 => {cmd => 'replace_sm_resp', decode => sub {
package Net::SMPP;
return 0;
}
}, 2147483656 => {cmd => 'cancel_sm_resp', decode => sub {
package Net::SMPP;
return 0;
}
}, 2147483657 => {cmd => 'bind_transceiver_resp', decode => sub {
package Net::SMPP;
my $pdu = shift();
my $me = shift();
($$pdu{'system_id'}) = unpack('Z*', $$pdu{'data'});
return length($$pdu{'system_id'}) + 1;
}
}, 2147483669 => {cmd => 'enquire_link_resp', decode => sub {
package Net::SMPP;
return 0;
}
}, 2147483681 => {cmd => 'submit_multi_resp', decode => sub {
package Net::SMPP;
my $pdu = shift();
($$pdu{'message_id'}) = unpack('Z*', $$pdu{'data'});
my $len = length($$pdu{'message_id'}) + 1;
($$pdu{'no_unsuccess'}) = unpack('C', substr($$pdu{'data'}, $len));
$$pdu{'num_unsuccess'} = $$pdu{'no_unsuccess'};
$len += 1;
for (my $i = 0; $i < $$pdu{'no_unsuccess'}; ++$i) {
($$pdu{'dest_addr_ton'}[$i], $$pdu{'dest_addr_npi'}[$i], $$pdu{'destination_addr'}[$i]) = unpack('CCZ*', substr($$pdu{'data'}, $len));
$len += 2 + length($$pdu{'destination_addr'}[$i]) + 1;
($$pdu{'error_status_code'}[$i]) = unpack('N', substr($$pdu{'data'}, $len));
$len += 4;
};
return $len;
}
}, 2147483907 => {cmd => 'data_sm_resp', decode => sub {
package Net::SMPP;
my $pdu = shift();
($$pdu{'message_id'}) = unpack('Z*', $$pdu{'data'});
return length($$pdu{'message_id'}) + 1;
}
}, 2147549184 => {cmd => 'generic_nack_v4', decode => sub {
package Net::SMPP;
return 0;
}
}, 2147549185 => {cmd => 'bind_receiver_resp_v4', decode => sub {
package Net::SMPP;
my $pdu = shift();
my $me = shift();
($$pdu{'system_id'}) = unpack('Z*', $$pdu{'data'});
my $len = length($$pdu{'system_id'}) + 1;
($$pdu{'facilities_mask'}) = unpack('N', substr($$pdu{'data'}, $len));
return $len + 4;
}
}, 2147549186 => {cmd => 'bind_transmitter_resp_v4', decode => sub {
package Net::SMPP;
my $pdu = shift();
my $me = shift();
($$pdu{'system_id'}) = unpack('Z*', $$pdu{'data'});
my $len = length($$pdu{'system_id'}) + 1;
($$pdu{'facilities_mask'}) = unpack('N', substr($$pdu{'data'}, $len));
return $len + 4;
}
}, 2147549187 => {cmd => 'query_sm_resp_v4', decode => sub {
package Net::SMPP;
my $pdu = shift();
($$pdu{'sc_msg_reference'}) = unpack('Z*', $$pdu{'data'});
my $len = length($$pdu{'sc_msg_reference'}) + 1;
($$pdu{'final_date'}) = unpack('Z*', substr($$pdu{'data'}, $len));
$len += length($$pdu{'final_date'}) + 1;
($$pdu{'message_status'}, $$pdu{'network_error_code'}) = unpack('CN', substr($$pdu{'data'}, $len));
$$pdu{'message_id'} = $$pdu{'sc_msg_reference'};
$$pdu{'message_state'} = $$pdu{'message_status'};
$$pdu{'error_code'} = $$pdu{'network_error_code'};
return $len + 1 + 4;
}
}, 2147549188 => {cmd => 'submit_sm_resp_v4', decode => sub {
package Net::SMPP;
my $pdu = shift();
($$pdu{'message_id'}) = unpack('Z*', $$pdu{'data'});
my $len = length($$pdu{'message_id'}) + 1;
($$pdu{'no_unsuccess'}) = unpack('n', substr($$pdu{'data'}, $len));
$$pdu{'num_unsuccess'} = $$pdu{'no_unsuccess'};
$len += 2;
for (my $i = 0; $i < $$pdu{'no_unsuccess'}; ++$i) {
($$pdu{'dest_addr_ton'}[$i], $$pdu{'dest_addr_npi'}[$i], $$pdu{'destination_addr'}[$i]) = unpack('CCZ*', substr($$pdu{'data'}, $len));
$len += 2 + length($$pdu{'destination_addr'}[$i]) + 1;
($$pdu{'error_status_code'}[$i]) = unpack('N', substr($$pdu{'data'}, $len));
$len += 4;
};
return $len;
}
}, 2147549189 => {cmd => 'deliver_sm_resp_v4', decode => sub {
package Net::SMPP;
return 0;
}
}, 2147549190 => {cmd => 'unbind_resp_v4', decode => sub {
package Net::SMPP;
return 0;
}
}, 2147549191 => {cmd => 'replace_sm_resp_v4', decode => sub {
package Net::SMPP;
return 0;
}
}, 2147549192 => {cmd => 'cancel_sm_resp_v4', decode => sub {
package Net::SMPP;
return 0;
}
}, 2147549193 => {cmd => 'delivery_receipt_resp_v4', decode => sub {
package Net::SMPP;
return 0;
}
}, 2147549194 => {cmd => 'enquire_link_resp_v4', decode => sub {
package Net::SMPP;
return 0;
}
}, 258 => {cmd => 'alert_notification', decode => sub {
package Net::SMPP;
my $pdu = shift();
my $len = decode_source_addr($pdu, $$pdu{'data'});
($$pdu{'esme_addr_ton'}, $$pdu{'esme_addr_npi'}, $$pdu{'esme_addr'}) = unpack('CCZ*', substr($$pdu{'data'}, $len));
return $len + 1 + 1 + length($$pdu{'esme_addr'}) + 1;
}
}, 259 => {cmd => 'data_sm', decode => sub {
package Net::SMPP;
my $pdu = shift();
($$pdu{'service_type'}) = unpack('Z*', $$pdu{'data'});
my $len = length($$pdu{'service_type'}) + 1;
$len += decode_source_and_destination($pdu, substr($$pdu{'data'}, $len));
($$pdu{'esm_class'}, $$pdu{'registered_delivery'}, $$pdu{'data_coding'}) = unpack('CCC', substr($$pdu{'data'}, $len));
return $len + 1 + 1 + 1;
}
}, 3 => {cmd => 'query_sm', decode => sub {
package Net::SMPP;
my $pdu = shift();
($$pdu{'message_id'}) = unpack('Z*', $$pdu{'data'});
my $len = length($$pdu{'message_id'}) + 1;
$len += decode_source_addr($pdu, substr($$pdu{'data'}, $len));
return $len;
}
}, 33 => {cmd => 'submit_multi', decode => sub {
package Net::SMPP;
my $pdu = shift();
($$pdu{'service_type'}) = unpack('Z*', $$pdu{'data'});
my $len = length($$pdu{'service_type'}) + 1;
$len += decode_source_addr($pdu, substr($$pdu{'data'}, $len));
($$pdu{'number_of_dests'}) = unpack('C', substr($$pdu{'data'}, $len));
$len += 1;
for (my $i = 0; $i < $$pdu{'number_of_dests'}; ++$i) {
($$pdu{'dest_flag'}[$i]) = unpack('C', substr($$pdu{'data'}, $len++));
if ($$pdu{'dest_flag'}[$i] == 1) {
($$pdu{'dest_addr_ton'}[$i], $$pdu{'dest_addr_npi'}[$i], $$pdu{'destination_addr'}[$i]) = unpack('CCZ*', substr($$pdu{'data'}, $len));
$len += 2 + length($$pdu{'destination_addr'}[$i]) + 1;
}
elsif ($$pdu{'dest_flag'}[$i] == 2) {
$$pdu{'dest_addr_ton'}[$i] = 0;
$$pdu{'dest_addr_npi'}[$i] = 0;
($$pdu{'destination_addr'}[$i]) = unpack('Z*', substr($$pdu{'data'}, $len));
$len += length($$pdu{'destination_addr'}[$i]) + 1;
}
else {
warn "Unknown multidest flag: $$pdu{'dest_flag'} (4.5.1.1, p. 75)";
};
};
($$pdu{'esm_class'}, $$pdu{'protocol_id'}, $$pdu{'priority_flag'}, $$pdu{'schedule_delivery_time'}) = unpack('CCCZ*', substr($$pdu{'data'}, $len));
$len += 3 + length($$pdu{'schedule_delivery_time'}) + 1;
($$pdu{'validity_period'}) = unpack('Z*', substr($$pdu{'data'}, $len));
$len += length($$pdu{'validity_period'}) + 1;
my $sm_length;
($$pdu{'registered_delivery'}, $$pdu{'replace_if_present_flag'}, $$pdu{'data_coding'}, $$pdu{'sm_default_msg_id'}, $sm_length) = unpack('CCCCC', substr($$pdu{'data'}, $len));
$len += 5;
($$pdu{'short_message'}) = unpack("a$sm_length", substr($$pdu{'data'}, $len));
return $len + $sm_length;
}
}, 4 => {cmd => 'submit_sm', decode => sub {
package Net::SMPP;
my $pdu = shift();
($$pdu{'service_type'}) = unpack('Z*', $$pdu{'data'});
my $len = length($$pdu{'service_type'}) + 1;
$len += decode_source_and_destination($pdu, substr($$pdu{'data'}, $len));
($$pdu{'esm_class'}, $$pdu{'protocol_id'}, $$pdu{'priority_flag'}, $$pdu{'schedule_delivery_time'}) = unpack('CCCZ*', substr($$pdu{'data'}, $len));
$len += 3 + length($$pdu{'schedule_delivery_time'}) + 1;
($$pdu{'validity_period'}) = unpack('Z*', substr($$pdu{'data'}, $len));
$len += length($$pdu{'validity_period'}) + 1;
my $sm_length;
($$pdu{'registered_delivery'}, $$pdu{'replace_if_present_flag'}, $$pdu{'data_coding'}, $$pdu{'sm_default_msg_id'}, $sm_length) = unpack('CCCCC', substr($$pdu{'data'}, $len));
$len += 5;
($$pdu{'short_message'}) = unpack("a$sm_length", substr($$pdu{'data'}, $len));
return $len + $sm_length;
}
}, 5 => {cmd => 'deliver_sm', decode => sub {
package Net::SMPP;
my $pdu = shift();
($$pdu{'service_type'}) = unpack('Z*', $$pdu{'data'});
my $len = length($$pdu{'service_type'}) + 1;
$len += decode_source_and_destination($pdu, substr($$pdu{'data'}, $len));
($$pdu{'esm_class'}, $$pdu{'protocol_id'}, $$pdu{'priority_flag'}, $$pdu{'schedule_delivery_time'}) = unpack('CCCZ*', substr($$pdu{'data'}, $len));
$len += 3 + length($$pdu{'schedule_delivery_time'}) + 1;
($$pdu{'validity_period'}) = unpack('Z*', substr($$pdu{'data'}, $len));
$len += length($$pdu{'validity_period'}) + 1;
my $sm_length;
($$pdu{'registered_delivery'}, $$pdu{'replace_if_present_flag'}, $$pdu{'data_coding'}, $$pdu{'sm_default_msg_id'}, $sm_length) = unpack('CCCCC', substr($$pdu{'data'}, $len));
$len += 5;
($$pdu{'short_message'}) = unpack("a$sm_length", substr($$pdu{'data'}, $len));
return $len + $sm_length;
}
}, 6 => {cmd => 'unbind', decode => sub {
package Net::SMPP;
return 0;
}
}, 65537 => {cmd => 'bind_receiver_v4', decode => sub {
package Net::SMPP;
my $pdu = shift();
my $me = shift();
($$pdu{'system_id'}) = unpack('Z*', $$pdu{'data'});
my $len = length($$pdu{'system_id'}) + 1;
($$pdu{'password'}) = unpack('Z*', substr($$pdu{'data'}, $len));
$len += length($$pdu{'password'}) + 1;
($$pdu{'system_type'}) = unpack('Z*', substr($$pdu{'data'}, $len));
$len += length($$pdu{'system_type'}) + 1;
($$pdu{'interface_version'}, $$pdu{'addr_ton'}, $$pdu{'addr_npi'}, $$pdu{'address_range'}) = unpack('CCCZ*', substr($$pdu{'data'}, $len));
$len += 3 + length($$pdu{'address_range'}) + 1;
if (${*$me;}{'smpp_version'} == 64) {
($$pdu{'facilities_mask'}) = unpack('N', substr($$pdu{'data'}, $len));
$len += 4;
};
return $len;
}
}, 65538 => {cmd => 'bind_transmitter_v4', decode => sub {
package Net::SMPP;
my $pdu = shift();
my $me = shift();
($$pdu{'system_id'}) = unpack('Z*', $$pdu{'data'});
my $len = length($$pdu{'system_id'}) + 1;
($$pdu{'password'}) = unpack('Z*', substr($$pdu{'data'}, $len));
$len += length($$pdu{'password'}) + 1;
($$pdu{'system_type'}) = unpack('Z*', substr($$pdu{'data'}, $len));
$len += length($$pdu{'system_type'}) + 1;
($$pdu{'interface_version'}, $$pdu{'addr_ton'}, $$pdu{'addr_npi'}, $$pdu{'address_range'}) = unpack('CCCZ*', substr($$pdu{'data'}, $len));
$len += 3 + length($$pdu{'address_range'}) + 1;
if (${*$me;}{'smpp_version'} == 64) {
($$pdu{'facilities_mask'}) = unpack('N', substr($$pdu{'data'}, $len));
$len += 4;
};
return $len;
}
}, 65539 => {cmd => 'query_sm_v4', decode => sub {
package Net::SMPP;
my $pdu = shift();
($$pdu{'message_id'}) = unpack('Z*', $$pdu{'data'});
my $len = length($$pdu{'message_id'}) + 1;
$len += decode_source_and_destination($pdu, substr($$pdu{'data'}, $len));
return $len;
}
}, 65540 => {cmd => 'submit_sm_v4', decode => sub {
package Net::SMPP;
my $pdu = shift();
($$pdu{'message_class'}, $$pdu{'source_addr_ton'}, $$pdu{'source_addr_npi'}, $$pdu{'source_addr'}) = unpack('nCCZ*', $$pdu{'data'});
my $len = 4 + length($$pdu{'source_addr'}) + 1;
($$pdu{'number_of_dests'}) = unpack('N', substr($$pdu{'data'}, $len));
$len += 4;
for (my $i = 0; $i < $$pdu{'number_of_dests'}; ++$i) {
($$pdu{'dest_addr_ton'}[$i], $$pdu{'dest_addr_npi'}[$i], $$pdu{'destination_addr'}[$i]) = unpack('CCZ*', substr($$pdu{'data'}, $len));
$len += 2 + length($$pdu{'destination_addr'}[$i]) + 1;
};
($$pdu{'messaging_mode'}, $$pdu{'msg_reference'}) = unpack('CZ*', substr($$pdu{'data'}, $len));
$len += 1 + length($$pdu{'msg_reference'}) + 1;
($$pdu{'telematic_interworking'}, $$pdu{'priority_level'}, $$pdu{'schedule_delivery_time'}) = unpack('CCZ*', substr($$pdu{'data'}, $len));
$len += 2 + length($$pdu{'schedule_delivery_time'}) + 1;
warn "d decode_submit ${len}: " . hexdump(substr($$pdu{'data'}, $len)) if $Net::SMPP::trace;
my $sm_length;
($$pdu{'validity_period'}, $$pdu{'registered_delivery'}, $$pdu{'data_coding'}, $$pdu{'sm_default_msg_id'}, $sm_length) = unpack('nCCCn', substr($$pdu{'data'}, $len));
$len += 7;
($$pdu{'short_message'}) = unpack("a$sm_length", substr($$pdu{'data'}, $len));
$len += $sm_length;
warn "e decode_submit ($$pdu{'short_message'}) ${len}: " . hexdump(substr($$pdu{'data'}, $len)) if $Net::SMPP::trace;
$$pdu{'service_type'} = $$pdu{'message_class'};
$$pdu{'esm_class'} = $$pdu{'messaging_mode'};
$$pdu{'protocol_id'} = $$pdu{'telematic_interworking'};
$$pdu{'priority_flag'} = $$pdu{'priority_level'};
return $len;
}
}, 65541 => {cmd => 'deliver_sm_v4', decode => sub {
package Net::SMPP;
my $pdu = shift();
my $len = decode_source_and_destination($pdu, $$pdu{'data'});
($$pdu{'msg_reference'}) = unpack('Z9', substr($$pdu{'data'}, $len));
$len += 9;
($$pdu{'message_class'}, $$pdu{'telematic_interworking'}, $$pdu{'priority_level'}, $$pdu{'submit_time_stamp'}) = unpack('nCCZ17', substr($$pdu{'data'}, $len));
$len += 21;
my $sm_length;
($$pdu{'data_coding'}, $sm_length) = unpack('Cn', substr($$pdu{'data'}, $len));
$len += 3;
($$pdu{'short_message'}) = unpack("a$sm_length", substr($$pdu{'data'}, $len));
$len += $sm_length;
$$pdu{'esm_class'} = $$pdu{'message_class'};
$$pdu{'protocol_id'} = $$pdu{'telematic_interworking'};
$$pdu{'priority_flag'} = $$pdu{'priority_level'};
$$pdu{'schedule_delivery_time'} = $$pdu{'submit_time_stamp'};
return $len;
}
}, 65542 => {cmd => 'unbind_v4', decode => sub {
package Net::SMPP;
return 0;
}
}, 65543 => {cmd => 'replace_sm_v4', decode => sub {
package Net::SMPP;
my $pdu = shift();
($$pdu{'msg_reference'}) = unpack('Z*', $$pdu{'data'});
my $len = length($$pdu{'msg_reference'}) + 1;
$len += decode_source_and_destination($pdu, substr($$pdu{'data'}, $len));
($$pdu{'schedule_delivery_time'}) = unpack('Z*', substr($$pdu{'data'}, $len));
$len += length($$pdu{'schedule_delivery_time'}) + 1;
my $sm_length;
($$pdu{'validity_period'}, $$pdu{'registered_delivery_mode'}, $$pdu{'data_coding'}, $$pdu{'sm_default_msg_id'}, $sm_length) = unpack('nCCCn', substr($$pdu{'data'}, $len));
$len += 7;
($$pdu{'short_message'}) = unpack("a$sm_length", substr($$pdu{'data'}, $len));
$$pdu{'message_id'} = $$pdu{'msg_reference'};
$$pdu{'registered_delivery'} = $$pdu{'registered_delivery_mode'};
return $len + $sm_length;
}
}, 65544 => {cmd => 'cancel_sm_v4', decode => sub {
package Net::SMPP;
my $pdu = shift();
my $me = shift();
my $len = 0;
if (${*$me;}{'smpp_version'} == 64) {
($$pdu{'service_type'}) = unpack('n', $$pdu{'data'});
$len += 2;
}
else {
($$pdu{'service_type'}) = unpack('Z*', $$pdu{'data'});
$len += length($$pdu{'service_type'}) + 1;
};
($$pdu{'message_id'}) = unpack('Z*', substr($$pdu{'data'}, $len));
$len += length($$pdu{'message_id'}) + 1;
$len += decode_source_and_destination($pdu, substr($$pdu{'data'}, $len));
$$pdu{'message_class'} = $$pdu{'service_type'};
return $len;
}
}, 65545 => {cmd => 'delivery_receipt_v4', decode => sub {
package Net::SMPP;
my $pdu = shift();
my $len = decode_source_and_destination($pdu, $$pdu{'data'});
($$pdu{'msg_reference'}) = unpack('Z*', substr($$pdu{'data'}, $len));
$len += length($$pdu{'msg_reference'}) + 1;
($$pdu{'num_msgs_submitted'}, $$pdu{'num_msgs_delivered'}, $$pdu{'submit_date'}) = unpack('NNZ*', substr($$pdu{'data'}, $len));
$len += 8 + length($$pdu{'submit_date'}) + 1;
($$pdu{'done_date'}) = unpack('Z*', substr($$pdu{'data'}, $len));
$len += length($$pdu{'done_date'}) + 1;
my $sm_length;
($$pdu{'message_state'}, $$pdu{'network_error_code'}, $$pdu{'data_coding'}, $sm_length) = unpack('NNCn', substr($$pdu{'data'}, $len));
$len += 11;
($$pdu{'short_message'}) = unpack("a$sm_length", substr($$pdu{'data'}, $len));
return $len + $sm_length;
}
}, 65546 => {cmd => 'enquire_link_v4', decode => sub {
package Net::SMPP;
return 0;
}
}, 65547 => {cmd => 'outbind_v4', decode => sub {
package Net::SMPP;
my $pdu = shift();
my $me = shift();
($$pdu{'password'}) = unpack('Z*', $$pdu{'data'});
return length($$pdu{'password'}) + 1;
}
}, 7 => {cmd => 'replace_sm', decode => sub {
package Net::SMPP;
my $pdu = shift();
($$pdu{'message_id'}) = unpack('Z*', $$pdu{'data'});
my $len = length($$pdu{'message_id'}) + 1;
$len += decode_source_addr($pdu, substr($$pdu{'data'}, $len));
($$pdu{'schedule_delivery_time'}) = unpack('Z*', substr($$pdu{'data'}, $len));
$len += length($$pdu{'schedule_delivery_time'}) + 1;
($$pdu{'validity_period'}) = unpack('Z*', substr($$pdu{'data'}, $len));
$len += length($$pdu{'validity_period'}) + 1;
my $sm_length;
($$pdu{'registered_delivery'}, $$pdu{'sm_default_msg_id'}, $sm_length) = unpack('CCC', substr($$pdu{'data'}, $len));
$len += 3;
($$pdu{'short_message'}) = unpack("a$sm_length", substr($$pdu{'data'}, $len));
return $len + $sm_length;
}
}, 8 => {cmd => 'cancel_sm', decode => sub {
package Net::SMPP;
my $pdu = shift();
my $me = shift();
my $len = 0;
if (${*$me;}{'smpp_version'} == 64) {
($$pdu{'service_type'}) = unpack('n', $$pdu{'data'});
$len += 2;
}
else {
($$pdu{'service_type'}) = unpack('Z*', $$pdu{'data'});
$len += length($$pdu{'service_type'}) + 1;
};
($$pdu{'message_id'}) = unpack('Z*', substr($$pdu{'data'}, $len));
$len += length($$pdu{'message_id'}) + 1;
$len += decode_source_and_destination($pdu, substr($$pdu{'data'}, $len));
$$pdu{'message_class'} = $$pdu{'service_type'};
return $len;
}
}, 9 => {cmd => 'bind_transceiver', decode => sub {
package Net::SMPP;
my $pdu = shift();
my $me = shift();
($$pdu{'system_id'}) = unpack('Z*', $$pdu{'data'});
my $len = length($$pdu{'system_id'}) + 1;
($$pdu{'password'}) = unpack('Z*', substr($$pdu{'data'}, $len));
$len += length($$pdu{'password'}) + 1;
($$pdu{'system_type'}) = unpack('Z*', substr($$pdu{'data'}, $len));
$len += length($$pdu{'system_type'}) + 1;
($$pdu{'interface_version'}, $$pdu{'addr_ton'}, $$pdu{'addr_npi'}, $$pdu{'address_range'}) = unpack('CCCZ*', substr($$pdu{'data'}, $len));
$len += 3 + length($$pdu{'address_range'}) + 1;
if (${*$me;}{'smpp_version'} == 64) {
($$pdu{'facilities_mask'}) = unpack('N', substr($$pdu{'data'}, $len));
$len += 4;
};
return $len;
}
}}->{$$me{'cmd'}} || {'cmd', sprintf('Unknown(0x%08X)', $$me{'cmd'})} |