Changes from version 1.8.2 to 1.9.0
-----------------------------------

- Added support for specifying the domain to use for selecting the
  mediaproxies (based on a patch by Kobi Eshun <kobi@sightspeed.com>)

Changes from version 1.8.1 to 1.8.2
-----------------------------------

- Added support to setup sessions by either caller or called as the initial
  INVITE may not contain a SDP body (Jeff Williams <jeffw@globaldial.com>)
- Added support to update the RTP stream sign-in addresses after re-INVITES
  (Jeff Williams <jeffw@globaldial.com>)


Changes from version 1.8.0 to 1.8.1
-----------------------------------

- Added User-Name attribute to the radius accounting Update request
  (freeradius needs it to be able to proxy the request)


Changes from version 1.7.2 to 1.8.0
-----------------------------------

- Added support for radius accounting. The accounting type can be specified
  in the configuration file. To support radius accounting the pyrad module
  must be installed (available at http://www.wiggy.net/code/pyrad/).
- The old boolead switch dbaccounting in the [Accounting] section of
  mediaproxy.ini was replaced by accounting which is a string specifying
  the accounting type to be used: none, radius or database.


Changes from version 1.7.1 to 1.7.2
-----------------------------------

- Changed how converters are specified for a mysql connection. It now uses
  the generic interface exposed by the connect() function. This fixed issues
  with incorrect encoding of literal values after some internal changes in
  MySQLdb.
- Added locking when creating a MySQL connection.
- Released the accounting component (read INSTALL for details and also for
  a note about a known issue and how to avoid it)


Changes from version 1.7.0 to 1.7.1
-----------------------------------

- Fixed the version number reported by sessions.py to be in sync with the
  other mediaproxy components.
- Fixed exception occuring when a mediaproxy server was not online to receive
  delete requests.
- Fixed recursion exception if no media proxies are defined for the domain
  in the defaultProxy option.


Changes from version 1.6.0 to 1.7.0
-----------------------------------

- Fixed problem where mediaproxy running under python2.2 would crash on
  receiving a request (python2.3 or newer was unaffected).
- Fixed problem with ignoring the saved accounting entries after restart.
- Fixed issue with forwarding to a mediaproxy server if there are multiple
  DNS A records for that mediaproxy server (next requests could have picked
  a different mediaproxy server which has no knowledge of the session).
- Moved accounting to dispatcher. Mediaproxy will return session closing
  information to the dispatcher when a stop request is made, as well as
  when a session does timeout (in this case mediaproxy will connect back
  to the dispatcher and signal the situation along with the session closing
  information). This can be used to record session stop information into
  the database even when the mediaproxy server doesn't have access to the
  database (the proxydispatcher always has as it runs on the same machine
  as SER). It also allows the proxy dispatcher to expire sessions that
  did timeout without having to wait a long period before deciding that
  the session did timeout.
  The queue with the notifications with the sessions that did timeout and
  need to be send to the dispatcher is saved on disk on program exit and
  restored on program start. Also if a notification fails for some reason
  it is put back in the queue and retried for as long as an hour. This
  mechanism makes the whole accounting of expired sessions to be very
  reliable.
- Simplified dispatcher startup.
- Generalized the database accounting code (this will make it easy to add
  adaptors for other databases than MySQL in the future if needed).
- Various simplifications to the code. Added a request class that handles
  requests received from SER/dispatcher as well as mediaproxy notifications
  for sessions that did timeout which is much easier to use and more clean.
- Added an exception tracing mechanism into the various threads that are
  run with the dispatcher or the mediaproxy server. This mechanism will
  guard against those threads dying, by printing traces of the uncaptured
  exceptions and then continuing execution. This avoids problems with the
  database accounting thread or the timeout notification thread dying and
  making the process lose those functionalities while still running the
  main tasks (dispatching and media relaying).
- Default to openser in the configuration options for socket's group
- Added extra protection against the control socket handler or the remote
  command handler dying due to exceptions. If this happens a new handler
  will be created to replace the old one and allow MediaProxy to continue
  to function. This should help (among others things) to avoid the infamous
  OverflowError problem which apparently was not completely eradicated by
  the previous fix.


Changes from version 1.5.0 to 1.6.0
-----------------------------------

- Mediaproxy handles the accounting stop records now in a new way which
  better integrates with SER and is able to more precisely identify how
  a call was ended (by BYE, by media timeout, ...)
- Better integration with CDRTool's normalization process.


Changes from version 1.4.2 to 1.5.0
-----------------------------------

- Do accounting in a separate thread to avoid mediaproxy to block from
  processing and create gaps in the media streams when the database is not
  responding immediately or is slow.
- Reduced default media port range to 60000-65000
- Improved logging of multiline messages to syslog
- Better detection for the path where mediaproxy is installed
- Simpler description of the configuration sections in the code


Changes from version 1.4.1 to 1.4.2
-----------------------------------

- Allow the called party to change the sign-in addresses of media streams.
  This is useful for example if the "200 OK" comes from a different device
  than the "183 Session in progress" (for example when a call to PSTN that
  is not answered is diverted to an announcement on a media server).


Changes from version 1.4.0 to 1.4.1
-----------------------------------

- Do not allow the control stream traffic to reset the idle timeout counter.
- Handle the situation where mediaproxy sometimes died with an OverflowError.
  This happened very rarely and the error backtrace doesn't make much sense.
  it seems like an obscure error in the underlying C select module and the
  OverflowError exception only seems to hide the real issue).


Changes from version 1.3.1 to 1.4.0
-----------------------------------

- The proxy dispatcher will test that a mediaproxy is actually responding
  to commands, not only that the mediaproxy TCP port is open, before choosing
  a mediaproxy to use. This solves issues with systems that die and stop
  responding, while the TCP port is still kept open by the operating system.
- Improved and optimized the mediaproxy server lookup procedure.
- Fixed bug with proxy dispatcher never actually running the timer that
  expired stale sessions.
- Rewrote the session expiration timer to run in a different thread at an
  interval that can be specified in the configuration. This will improve
  accuracy it as it no longer depends on receiving commands from SER to run.
- Also report proxy version with the status command to avoid the need to run
  the version command as well when requesting status (if version is needed).


Changes from version 1.3.0 to 1.3.1
-----------------------------------

- Added a new option named 'start' for both the dispatcher and the media proxy
  server in the configuration file to specify which component to start.
  The option is specified in the component's section in mediaproxy.ini
  By default both the dispatcher and the media proxy server are started.
- Renamed mediaproxy.ini to mediaproxy.ini.sample to avoid rewriting the
  configuration file on upgrades. For a first install the sample file should
  be renamed to mediaproxy.ini (see the INSTALL file)


Changes from version 1.2.1 to 1.3.0
-----------------------------------

- Only create a new session if a request belongs to the first INVITE
  (no longer creates new sessions on re-INVITEs)
- Replaced the many command line options in mediaproxy and proxydispatcher
  with options in a configuration file: mediaproxy.ini
  (the startup script in /etc/init.d/mediaproxy will need to be updated)
- Rewrote the mysql database connection and moved the database connection
  settings into the configuration file
- Restore the database connection if connection to mysql is lost.
- Improved the fake conversation generators to be more precise with the
  timing of the generated rtp streams
- Added option to the rtp generator to generate packets at constant
  intervals (default) or in bursts. Most phones send at constant intervals,
  but xten phones send in bursts.


Changes from version 1.2.0 to 1.2.1
-----------------------------------

- Fixed payload=101 (Telephone event) as being wrongly interpreted as codec
- Fixed memory leak caused by cyclic references between objects
- Fixed memory leak caused by exception tracing
- Fixed typo in variable name for counting idle time
- Fixed issue with jerky video


Changes from version 1.1.0 to 1.2.0
-----------------------------------

- Increased to 50 the number of maximum generated calls by one instance of
  rtpgenerator.py
- Fixed regular expresion to correctly identify older Grandstream ATA
  adaptors in the web page showing media sessions.
- Write call duration in any situation. It will be overwritten later by
  ser if everything goes well with the call, but if not we still have the
  call duration.
- Made the dispatcher to save the existing sessions on exit and restore them
  (if available) on start. This avoids problems if the dispatcher is restarted
  while there are running media sessions.
- Media type information is now received from the ser module (it is
  problematic to be determined from the payload type).
- If updating an accounting record doesn't modify anything, retry the query
  with to_tag='n/a' and call_duration=0. This will update accounting entries
  added by a failed request (such as a canceled one or one that did timeout)
- Added some more IP ranges to the non-public network classes
- Only allow 0.0.0.0 to put a call on hold after the session was started (both
  parties have sent their contact information with an INVITE and an OK).
  This fixes some Xten weirdness where the phone had sent 0.0.0.0 as the contact
  IP address from the first INVITE request.
- Added ability to add media streams to a conversation on the fly (used mostly
  by Video SIP clients).
- Correctly handle a RTP payload of 13 (Confort noise). This fixes some cases
  where for certain phones the codec for the call was shown as Unknown(13)
  instead of the real codec (seen with Cisco ATA 186).


Changes from version 1.0.1 to 1.1.0
-----------------------------------

- Renamed flags= to info= in the commands sent by mediaproxy.so
- Pass more information from mediaproxy.so to allow better statistics
  and unambiguous update of log record in mysql
- Use from and to tags when updating accounting info to avoid
  updating wrong records
- Show From/To and User-Agent in statistics web page
- Log User-Agent, codecs and stream types into mysql
- Display payload if codec is Unknown or Dynamic
- Handle network timeouts in dispatcher when doing DNS lookups
- Handle case with clients using public IPs behind NAT
- Reduced DNS timeout from 30 seconds to 7 seconds
- The dispatcher will forward calls for which none of the From/To domains are
  local to the default mediaproxy. The decision if to handle these calls is
  one that SER should make, not the dispatcher. The dispatcher should handle
  any call for which it was called. (This fixes the case when a call from
  outside is directed to a local user, but that user is mapped with ENUM to
  a remote address. After the ENUM mapping both From/Destination are remote
  but if SER decides to handle the call, so should mediaproxy).
- Changed session timer to be more precise (closer to the 1 second period)
- Simplified and made more flexible the MySQL accounting
- Simplified code in the RTPSession class (used properties for cleaner code)
- Log call time if call did timeout (to avoid not having the call duration in
  the accounting records when a BYE is never sent)
- Compute a 1 second average of traffic in mediaproxy (more reliable than the
  trivial bytes/time computed by the statistics script/web page)
- Simplified some code by using properties
- Added new 'summary' command that returns the number of sessions and
  the total traffic flowing through the proxy
- Optimised some sensitive areas of the code for speed
- Added option to forcefully close a session after a given time period. A value
  of 0 seconds means never (default). If this option is enabled it may reduce
  the number of simultaneous sessions that can be processed.
- New improved statistics web page.
- Show new 'on hold' status in statistics


Changes from version 1.0.0 to 1.0.1
-----------------------------------

- Fixed incorrect use of max() instead of min() to compute media stream
  count (reported by "Martin Kihlgren" <martin@rabbta.com>)

