'2.14
'-----------------------------------------------------------------------------------------
'Session Initiation Protocol (SIP)
'
'      13.09.2010 ASI  ! updated to use labels below 32768 for BCL 1.5 compatibility
'      01.09      ASI  ! clean history (last version 0.28/13.092010
'                      ! start new version numbering from 1.00
' 1.00 02.11.2010 ASI  ! updated to the new style webUI
'                      + added Ann155 speaker and mic supervision on the home page
'                      ! fixed to recognise the keypress on Ann155
'                      ! started using long variable names (BCL 1.5 feature)
'                      ! set last 32 bits from the MAC address as RTP SSRC
'                      + added registration status
'      03.11.2010 ASI  ! simplified the Basic menu (no submenus)
'                      ! fix a bug in timer 4 and 5 sharing
'                      ! fixing some typos in the webUI help files
'      10.11.2010 ASI  ! fixed wrong remote party ID display in case of incoming call
'                      ! added missing function call in the profile selection webUI
'                        scripts
'                      ! fixed random sip call at boot with the COM port init string
'                        as remote party ID 
'                      ! fixed broken reload of the home page when speaker test is 
'                        started from the webUI
'      12.10.2010 ASI  + added close call on level feature
'   16-18.10.2010 ASI  ! fixed wrong dialing on X8 input even if the ID is not set 
'                      + added support for PS16
'                      - removed correction for detected inputs on Ann 155 (fixed 
'                        in the driver)
'                      ! updated to check for X8 every 15 seconds instead of every
'                        second	
'      15.12.2010 ASI  + added support for the IP Speaker
' 1.01 05.01.2011 ASI  ! fixed typos in the webUI
'	               ! fixed nonworking SonicIP control from the webUI
'                      + added syslog server configuration entry
'                      + added Reset  function to the security options
' 1.02 12.01.2011 ASI  ! fixed bug 069.26: Auto pick-up on timeout does not work 
'                        reliably
' 1.03 17.01.2011 ASI  ! optimised X8 keypress scan and receiving audio procedures
' 1.04 31.01.2011 ASI  + added HDX mode and AI Phone support
'                      ! fixed the names of the pickup modes in the webUI
'                      - removed defs.bcl
'                      ! fixed bug 069.27: BGM stops if the device is not registered
' 1.05 03.02.2011 ASI  ! fixed minor issues rendering the webUI in IE8
'                      ! fixed autohangup issues for outgoing and incoming calls
' 1.06 08.02.2011 ASI  ! fixed non blinking LEDs on PS16
' 1.07 21.02.2011 ASI  ! fixed bug 069.28: The CGI interface hangs after the first CGI 
'                        command
'                      - removed the unconditional switch off of relay1 at call close
' 1.08 30.03.2011 ASI  ! improved SIP call audio handling for lower latency
'                      ! updated to use LINK command for BGM
'                      ! fixed bug 069.30: No busy tone sent if the SIP client is in
'                        a call and a third party dials in
'                      + new feature 069.29: notification audio messaging
'                      - removed X8 check every 15 seconds after boot
'                      + modified command API interface to use own buffer variables
'                        to avoid variable sharing conflicts
'                      ! modified not to stop the application if BGM fails
'                      ! updated profiles help page
' 1.09 19.05.2011 ASI  ! fixed bug 069.31,069.37: Command interfaces do not work when 
'                        serial interface = OFF
'                      ! fixed bugs 069.32,33,34,35,36: Various problems related to
'                        notification messaging
'                      ! fixed bug 069.38: No pickup in P2P mode when "Debug messages" 
'                        setting is "OFF"
'                      ! fixed bug 069.40: No auto-answer set when selecting SIP Paging 
'                        Station profile in IE8 and Google Chrome browsers
'                      ! fixed bug 069.42: HTTP 200 OK is not send after processing of 
'                        some CGI commands
'                      ! fixed bug 069.43: The reverse channel of the serial tunnel, 
'                        opened with X command, does not work
'      20.05.2011 ASI  ! fixed wrong UDP control stream handle name:
'                        UDP_COMMAND_STREAM-->UDP_CONTROL_STREAM
'                      ! fixed typo in the if condition for enabling the relay on 
'                        incoming notification message
'                      ! declare undeclared variables
' 1.10 31.05.2011 ASI  ! fixed bug 069.44: Device homepage does not show indication
'                        when getting notification message
'                      ! fixed bug 069.45: In case of incoming call while the SIP 
'                        client is getting high priority message, the remote party ID 
'                        is displayed on the web page, and not cleared when the 
'                        notification message ends, and the SIP client goes in idle
'                      ! fixed bug 069.46: In SIP paging mode the BGM playback is not 
'                        restored when interrupted by a notification message
'                      ! fixed bug 069.47: Autohang-up on outgoing calls does not work 
'                        in SIP Monitor mode
'                      ! fixed bug 069.48: SIP URI is not displayed in the remote ID 
'                        in the browser for incoming calls
' 1.11 09.06.2011 ASI  ! fixed bug 069.49: There is no audio when  SIP client is run  
'                        as a Paging Station on Exstreamer 110/120/200
'                        fixed bug 069.50: The relay is not switched off after the end
'                        of the notification message
' 1.12 22.06.2011 ASI  ! fixed bug 069.51: BCL crashes when opening, or after closing 
'                        the notification message in SIP Monitoring Point mode
' 1.13 13.09.2011 ASI  + new feature 069.53: Implemented transparent passive TCP 
'                        serial GW
'      21.09.2011 ASi  ! fixed bug 069.52: Line-in not selectable in Monitoring Mode
' 1.14 26.10.2011 ASI  ! new feature 047.65: added DNS resolve if the registration 
'                        fails
'      30.11.2011 ASI  ! Fixed to disable the speaker in AI_Phone talk mode in door
'                        station profile
'      05.12.2011 ASI  ! Fixed to use autohangup=30 seconds as default in Door Station
'                        mode
'                      ! Fixed to "mute" the AI_Phone speaker using audio interface 
'                        balance setting when in encoding (talk) mode to avoid acoustic
'                        feedback
'                      + Added "Periodically Renew DNS" settings to the status page
'                      ! Fixed to check for output peak levels for AI_Phone only when
'                        the call is established
'                      ! Changed the default settings for Input Buffer, Notification 
'                        Message buffer, Trigger Level Timeout.
' 1.15 20.01.2012 ASI  + Prepare code to support for G.722 for the future song module 
'                        that will support it
'                      + new feature 069.56: Timeout on missing audio communication
'                      + new feature 069.57: Add a command to close the active call
'                      ! fixed bug 069.58:  Notification message remote party ID not 
'                        always correctly detected
' 2.00 14.02.2012 ASI  + Added support for IPAM-102 module and G.722 audio codec
' 2.01 05.03.2012 ASI  ! Rebuilding with the latest ABCL FW
'                      ! Fixing duplicate code created by the latest CVS merge
'                      ! Fixed bug 069.59: Notification message with RTP payload 100 
'                        (32 kHz uLaw) crashes the application
'                      ! Fixed bug 069.60: The call state of the SIP client is not 
'                        correctly displayed on the status page when getting 
'                        notification message
'                      + Added IPAM module detection
' 2.02 20.03.2012 ASI  ! Fixed AI_Phone direction switching to work with IPAM 102
' 2.03 23.03.2012 ASI  ! Fixed bug 069.62: The established call is not properly closed
'                        if SIP Client registration happens during the call
' 2.04 10.04.2012 ASI  ! Fixed bug 069.63: Closing established incoming call fails 
'                        with error 481
'                      ! Fixed bug 069.64. Closing established call fails when the 
'                        SIP messages from the remote party has the Contact field
'                        containing optional parameters
' 		           + New feature 069.65: Added support for PS1 buttons
'                      ! Fixed Bug 069.66: SDP description for DTMF detection is not 
'                        complete
' 2.05 18.04.2012 ASI  ! Fixed bug 069.68: SIP client does not accept any incoming 
'                        calls after it receives notification message during call 
'                        setup
'                      ! Fixed bug 069.69: Security options missing in the SIP 
'                        configuration status report
'                      ! Fixed bug 069.70: Call hang-up problem if OPTIONS message is 
'                        received between call dial and call pickup
'                      ! Fixed bug 069.71: The SIP client stops sending audio to the
'                        remote party after it rejects an incomig call during the 
'                        active call session
' 2.06 01.06.2012 ASI  + Added AEC
'                      + New feature 069.72: Support for multiple peers in P2P mode
'                      ! Fixed bug 069.73: BCL(58) warning when getting INVITE message 
'                        in P2P mode from SNOM-360 phone
'                      ! Fixed to ignore direct IP calls in SIP mode
'      05.06.2012 ASI  + Added handling of 486 Busy Here message
'                      ! Fixed to reject incoming calls with 486 when busy in another
'                        call
'                      ! Fixed bug 069.74: The SIP client does not clear the remote
'                        party ID if it rejects incoming call in "not callable" mode
'      06.06.2012 ASI  ! Fixed bug 069.75: The call ID of the remote party is not 
'                        correctly displayed on the PS16 LCD in some cases
'      08.08.2012 ASI  + New feature 069.76: Add the call ID in the FROM field of the 
'                        INVITE message also in P2P mode
' 2.06a 10.09.2012 ASI + Added support for Crestron CIP protocol and SIP PAGE via 
'                        Answer-Mode and Multicast-Mode fields in the INVITE message
' 2.07 06.09.2012 ASI  ! fixed bug 069.85: SIP client cannot initiate call on button 
'                        press when run on Annuncicom 60
' 2.08 12.09.2012 ASI  ! merged the changes to use LINK on FDX
'                      ! fixed not to use LINK in SIP Paging GW profile
'                      ! fixed to send fake RTP packets also when using LINK with
'                        decoder only devices
'      13.09.2012 ASI  + New feature 069.80: Add relay ON on incoming ring
'      14.09.2012 ASI  + new feature 069.77: Beep on call answer
'                      ! Fixed Bug 069.78: Half Duplex not fully implemented
'                      ! Fixed bug 069.84: Helptext for multipeer
'      17.09.2012 ASI  + Added beep on call answer also for incoming calls
'2.08C 18.09.2012 ASI  ! Merged the mainstream v2.08 changes into the RAVA branch
'2.09C 25.09.2012 ASi  ! fixed bug 069.86: Sometimes outgoing call cannot be properly 
'                        closed
'                      ! fixed bug 069.87: Audio stays open in listen mode after closing
'                        the call
'                      ! fixed bug 069.88: Incoming P2P call gets rejected when the SIP 
'                        client is set to "autoanswer" mode
'2.10C 02.10.2012 ASI  ! fixed bug 053.69: Large latency (more than 1 second) at the 
'                        first Audio Open with VS1063
'                      ! fixed not to ring in SIP Phone profile when Auto-answer field
'                        is used in the INVITE message (SIP multicast paging)
'                      ! fixed not to go in SIP QUERY state when trying to initiate
'                        call with empty ID
'2.11C 24.10.2012 ASI  - Removed PS16 support
'                      - Removed X8 support
'                      - Removed BGM
'                      - Removed SIP Paging End Point, SIP Monitoring Point and SIP
'                        Paging Gateway profiles
'                      - Removed notification messaging
'                      - Removed Serial GW
'                      + Added CIP IP table handling of maximum 8 entries
'                      + Added multiple outgoing INVITE handling
'                      + Added csqd and branch arrays for proper group call handling
'                      ! Fixed to show "Group Call" as remote party ID in case of a
'                        group call
'                      ! Fixed to fetch also the remote SIP port from messages 0xA9 
'                        and 0xA7
'                      ! Removed the limitation to use fixed ports in P2P mode
'                      ! Fixed first CANCEL not being sent
'      25.10.2012 ASI  ! Cleaning up the code and the HTML files
'                      ! Make the relay on call answer, on call ring, and door open
'                        mutually exclusive
'                      - Disabled AI_Phone functionality
'      26.10.2012 ASI  ! Adapted factory defaults
'                      + Added independent temp variables for the cut function
'      29.10.2012 ASI  ! Fixed SIP group list parsing in the received 0xA8 message
'                      ! Fixed to properly close on timeout a group initiated call
'                      ! Fixed not to hang up an established call on button press in 
'                        doorstation profile
'2.12C 04.03.2013 ASI  ! Improved the CANCEL handling for CIP group call (120.02)
'                        Fixed stream timeout detection
'                        Fixed bug 069.95: Auto hangup timer is not stopped when the 
'                        outgoing call is rejected from the remote party
'                        Fixed bug 069.96: SIP password entry is disabled when 
'                        switching from P2P to SIP mode from the Advanced Settings
'2.12D 03.04.2013 ASI  ! Fixed to clear the To: field array before starting a group
'                        call
'      08.04.2013 ASI  ! Fixed to clear the call IDs array before starting a group 
'                        call
'2.13C 11.11.2013 ASI  + Upgraded to the latest ABCL FW
'                      ! fixed bug 117.15: Codec bug and consequent BCL crash loop
'                      ! fixed bug 117.16: Processing received CGI command can cause 
'                        BCL restart
'                      ! fixed bug 117.17: Auto answering incoming call on timeout  can 
'                        cause BCL crash
'                      ! fixed bug 120.06: BCL string size warning with some IP addresses
'2.13D 10.06.2014 ASI  + New feature 120.08: Support up to 16 CIP peers in the IP table
'                      ! Fixed bug 120.09: Improved the AEC performance by forcing the 
'                        audio interface to work without reopening
'      12.06.2014 ASI  ! Fixed bug 120.10: Direct call fails with some IP addresses
'2.13E 18.07.2014 ASI  ! Fixed to reopen the audio at boot to avoid distorted G.722 
'                        encoding
'                      ! Fixed issue with empty IP and port when sending RINGING 180
'                        in P2P mode
'      23.07.2014 ASI  ! Added buffer flush before starting the RTP stream
'      28.08.2014 ASI  ! Adapted to compile with the new GIT repo
'      01.09.2014 ASI  + Added FW upgrade check utility to run when upgrading from
'                        versions prior to 2.13e
'      08.09.2014 ASI  ! Temporary disabled the G.722 codec
'                      ! Fixed to always reply to the configured CIP port instead of
'                        the detected remote port
'2.14  15.09.2015 ASI  ! fixed bug 117.23: BCL warning when the nonce is 64 bytes long
'                      ! fixed bug 117.24: Wrong value in the SDP description
'                      + new feature 117.28: Added support for the opaque parameter during 
'                        the authorization process for compatibility with Panasonic PBX
'                      ! fixed: Removed the quotes around MD5 when specifying the
'                        algorithm in the Authorization header
'      16.09.2015 ASI  + new feature HY-133: Add global call timeout
'                      ! fixed bug HY-134: Extend the auto hangup timer to 2 min
'      17.09.2015 ASI  ! fixed bug TW-13: UDP CIP messages processing is not optimal
'      28.09.2015 ASI  + added a ping before each INVITE in a single and group call to 
'                        improve the ARP resolution over WiFi
'                      ! Fixed bug TW-14: The SIP client attempts a group call even if 
'                        no peers are detected
'      01.10.2015 ASI  ! Moved the pings at the end of the CIP receive states (8 and 9)
'      03.11.2015 ASI  ! Fixed bug TW-15: No ringtone for outgoing call in HDX mode
'                    
'-----------------------------------------------------------------------------------------

