On 07/06/2009 03:00 PM, Joe Atzberger wrote:
Colin --
Koha SIP can handle dossy ^M line endings just fine. The detection of line endings is essentially delegated to the IO::Socket::INET and Socket modules with local $/ = "\012". The problem is that the protocol states that all messages end in a carrage return (hex 0d). There is no requirement to set linefeed as a terminator as it is not a message separator.
I don't see any reason for a client to send hex 0a or any other control character in any message field.
It's allowed so they will. I've seen it on a number of occasions.
I'm really talking about raw sockets implementations here. Although in my experience a "strictly conforming" implementation can handle communication over a telnet connection because basic telnet handles the extra overhead (the clients typically script the connection set up).
It may be possible to make the line-ending an attribute of the SIPconfig account, such that you could have a different one for a given SIP terminal. Or more likely, you can get the clients to send a different line ending.
This would be the way to go for flexibility. At the moment the assumption is interwoven with the protocol handling. I don't think expecting the clients to send different line endings is likely as these are usually closed (often windows) binaries. Its a lot easier to handle the vagaries of the clients in the perl code. Cheers Colin -- Colin Campbell Software Engineer, PTFS Europe Limited Content Management and Library Solutions +44 (0) 208 366 1295 (phone) +44 (0) 7759 633626 (mobile) colin.campbell@ptfs-europe.com skype: colin_campbell2 http://www.ptfs-europe.com