ExtendedBlinkenIsdnProtocolEnglish

From BlinkenArea Wiki
Revision as of 20:54, 27 December 2011 by StefanSchuermans (talk | contribs) (register message needs port)
Jump to: navigation, search
Zur deutschsprachigen Version dieser Seite

back to summary

The extended Blinkenisdn protocol is used to transmit the state and the pressed keys of ISDN lines across a network. This is done by sending UDP packtes containing a line of plain text. UDP was chosen to make the response times as small as possible.

To achieve the needed bidirectional communication, the ISDN server must know the IP and the port of the client and the client must know the IP and the port of the ISDN server.

The server and the client periodically (e.g. every 10 seconds) send heartbeat messages to show that they are still alive. A timeout occurs after no heartbeat has been received for a longer time (e.g. 60 seconds). In this case, the server hangs up the ISDN-lines until a new client connects (or the same client reconnects) by sending heartbeat messages. The client will react as if all callers hung up, if it recognizes a server timeout.

Messages sent in the UDP packets are coded as an ASCII string, divided into two, three or four fields by colons, for example:

  • 0:heartbeat
  • 1:dtmf:#
  • 1:setup:foobar:1234567890

The first field specifies the number of the ISDN line as decimal number or is 0 for messages that do not correspond to a ISDN line like heartbeat messages. The type of message is specified in the second field. The third and fourth field depend on the type of the message.

Messages from server to client:

  • 0:heartbeat
    • sent periodically (e.g. every 20s) to show the client that the server is still alive
  • <line-no>:setup:<caller-id>:<phone-no>
    • sent if a connection from <caller-id> for phone number <phone-no> is comeing in on ISDN line <line-no>
  • <line-no>:connected
    • sent if the connection on ISDN line <line-no> is established
  • <line-no>:dtmf:<key>
    • sent if the key <key> on ISDN line <line-no> was pressed
    • <key> may be 0, ..., 9, *, #
  • <line-no>:onhook
    • sent if the connection on ISDN line <line-no> is closed (by the caller or by the server)

Messages from client to server:

  • 0:register:1234
    • 1234 is the port number the client is listening on
    • sent once at begin to register the client with the server
    • is repeated if no messages arrive from the server (e.g. after 5s)
  • 0:heartbeat
    • sent periodically (e.g. every 20s) to show the server that the client is still alive
  • <line-no>:accept
    • sent if the client wants to accept an incoming call on line <line-no>
  • <line-no>:hangup:18
    • sent if the client requests the server to hangup the ISDN line <line-no>
    • it is currently unknown what the 18 is good for...
  • <line-no>:play:<filename> or <line-no>:playbackground:<filename>
    • play specified file over telephone line