Replying to Robert Andersson:
> Hi
> When I send an OTA configuration from kannel it is always ignored by
> the phone (Sony Ericsson K500)

Teliasonera is about to release award-winning breaking-through
platform for OTA configuration? how sad.

> The same XML document works well with the NowSMS gateway.
> The message is splitted in two SMS.

--- cut here ---

# UDH - User Data Header
# Consists of 1-byte header length + TLV fields
# We will use this header:
#   0b - length
#     05 - UserPorts TAG
#       04 - UserPorts len
#       xxxx xxxx - Destination & Source port
#     00 - Segmented TAG
#       03 - Segmented len
#       04 - ??? id
#       xx - total fragments
#       xx - current fragment
#
# Second TLV field (segmentation info) can be omitted if we have only
# 1 segment,
# but if exist, it MUST BE second! Order is critical for many phones,
# along with
# port numbers.

def MakeUDH(Total, Current, SPort = 49154, DPort = 49999):
  if Total == 1:
    return '\x06\x05\x04' + struct.pack("!HH", DPort, SPort)
  else:
    return '\x0b\x05\x04' + struct.pack("!HH", DPort, SPort) + '\x00\x03\x04' + 
struct.pack("!BB", Total, Current)

def MakeUDH2(Total, Current):
    return '\x05\x00\x03\x04' + struct.pack("!BB", Total, Current)

--- cut here ---

I think this is enough info :)
P.S. The original message should be split in pieces of 119 bytes
length ;)


-- 
Paul P 'Stingray' Komkoff Jr // http://stingr.net/key <- my pgp key
 This message represents the official view of the voices in my head

Reply via email to