This should work to generate your ping packet:
def ping(identifier)
v = identifier
a = []
while v > 256 # extract bytes from the identifier
a << v % 256
v = v / 256
end
a << v % 256
prefix = [0] * (8-a.length) # pad the identifier
([0,0,0,0] + prefix + a).pack("C*") # pack the message as bytes
end
usage:
# random 8 byte number as a message identifier - compare this to any packet
# received to ensure you're receiving the correct response.
identifier = rand(256**8)
sock.send ping(identifier), 0
# you should get a response here if the mumble server is
# accessible and responding to pings.
sock.recvfrom(1)