]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 14 Dec 2005 00:07:42 +0000 (00:07 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 14 Dec 2005 00:07:42 +0000 (00:07 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@144 d0543943-73ff-0310-b7d9-9358b9ac24b2

41 files changed:
libs/iax/.cvsignore [new file with mode: 0644]
libs/iax/AUTHORS [new file with mode: 0644]
libs/iax/COPYING [new file with mode: 0644]
libs/iax/COPYING.LIB [new file with mode: 0644]
libs/iax/ChangeLog [new file with mode: 0644]
libs/iax/INSTALL [new file with mode: 0644]
libs/iax/Makefile.am [new file with mode: 0644]
libs/iax/NEWS [new file with mode: 0644]
libs/iax/README [new file with mode: 0644]
libs/iax/bootstrap.sh [new file with mode: 0755]
libs/iax/build.sh [new file with mode: 0755]
libs/iax/configure.in [new file with mode: 0644]
libs/iax/iax-config.in [new file with mode: 0755]
libs/iax/iax.spec.in [new file with mode: 0644]
libs/iax/install-sh [new file with mode: 0755]
libs/iax/libiax2.vcproj [new file with mode: 0644]
libs/iax/src/.cvsignore [new file with mode: 0644]
libs/iax/src/Makefile.am [new file with mode: 0644]
libs/iax/src/Makefile.in [new file with mode: 0644]
libs/iax/src/answer.h [new file with mode: 0644]
libs/iax/src/busy.h [new file with mode: 0644]
libs/iax/src/dialtone.h [new file with mode: 0644]
libs/iax/src/frame.h [new file with mode: 0644]
libs/iax/src/iax-client.h [new file with mode: 0644]
libs/iax/src/iax.c [new file with mode: 0644]
libs/iax/src/iax.h [new file with mode: 0644]
libs/iax/src/iax2-parser.c [new file with mode: 0644]
libs/iax/src/iax2-parser.h [new file with mode: 0644]
libs/iax/src/iax2.h [new file with mode: 0644]
libs/iax/src/jitterbuf.c [new file with mode: 0644]
libs/iax/src/jitterbuf.h [new file with mode: 0644]
libs/iax/src/md5.c [new file with mode: 0644]
libs/iax/src/md5.h [new file with mode: 0644]
libs/iax/src/miniphone.c [new file with mode: 0644]
libs/iax/src/miniphone.h [new file with mode: 0644]
libs/iax/src/options.c [new file with mode: 0644]
libs/iax/src/options.h [new file with mode: 0644]
libs/iax/src/ring10.h [new file with mode: 0644]
libs/iax/src/ringtone.h [new file with mode: 0644]
libs/iax/src/winiphone.c [new file with mode: 0644]
libs/iax/src/winpoop.h [new file with mode: 0644]

diff --git a/libs/iax/.cvsignore b/libs/iax/.cvsignore
new file mode 100644 (file)
index 0000000..6227dce
--- /dev/null
@@ -0,0 +1,21 @@
+libtool
+config.status
+config.guess
+config.sub
+ltconfig
+ltmain.sh
+install-sh
+mkinstalldirs
+missing
+aclocal.m4
+configure
+config.h.in
+stamp-h.in
+Makefile.in
+config.log
+config.cache
+Makefile
+stamp-h
+libtool
+iax.spec
+iax-config
diff --git a/libs/iax/AUTHORS b/libs/iax/AUTHORS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/libs/iax/COPYING b/libs/iax/COPYING
new file mode 100644 (file)
index 0000000..6757284
--- /dev/null
@@ -0,0 +1,416 @@
+                   GNU GENERAL PUBLIC LICENSE
+                      Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                          675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                           Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+                   GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+
+
+
+
+
+
+
+
+
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+
+
+
+
+
+
+
+
+
+
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                           NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                    END OF TERMS AND CONDITIONS
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+       Appendix: How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) 19yy  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) 19yy name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/libs/iax/COPYING.LIB b/libs/iax/COPYING.LIB
new file mode 100644 (file)
index 0000000..161a3d1
--- /dev/null
@@ -0,0 +1,482 @@
+                 GNU LIBRARY GENERAL PUBLIC LICENSE
+                      Version 2, June 1991
+
+ Copyright (C) 1991 Free Software Foundation, Inc.
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the library GPL.  It is
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+                           Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Library General Public License, applies to some
+specially designated Free Software Foundation software, and to any
+other libraries whose authors decide to use it.  You can use it for
+your libraries, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if
+you distribute copies of the library, or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link a program with the library, you must provide
+complete object files to the recipients so that they can relink them
+with the library, after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  Our method of protecting your rights has two steps: (1) copyright
+the library, and (2) offer you this license which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  Also, for each distributor's protection, we want to make certain
+that everyone understands that there is no warranty for this free
+library.  If the library is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original
+version, so that any problems introduced by others will not reflect on
+the original authors' reputations.
+\f
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that companies distributing free
+software will individually obtain patent licenses, thus in effect
+transforming the program into proprietary software.  To prevent this,
+we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+  Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License, which was designed for utility programs.  This
+license, the GNU Library General Public License, applies to certain
+designated libraries.  This license is quite different from the ordinary
+one; be sure to read it in full, and don't assume that anything in it is
+the same as in the ordinary license.
+
+  The reason we have a separate public license for some libraries is that
+they blur the distinction we usually make between modifying or adding to a
+program and simply using it.  Linking a program with a library, without
+changing the library, is in some sense simply using the library, and is
+analogous to running a utility program or application program.  However, in
+a textual and legal sense, the linked executable is a combined work, a
+derivative of the original library, and the ordinary General Public License
+treats it as such.
+
+  Because of this blurred distinction, using the ordinary General
+Public License for libraries did not effectively promote software
+sharing, because most developers did not use the libraries.  We
+concluded that weaker conditions might promote sharing better.
+
+  However, unrestricted linking of non-free programs would deprive the
+users of those programs of all benefit from the free status of the
+libraries themselves.  This Library General Public License is intended to
+permit developers of non-free programs to use free libraries, while
+preserving your freedom as a user of such programs to change the free
+libraries that are incorporated in them.  (We have not seen how to achieve
+this as regards changes in header files, but we have achieved it as regards
+changes in the actual functions of the Library.)  The hope is that this
+will lead to faster development of free libraries.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, while the latter only
+works together with the library.
+
+  Note that it is possible for a library to be covered by the ordinary
+General Public License rather than by this special one.
+\f
+                 GNU LIBRARY GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library which
+contains a notice placed by the copyright holder or other authorized
+party saying it may be distributed under the terms of this Library
+General Public License (also called "this License").  Each licensee is
+addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+\f
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+\f
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+\f
+  6. As an exception to the Sections above, you may also compile or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    c) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    d) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the source code distributed need not include anything that is normally
+distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+\f
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+\f
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Library General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+\f
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+                           NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+                    END OF TERMS AND CONDITIONS
+\f
+     Appendix: How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public
+    License along with this library; if not, write to the Free
+    Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+    MA 02111-1307, USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
diff --git a/libs/iax/ChangeLog b/libs/iax/ChangeLog
new file mode 100644 (file)
index 0000000..311fecb
--- /dev/null
@@ -0,0 +1,21 @@
+libiax
+======
+
+version 0.2.3:
+       * Allow password to be passed in connect
+
+version 0.2.2 (Nov 13th, 2001):
+       * HTML Unlink requests
+       * HTML Reject link requests
+       * Text frames
+
+version 0.2.1 (Oct 20th, 2001):
+       * More space for challenge in IAX
+       * Fixed strncpy security bug
+       * Accept larger packets
+       * Handle out of order packets better
+       * Implemented send_url
+       * Added an iax-config script :-)
+
+version 0.2.0 (Oct 10th, 2001): 
+       * Initial Public Release
diff --git a/libs/iax/INSTALL b/libs/iax/INSTALL
new file mode 100644 (file)
index 0000000..095b1eb
--- /dev/null
@@ -0,0 +1,231 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004 Free
+Software Foundation, Inc.
+
+This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+These are generic installation instructions.
+
+   The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation.  It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions.  Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+   It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring.  (Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.)
+
+   If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release.  If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+   The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'.  You only need
+`configure.ac' if you want to change it or regenerate `configure' using
+a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+  1. `cd' to the directory containing the package's source code and type
+     `./configure' to configure the package for your system.  If you're
+     using `csh' on an old version of System V, you might need to type
+     `sh ./configure' instead to prevent `csh' from trying to execute
+     `configure' itself.
+
+     Running `configure' takes awhile.  While running, it prints some
+     messages telling which features it is checking for.
+
+  2. Type `make' to compile the package.
+
+  3. Optionally, type `make check' to run any self-tests that come with
+     the package.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.
+
+  5. You can remove the program binaries and object files from the
+     source code directory by typing `make clean'.  To also remove the
+     files that `configure' created (so you can compile the package for
+     a different kind of computer), type `make distclean'.  There is
+     also a `make maintainer-clean' target, but that is intended mainly
+     for the package's developers.  If you use it, you may have to get
+     all sorts of other programs in order to regenerate files that came
+     with the distribution.
+
+Compilers and Options
+=====================
+
+Some systems require unusual options for compilation or linking that the
+`configure' script does not know about.  Run `./configure --help' for
+details on some of the pertinent environment variables.
+
+   You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment.  Here
+is an example:
+
+     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
+
+   *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory.  To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'.  `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script.  `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+   If you have to use a `make' that does not support the `VPATH'
+variable, you have to compile the package for one architecture at a
+time in the source code directory.  After you have installed the
+package for one architecture, use `make distclean' before reconfiguring
+for another architecture.
+
+Installation Names
+==================
+
+By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc.  You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PREFIX'.
+
+   You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files.  If you
+give `configure' the option `--exec-prefix=PREFIX', the package will
+use PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+   In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files.  Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+   If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System).  The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+   For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+There may be some features `configure' cannot figure out automatically,
+but needs to determine by the type of machine the package will run on.
+Usually, assuming the package is built to be run on the _same_
+architectures, `configure' can figure that out, but if it prints a
+message saying it cannot guess the machine type, give it the
+`--build=TYPE' option.  TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+     CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+     OS KERNEL-OS
+
+   See the file `config.sub' for the possible values of each field.  If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+   If you are _building_ compiler tools for cross-compiling, you should
+use the `--target=TYPE' option to select the type of system they will
+produce code for.
+
+   If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+If you want to set default values for `configure' scripts to share, you
+can create a site shell script called `config.site' that gives default
+values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+Variables not defined in a site shell script can be set in the
+environment passed to `configure'.  However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost.  In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'.  For example:
+
+     ./configure CC=/usr/local2/bin/gcc
+
+will cause the specified gcc to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+`configure' Invocation
+======================
+
+`configure' recognizes the following options to control how it operates.
+
+`--help'
+`-h'
+     Print a summary of the options to `configure', and exit.
+
+`--version'
+`-V'
+     Print the version of Autoconf used to generate the `configure'
+     script, and exit.
+
+`--cache-file=FILE'
+     Enable the cache: use and save the results of the tests in FILE,
+     traditionally `config.cache'.  FILE defaults to `/dev/null' to
+     disable caching.
+
+`--config-cache'
+`-C'
+     Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+     Do not print messages saying which checks are being made.  To
+     suppress all normal output, redirect it to `/dev/null' (any error
+     messages will still be shown).
+
+`--srcdir=DIR'
+     Look for the package's source code in directory DIR.  Usually
+     `configure' can determine that directory automatically.
+
+`configure' also accepts some other, not widely useful, options.  Run
+`configure --help' for more details.
+
diff --git a/libs/iax/Makefile.am b/libs/iax/Makefile.am
new file mode 100644 (file)
index 0000000..40d3da5
--- /dev/null
@@ -0,0 +1,6 @@
+SUBDIRS = src
+
+bin_SCRIPTS=iax-config
+BUILT_SCOURCES=iax-config
+EXTRA_DIST=iax.spec libiax2.vcproj
+iax-config: iax-config.in
diff --git a/libs/iax/NEWS b/libs/iax/NEWS
new file mode 100644 (file)
index 0000000..233df64
--- /dev/null
@@ -0,0 +1,12 @@
+libiax
+======
+
+0.2.3:
+
+0.2.2:
+
+0.2.1:
+
+0.2.0 (Oct 10th, 2001): 
+       Initial Release. Hooray! Rejoice! :)
+
diff --git a/libs/iax/README b/libs/iax/README
new file mode 100644 (file)
index 0000000..72f5e9e
--- /dev/null
@@ -0,0 +1,4 @@
+libiax: An implementation of the Inter-Asterisk eXchange protocol distributed
+under the terms of the GNU Lesser General Public License
+
+Written by Mark Spencer <markster@linux-support.net>
diff --git a/libs/iax/bootstrap.sh b/libs/iax/bootstrap.sh
new file mode 100755 (executable)
index 0000000..640caa7
--- /dev/null
@@ -0,0 +1,6 @@
+echo If this fails you probably need to download the latest
+echo libtool,aclocal,autoconf and automake
+libtoolize --force
+aclocal --force
+autoconf -f
+automake -acf
diff --git a/libs/iax/build.sh b/libs/iax/build.sh
new file mode 100755 (executable)
index 0000000..9dfda77
--- /dev/null
@@ -0,0 +1,13 @@
+echo configuring automake
+./bootstrap.sh
+echo configuring libiax2
+./configure --enable-newjb
+echo building libiax2
+make
+echo 
+echo
+echo '##################################################################'
+echo '#                                                                #'
+echo '# If all is well, enter "make install" to complete installation. #'
+echo '#                                                                #'
+echo '##################################################################'
diff --git a/libs/iax/configure.in b/libs/iax/configure.in
new file mode 100644 (file)
index 0000000..54bbc85
--- /dev/null
@@ -0,0 +1,39 @@
+dnl Yo Yo Yo
+AC_INIT(src/iax.c)
+AM_INIT_AUTOMAKE([iax], [0.2.3])
+
+
+dnl Check for various goodies
+AC_PROG_CC
+AM_PROG_LIBTOOL
+dnl LIBTOOL="$LIBTOOL --silent"
+AC_PROG_INSTALL
+
+dnl Check for libraries
+dnl None available
+
+dnl Check header files
+AC_HEADER_STDC
+
+AC_SUBST(LIBS)
+
+AC_ARG_ENABLE(snomhack,     [  --enable-snomhack       Use slower memset for SNOM phoneem ],,enable_snomhack=no)
+AC_ARG_ENABLE(extreme_debug,     [  --enable-extreme-debug  Compile with extreme debugging code enabled ],,enable_extreme_debug=no)
+AC_ARG_ENABLE(newjb,     [  --enable-newjb       Use new jitter buffer  ], [CFLAGS="$CFLAGS -DNEWJB"])
+if test "$enable_snomhack" = yes ; then
+       AC_DEFINE(SNOM_HACK)
+fi
+
+if test "$enable_extreme_debug" = yes ; then
+       AC_DEFINE(EXTREME_DEBUG)
+fi
+
+AC_SUBST(IAX_VERSION)
+
+AC_OUTPUT([
+Makefile
+src/Makefile
+iax.spec
+iax-config],[case "$CONFIG_FILES" in
+*iax-config*)chmod +x iax-config;;
+esac])
diff --git a/libs/iax/iax-config.in b/libs/iax/iax-config.in
new file mode 100755 (executable)
index 0000000..a4e82c3
--- /dev/null
@@ -0,0 +1,74 @@
+#!/bin/sh
+iax_libs="-L/usr/lib -liax"
+iax_cflags=""
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+exec_prefix_set=no
+
+usage="\
+Usage: iax-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags]"
+
+if test $# -eq 0; then
+      echo "${usage}" 1>&2
+      exit 1
+fi
+
+while test $# -gt 0; do
+  case "$1" in
+  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) optarg= ;;
+  esac
+
+  case $1 in
+    --prefix=*)
+      prefix=$optarg
+      if test $exec_prefix_set = no ; then
+        exec_prefix=$optarg
+      fi
+      ;;
+    --prefix)
+      echo $prefix
+      ;;
+    --exec-prefix=*)
+      exec_prefix=$optarg
+      exec_prefix_set=yes
+      ;;
+    --exec-prefix)
+      echo $exec_prefix
+      ;;
+    --version)
+      echo @VERSION@
+      ;;
+    --cflags)
+#      if test ${prefix}/include/iax != /usr/include/iax ; then
+        includes=-I${prefix}/include/iax
+        for i in $iax_cflags ; do
+          if test $i = -I${prefix}/include ; then
+            includes=""
+          fi
+        done      
+#      fi
+      echo $includes $iax_cflags
+      ;;
+    --libs)
+      my_iax_libs=
+      libdirs=-L${exec_prefix}/lib
+      for i in $iax_libs ; do
+        if test $i != -L${exec_prefix}/lib ; then
+          if test -z "$my_iax_libs" ; then
+            my_iax_libs="$i"
+          else
+            my_iax_libs="$my_iax_libs $i"
+          fi
+        fi
+      done
+      echo $libdirs $my_iax_libs 
+      ;;
+    *)
+      echo "${usage}" 1>&2
+      exit 1
+      ;;
+  esac
+  shift
+done
diff --git a/libs/iax/iax.spec.in b/libs/iax/iax.spec.in
new file mode 100644 (file)
index 0000000..1fc057d
--- /dev/null
@@ -0,0 +1,91 @@
+%define name   @PACKAGE@
+%define version        @VERSION@
+%define release        1
+%define prefix /usr
+
+Summary: IAX (Inter Asterisk eXchange) Library
+Name: %{name}
+Version: %{version}
+Release: %{release}
+Copyright: LGPL
+Group: Development/Libraries
+Source: %{name}-%{version}.tar.gz
+URL: http://www.linux-support.net/
+Distribution: RedHat Linux
+Vendor: Linux Support Services
+Packager: Rob Flynn <rob@linux-support.net>
+BuildRoot: /var/tmp/%{name}-%{version}-root
+
+%description
+Inter Asterisk eXchange, lovingly called IAX (pronounced: eeks), is the protocol used by the Asterisk PBX
+system for inter-asterisk-communication.  Other applications may use libiax to communicate with each other
+and other asterisk servers.  IAX is a high performance, feature rich protocol unrelated
+to SIP or H.323.  Its single-socket design allows it to interoperate with NAT and PAT
+masquerade firewalls.  It supports internationalization, remote dialplans, 
+and voice, HTML, image, DTMF, and video content.  For more information see
+http://www.gnophone.com.
+
+%package devel
+Summary: IAX (Inter Asterisk eXchange) Development Package
+Group: Development/Libraries
+Requires: iax
+
+%description devel
+Inter Asterisk eXchange, lovingly called IAX (pronounced: eeks), is the protocol used by the Asterisk PBX
+system for inter-asterisk-communication.  Other applications may use libiax to communicate with each other
+and other asterisk servers.  IAX is a high performance, feature rich protocol unrelated
+to SIP or H.323.  Its single-socket design allows it to interoperate with NAT and PAT
+masquerade firewalls.  It supports internationalization, remote dialplans, 
+and voice, HTML, image, DTMF, and video content.  For more information see
+http://www.gnophone.com.
+
+This package contains all of the development files that you will need in order to compile IAX applications.
+
+%prep
+
+%setup
+
+%build
+CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} --enable-autoupdate
+make
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make prefix=$RPM_BUILD_ROOT%{prefix} install-strip
+
+%files
+%defattr(-,root,root)
+%doc NEWS COPYING AUTHORS README
+%{prefix}/lib
+
+%files devel
+%defattr(-,root,root)
+%{prefix}/include/iax
+%{prefix}/bin/*
+
+%clean
+rm -r $RPM_BUILD_ROOT
+
+%changelog
+* Tue Nov 13 2001 Rob Flynn <rob@linux-support.net> (0.2.2 release)
+- HTML Unlink requests
+- HTML Reject link requests
+- Text frames
+
+* Sat Oct 20 2001 Rob Flynn <rob@linux-support.net> (0.2.1 release)
+- More space for challenge in IAX
+- Fixed strncpy security bug
+- Accept larger packets
+- Handle out of order packets better
+- Implemented send_url
+- Added an iax-config script :-)
+
+* Wed Oct 10 2001 Rob Flynn <rob@linux-support.net> (0.2.0 release)
+- Initial public release
+
+%post
+
+%preun
+
+%postun
+
diff --git a/libs/iax/install-sh b/libs/iax/install-sh
new file mode 100755 (executable)
index 0000000..6ebe46d
--- /dev/null
@@ -0,0 +1,323 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2004-12-17.09
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.  It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+chmodcmd="$chmodprog 0755"
+chowncmd=
+chgrpcmd=
+stripcmd=
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=
+dst=
+dir_arg=
+dstarg=
+no_target_directory=
+
+usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+   or: $0 [OPTION]... SRCFILES... DIRECTORY
+   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+   or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+-c         (ignored)
+-d         create directories instead of installing files.
+-g GROUP   $chgrpprog installed files to GROUP.
+-m MODE    $chmodprog installed files to MODE.
+-o USER    $chownprog installed files to USER.
+-s         $stripprog installed files.
+-t DIRECTORY  install into DIRECTORY.
+-T         report an error if DSTFILE is a directory.
+--help     display this help and exit.
+--version  display version info and exit.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+"
+
+while test -n "$1"; do
+  case $1 in
+    -c) shift
+        continue;;
+
+    -d) dir_arg=true
+        shift
+        continue;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+        shift
+        shift
+        continue;;
+
+    --help) echo "$usage"; exit 0;;
+
+    -m) chmodcmd="$chmodprog $2"
+        shift
+        shift
+        continue;;
+
+    -o) chowncmd="$chownprog $2"
+        shift
+        shift
+        continue;;
+
+    -s) stripcmd=$stripprog
+        shift
+        continue;;
+
+    -t) dstarg=$2
+       shift
+       shift
+       continue;;
+
+    -T) no_target_directory=true
+       shift
+       continue;;
+
+    --version) echo "$0 $scriptversion"; exit 0;;
+
+    *)  # When -d is used, all remaining arguments are directories to create.
+       # When -t is used, the destination is already specified.
+       test -n "$dir_arg$dstarg" && break
+        # Otherwise, the last argument is the destination.  Remove it from $@.
+       for arg
+       do
+          if test -n "$dstarg"; then
+           # $@ is not empty: it contains at least $arg.
+           set fnord "$@" "$dstarg"
+           shift # fnord
+         fi
+         shift # arg
+         dstarg=$arg
+       done
+       break;;
+  esac
+done
+
+if test -z "$1"; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call `install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src ;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    src=
+
+    if test -d "$dst"; then
+      mkdircmd=:
+      chmodcmd=
+    else
+      mkdircmd=$mkdirprog
+    fi
+  else
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dstarg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+
+    dst=$dstarg
+    # Protect names starting with `-'.
+    case $dst in
+      -*) dst=./$dst ;;
+    esac
+
+    # If destination is a directory, append the input filename; won't work
+    # if double slashes aren't ignored.
+    if test -d "$dst"; then
+      if test -n "$no_target_directory"; then
+       echo "$0: $dstarg: Is a directory" >&2
+       exit 1
+      fi
+      dst=$dst/`basename "$src"`
+    fi
+  fi
+
+  # This sed command emulates the dirname command.
+  dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
+
+  # Make sure that the destination directory exists.
+
+  # Skip lots of stat calls in the usual case.
+  if test ! -d "$dstdir"; then
+    defaultIFS='
+        '
+    IFS="${IFS-$defaultIFS}"
+
+    oIFS=$IFS
+    # Some sh's can't handle IFS=/ for some reason.
+    IFS='%'
+    set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+    shift
+    IFS=$oIFS
+
+    pathcomp=
+
+    while test $# -ne 0 ; do
+      pathcomp=$pathcomp$1
+      shift
+      if test ! -d "$pathcomp"; then
+        $mkdirprog "$pathcomp"
+       # mkdir can fail with a `File exist' error in case several
+       # install-sh are creating the directory concurrently.  This
+       # is OK.
+       test -d "$pathcomp" || exit
+      fi
+      pathcomp=$pathcomp/
+    done
+  fi
+
+  if test -n "$dir_arg"; then
+    $doit $mkdircmd "$dst" \
+      && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
+      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
+      && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
+      && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
+
+  else
+    dstfile=`basename "$dst"`
+
+    # Make a couple of temp file names in the proper directory.
+    dsttmp=$dstdir/_inst.$$_
+    rmtmp=$dstdir/_rm.$$_
+
+    # Trap to clean up those temp files at exit.
+    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+    trap '(exit $?); exit' 1 2 13 15
+
+    # Copy the file name to the temp name.
+    $doit $cpprog "$src" "$dsttmp" &&
+
+    # and set any options; do chmod last to preserve setuid bits.
+    #
+    # If any of these fail, we abort the whole thing.  If we want to
+    # ignore errors from any of these, just make sure not to ignore
+    # errors from the above "$doit $cpprog $src $dsttmp" command.
+    #
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
+      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
+      && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
+      && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
+
+    # Now rename the file to the real destination.
+    { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
+      || {
+          # The rename failed, perhaps because mv can't rename something else
+          # to itself, or perhaps because mv is so ancient that it does not
+          # support -f.
+
+          # Now remove or move aside any old file at destination location.
+          # We try this two ways since rm can't unlink itself on some
+          # systems and the destination file might be busy for other
+          # reasons.  In this case, the final cleanup might fail but the new
+          # file should still install successfully.
+          {
+            if test -f "$dstdir/$dstfile"; then
+              $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
+              || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
+              || {
+                echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+                (exit 1); exit 1
+              }
+            else
+              :
+            fi
+          } &&
+
+          # Now rename the file to the real destination.
+          $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
+        }
+    }
+  fi || { (exit 1); exit 1; }
+done
+
+# The final little trick to "correctly" pass the exit status to the exit trap.
+{
+  (exit 0); exit 0
+}
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/libs/iax/libiax2.vcproj b/libs/iax/libiax2.vcproj
new file mode 100644 (file)
index 0000000..ad5c7c6
--- /dev/null
@@ -0,0 +1,242 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="8.00"\r
+       Name="libiax2"\r
+       ProjectGUID="{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}"\r
+       RootNamespace="libiax2"\r
+       Keyword="Win32Proj"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="4"\r
+                       CharacterSet="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               InlineFunctionExpansion="0"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LIBIAX;DEBUG_SUPPORT;_CRT_SECURE_NO_DEPRECATE;NEWJB;WIN32_TIME_GET_TIME"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="4"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="4"\r
+                       CharacterSet="1"\r
+                       WholeProgramOptimization="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LIBIAX"\r
+                               RuntimeLibrary="2"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\src\iax.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\iax2-parser.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\jitterbuf.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\md5.c"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\src\answer.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\busy.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\dialtone.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\frame.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\iax-client.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\iax.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\iax2-parser.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\iax2.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\jitterbuf.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\md5.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\miniphone.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\options.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\ring10.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\ringtone.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\winpoop.h"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+                       >\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/libs/iax/src/.cvsignore b/libs/iax/src/.cvsignore
new file mode 100644 (file)
index 0000000..b9d4fae
--- /dev/null
@@ -0,0 +1,8 @@
+Makefile.in
+Makefile
+.deps
+.libs
+iax.lo
+md5.lo
+libiax.la
+
diff --git a/libs/iax/src/Makefile.am b/libs/iax/src/Makefile.am
new file mode 100644 (file)
index 0000000..ac02c62
--- /dev/null
@@ -0,0 +1,22 @@
+AM_CFLAGS = -Wall -O2
+AM_CFLAGS += -g -Wall -Wstrict-prototypes -I .
+AM_CFLAGS += -DDEBUG_SUPPORT -DLIBIAX
+AM_CFLAGS += -fsigned-char
+# -DDEBUG_DEFAULT 
+AM_CFLAGS += $(UCFLAGS)
+
+
+pkgdir = $(libdir)
+pkg_LTLIBRARIES=libiax.la
+libiax_la_SOURCES = iax2-parser.c iax.c md5.c jitterbuf.c
+EXTRA_DIST = md5.h frame.h iax-client.h iax2.h iax2-parser.h jitterbuf.h
+
+install-data-local:
+       mkdir -p $(includedir)/iax
+       install -m 644 md5.h $(includedir)/iax
+       install -m 644 frame.h $(includedir)/iax
+       install -m 644 iax.h $(includedir)/iax
+       install -m 644 iax2.h $(includedir)/iax
+       install -m 644 iax2-parser.h $(includedir)/iax
+       install -m 644 iax-client.h $(includedir)/iax
+
diff --git a/libs/iax/src/Makefile.in b/libs/iax/src/Makefile.in
new file mode 100644 (file)
index 0000000..a9c491e
--- /dev/null
@@ -0,0 +1,467 @@
+# Makefile.in generated by automake 1.9.4 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+SOURCES = $(libiax_la_SOURCES)
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(pkgdir)"
+pkgLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(pkg_LTLIBRARIES)
+libiax_la_LIBADD =
+am_libiax_la_OBJECTS = iax2-parser.lo iax.lo md5.lo jitterbuf.lo
+libiax_la_OBJECTS = $(am_libiax_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libiax_la_SOURCES)
+DIST_SOURCES = $(libiax_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+IAX_VERSION = @IAX_VERSION@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+# -DDEBUG_DEFAULT 
+AM_CFLAGS = -Wall -O2 -g -Wall -Wstrict-prototypes -I . \
+       -DDEBUG_SUPPORT -DLIBIAX -fsigned-char $(UCFLAGS)
+pkgdir = $(libdir)
+pkg_LTLIBRARIES = libiax.la
+libiax_la_SOURCES = iax2-parser.c iax.c md5.c jitterbuf.c
+EXTRA_DIST = md5.h frame.h iax-client.h iax2.h iax2-parser.h jitterbuf.h
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --gnu  src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-pkgLTLIBRARIES: $(pkg_LTLIBRARIES)
+       @$(NORMAL_INSTALL)
+       test -z "$(pkgdir)" || $(mkdir_p) "$(DESTDIR)$(pkgdir)"
+       @list='$(pkg_LTLIBRARIES)'; for p in $$list; do \
+         if test -f $$p; then \
+           f=$(am__strip_dir) \
+           echo " $(LIBTOOL) --mode=install $(pkgLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkgdir)/$$f'"; \
+           $(LIBTOOL) --mode=install $(pkgLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkgdir)/$$f"; \
+         else :; fi; \
+       done
+
+uninstall-pkgLTLIBRARIES:
+       @$(NORMAL_UNINSTALL)
+       @set -x; list='$(pkg_LTLIBRARIES)'; for p in $$list; do \
+         p=$(am__strip_dir) \
+         echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkgdir)/$$p'"; \
+         $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkgdir)/$$p"; \
+       done
+
+clean-pkgLTLIBRARIES:
+       -test -z "$(pkg_LTLIBRARIES)" || rm -f $(pkg_LTLIBRARIES)
+       @list='$(pkg_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+libiax.la: $(libiax_la_OBJECTS) $(libiax_la_DEPENDENCIES) 
+       $(LINK) -rpath $(pkgdir) $(libiax_la_LDFLAGS) $(libiax_la_OBJECTS) $(libiax_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iax.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iax2-parser.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jitterbuf.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+distclean-libtool:
+       -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       test -z "$(CTAGS_ARGS)$$tags$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$tags $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && cd $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+       list='$(DISTFILES)'; for file in $$list; do \
+         case $$file in \
+           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+         esac; \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+           dir="/$$dir"; \
+           $(mkdir_p) "$(distdir)$$dir"; \
+         else \
+           dir=''; \
+         fi; \
+         if test -d $$d/$$file; then \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+         else \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+       for dir in "$(DESTDIR)$(pkgdir)"; do \
+         test -z "$$dir" || $(mkdir_p) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkgLTLIBRARIES \
+       mostlyclean-am
+
+distclean: distclean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-data-local install-pkgLTLIBRARIES
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-pkgLTLIBRARIES
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+       clean-libtool clean-pkgLTLIBRARIES ctags distclean \
+       distclean-compile distclean-generic distclean-libtool \
+       distclean-tags distdir dvi dvi-am html html-am info info-am \
+       install install-am install-data install-data-am \
+       install-data-local install-exec install-exec-am install-info \
+       install-info-am install-man install-pkgLTLIBRARIES \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags uninstall uninstall-am \
+       uninstall-info-am uninstall-pkgLTLIBRARIES
+
+
+install-data-local:
+       mkdir -p $(includedir)/iax
+       install -m 644 md5.h $(includedir)/iax
+       install -m 644 frame.h $(includedir)/iax
+       install -m 644 iax.h $(includedir)/iax
+       install -m 644 iax2.h $(includedir)/iax
+       install -m 644 iax2-parser.h $(includedir)/iax
+       install -m 644 iax-client.h $(includedir)/iax
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libs/iax/src/answer.h b/libs/iax/src/answer.h
new file mode 100644 (file)
index 0000000..2a03420
--- /dev/null
@@ -0,0 +1,237 @@
+/*
+  * Signed 16-bit audio data
+  *
+  * Source: answer.raw
+  *
+  * Copyright (C) 1999, Mark Spencer and Linux Support Services
+  *
+  * Distributed under the terms of the GNU General Public License
+  *
+  */
+
+static signed short answer[] = {
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 0x19b7, 0x0245, 0xeee5, 0xb875, 0xd9a4, 0x6018, 0x660a, 0xc3c6, 
+0x8741, 0xff55, 0x4c2e, 0x2146, 0xfed2, 0xf079, 0xcbd4, 0xe561, 0x3c41, 0x3166, 
+0xd425, 0xdc59, 0x2748, 0x087d, 0xc72b, 0xfe3a, 0x4681, 0x14c6, 0xcf45, 0xdd38, 
+0xf8dd, 0x0a39, 0x3a5a, 0x32b9, 0xbfec, 0x957f, 0x15a3, 0x70f4, 0x1d95, 0xbfc4, 
+0xd367, 0xfda0, 0x0dc0, 0x29eb, 0x1fc2, 0xd684, 0xcab1, 0x19c7, 0x29ef, 0xe679, 
+0xe9d0, 0x2b82, 0x151a, 0xca9f, 0xdb68, 0x1f4a, 0x271c, 0x0e2a, 0xfb32, 0xd1b2, 
+0xc8ff, 0x2382, 0x6380, 0x0a52, 0xa118, 0xccbf, 0x2ddc, 0x33fd, 0x0964, 0xf2a4, 
+0xdd81, 0xe092, 0x1a00, 0x325c, 0xf5e3, 0xd6a1, 0x0b6c, 0x1c75, 0xe4f8, 0xe07c, 
+0x2082, 0x2b3e, 0xf445, 0xdaa9, 0xea13, 0xff3c, 0x245c, 0x35c1, 0xf308, 0xab53, 
+0xdf59, 0x4698, 0x3f3b, 0xe7f7, 0xca84, 0xed4d, 0x0c3f, 0x1e94, 0x1c2d, 0xf06f, 
+0xd4df, 0xff34, 0x23d8, 0x001e, 0xe3f1, 0x0b15, 0x2113, 0xf3fd, 0xd768, 0xf9a0, 
+0x1d31, 0x1c6e, 0x0797, 0xe3a0, 0xce6c, 0xfd7b, 0x422a, 0x2c4c, 0xd364, 0xbf42, 
+0x0278, 0x303e, 0x1c51, 0xf737, 0xe25a, 0xe75f, 0x0a8f, 0x22ab, 0x05f4, 0xe3f9, 
+0xf8c4, 0x1705, 0x0162, 0xe49f, 0xfb8b, 0x1e2b, 0x13ac, 0xf044, 0xe07b, 0xf01a, 
+0x1567, 0x2cbf, 0x0b75, 0xd01b, 0xd206, 0x1563, 0x38d7, 0x0f2e, 0xdb32, 0xdc30, 
+0x023b, 0x1e44, 0x16eb, 0xf5f7, 0xe425, 0xfa33, 0x14d5, 0x0968, 0xeff2, 0xf762, 
+0x1137, 0x0e59, 0xf13a, 0xe651, 0xff41, 0x1d60, 0x18fd, 0xf1e6, 0xd75f, 0xf097, 
+0x20ec, 0x27fa, 0xfba4, 0xd5b8, 0xe68e, 0x1657, 0x2518, 0x04f6, 0xe5a3, 0xe976, 
+0x0578, 0x18fa, 0x0a92, 0xec0a, 0xef2a, 0x111f, 0x12f4, 0xeec3, 0xe95e, 0x0d3a, 
+0x18fd, 0xff72, 0xeefc, 0xf114, 0xfaaa, 0x14ee, 0x21db, 0xf56e, 0xcb49, 0xf621, 
+0x3323, 0x1947, 0xe017, 0xe7e9, 0x0819, 0x0707, 0x084c, 0x0f57, 0xf152, 0xdf92, 
+0x104a, 0x28eb, 0xedcc, 0xd4ad, 0x1415, 0x296d, 0xed9a, 0xdf57, 0x0cc2, 0x0d95, 
+0xf7b5, 0x0deb, 0x0b34, 0xd713, 0xea08, 0x38d6, 0x216d, 0xc727, 0xdc32, 0x2cd2, 
+0x1822, 0xe2d5, 0xfeb3, 0x106c, 0xe6e5, 0xf81e, 0x2fe8, 0x01af, 0xc180, 0x037a, 
+0x42d8, 0xf88d, 0xc344, 0x0a4f, 0x2c4e, 0xf19d, 0xebeb, 0x162c, 0xf9e9, 0xde93, 
+0x1b56, 0x2c60, 0xd8aa, 0xce3e, 0x2a41, 0x2eeb, 0xdab1, 0xde32, 0x1c32, 0x0aba, 
+0xeabe, 0x1008, 0x136d, 0xda2f, 0xec3b, 0x31dd, 0x1130, 0xca79, 0xf5b8, 0x3423, 
+0x0274, 0xd27d, 0x035e, 0x1e68, 0xf641, 0xf904, 0x1691, 0xef7d, 0xd57a, 0x1c3b, 
+0x3c23, 0xe881, 0xc274, 0x0af5, 0x2962, 0xfa34, 0xf676, 0x0f71, 0xefcc, 0xe01f, 
+0x19e7, 0x276f, 0xe694, 0xe134, 0x1c3a, 0x0e8b, 0xd8e7, 0xfa81, 0x2f8b, 0x07c5, 
+0xd904, 0xf6fa, 0x0ca5, 0xf9a2, 0x0dc7, 0x2623, 0xec54, 0xbe23, 0x02b6, 0x4296, 
+0x10cd, 0xda61, 0xf11c, 0x0103, 0xf41c, 0x10b4, 0x2a03, 0xf63c, 0xce1a, 0xfdbd, 
+0x1fb4, 0xfc51, 0xf727, 0x1c8a, 0x04ff, 0xcf41, 0xec05, 0x2913, 0x1ce8, 0xf70c, 
+0xf744, 0xede8, 0xdd77, 0x0d99, 0x43f1, 0x119c, 0xc14f, 0xd60e, 0x17cb, 0x1e19, 
+0x0d4e, 0x0c95, 0xeed1, 0xcdf4, 0xf7a5, 0x331f, 0x1cd0, 0xeb17, 0xf082, 0xfb19, 
+0xe899, 0xfdeb, 0x323c, 0x2036, 0xdad3, 0xd134, 0xfd03, 0x1345, 0x1c10, 0x2239, 
+0xf656, 0xbc22, 0xdc3f, 0x3392, 0x3d59, 0xfd77, 0xdb4d, 0xe23f, 0xedbe, 0x0f7e, 
+0x35cc, 0x1947, 0xd5dc, 0xd1bf, 0x035d, 0x16fc, 0x1174, 0x1675, 0x0249, 0xd2d4, 
+0xd851, 0x184d, 0x32fe, 0x0f91, 0xee14, 0xe1e6, 0xdf9b, 0x016b, 0x3668, 0x2b2b, 
+0xe20c, 0xc554, 0xf257, 0x1c05, 0x1fc5, 0x14f0, 0xf891, 0xd41c, 0xdf83, 0x1865, 
+0x2de1, 0x0b16, 0xed58, 0xea0c, 0xea79, 0xfbd9, 0x22af, 0x2732, 0xf62f, 0xd389, 
+0xe7d9, 0x0b39, 0x1cdc, 0x1de3, 0x038a, 0xd809, 0xd5f7, 0x0b55, 0x305e, 0x1910, 
+0xf02e, 0xe089, 0xe7c7, 0x0195, 0x2265, 0x21da, 0xf743, 0xd8f2, 0xe978, 0x09a1, 
+0x190a, 0x17c5, 0x045a, 0xe46d, 0xdd06, 0xffb2, 0x2293, 0x1cfe, 0xfd4d, 0xe4f9, 
+0xe310, 0xfaf1, 0x1d22, 0x2376, 0x0113, 0xde3a, 0xe21b, 0x0204, 0x1ba1, 0x1bd6, 
+0x0333, 0xe563, 0xe104, 0xfd51, 0x1bc1, 0x1ccf, 0x0285, 0xe757, 0xe35e, 0xfaf2, 
+0x185d, 0x1d46, 0x06b7, 0xec13, 0xe108, 0xef6e, 0x121d, 0x2a17, 0x16a6, 0xe32c, 
+0xc9a9, 0xf070, 0x2f48, 0x3788, 0xfa4e, 0xc32a, 0xd9c2, 0x1fa1, 0x36fe, 0x07fa, 
+0xd9e4, 0xe577, 0x0e5e, 0x1755, 0xfb53, 0xed71, 0x0540, 0x19e0, 0x0301, 0xdc97, 
+0xe391, 0x1937, 0x367c, 0x0bc9, 0xca4c, 0xc96b, 0x105d, 0x461f, 0x2416, 0xd481, 
+0xbc97, 0xf8b7, 0x39af, 0x2ec9, 0xecc6, 0xcb50, 0xeee3, 0x1ffe, 0x1e8e, 0xf700, 
+0xe66a, 0xff58, 0x149f, 0x02e5, 0xe792, 0xf2d8, 0x1a4d, 0x225a, 0xf642, 0xce7f, 
+0xe6a6, 0x25e2, 0x38f5, 0x01d0, 0xc50f, 0xd243, 0x19bd, 0x3fc6, 0x14f0, 0xd2d7, 
+0xcdb6, 0x069a, 0x2ffe, 0x1847, 0xe6f8, 0xdf0a, 0x0337, 0x1a90, 0x067a, 0xeb5b, 
+0xf541, 0x143b, 0x14f2, 0xf092, 0xdc02, 0xfb91, 0x28a3, 0x2274, 0xeaa8, 0xc9e7, 
+0xef48, 0x2d01, 0x322e, 0xf6d2, 0xc7cb, 0xe13b, 0x1fda, 0x3217, 0x0458, 0xd690, 
+0xe2bf, 0x11c4, 0x21d5, 0x0291, 0xe5c8, 0xf3a9, 0x12ba, 0x11aa, 0xf22b, 0xe627, 
+0x03ec, 0x219a, 0x1036, 0xe2f2, 0xd93f, 0x059c, 0x2ed6, 0x1b75, 0xe227, 0xce55, 
+0xfb19, 0x2de0, 0x2477, 0xed08, 0xd148, 0xf307, 0x21d4, 0x2002, 0xf543, 0xdeac, 
+0xf7f9, 0x18a9, 0x11d6, 0xf0ef, 0xe8e4, 0x05ea, 0x1ba5, 0x0727, 0xe448, 0xe748, 
+0x100e, 0x265e, 0x07fc, 0xdbae, 0xde78, 0x0efa, 0x2ce0, 0x0f94, 0xddf1, 0xd9ea, 
+0x0797, 0x28f6, 0x12eb, 0xe60c, 0xdf46, 0x0469, 0x1fbb, 0x0ced, 0xe9f6, 0xe95f, 
+0x09fe, 0x1ab9, 0x02cb, 0xe5a4, 0xef2a, 0x1327, 0x1d7b, 0xfd07, 0xde3d, 0xed9c, 
+0x17e5, 0x22e7, 0xfe3a, 0xdb38, 0xe9b9, 0x161a, 0x2416, 0x0175, 0xde3d, 0xe9de, 
+0x1294, 0x1fc9, 0x00ea, 0xe2a7, 0xeee2, 0x1298, 0x1a7d, 0xfc1d, 0xe3bb, 0xf47a, 
+0x1642, 0x185e, 0xf727, 0xe1af, 0xf709, 0x19c3, 0x18e7, 0xf50d, 0xe010, 0xf75b, 
+0x1a9c, 0x18d8, 0xf4c5, 0xe0c9, 0xf865, 0x1a1c, 0x16d5, 0xf3a6, 0xe257, 0xfaf2, 
+0x1a44, 0x14d5, 0xf34f, 0xe4b6, 0xfc77, 0x17d5, 0x0ff8, 0xf133, 0xe8b7, 0x0344, 
+0x1a37, 0x0ad5, 0xe95e, 0xe61a, 0x08a5, 0x227e, 0x0e33, 0xe4a7, 0xdd70, 0x03b0, 
+0x25f4, 0x17b2, 0xec0a, 0xdb4e, 0xf898, 0x1ba3, 0x18f6, 0xf973, 0xe87f, 0xf77a, 
+0x0b93, 0x096c, 0xfb0e, 0xfb03, 0x0896, 0x0940, 0xf51d, 0xe904, 0xfdc7, 0x1dda, 
+0x1bf9, 0xf29b, 0xd37f, 0xea1b, 0x1f37, 0x3175, 0x07eb, 0xd3f7, 0xd46b, 0x077d, 
+0x2eeb, 0x1e67, 0xeeae, 0xd8c7, 0xef85, 0x1119, 0x18d3, 0x088e, 0xf953, 0xf5ad, 
+0xf556, 0xf63d, 0x0234, 0x167a, 0x19a1, 0xfbf9, 0xd873, 0xdd4b, 0x0f06, 0x3748, 
+0x21e6, 0xe181, 0xc032, 0xe79a, 0x2bec, 0x3e76, 0x0b1b, 0xce41, 0xcb23, 0xff96, 
+0x2d79, 0x26d1, 0xfcc7, 0xdf8a, 0xe525, 0xfd83, 0x10f1, 0x16d7, 0x0f50, 0xfaea, 
+0xe3f1, 0xe20f, 0x0158, 0x27d9, 0x2866, 0xf96f, 0xcb34, 0xd563, 0x11d6, 0x3d25, 
+0x2424, 0xe254, 0xc2c9, 0xe7cd, 0x248d, 0x34f5, 0x0c42, 0xdcd0, 0xd827, 0xfa65, 
+0x19eb, 0x1b50, 0x0721, 0xf396, 0xeb9c, 0xefde, 0x0016, 0x1594, 0x1cc1, 0x0658, 
+0xe22b, 0xd852, 0xfb3e, 0x2923, 0x2c78, 0xfc87, 0xcdb5, 0xd69c, 0x0e3c, 0x3527, 
+0x201f, 0xe993, 0xcf9e, 0xeb21, 0x183f, 0x25ea, 0x0c93, 0xed4d, 0xe5f9, 0xf548, 
+0x07fb, 0x117c, 0x0ff2, 0x0398, 0xf08c, 0xe628, 0xf489, 0x143b, 0x2419, 0x0ccf, 
+0xe2cc, 0xd5a6, 0xf861, 0x2615, 0x2a1b, 0xfeb4, 0xd543, 0xdc53, 0x09b4, 0x2901, 
+0x19ff, 0xf24a, 0xde86, 0xeec4, 0x0b7b, 0x1733, 0x0d0a, 0xfc24, 0xf1bb, 0xf110, 
+0xfa03, 0x0a0f, 0x15d4, 0x0e21, 0xf435, 0xe17e, 0xee90, 0x1225, 0x2527, 0x0efa, 
+0xe61f, 0xd916, 0xf7b8, 0x1f50, 0x2326, 0x0099, 0xe01e, 0xe473, 0x0491, 0x1b37, 
+0x1360, 0xfb17, 0xecd9, 0xf20d, 0x0051, 0x0aec, 0x0d4a, 0x073d, 0xfa5a, 0xeeb8, 
+0xf165, 0x0516, 0x17dc, 0x12da, 0xf71b, 0xe213, 0xed85, 0x0eef, 0x20c8, 0x0e09, 
+0xebcc, 0xe0d4, 0xf848, 0x1637, 0x19d6, 0x026b, 0xec09, 0xed00, 0xff9b, 0x0e5a, 
+0x0d6b, 0x026c, 0xf865, 0xf4da, 0xf888, 0x025a, 0x0cbb, 0x0d53, 0xff96, 0xeefa, 
+0xee80, 0x021c, 0x15d6, 0x126a, 0xf9c1, 0xe724, 0xf017, 0x0aa1, 0x18b6, 0x0b4e, 
+0xf2d7, 0xea91, 0xf957, 0x0cac, 0x1061, 0x03f4, 0xf6ad, 0xf476, 0xfbdf, 0x0489, 
+0x08b1, 0x06df, 0xffcf, 0xf766, 0xf537, 0xfddf, 0x0ad4, 0x0e15, 0x01da, 0xf205, 
+0xf0a0, 0x0082, 0x1066, 0x0e41, 0xfc71, 0xef1b, 0xf4ad, 0x05cd, 0x0f32, 0x07ed, 
+0xf9c8, 0xf401, 0xfa93, 0x04af, 0x088c, 0x04a7, 0xfe15, 0xf9f1, 0xfa64, 0xff1e, 
+0x0539, 0x078c, 0x02af, 0xfa1a, 0xf69d, 0xfd09, 0x075b, 0x0a3d, 0x01f2, 0xf761, 
+0xf642, 0xffa7, 0x08f3, 0x0830, 0xff05, 0xf7db, 0xf9bc, 0x0174, 0x068b, 0x04b2, 
+0xfeff, 0xfb39, 0xfc1a, 000000, 0x0371, 0x03d7, 0x00fe, 0xfd37, 0xfbe0, 0xfe78, 
+0x02af, 0x044a, 0x0180, 0xfd43, 0xfc00, 0xfed1, 0x02aa, 0x0346, 0x00dd, 0xfde0, 
+0xfbfe, 0x0114, 0x0987, 0x04bc, 0xf49d, 0xf23a, 0x06ab, 0x162e, 0x0544, 0xe76b, 
+0xea25, 0x1015, 0x2474, 0x0431, 0xd7d3, 0xe1ec, 0x1923, 0x2df5, 0x01cd, 0xd386, 
+0xe3d9, 0x1b9d, 0x2c62, 0xfeb8, 0xd31a, 0xe6ba, 0x1dbd, 0x2abb, 0xfbab, 0xd2ed, 
+0xe9ab, 0x1fa7, 0x28ef, 0xf8b3, 0xd2f5, 0xeca5, 0x2160, 0x26fd, 0xf5d7, 0xd334, 
+0xefa1, 0x22e5, 0x24ea, 0xf31b, 0xd3a9, 0xf29f, 0x2435, 0x22b6, 0xf07e, 0xd44e, 
+0xf59b, 0x2551, 0x2067, 0xee08, 0xd527, 0xf88e, 0x2639, 0x1e00, 0xebb6, 0xd62d, 
+0xfb77, 0x26eb, 0x1b85, 0xe98b, 0xd75f, 0xfe51, 0x276b, 0x18f9, 0xe78e, 0xd8b9, 
+0x011a, 0x27b6, 0x1660, 0xe5bb, 0xda3a, 0x03cc, 0x27cf, 0x13bd, 0xe415, 0xdbdf, 
+0x066a, 0x27b7, 0x1117, 0xe29e, 0xdda5, 0x08ec, 0x276e, 0x0e6d, 0xe154, 0xdf89, 
+0x0b52, 0x26f6, 0x0bc7, 0xe039, 0xe185, 0x0d96, 0x2653, 0x0924, 0xdf4e, 0xe399, 
+0x0fb9, 0x2584, 0x068b, 0xde93, 0xe5c0, 0x11b8, 0x248e, 0x03fd, 0xde08, 0xe7f8, 
+0x1390, 0x2372, 0x0180, 0xddaa, 0xea3c, 0x1544, 0x2231, 0xff12, 0xdd7a, 0xec89, 
+0x16cf, 0x20d0, 0xfcb9, 0xdd77, 0xeedb, 0x1831, 0x1f52, 0xfa77, 0xdd9f, 0xf132, 
+0x1969, 0x1db7, 0xf850, 0xddf1, 0xf385, 0x1a75, 0x1c06, 0xf645, 0xde6b, 0xf5d7, 
+0x1b5b, 0x1a3f, 0xf457, 0xdf0d, 0xf820, 0x1c13, 0x1867, 0xf288, 0xdfd2, 0xfa5f, 
+0x1ca1, 0x167f, 0xf0db, 0xe0ba, 0xfc92, 0x1d06, 0x148b, 0xef50, 0xe1c1, 0xfeb5, 
+0x1d43, 0x1290, 0xede9, 0xe2e6, 0x00c6, 0x1d58, 0x108e, 0xeca7, 0xe426, 0x02c4, 
+0x1d45, 0x0e8a, 0xeb8a, 0xe57f, 0x04a9, 0x1d0e, 0x0c87, 0xea92, 0xe6ec, 0x0677, 
+0x1cb2, 0x0a87, 0xe9be, 0xe86e, 0x082a, 0x1c34, 0x088b, 0xe912, 0xe9fe, 0x09c1, 
+0x1b95, 0x069c, 0xe88c, 0xeb9c, 0x0b3a, 0x1ad9, 0x04b6, 0xe82a, 0xed43, 0x0c96, 
+0x1a00, 0x02df, 0xe7eb, 0xeef3, 0x0dd0, 0x190d, 0x0116, 0xe7d0, 0xf0a8, 0x0eec, 
+0x1804, 0xff61, 0xe7d8, 0xf25d, 0x0fe6, 0x16e3, 0xfdc0, 0xe800, 0xf412, 0x10bf, 
+0x15b1, 0xfc36, 0xe848, 0xf5c5, 0x1176, 0x146e, 0xfac2, 0xe8ad, 0xf771, 0x120d, 
+0x1320, 0xf969, 0xe92e, 0xf913, 0x1282, 0x11c4, 0xf828, 0xe9cb, 0xfaac, 0x12d8, 
+0x1062, 0xf703, 0xea7e, 0xfc38, 0x130e, 0x0efa, 0xf5fb, 0xeb49, 0xfdb5, 0x1325, 
+0x0d8e, 0xf50e, 0xec26, 0xff20, 0x131e, 0x0c21, 0xf43f, 0xed15, 0x007a, 0x12fa, 
+0x0ab6, 0xf38d, 0xee15, 0x01be, 0x12bd, 0x094f, 0xf2f9, 0xef22, 0x02ef, 0x1265, 
+0x07f0, 0xf283, 0xf037, 0x0408, 0x11f6, 0x0699, 0xf226, 0xf156, 0x050a, 0x1170, 
+0x054b, 0xf1e8, 0xf27a, 0x05f4, 0x10d8, 0x040c, 0xf1c5, 0xf3a3, 0x06c2, 0x102c, 
+0x02da, 0xf1bc, 0xf4cc, 0x0779, 0x0f71, 0x01b7, 0xf1cc, 0xf5f5, 0x0815, 0x0ea7, 
+0x00a8, 0xf1f4, 0xf719, 0x0899, 0x0dd2, 0xffab, 0xf233, 0xf839, 0x0902, 0x0cf4, 
+0xfec0, 0xf288, 0xf950, 0x0952, 0x0c0e, 0xfdec, 0xf2ee, 0xfa5d, 0x0989, 0x0b23, 
+0xfd2d, 0xf368, 0xfb62, 0x09a7, 0x0a35, 0xfc85, 0xf3f1, 0xfc58, 0x09af, 0x0946, 
+0xfbf2, 0xf488, 0xfd3f, 0x09a1, 0x0859, 0xfb77, 0xf52c, 0xfe17, 0x097d, 0x076f, 
+0xfb14, 0xf5d8, 0xfede, 0x0945, 0x068a, 0xfac6, 0xf68d, 0xff93, 0x08fb, 0x05ad, 
+0xfa8e, 0xf747, 0x0034, 0x08a1, 0x04da, 0xfa6f, 0xf805, 0x00c2, 0x0836, 0x0410, 
+0xfa63, 0xf8c6, 0x013c, 0x07bf, 0x0354, 0xfa6c, 0xf985, 0x01a1, 0x073b, 0x02a4, 
+0xfa8a, 0xfa43, 0x01f1, 0x06af, 0x0204, 0xfab9, 0xfafc, 0x022c, 0x0619, 0x0175, 
+0xfafa, 0xfbae, 0x0252, 0x057f, 0x00f6, 0xfb4b, 0xfc5a, 0x0263, 0x04e0, 0x008b, 
+0xfbaa, 0xfcfa, 0x0262, 0x0440, 0x0032, 0xfc16, 0xfd90, 0x024b, 0x03a0, 0xffec, 
+0xfc8c, 0xfe19, 0x0225, 0x0301, 0xffb9, 0xfd0c, 0xfe93, 0x01ea, 0x0267, 0xff9c, 
+0xfd95, 0xfefe, 0x01a0, 0x01d3, 0xff90, 0xfe22, 0xff5a, 0x0147, 0x0145, 0xff99, 
+0xfeb3, 0xffa1, 0x00e0, 0x00c3, 0xffb6, 0xff46, 0xffd9, 0x006d, 0x004b, 0xffe5, 
+0xffda, 0xfffc, 000000, 0xfffe, 000000, 0xffff, 000000, 0xffff, 0xffff, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000 };
diff --git a/libs/iax/src/busy.h b/libs/iax/src/busy.h
new file mode 100644 (file)
index 0000000..2c642fa
--- /dev/null
@@ -0,0 +1,55 @@
+/* busy.h: Generated from frequencies 480 and 620 
+   by gensound.  400 samples  */
+static short busy[400] = {
+           0, 13697, 24766, 31109, 31585, 26222, 16198,  3569, 
+       -9162, -19575, -25812, -26935, -23069, -15322, -5493,  4339, 
+       12277, 16985, 17934, 15440, 10519,  4585,  -908, -4827, 
+       -6592, -6269, -4489, -2220,  -467,    30,  -983, -3203, 
+       -5839, -7844, -8215, -6301, -2035,  3975, 10543, 16141, 
+       19260, 18787, 14322,  6338, -3845, -14296, -22858, -27611, 
+       -27309, -21691, -11585,  1213, 14285, 25068, 31388, 31915, 
+       26457, 16010,  2568, -11282, -22885, -30054, -31509, -27120, 
+       -17908, -5805,  6760, 17379, 24147, 26028, 23020, 16094, 
+        6931, -2478, -10279, -15136, -16474, -14538, -10253, -4949, 
+           0,  3515,  5052,  4688,  3045,  1069,  -268,  -272, 
+        1269,  3996,  7067,  9381,  9889,  7910,  3365, -3123, 
+       -10320, -16622, -20424, -20510, -16384, -8448,  2006, 13026, 
+       22383, 28040, 28613, 23696, 13996,  1232, -12193, -23670, 
+       -30918, -32459, -27935, -18190, -5103,  8795, 20838, 28764, 
+       31164, 27753, 19395,  7893, -4412, -15136, -22342, -24909, 
+       -22717, -16609, -8143,   780,  8361, 13272, 14909, 13455, 
+        9758,  5067,   678, -2387, -3624, -3133, -1538,   224, 
+        1209,   751, -1315, -4580, -8145, -10848, -11585, -9628, 
+       -4878,  2038,  9844, 16867, 21403, 22124, 18429, 10638, 
+           0, -11524, -21643, -28211, -29702, -25561, -16364, -3737, 
+        9946, 22044, 30180, 32733, 29182, 20210,  7573, -6269, 
+       -18655, -27259, -30558, -28117, -20645, -9807,  2148, 12878, 
+       20426, 23599, 22173, 16865,  9117,   731, -6552, -11426, 
+       -13269, -12216, -9050, -4941, -1118,  1460,  2335,  1635, 
+           0, -1635, -2335, -1460,  1118,  4941,  9050, 12216, 
+       13269, 11426,  6552,  -731, -9117, -16865, -22173, -23599, 
+       -20426, -12878, -2148,  9807, 20645, 28117, 30558, 27259, 
+       18655,  6269, -7573, -20210, -29182, -32733, -30180, -22044, 
+       -9946,  3737, 16364, 25561, 29702, 28211, 21643, 11524, 
+           0, -10638, -18429, -22124, -21403, -16867, -9844, -2038, 
+        4878,  9628, 11585, 10848,  8145,  4580,  1315,  -751, 
+       -1209,  -224,  1538,  3133,  3624,  2387,  -678, -5067, 
+       -9758, -13455, -14909, -13272, -8361,  -780,  8143, 16609, 
+       22717, 24909, 22342, 15136,  4412, -7893, -19395, -27753, 
+       -31164, -28764, -20838, -8795,  5103, 18190, 27935, 32459, 
+       30918, 23670, 12193, -1232, -13996, -23696, -28613, -28040, 
+       -22383, -13026, -2006,  8448, 16384, 20510, 20424, 16622, 
+       10320,  3123, -3365, -7910, -9889, -9381, -7067, -3996, 
+       -1269,   272,   268, -1069, -3045, -4688, -5052, -3515, 
+           0,  4949, 10253, 14538, 16474, 15136, 10279,  2478, 
+       -6931, -16094, -23020, -26028, -24147, -17379, -6760,  5805, 
+       17908, 27120, 31509, 30054, 22885, 11282, -2568, -16010, 
+       -26457, -31915, -31388, -25068, -14285, -1213, 11585, 21691, 
+       27309, 27611, 22858, 14296,  3845, -6338, -14322, -18787, 
+       -19260, -16141, -10543, -3975,  2035,  6301,  8215,  7844, 
+        5839,  3203,   983,   -30,   467,  2220,  4489,  6269, 
+        6592,  4827,   908, -4585, -10519, -15440, -17934, -16985, 
+       -12277, -4339,  5493, 15322, 23069, 26935, 25812, 19575, 
+        9162, -3569, -16198, -26222, -31585, -31109, -24766, -13697, 
+       
+};
diff --git a/libs/iax/src/dialtone.h b/libs/iax/src/dialtone.h
new file mode 100644 (file)
index 0000000..09b8814
--- /dev/null
@@ -0,0 +1,105 @@
+/* dialtone.h: Generated from frequencies 350 and 440 
+   by gensound.  800 samples  */
+static short dialtone[800] = {
+           0,  9997, 19004, 26133, 30692, 32251, 30690, 26206, 
+       19286, 10657,  1206, -8116, -16396, -22848, -26895, -28221, 
+       -26797, -22878, -16960, -9723, -1954,  5545, 12044, 16954, 
+       19887, 20687, 19434, 16420, 12107,  7061,  1881, -2866, 
+       -6721, -9365, -10657, -10634, -9491, -7547, -5190, -2822, 
+        -801,   607,  1263,  1168,   454,  -633, -1784, -2669, 
+       -2993, -2548, -1247,   855,  3558,  6538,  9388, 11665, 
+       12955, 12933, 11408,  8370,  3996, -1349, -7152, -12797, 
+       -17635, -21060, -22583, -21895, -18914, -13807, -6985,   934, 
+        9180, 16913, 23309, 27654, 29422, 28342, 24429, 17998, 
+        9630,   123, -9589, -18538, -25813, -30667, -32588, -31360, 
+       -27088, -20185, -11332, -1411,  8594, 17694, 24997, 29805, 
+       31675, 30473, 26374, 19844, 11585,  2455, -6618, -14745, 
+       -21156, -25284, -26815, -25713, -22213, -16785, -10073, -2824, 
+        4203, 10318, 14969, 17794, 18653, 17628, 14998, 11197, 
+        6753,  2217, -1899, -5189, -7386, -8388, -8261, -7212, 
+       -5555, -3657, -1881,  -536,   169,   157,  -515, -1664, 
+       -3009, -4217, -4954, -4940, -3996, -2080,   697,  4081, 
+        7689, 11059, 13710, 15199, 15187, 13489, 10114,  5272, 
+        -630, -7031, -13263, -18632, -22491, -24320, -23794, -20823, 
+       -15582, -8498,  -218,  8457, 16651, 23507, 28276, 30407, 
+       29606, 25876, 19524, 11134,  1511, -8401, -17616, -25208, 
+       -30406, -32682, -31800, -27845, -21215, -12576, -2796,  7150, 
+       16278, 23700, 28713, 30868, 30015, 26312, 20199, 12351, 
+        3598, -5164, -13071, -19378, -23531, -25223, -24413, -21318, 
+       -16384, -10218, -3526,  2980,  8655, 12985, 15642, 16505, 
+       15661, 13381, 10073,  6228,  2348, -1110, -3796, -5495, 
+       -6152, -5863, -4853, -3434, -1954,  -744,   -62,   -60, 
+        -757, -2037, -3664, -5317, -6637, -7283, -6985, -5590, 
+       -3096,   334,  4390,  8631, 12544, 15605, 17339, 17393, 
+       15582, 11928,  6672,   258, -6705, -13506, -19403, -23711, 
+       -25879, -25558, -22653, -17341, -10061, -1480,  7570, 16185, 
+       23475, 28661, 31164, 30670, 27167, 20951, 12603,  2930, 
+       -7116, -16540, -24401, -29915, -32533, -32003, -28391, -22075, 
+       -13704, -4128,  5690, 14781, 22262, 27432, 29838, 29319, 
+       26014, 20339, 12940,  4614, -3777, -11401, -17540, -21660, 
+       -23463, -22908, -20199, -15755, -10150, -4044,  1898,  7079, 
+       11030, 13459, 14268, 13555, 11585,  8745,  5487,  2268, 
+        -511, -2559, -3716, -3975, -3468, -2440, -1206,  -101, 
+         578,   618,   -78, -1470, -3382, -5524, -7531, -9018, 
+       -9630, -9103, -7308, -4280,  -226,  4483,  9357, 13829, 
+       17329, 19352, 19524, 17659, 13788,  8177,  1302, -6184, 
+       -13528, -19945, -24710, -27240, -27167, -24381, -19058, -11646, 
+       -2830,  6539, 15528, 23219, 28806, 31685, 31520, 28282, 
+       22254, 14010,  4355, -5759, -15331, -23411, -29203, -32144, 
+       -31966, -28714, -22748, -14695, -5384,  4241, 13228, 20707, 
+       25981, 28600, 28391, 25479, 20256, 13337,  5482, -2482, 
+       -9761, -15668, -19694, -21556, -21215, -18865, -14902, -9864, 
+       -4366,   975,  5614,  9130, 11270, 11967, 11332,  9628, 
+        7223,  4536,  1976,  -113, -1495, -2071, -1882, -1102, 
+           0,  1102,  1882,  2071,  1495,   113, -1976, -4536, 
+       -7223, -9628, -11332, -11967, -11270, -9130, -5614,  -975, 
+        4366,  9864, 14902, 18865, 21215, 21556, 19694, 15668, 
+        9761,  2482, -5482, -13337, -20256, -25479, -28391, -28600, 
+       -25981, -20707, -13228, -4241,  5384, 14695, 22748, 28714, 
+       31966, 32144, 29203, 23411, 15331,  5759, -4355, -14010, 
+       -22254, -28282, -31520, -31685, -28806, -23219, -15528, -6539, 
+        2830, 11646, 19058, 24381, 27167, 27240, 24710, 19945, 
+       13528,  6184, -1302, -8177, -13788, -17659, -19524, -19352, 
+       -17329, -13829, -9357, -4483,   226,  4280,  7308,  9103, 
+        9630,  9018,  7531,  5524,  3382,  1470,    78,  -618, 
+        -578,   101,  1206,  2440,  3468,  3975,  3716,  2559, 
+         511, -2268, -5487, -8745, -11585, -13555, -14268, -13459, 
+       -11030, -7079, -1898,  4044, 10150, 15755, 20199, 22908, 
+       23463, 21660, 17540, 11401,  3777, -4614, -12940, -20339, 
+       -26014, -29319, -29838, -27432, -22262, -14781, -5690,  4128, 
+       13704, 22075, 28391, 32003, 32533, 29915, 24401, 16540, 
+        7116, -2930, -12603, -20951, -27167, -30670, -31164, -28661, 
+       -23475, -16185, -7570,  1480, 10061, 17341, 22653, 25558, 
+       25879, 23711, 19403, 13506,  6705,  -258, -6672, -11928, 
+       -15582, -17393, -17339, -15605, -12544, -8631, -4390,  -334, 
+        3096,  5590,  6985,  7283,  6637,  5317,  3664,  2037, 
+         757,    60,    62,   744,  1954,  3434,  4853,  5863, 
+        6152,  5495,  3796,  1110, -2348, -6228, -10073, -13381, 
+       -15661, -16505, -15642, -12985, -8655, -2980,  3526, 10218, 
+       16384, 21318, 24413, 25223, 23531, 19378, 13071,  5164, 
+       -3598, -12351, -20199, -26312, -30015, -30868, -28713, -23700, 
+       -16278, -7150,  2796, 12576, 21215, 27845, 31800, 32682, 
+       30406, 25208, 17616,  8401, -1511, -11134, -19524, -25876, 
+       -29606, -30407, -28276, -23507, -16651, -8457,   218,  8498, 
+       15582, 20823, 23794, 24320, 22491, 18632, 13263,  7031, 
+         630, -5272, -10114, -13489, -15187, -15199, -13710, -11059, 
+       -7689, -4081,  -697,  2080,  3996,  4940,  4954,  4217, 
+        3009,  1664,   515,  -157,  -169,   536,  1881,  3657, 
+        5555,  7212,  8261,  8388,  7386,  5189,  1899, -2217, 
+       -6753, -11197, -14998, -17628, -18653, -17794, -14969, -10318, 
+       -4203,  2824, 10073, 16785, 22213, 25713, 26815, 25284, 
+       21156, 14745,  6618, -2455, -11585, -19844, -26374, -30473, 
+       -31675, -29805, -24997, -17694, -8594,  1411, 11332, 20185, 
+       27088, 31360, 32588, 30667, 25813, 18538,  9589,  -123, 
+       -9630, -17998, -24429, -28342, -29422, -27654, -23309, -16913, 
+       -9180,  -934,  6985, 13807, 18914, 21895, 22583, 21060, 
+       17635, 12797,  7152,  1349, -3996, -8370, -11408, -12933, 
+       -12955, -11665, -9388, -6538, -3558,  -855,  1247,  2548, 
+        2993,  2669,  1784,   633,  -454, -1168, -1263,  -607, 
+         801,  2822,  5190,  7547,  9491, 10634, 10657,  9365, 
+        6721,  2866, -1881, -7061, -12107, -16420, -19434, -20687, 
+       -19887, -16954, -12044, -5545,  1954,  9723, 16960, 22878, 
+       26797, 28221, 26895, 22848, 16396,  8116, -1206, -10657, 
+       -19286, -26206, -30690, -32251, -30692, -26133, -19004, -9997, 
+       
+};
diff --git a/libs/iax/src/frame.h b/libs/iax/src/frame.h
new file mode 100644 (file)
index 0000000..cd6e28f
--- /dev/null
@@ -0,0 +1,134 @@
+/*
+ * libiax: An implementation of the Inter-Asterisk eXchange protocol
+ *
+ * Asterisk internal frame definitions.
+ * 
+ * Copyright (C) 1999, Mark Spencer
+ *
+ * Mark Spencer <markster@linux-support.net>
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU Lesser General Public License.  Other components of
+ * Asterisk are distributed under The GNU General Public License
+ * only.
+ */
+
+#ifndef _LIBIAX_FRAME_H
+#define _LIBIAX_FRAME_H
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+/* Frame types */
+#define AST_FRAME_DTMF         1               /* A DTMF digit, subclass is the digit */
+#define AST_FRAME_VOICE                2               /* Voice data, subclass is AST_FORMAT_* */
+#define AST_FRAME_VIDEO                3               /* Video frame, maybe?? :) */
+#define AST_FRAME_CONTROL      4               /* A control frame, subclass is AST_CONTROL_* */
+#define AST_FRAME_NULL         5               /* An empty, useless frame */
+#define AST_FRAME_IAX          6               /* Inter Aterisk Exchange private frame type */
+#define AST_FRAME_TEXT         7               /* Text messages */
+#define AST_FRAME_IMAGE                8               /* Image Frames */
+#define AST_FRAME_HTML         9               /* HTML Frames */
+#define AST_FRAME_CNG           10             /* Comfort Noise frame (subclass is level of CNG in -dBov) */
+
+/* HTML subclasses */
+#define AST_HTML_URL           1               /* Sending a URL */
+#define AST_HTML_DATA          2               /* Data frame */
+#define AST_HTML_BEGIN         4               /* Beginning frame */
+#define AST_HTML_END           8               /* End frame */
+#define AST_HTML_LDCOMPLETE    16              /* Load is complete */
+#define AST_HTML_NOSUPPORT     17              /* Peer is unable to support HTML */
+#define AST_HTML_LINKURL       18              /* Send URL and track */
+#define AST_HTML_UNLINK                19              /* Request no more linkage */
+#define AST_HTML_LINKREJECT    20              /* Reject LINKURL */
+
+/* Data formats for capabilities and frames alike */
+/*! G.723.1 compression */
+#define AST_FORMAT_G723_1       (1 << 0)
+       /*! GSM compression */
+#define AST_FORMAT_GSM          (1 << 1)
+       /*! Raw mu-law data (G.711) */
+#define AST_FORMAT_ULAW         (1 << 2)
+       /*! Raw A-law data (G.711) */
+#define AST_FORMAT_ALAW         (1 << 3)
+       /*! ADPCM (G.726, 32kbps) */
+#define AST_FORMAT_G726         (1 << 4)
+       /*! ADPCM (IMA) */
+#define AST_FORMAT_ADPCM        (1 << 5)
+       /*! Raw 16-bit Signed Linear (8000 Hz) PCM */
+#define AST_FORMAT_SLINEAR      (1 << 6)
+       /*! LPC10, 180 samples/frame */
+#define AST_FORMAT_LPC10        (1 << 7)
+       /*! G.729A audio */
+#define AST_FORMAT_G729A        (1 << 8)
+       /*! SpeeX Free Compression */
+#define AST_FORMAT_SPEEX        (1 << 9)
+       /*! iLBC Free Compression */
+#define AST_FORMAT_ILBC         (1 << 10)
+       /*! Maximum audio format */
+#define AST_FORMAT_MAX_AUDIO    (1 << 15)
+       /*! JPEG Images */
+#define AST_FORMAT_JPEG         (1 << 16)
+       /*! PNG Images */
+#define AST_FORMAT_PNG          (1 << 17)
+       /*! H.261 Video */
+#define AST_FORMAT_H261         (1 << 18)
+       /*! H.263 Video */
+#define AST_FORMAT_H263         (1 << 19)
+       /*! Max one */
+#define AST_FORMAT_MAX_VIDEO    (1 << 24)
+
+/* Control frame types */
+#define AST_CONTROL_HANGUP             1                       /* Other end has hungup */
+#define AST_CONTROL_RING               2                       /* Local ring */
+#define AST_CONTROL_RINGING    3                       /* Remote end is ringing */
+#define AST_CONTROL_ANSWER             4                       /* Remote end has answered */
+#define AST_CONTROL_BUSY               5                       /* Remote end is busy */
+#define AST_CONTROL_TAKEOFFHOOK 6                      /* Make it go off hook */
+#define AST_CONTROL_OFFHOOK            7                       /* Line is off hook */
+#define AST_CONTROL_CONGESTION 8                       /* Congestion (circuits busy) */
+#define AST_CONTROL_FLASH              9                       /* Flash hook */
+#define AST_CONTROL_WINK               10                      /* Wink */
+#define AST_CONTROL_OPTION             11                      /* Set an option */
+
+#define AST_FRIENDLY_OFFSET            64                      /* Reserved header space */
+
+struct ast_frame {
+        /*! Kind of frame */
+        int frametype;
+        /*! Subclass, frame dependent */
+        int subclass;
+        /*! Length of data */
+        int datalen;
+        /*! Number of 8khz samples in this frame */
+        int samples;
+        /*! Was the data malloc'd?  i.e. should we free it when we discard the f
+rame? */
+        int mallocd;
+        /*! How far into "data" the data really starts */
+        int offset;
+        /*! Optional source of frame for debugging */
+        char *src;
+        /*! Pointer to actual data */
+        void *data;
+        /*! Next/Prev for linking stand alone frames */
+        struct ast_frame *prev;
+       /*! Next/Prev for linking stand alone frames */
+        struct ast_frame *next;
+                                                                /* Unused except
+ if debugging is turned on, but left
+                                                                   in the struct
+ so that it can be turned on without
+                                                                   requiring a r
+ecompile of the whole thing */
+};
+
+
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+
+#endif
diff --git a/libs/iax/src/iax-client.h b/libs/iax/src/iax-client.h
new file mode 100644 (file)
index 0000000..f425eed
--- /dev/null
@@ -0,0 +1,233 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
+ * Implementation of Inter-Asterisk eXchange
+ * 
+ * Copyright (C) 1999, Mark Spencer
+ *
+ * Mark Spencer <markster@linux-support.net>
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU Lesser General Public License (LGPL)
+ */
+#ifndef _ASTERISK_IAX_CLIENT_H
+#define _ASTERISK_IAX_CLIENT_H
+
+#ifdef WIN32_TIME_GET_TIME
+#include <Mmsystem.h>
+#endif
+
+#if defined(_MSC_VER)
+/* disable zero-sized array in struct/union warning */
+#pragma warning(disable:4200)
+#endif
+
+#ifndef LINUX
+#define socklen_t int
+#endif
+
+#include "frame.h"
+#include "iax2.h"
+#include "iax2-parser.h"
+
+#define MAXSTRLEN 80
+
+#define IAX_AUTHMETHOD_PLAINTEXT       IAX_AUTH_PLAINTEXT
+#define IAX_AUTHMETHOD_MD5                     IAX_AUTH_MD5
+
+extern char iax_errstr[];
+
+struct iax_session;
+
+
+#define IAX_EVENT_CONNECT 0                    /* Connect a new call */
+#define IAX_EVENT_ACCEPT  1                    /* Accept a call */
+#define IAX_EVENT_HANGUP  2                    /* Hang up a call */
+#define IAX_EVENT_REJECT  3                    /* Rejected call */
+#define IAX_EVENT_VOICE   4                    /* Voice Data */
+#define IAX_EVENT_DTMF    5                    /* A DTMF Tone */
+#define IAX_EVENT_TIMEOUT 6                    /* Connection timeout...  session will be
+                                                                          a pointer to free()'d memory! */
+#define IAX_EVENT_LAGRQ   7                    /* Lag request -- Internal use only */
+#define IAX_EVENT_LAGRP   8                    /* Lag Measurement.  See event.lag */
+#define IAX_EVENT_RINGA          9                     /* Announce we/they are ringing */
+#define IAX_EVENT_PING   10            /* Ping -- internal use only */
+#define IAX_EVENT_PONG   11            /* Pong -- internal use only */
+#define IAX_EVENT_BUSY   12            /* Report a line busy */
+#define IAX_EVENT_ANSWER  13           /* Answer the line */
+
+#define IAX_EVENT_IMAGE   14           /* Send/Receive an image */
+#define IAX_EVENT_AUTHRQ  15           /* Authentication request */
+#define IAX_EVENT_AUTHRP  16           /* Authentication reply */
+
+#define IAX_EVENT_REGREQ  17           /* Registration request */
+#define IAX_EVENT_REGACK  18           /* Registration reply */
+#define IAX_EVENT_URL    19            /* URL received */
+#define IAX_EVENT_LDCOMPLETE 20                /* URL loading complete */
+
+#define IAX_EVENT_TRANSFER     21              /* Transfer has taken place */
+
+#define IAX_EVENT_DPREQ                22              /* Dialplan request */
+#define IAX_EVENT_DPREP                23              /* Dialplan reply */
+#define IAX_EVENT_DIAL         24              /* Dial on a TBD call */
+
+#define IAX_EVENT_QUELCH       25              /* Quelch Audio */
+#define IAX_EVENT_UNQUELCH     26              /* Unquelch Audio */
+
+#define IAX_EVENT_UNLINK       27              /* Unlink */
+#define IAX_EVENT_LINKREJECT   28              /* Link Rejection */
+#define IAX_EVENT_TEXT         29              /* Text Frame :-) */
+#define IAX_EVENT_REGREJ  30           /* Registration reply */
+#define IAX_EVENT_LINKURL      31              /* Unlink */
+#define IAX_EVENT_CNG  32              /* Comfort-noise (almost silence) */
+
+/* moved from iax.c to support attended transfer */
+#define IAX_EVENT_REREQUEST    999
+#define IAX_EVENT_TXREPLY      1000
+#define IAX_EVENT_TXREJECT     1001
+#define IAX_EVENT_TXACCEPT  1002
+#define IAX_EVENT_TXREADY      1003
+
+#define IAX_SCHEDULE_FUZZ 0                    /* ms of fuzz to drop */
+
+#ifdef WIN32
+#if defined(_MSC_VER)
+typedef int (__stdcall *sendto_t)(SOCKET, const char *, int, int, const struct sockaddr *, int);
+typedef int (__stdcall *recvfrom_t)(SOCKET, char *, int, int, struct sockaddr *, int *);
+#else
+typedef int PASCAL (*sendto_t)(SOCKET, const char *, int, int, const struct sockaddr *, int);
+typedef int PASCAL (*recvfrom_t)(SOCKET, char *buf, int len, int flags, struct sockaddr *from, int *fromlen);
+#endif
+#else
+typedef int (*sendto_t)(int, const void *, size_t, int, const struct sockaddr *, socklen_t);
+typedef int (*recvfrom_t)(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen);
+#endif
+
+struct iax_event {
+       int etype;                                              /* Type of event */
+       int subclass;                                   /* Subclass data (event specific) */
+       unsigned int ts;                                /* Timestamp */
+       struct iax_session *session;    /* Applicable session */
+       int datalen;                                    /* Length of raw data */
+       struct iax_ies ies;                             /* IE's for IAX2 frames */
+       unsigned char data[0];                  /* Raw data if applicable */
+};
+
+#if defined(__cplusplus)
+extern "C"
+{
+#endif
+
+/* All functions return 0 on success and -1 on failure unless otherwise
+   specified */
+
+/* Called to initialize IAX structures and sockets.  Returns actual
+   portnumber (which it will try preferred portno first, but if not
+   take what it can get */
+extern int iax_init(int preferredportno);
+
+extern int iax_shutdown(void);
+
+/* Get filedescriptor for IAX to use with select or gtk_input_add */
+extern int iax_get_fd(void);
+
+/* Find out how many milliseconds until the next scheduled event */
+extern int iax_time_to_next_event(void);
+
+/* Generate a new IAX session */
+extern struct iax_session *iax_session_new(void);
+
+/* Return exactly one iax event (if there is one pending).  If blocking is
+   non-zero, IAX will block until some event is received */
+extern struct iax_event *iax_get_event(int blocking);
+
+
+extern int iax_auth_reply(struct iax_session *session, char *password, 
+                                               char *challenge, int methods);
+
+/* Free an event */
+extern void iax_event_free(struct iax_event *event);
+
+struct sockaddr_in;
+
+/* Front ends for sending events */
+extern int iax_send_dtmf(struct iax_session *session, char digit);
+extern int iax_send_voice(struct iax_session *session, int format, unsigned char *data, int datalen, int samples);
+extern int iax_send_cng(struct iax_session *session, int level, unsigned char *data, int datalen);
+extern int iax_send_image(struct iax_session *session, int format, unsigned char *data, int datalen);
+extern int iax_send_url(struct iax_session *session, char *url, int link);
+extern int iax_send_text(struct iax_session *session, char *text);
+extern int iax_send_ping(struct iax_session *session);
+extern int iax_load_complete(struct iax_session *session);
+extern int iax_reject(struct iax_session *session, char *reason);
+extern int iax_busy(struct iax_session *session);
+extern int iax_congestion(struct iax_session *session);
+extern int iax_hangup(struct iax_session *session, char *byemsg);
+extern int iax_call(struct iax_session *session, char *cidnum, char *cidname, char *ich, char *lang, int wait, int format, int capability);
+extern int iax_accept(struct iax_session *session, int format);
+extern int iax_answer(struct iax_session *session);
+extern int iax_sendurl(struct iax_session *session, char *url);
+extern int iax_send_unlink(struct iax_session *session);
+extern int iax_send_link_reject(struct iax_session *session);
+extern int iax_ring_announce(struct iax_session *session);
+extern struct sockaddr_in iax_get_peer_addr(struct iax_session *session);
+extern int iax_register(struct iax_session *session, char *hostname, char *peer, char *secret, int refresh);
+extern int iax_lag_request(struct iax_session *session);
+extern int iax_dial(struct iax_session *session, char *number);        /* Dial on a TBD call */
+extern int iax_dialplan_request(struct iax_session *session, char *number);    /* Request dialplan status for number */
+extern int iax_quelch(struct iax_session *session);
+extern int iax_unquelch(struct iax_session * session);
+extern int iax_transfer(struct iax_session *session, char *number);  
+extern int iax_quelch_moh(struct iax_session *session, int MOH);
+
+extern void iax_destroy(struct iax_session  * session);
+
+extern void iax_enable_debug(void);
+extern void iax_disable_debug(void);
+
+/* For attended transfer, application create a new session,
+ * make a call on the new session.
+ * On answer of the new session, call iax_setup_transfer and wait for
+ * IAX_EVENT_TXREADY when both sides are completed succefully or
+ * IAX_EVENT_TXREJECT for either side.
+ * If there are music on hold the it will be stopped by this library.
+ */
+extern int iax_setup_transfer(struct iax_session *s0, struct iax_session *s1);
+
+struct iax_netstat {
+       int jitter;
+       int losspct;
+       int losscnt;
+       int packets;
+       int delay;
+       int dropped;
+       int ooo;
+};
+/* fills in rtt, and an iax_netstat structure for each of local/remote directions of call */
+extern int iax_get_netstats(struct iax_session *s, int *rtt, struct iax_netstat *local, struct iax_netstat *remote);
+
+
+extern void iax_set_private(struct iax_session *s, void *pvt);
+extern void *iax_get_private(struct iax_session *s);
+extern void iax_set_sendto(struct iax_session *s, sendto_t sendto);
+
+/* to use application networking instead of internal, set call this instead of iax_init,
+ * and pass in sendto and recvfrom replacements.  blocking reads may not be implemented */
+extern void iax_set_networking(sendto_t st, recvfrom_t rf);
+
+/* destroy an iax session */
+extern void iax_session_destroy(struct iax_session **session);
+
+/* Handle externally received frames */
+struct iax_event *iax_net_process(unsigned char *buf, int len, struct sockaddr_in *sin);
+extern unsigned int iax_session_get_capability(struct iax_session *s);
+extern char iax_pref_codec_add(struct iax_session *session, unsigned int format);
+extern void iax_pref_codec_del(struct iax_session *session, unsigned int format);
+extern int iax_pref_codec_get(struct iax_session *session, unsigned int *array, int len);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* _ASTERISK_IAX_CLIENT_H */
diff --git a/libs/iax/src/iax.c b/libs/iax/src/iax.c
new file mode 100644 (file)
index 0000000..0e1e987
--- /dev/null
@@ -0,0 +1,3196 @@
+ /*
+ * libiax: An implementation of Inter-Asterisk eXchange
+ *
+ * Copyright (C) 2001, Linux Support Services, Inc.
+ *
+ * Mark Spencer <markster@linux-support.net>
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU Lesser (Library) General Public License
+ */
+#ifdef WIN32
+#undef __STRICT_ANSI__ //for strdup with ms
+
+#include <string.h>
+#include <process.h>
+#include <windows.h>
+#include <winsock.h>
+#include <time.h>
+#include <stdlib.h>
+#include <malloc.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <io.h>
+#include <errno.h>
+#include <limits.h>
+
+
+#define        snprintf _snprintf
+
+#if defined(_MSC_VER)
+#define        close           _close
+#define inline __inline
+#endif
+
+void gettimeofday(struct timeval *tv, void /*struct timezone*/ *tz);
+
+
+#else
+
+#include <netdb.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <sys/time.h>
+#include <stdlib.h>
+#ifdef __GNUC__
+#ifndef __USE_SVID
+#define __USE_SVID
+#endif
+#endif
+#include <string.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <sys/select.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <time.h>
+
+#ifndef MACOSX
+#include <malloc.h>
+#ifndef SOLARIS
+#include <error.h>
+#endif
+#endif
+
+#endif
+#ifdef NEWJB
+#include "jitterbuf.h"
+#endif
+
+typedef long time_in_ms_t;
+
+#include "iax-client.h"
+#include "md5.h"
+
+/*
+       work around jitter-buffer shrinking in asterisk:
+       channels/chan_iax2.c:schedule_delivery() shrinks jitter buffer by 2.
+       this causes frames timestamped 1ms apart to ( sometimes ) be delivered 
+       out of order, and results in garbled audio. our temporary fix is to increase
+       the minimum number of ( timestamped ) milliseconds between frames to 3 ( 2 + 1 ).
+*/
+#define IAX_MIN_TIMESTAMP_INCREMENT 3
+
+/* Define socket options for IAX2 sockets, based on platform
+ * availability of flags */
+#ifdef WIN32
+#define IAX_SOCKOPTS 0
+#else
+#ifdef MACOSX
+#define IAX_SOCKOPTS MSG_DONTWAIT
+#else
+#ifdef SOLARIS
+#define IAX_SOCKOPTS MSG_DONTWAIT
+#else  /* Linux and others */
+#define IAX_SOCKOPTS MSG_DONTWAIT | MSG_NOSIGNAL
+#endif
+#endif
+#endif
+
+
+#ifdef SNOM_HACK
+/* The snom phone seems to improperly execute memset in some cases */
+#include "../../snom_phonecore2/include/snom_memset.h"
+#endif
+
+/* Voice TS Prediction causes libiax2 to clean up the timestamps on
+ * outgoing frames.  It works best with either continuous voice, or
+ * callers who call iax_send_cng to indicate DTX for silence */
+#define USE_VOICE_TS_PREDICTION
+
+/* Define Voice Smoothing to try to make some judgements and adjust timestamps
+   on incoming packets to what they "ought to be" */
+
+#define VOICE_SMOOTHING
+#undef VOICE_SMOOTHING
+
+/* Define Drop Whole Frames to make IAX shrink its jitter buffer by dropping entire
+   frames rather than simply delivering them faster.  Dropping encoded frames, 
+   before they're decoded, usually leads to better results than dropping 
+   decoded frames. */
+
+#define DROP_WHOLE_FRAMES
+
+#define MIN_RETRY_TIME 10
+#define MAX_RETRY_TIME 4000
+#define MEMORY_SIZE 1000
+
+#define TRANSFER_NONE  0
+#define TRANSFER_BEGIN 1
+#define TRANSFER_READY 2
+#define TRANSFER_REL   3
+
+#ifndef NEWJB
+/* No more than 4 seconds of jitter buffer */
+static int max_jitterbuffer = 4000;
+/* No more than 50 extra milliseconds of jitterbuffer than needed */
+static int max_extra_jitterbuffer = 50;
+/* To use or not to use the jitterbuffer */
+static int iax_use_jitterbuffer = 1;
+
+/* Dropcount (in per-MEMORY_SIZE) usually percent */
+static int iax_dropcount = 3;
+#endif
+
+/* UDP Socket (file descriptor) */
+static int netfd = -1;
+
+/* Max timeouts */
+static int maxretries = 10;
+
+static int do_shutdown = 0;
+
+/* external global networking replacements */
+static sendto_t          iax_sendto = (sendto_t) sendto;
+static recvfrom_t iax_recvfrom = (recvfrom_t) recvfrom;
+
+/* ping interval (seconds) */
+static int ping_time = 10;
+static void send_ping(void *session);
+
+struct iax_session {
+       /* Private data */
+       void *pvt;
+       /* session-local Sendto function */
+       sendto_t sendto;
+       /* Is voice quelched (e.g. hold) */
+       int quelch;
+       /* Codec Pref Order */
+       char codec_order[32];
+       /* Codec Pref Order Index*/
+       int codec_order_len;
+       /* Last received voice format */
+       int voiceformat;
+       /* Last transmitted voice format */
+       int svoiceformat;
+       /* Per session capability */
+       int capability;
+       /* Last received timestamp */
+       unsigned int last_ts;
+       /* Last transmitted timestamp */
+       unsigned int lastsent;
+       /* Last transmitted voice timestamp */
+       unsigned int lastvoicets;
+       /* Next predicted voice ts */
+       unsigned int nextpred;
+       /* True if the last voice we transmitted was not silence/CNG */
+       int notsilenttx;
+       /* Our last measured ping time */
+       unsigned int pingtime;
+       /* Address of peer */
+       struct sockaddr_in peeraddr;
+       /* Our call number */
+       int callno;
+       /* Peer's call number */
+       int peercallno;
+       /* Our next outgoing sequence number */
+       unsigned char oseqno;
+       /* Next sequence number they have not yet acknowledged */
+       unsigned char rseqno;
+       /* Our last received incoming sequence number */
+       unsigned char iseqno;
+       /* Last acknowledged sequence number */
+       unsigned char aseqno;
+       /* Peer supported formats */
+       int peerformats;
+       /* Time value that we base our transmission on */
+       time_in_ms_t offset;
+       /* Time value we base our delivery on */
+       time_in_ms_t rxcore;
+       /* History of lags */
+       int history[MEMORY_SIZE];
+       /* Current base jitterbuffer */
+       int jitterbuffer;
+       /* Informational jitter */
+       int jitter;
+       /* Measured lag */
+       int lag;
+       /* Current link state */
+       int state;
+       /* Peer name */
+       char peer[MAXSTRLEN];
+       /* Default Context */
+       char context[MAXSTRLEN];
+       /* Caller ID if available */
+       char callerid[MAXSTRLEN];
+       /* DNID */
+       char dnid[MAXSTRLEN];
+       /* Requested Extension */
+       char exten[MAXSTRLEN];
+       /* Expected Username */
+       char username[MAXSTRLEN];
+       /* Expected Secret */
+       char secret[MAXSTRLEN];
+       /* permitted authentication methods */
+       char methods[MAXSTRLEN];
+       /* MD5 challenge */
+       char challenge[12];
+#ifdef VOICE_SMOOTHING
+       unsigned int lastts;
+#endif
+       /* Refresh if applicable */
+       int refresh;
+
+       /* ping scheduler id */
+       int pingid;
+       
+       /* Transfer stuff */
+       struct sockaddr_in transfer;
+       int transferring;
+       int transfercallno;
+       int transferid;
+       int transferpeer;       /* for attended transfer */
+       int transfer_moh;       /* for music on hold while performing attended transfer */
+
+#ifdef NEWJB
+       jitterbuf *jb;
+#endif
+       struct iax_netstat remote_netstats;
+
+       /* For linking if there are multiple connections */
+       struct iax_session *next;
+};
+
+char iax_errstr[256];
+
+static void destroy_session(struct iax_session *session);
+
+#define IAXERROR snprintf(iax_errstr, sizeof(iax_errstr), 
+
+#ifdef DEBUG_SUPPORT
+
+#ifdef DEBUG_DEFAULT
+static int debug = 1;
+#else
+static int debug = 0;
+#endif
+
+void iax_enable_debug(void)
+{
+       debug = 1;
+}
+
+void iax_disable_debug(void)
+{
+       debug = 0;
+}
+
+/* This is a little strange, but to debug you call DEBU(G "Hello World!\n"); */ 
+#ifdef WIN32
+#define G __FILE__, __LINE__,
+#else
+#define G __FILE__, __LINE__, __PRETTY_FUNCTION__, 
+#endif
+
+#define DEBU __debug 
+#ifdef WIN32
+static int __debug(char *file, int lineno, char *fmt, ...) 
+{
+       va_list args;
+       va_start(args, fmt);
+       if (debug) {
+               fprintf(stderr, "%s line %d: ", file, lineno);
+               vfprintf(stderr, fmt, args);
+       }
+       va_end(args);
+       return 0;
+}
+#else
+static int __debug(char *file, int lineno, char *func, char *fmt, ...) 
+{
+       va_list args;
+       va_start(args, fmt);
+       if (debug) {
+               fprintf(stderr, "%s line %d in %s: ", file, lineno, func);
+               vfprintf(stderr, fmt, args);
+       }
+       va_end(args);
+       return 0;
+}
+#endif
+#else /* No debug support */
+
+#ifdef WIN32
+#define        DEBU
+#else
+#define DEBU(fmt...) \
+    do {} while(0)
+#endif
+#define G
+#endif
+
+typedef void (*sched_func)(void *);
+
+struct iax_sched {
+       /* These are scheduled things to be delivered */
+       time_in_ms_t when;
+       /* If event is non-NULL then we're delivering an event */
+       struct iax_event *event;
+       /* If frame is non-NULL then we're transmitting a frame */
+       struct iax_frame *frame;
+       /* If func is non-NULL then we should call it */
+       sched_func func;
+       /* and pass it this argument */
+       void *arg;
+       /* Easy linking */
+       struct iax_sched *next;
+};
+
+static struct iax_sched *schedq = NULL;
+static struct iax_session *sessions = NULL;
+static int callnums = 1;
+static int transfer_id = 1;            /* for attended transfer */
+static int time_init = 0;
+
+static void init_time(void)
+{
+#ifdef WIN32_TIME_GET_TIME
+       timeBeginPeriod(1);
+#endif
+       time_init = 1;
+}
+
+static void time_end(void)
+{
+#ifdef WIN32_TIME_GET_TIME
+       timeEndPeriod(1);
+#endif
+       time_init = 0;
+}
+
+static time_in_ms_t current_time_in_ms(void)
+{
+#ifdef WIN32_TIME_GET_TIME
+       return timeGetTime();
+#else
+       struct timeval tv;
+       gettimeofday(&tv, NULL);
+       return ((tv.tv_sec * 1000) + (tv.tv_usec / 1000));
+#endif
+}
+
+void iax_set_private(struct iax_session *s, void *ptr)
+{
+       s->pvt = ptr;
+}
+
+void *iax_get_private(struct iax_session *s)
+{
+       return s->pvt;
+}
+
+void iax_set_sendto(struct iax_session *s, sendto_t ptr)
+{
+       s->sendto = ptr;
+}
+
+
+unsigned int iax_session_get_capability(struct iax_session *s)
+{
+       return s->capability;
+}
+
+
+static int inaddrcmp(struct sockaddr_in *sin1, struct sockaddr_in *sin2)
+{
+       return (sin1->sin_addr.s_addr != sin2->sin_addr.s_addr) || (sin1->sin_port != sin2->sin_port);
+}
+
+static int iax_sched_add(struct iax_event *event, struct iax_frame *frame, sched_func func, void *arg, int ms)
+{
+
+       /* Schedule event to be delivered to the client
+          in ms milliseconds from now, or a reliable frame to be retransmitted */
+       struct iax_sched *sched, *cur, *prev = NULL;
+       
+       if (!event && !frame && !func) {
+               DEBU(G "No event, no frame, no func?  what are we scheduling?\n");
+               return -1;
+       }
+       
+
+       sched = (struct iax_sched*)malloc(sizeof(struct iax_sched));
+       if (sched) {
+        memset(sched, 0, sizeof(struct iax_sched));
+               sched->when = current_time_in_ms() + ms;
+               sched->event = event;
+               sched->frame = frame;
+               sched->func = func;
+               sched->arg = arg;
+               /* Put it in the list, in order */
+               cur = schedq;
+               while(cur && cur->when <= sched->when) {
+                       prev = cur;
+                       cur = cur->next;
+               }
+               sched->next = cur;
+               if (prev) {
+                       prev->next = sched;
+               } else {
+                       schedq = sched;
+               }
+               return 0;
+       } else {
+               DEBU(G "Out of memory!\n");
+               return -1;
+       }
+}
+
+static int iax_sched_del(struct iax_event *event, struct iax_frame *frame, sched_func func, void *arg, int all)
+{
+       struct iax_sched *cur, *tmp, *prev = NULL;
+
+       cur = schedq;
+       while (cur) {
+               if (cur->event == event && cur->frame == frame && cur->func == func && cur->arg == arg) {
+                       if (prev)
+                               prev->next = cur->next;
+                       else
+                               schedq = cur->next;
+                       tmp = cur;
+                       cur = cur->next;        
+                       free(tmp);
+                       if (!all)
+                               return -1;
+               } else {
+                       prev = cur;
+                       cur = cur->next;
+               }
+       }
+       return 0;
+
+}
+
+
+int iax_time_to_next_event(void)
+{
+       struct iax_sched *cur = schedq;
+       int min = 999999999;
+       
+       /* If there are no pending events, we don't need to timeout */
+       if (!cur)
+               return -1;
+
+       while(cur) {
+               if (cur->when < min) {
+                       min = cur->when;
+               }
+               cur = cur->next;
+       }
+
+       if (min <= 0) {
+               return -1;
+       }
+
+       return (int) (min - current_time_in_ms());
+}
+
+struct iax_session *iax_session_new(void)
+{
+       struct iax_session *s;
+       s = (struct iax_session *)malloc(sizeof(struct iax_session));
+       if (s) {
+               memset(s, 0, sizeof(struct iax_session));
+               /* Initialize important fields */
+               s->voiceformat = -1;
+               s->svoiceformat = -1;
+               /* Default pingtime to 30 ms */
+               s->pingtime = 30;
+               /* XXX Not quite right -- make sure it's not in use, but that won't matter
+                  unless you've had at least 65k calls.  XXX */
+               s->callno = callnums++;
+               if (callnums > 32767)
+                       callnums = 1;
+               s->peercallno = 0;
+               s->transferpeer = 0;            /* for attended transfer */
+               s->next = sessions;
+               s->sendto = iax_sendto;
+               s->pingid = -1;
+#ifdef NEWJB
+               s->jb = jb_new();
+               {
+                       jb_conf jbconf;
+                       jbconf.max_jitterbuf = 0;
+                       jbconf.resync_threshold = 1000;
+                       jbconf.max_contig_interp = 0;
+                       jb_setconf(s->jb, &jbconf);
+               }
+#endif
+               sessions = s;
+       }
+       return s;
+}
+
+static int iax_session_valid(struct iax_session *session)
+{
+       /* Return -1 on a valid iax session pointer, 0 on a failure */
+       struct iax_session *cur = sessions;
+       while(cur) {
+               if (session == cur)
+                       return -1;
+               cur = cur->next;
+       }
+       return 0;
+}
+
+int iax_get_netstats(struct iax_session *session, int *rtt, struct iax_netstat *local, struct iax_netstat *remote) {
+
+  if(!iax_session_valid(session)) return -1;
+
+  *rtt = session->pingtime;
+
+  *remote = session->remote_netstats;
+
+#ifdef NEWJB
+  {
+      jb_info stats;
+      jb_getinfo(session->jb, &stats);
+
+      local->jitter = stats.jitter;
+      /* XXX: should be short-term loss pct.. */
+      if(stats.frames_in == 0) stats.frames_in = 1;
+      local->losspct = stats.losspct/1000;
+      local->losscnt = stats.frames_lost;
+      local->packets = stats.frames_in;
+      local->delay = stats.current - stats.min;
+      local->dropped = stats.frames_dropped;
+      local->ooo = stats.frames_ooo;
+  }
+#endif
+  return 0;
+}
+
+static int calc_timestamp(struct iax_session *session, unsigned int ts, struct ast_frame *f)
+{
+       int ms;
+       time_in_ms_t time_in_ms;
+       int voice = 0;
+       int genuine = 0;
+       
+       if (f && f->frametype == AST_FRAME_VOICE) {
+               voice = 1;
+       } else if (!f || f->frametype == AST_FRAME_IAX) {
+               genuine = 1;
+       }
+       
+       /* If this is the first packet we're sending, get our
+          offset now. */
+       if (!session->offset) {
+               session->offset = current_time_in_ms();
+       }
+       /* If the timestamp is specified, just use their specified
+          timestamp no matter what.  Usually this is done for
+          special cases.  */
+       if (ts) {
+               return ts;
+       }
+       /* Otherwise calculate the timestamp from the current time */
+       time_in_ms = current_time_in_ms();
+
+
+       /* Calculate the number of milliseconds since we sent the first packet */
+       ms = time_in_ms - session->offset;
+
+       if (ms < 0) {
+               ms = 0;
+       }
+
+       if(voice) {
+#ifdef USE_VOICE_TS_PREDICTION
+
+               /* If we haven't most recently sent silence, and we're
+                * close in time, use predicted time */
+               if(session->notsilenttx && abs(ms - session->nextpred) <= 240) {
+                   /* Adjust our txcore, keeping voice and non-voice
+                    * synchronized */
+                       session->offset += (int)(ms - session->nextpred)/10;
+                   
+                   if(!session->nextpred) {
+                               session->nextpred = ms; 
+                       }
+                   ms = session->nextpred; 
+               } else {
+                   /* in this case, just use the actual time, since
+                    * we're either way off (shouldn't happen), or we're
+                    * ending a silent period -- and seed the next predicted
+                    * time.  Also, round ms to the next multiple of
+                    * frame size (so our silent periods are multiples
+                    * of frame size too) */
+                   int diff = ms % (f->samples / 8);
+                   if(diff)
+                       ms += f->samples/8 - diff;
+                   session->nextpred = ms; 
+               }
+#else
+               if(ms <= session->lastsent)
+                       ms = session->lastsent + 3;
+#endif
+               session->notsilenttx = 1;
+       } else {
+               /* On a dataframe, use last value + 3 (to accomodate jitter buffer shrinking) 
+                  if appropriate unless it's a genuine frame */
+               if (genuine) {
+                       if (ms <= session->lastsent)
+                               ms = session->lastsent + 3;
+               } else if (abs(ms - session->lastsent) <= 240) {
+                       ms = session->lastsent + 3;
+               }
+             
+       }
+
+       /* Record the last sent packet for future reference */
+       /* unless an AST_FRAME_IAX */
+       if (!genuine)
+               session->lastsent = ms;
+
+#ifdef USE_VOICE_TS_PREDICTION
+       /* set next predicted ts based on 8khz samples */
+       if(voice)
+           session->nextpred = session->nextpred + f->samples / 8;
+#endif
+
+       return ms;
+}
+
+#ifdef NEWJB
+static unsigned char get_n_bits_at(unsigned char *data, int n, int bit)
+{
+       int byte = bit / 8;       /* byte containing first bit */
+       int rem = 8 - (bit % 8);  /* remaining bits in first byte */
+       unsigned char ret = 0;
+       
+       if (n <= 0 || n > 8)
+               return 0;
+
+       if (rem < n) {
+               ret = (data[byte] << (n - rem));
+               ret |= (data[byte + 1] >> (8 - n + rem));
+       } else {
+               ret = (data[byte] >> (rem - n));
+       }
+
+       return (ret & (0xff >> (8 - n)));
+}
+
+static int speex_get_wb_sz_at(unsigned char *data, int len, int bit)
+{
+       static int SpeexWBSubModeSz[] = {
+               0, 36, 112, 192,
+               352, 0, 0, 0 };
+       int off = bit;
+       unsigned char c;
+
+       /* skip up to two wideband frames */
+       if (((len * 8 - off) >= 5) && 
+               get_n_bits_at(data, 1, off)) {
+               c = get_n_bits_at(data, 3, off + 1);
+               off += SpeexWBSubModeSz[c];
+
+               if (((len * 8 - off) >= 5) && 
+                       get_n_bits_at(data, 1, off)) {
+                       c = get_n_bits_at(data, 3, off + 1);
+                       off += SpeexWBSubModeSz[c];
+
+                       if (((len * 8 - off) >= 5) && 
+                               get_n_bits_at(data, 1, off)) {
+                               /* too many in a row */
+                               DEBU(G "\tCORRUPT too many wideband streams in a row\n");
+                               return -1;
+                       }
+               }
+
+       }
+       return off - bit;
+}
+
+static int speex_get_samples(unsigned char *data, int len)
+{
+       static int SpeexSubModeSz[] = {
+               0, 43, 119, 160, 
+               220, 300, 364, 492, 
+               79, 0, 0, 0,
+               0, 0, 0, 0 };
+       static int SpeexInBandSz[] = { 
+               1, 1, 4, 4,
+               4, 4, 4, 4,
+               8, 8, 16, 16,
+               32, 32, 64, 64 };
+       int bit = 0;
+       int cnt = 0;
+       int off = 0;
+       unsigned char c;
+
+       DEBU(G "speex_get_samples(%d)\n", len);
+       while ((len * 8 - bit) >= 5) {
+               /* skip wideband frames */
+               off = speex_get_wb_sz_at(data, len, bit);
+               if (off < 0)  {
+                       DEBU(G "\tERROR reading wideband frames\n");
+                       break;
+               }
+               bit += off;
+
+               if ((len * 8 - bit) < 5) {
+                       DEBU(G "\tERROR not enough bits left after wb\n");
+                       break;
+               }
+
+               /* get control bits */
+               c = get_n_bits_at(data, 5, bit);
+               DEBU(G "\tCONTROL: %d at %d\n", c, bit);
+               bit += 5;
+
+               if (c == 15) { 
+                       DEBU(G "\tTERMINATOR\n");
+                       break;
+               } else if (c == 14) {
+                       /* in-band signal; next 4 bits contain signal id */
+                       c = get_n_bits_at(data, 4, bit);
+                       bit += 4;
+                       DEBU(G "\tIN-BAND %d bits\n", SpeexInBandSz[c]);
+                       bit += SpeexInBandSz[c];
+               } else if (c == 13) {
+                       /* user in-band; next 5 bits contain msg len */
+                       c = get_n_bits_at(data, 5, bit);
+                       bit += 5;
+                       DEBU(G "\tUSER-BAND %d bytes\n", c);
+                       bit += c * 8;
+               } else if (c > 8) {
+                       DEBU(G "\tUNKNOWN sub-mode %d\n", c);
+                       break;
+               } else {
+                       /* skip number bits for submode (less the 5 control bits) */
+                       DEBU(G "\tSUBMODE %d %d bits\n", c, SpeexSubModeSz[c]);
+                       bit += SpeexSubModeSz[c] - 5;
+
+                       cnt += 160; /* new frame */
+               }
+       }
+       DEBU(G "\tSAMPLES: %d\n", cnt);
+       return cnt;
+}
+
+static int get_sample_cnt(struct iax_event *e)
+{
+       int cnt = 0;
+       switch (e->subclass) {
+         case AST_FORMAT_SPEEX:
+           cnt = speex_get_samples(e->data, e->datalen);
+           break;
+         case AST_FORMAT_G723_1:
+           cnt = 240;          /* FIXME Not always the case */
+           break;
+         case AST_FORMAT_ILBC:
+           cnt = 240 * (e->datalen / 50);
+           break;
+         case AST_FORMAT_GSM:
+           cnt = 160 * (e->datalen / 33);
+           break;
+         case AST_FORMAT_G729A:
+           cnt = 160 * (e->datalen / 20);
+           break;
+         case AST_FORMAT_SLINEAR:
+           cnt = e->datalen / 2;
+           break;
+         case AST_FORMAT_LPC10:
+           cnt = 22 * 8 + (((char *)(e->data))[7] & 0x1) * 8;
+           break;
+         case AST_FORMAT_ULAW:
+         case AST_FORMAT_ALAW:
+           cnt = e->datalen;
+           break;
+         case AST_FORMAT_ADPCM:
+         case AST_FORMAT_G726:
+           cnt = e->datalen * 2;
+           break;
+         default:
+           return 0;
+       }
+       return cnt;
+}
+#endif
+
+static int iax_xmit_frame(struct iax_frame *f)
+{
+       struct ast_iax2_full_hdr *h = (f->data);
+       /* Send the frame raw */
+#ifdef DEBUG_SUPPORT
+       if (ntohs(h->scallno) & IAX_FLAG_FULL)
+               iax_showframe(f, NULL, 0, f->transfer ? 
+                                               &(f->session->transfer) :
+                                       &(f->session->peeraddr), f->datalen - sizeof(struct ast_iax2_full_hdr));
+#endif
+
+       return f->session->sendto(netfd, (const char *) f->data, f->datalen,
+               IAX_SOCKOPTS,
+                                       f->transfer ? 
+                                               (struct sockaddr *)&(f->session->transfer) :
+                                       (struct sockaddr *)&(f->session->peeraddr), sizeof(f->session->peeraddr));
+}
+
+static int iax_reliable_xmit(struct iax_frame *f)
+{
+       struct iax_frame *fc;
+       struct ast_iax2_full_hdr *fh;
+       fh = (struct ast_iax2_full_hdr *) f->data;
+       if (!fh->type) {
+               DEBU(G "Asked to reliably transmit a non-packet.  Crashing.\n");
+               *((char *)0)=0;
+       }
+       fc = (struct iax_frame *)malloc(sizeof(struct iax_frame));
+       if (fc) {
+               /* Make a copy of the frame */
+               memcpy(fc, f, sizeof(struct iax_frame));
+               /* And a copy of the data if applicable */
+               if (!fc->data || !fc->datalen) {
+                       IAXERROR "No frame data?");
+                       DEBU(G "No frame data?\n");
+                       return -1;
+               } else {
+                       fc->data = (char *)malloc(fc->datalen);
+                       if (!fc->data) {
+                               DEBU(G "Out of memory\n");
+                               IAXERROR "Out of memory\n");
+                               return -1;
+                       }
+                       memcpy(fc->data, f->data, f->datalen);
+                       iax_sched_add(NULL, fc, NULL, NULL, fc->retrytime);
+                       return iax_xmit_frame(fc);
+               }
+       } else
+               return -1;
+}
+
+void iax_set_networking(sendto_t st, recvfrom_t rf)
+{
+
+       init_time();
+       iax_sendto = st;
+       iax_recvfrom = rf;
+}
+
+int __iax_shutdown(void)
+{
+       /* Hangup Calls */
+       if (sessions) {
+               struct iax_session *sp = NULL, *fp = NULL;
+               for(sp = sessions; sp ;) {
+                       iax_hangup(sp, "System Shutdown");
+                       fp = sp;
+                       sp = sp->next;
+                       destroy_session(fp);
+               }
+       }
+
+       /* Clear Scheduler */
+       if(schedq) {
+               struct iax_sched *sp, *fp;
+               for(sp = schedq; sp ;) {
+                       fp = sp;
+                       sp = sp->next;
+                       free(fp);
+               }
+       }
+       
+       if (netfd > -1) {
+               close(netfd);
+       }
+
+       time_end();
+
+       return 0;
+}
+
+int iax_shutdown(void)
+{
+       return do_shutdown++;
+}
+
+int iax_init(int preferredportno)
+{
+       int portno = preferredportno;
+       struct sockaddr_in sin;
+       unsigned int sinlen;
+       int flags;
+
+       init_time();
+
+       if(iax_recvfrom == (recvfrom_t) recvfrom) {
+           if (netfd > -1) {
+                   /* Sokay, just don't do anything */
+                   DEBU(G "Already initialized.");
+                   return 0;
+           }
+           netfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP);
+           if (netfd < 0) {
+                   DEBU(G "Unable to allocate UDP socket\n");
+                   IAXERROR "Unable to allocate UDP socket\n");
+                   return -1;
+           }
+           
+           if (preferredportno == 0) 
+                   preferredportno = IAX_DEFAULT_PORTNO;
+                   
+           if (preferredportno > 0) {
+                   sin.sin_family = AF_INET;
+                   sin.sin_addr.s_addr = 0;
+                   sin.sin_port = htons((short)preferredportno);
+                   if (bind(netfd, (struct sockaddr *) &sin, sizeof(sin)) < 0) {
+                           DEBU(G "Unable to bind to preferred port.  Using random one instead.");
+                   }
+           }
+           sinlen = sizeof(sin);
+           if (getsockname(netfd, (struct sockaddr *) &sin, &sinlen) < 0) {
+                   close(netfd);
+                   netfd = -1;
+                   DEBU(G "Unable to figure out what I'm bound to.");
+                   IAXERROR "Unable to determine bound port number.");
+           }
+#ifdef WIN32
+           flags = 1;
+           if (ioctlsocket(netfd,FIONBIO,(unsigned long *) &flags)) {
+                   _close(netfd);
+                   netfd = -1;
+                   DEBU(G "Unable to set non-blocking mode.");
+                   IAXERROR "Unable to set non-blocking mode.");
+           }
+           
+#else
+           if ((flags = fcntl(netfd, F_GETFL)) < 0) {
+                   close(netfd);
+                   netfd = -1;
+                   DEBU(G "Unable to retrieve socket flags.");
+                   IAXERROR "Unable to retrieve socket flags.");
+           }
+           if (fcntl(netfd, F_SETFL, flags | O_NONBLOCK) < 0) {
+                   close(netfd);
+                   netfd = -1;
+                   DEBU(G "Unable to set non-blocking mode.");
+                   IAXERROR "Unable to set non-blocking mode.");
+           }
+#endif
+           portno = ntohs(sin.sin_port);
+       }
+       srand(time(NULL));
+       callnums = rand() % 32767 + 1;
+       transfer_id = rand() % 32767 + 1;
+       DEBU(G "Started on port %d\n", portno);
+       return portno;  
+}
+
+
+
+static void convert_reply(char *out, unsigned char *in)
+{
+       int x;
+       for (x=0;x<16;x++)
+               out += sprintf(out, "%2.2x", (int)in[x]);
+}
+
+static unsigned char compress_subclass(int subclass)
+{
+       int x;
+       int power=-1;
+       /* If it's 128 or smaller, just return it */
+       if (subclass < IAX_FLAG_SC_LOG)
+               return subclass;
+       /* Otherwise find its power */
+       for (x = 0; x < IAX_MAX_SHIFT; x++) {
+               if (subclass & (1 << x)) {
+                       if (power > -1) {
+                               DEBU(G "Can't compress subclass %d\n", subclass);
+                               return 0;
+                       } else
+                               power = x;
+               }
+       }
+       return power | IAX_FLAG_SC_LOG;
+}
+
+static int iax_send(struct iax_session *pvt, struct ast_frame *f, unsigned int ts, int seqno, int now, int transfer, int final) 
+{
+       /* Queue a packet for delivery on a given private structure.  Use "ts" for
+          timestamp, or calculate if ts is 0.  Send immediately without retransmission
+          or delayed, with retransmission */
+       struct ast_iax2_full_hdr *fh;
+       struct ast_iax2_mini_hdr *mh;
+       unsigned char   buf[5120];
+       struct iax_frame *fr;
+       int res;
+       int sendmini=0;
+       unsigned int lastsent;
+       unsigned int fts;
+       
+       if (!pvt) {
+               IAXERROR "No private structure for packet?\n");
+               return -1;
+       }
+       
+       /* this must come before the next call to calc_timestamp() since
+        calc_timestamp() will change lastsent to the returned value */
+       lastsent = pvt->lastsent;
+
+       /* Calculate actual timestamp */
+       fts = calc_timestamp(pvt, ts, f);
+
+       if (((fts & 0xFFFF0000L) == (lastsent & 0xFFFF0000L))
+               /* High two bits are the same on timestamp, or sending on a trunk */ &&
+           (f->frametype == AST_FRAME_VOICE) 
+               /* is a voice frame */ &&
+               (f->subclass == pvt->svoiceformat) 
+               /* is the same type */ ) {
+                       /* Force immediate rather than delayed transmission */
+                       now = 1;
+                       /* Mark that mini-style frame is appropriate */
+                       sendmini = 1;
+       }
+       /* Allocate an iax_frame */
+       if (now) {
+               fr = (struct iax_frame *) buf;
+       } else
+               fr = iax_frame_new(DIRECTION_OUTGRESS, f->datalen);
+       if (!fr) {
+               IAXERROR "Out of memory\n");
+               return -1;
+       }
+       /* Copy our prospective frame into our immediate or retransmitted wrapper */
+       iax_frame_wrap(fr, f);
+
+       fr->ts = fts;
+       if (!fr->ts) {
+               IAXERROR "timestamp is 0?\n");
+               if (!now)
+                       iax_frame_free(fr);
+               return -1;
+       }
+
+       fr->callno = pvt->callno;
+       fr->transfer = transfer;
+       fr->final = final;
+       fr->session = pvt;
+       if (!sendmini) {
+               /* We need a full frame */
+               if (seqno > -1)
+                       fr->oseqno = seqno;
+               else
+                       fr->oseqno = pvt->oseqno++;
+               fr->iseqno = pvt->iseqno;
+               fh = (struct ast_iax2_full_hdr *)(((char *)fr->af.data) - sizeof(struct ast_iax2_full_hdr));
+               fh->scallno = htons(fr->callno | IAX_FLAG_FULL);
+               fh->ts = htonl(fr->ts);
+               fh->oseqno = fr->oseqno;
+               if (transfer) {
+                       fh->iseqno = 0;
+               } else
+                       fh->iseqno = fr->iseqno;
+               /* Keep track of the last thing we've acknowledged */
+               pvt->aseqno = fr->iseqno;
+               fh->type = fr->af.frametype & 0xFF;
+               fh->csub = compress_subclass(fr->af.subclass);
+               if (transfer) {
+                       fr->dcallno = pvt->transfercallno;
+               } else
+                       fr->dcallno = pvt->peercallno;
+               fh->dcallno = htons(fr->dcallno);
+               fr->datalen = fr->af.datalen + sizeof(struct ast_iax2_full_hdr);
+               fr->data = fh;
+               fr->retries = maxretries;
+               /* Retry after 2x the ping time has passed */
+               fr->retrytime = pvt->pingtime * 2;
+               if (fr->retrytime < MIN_RETRY_TIME)
+                       fr->retrytime = MIN_RETRY_TIME;
+               if (fr->retrytime > MAX_RETRY_TIME)
+                       fr->retrytime = MAX_RETRY_TIME;
+               /* Acks' don't get retried */
+               if ((f->frametype == AST_FRAME_IAX) && (f->subclass == IAX_COMMAND_ACK))
+                       fr->retries = -1;
+               if (f->frametype == AST_FRAME_VOICE) {
+                       pvt->svoiceformat = f->subclass;
+               }
+               if (now) {
+                       res = iax_xmit_frame(fr);
+               } else
+                       res = iax_reliable_xmit(fr);
+       } else {
+               /* Mini-frames have no sequence number */
+               fr->oseqno = -1;
+               fr->iseqno = -1;
+               /* Mini frame will do */
+               mh = (struct ast_iax2_mini_hdr *)(((char *)fr->af.data) - sizeof(struct ast_iax2_mini_hdr));
+               mh->callno = htons(fr->callno);
+               mh->ts = htons(fr->ts & 0xFFFF);
+               fr->datalen = fr->af.datalen + sizeof(struct ast_iax2_mini_hdr);
+               fr->data = mh;
+               fr->retries = -1;
+               res = iax_xmit_frame(fr);
+       }
+       if( !now && fr!=NULL )
+               iax_frame_free( fr ); 
+       return res;
+}
+
+#if 0
+static int iax_predestroy(struct iax_session *pvt)
+{
+       if (!pvt) {
+               return -1;
+       }
+       if (!pvt->alreadygone) {
+               /* No more pings or lagrq's */
+               if (pvt->pingid > -1)
+                       ast_sched_del(sched, pvt->pingid);
+               if (pvt->lagid > -1)
+                       ast_sched_del(sched, pvt->lagid);
+               if (pvt->autoid > -1)
+                       ast_sched_del(sched, pvt->autoid);
+               if (pvt->initid > -1)
+                       ast_sched_del(sched, pvt->initid);
+               pvt->pingid = -1;
+               pvt->lagid = -1;
+               pvt->autoid = -1;
+               pvt->initid = -1;
+               pvt->alreadygone = 1;
+       }
+       return 0;
+}
+#endif
+
+static int __send_command(struct iax_session *i, char type, int command, unsigned int ts, unsigned char *data, int datalen, int seqno, 
+               int now, int transfer, int final, int samples)
+{
+       struct ast_frame f;
+       f.frametype = type;
+       f.subclass = command;
+       f.datalen = datalen;
+       f.samples = samples;
+       f.mallocd = 0;
+       f.offset = 0;
+#ifdef __GNUC__
+       f.src = (char *) __FUNCTION__;
+#else
+       f.src = (char *) __FILE__;
+#endif
+       f.data = data;
+       return iax_send(i, &f, ts, seqno, now, transfer, final);
+}
+
+static int send_command(struct iax_session *i, char type, int command, unsigned int ts, unsigned char *data, int datalen, int seqno)
+{
+       return __send_command(i, type, command, ts, data, datalen, seqno, 0, 0, 0, 0);
+}
+
+static int send_command_final(struct iax_session *i, char type, int command, unsigned int ts, unsigned char *data, int datalen, int seqno)
+{
+#if 0
+       /* It is assumed that the callno has already been locked */
+       iax_predestroy(i);
+#endif 
+       int r;
+       r = __send_command(i, type, command, ts, data, datalen, seqno, 0, 0, 1, 0);
+       if (r >= 0) destroy_session(i);
+       return r;
+}
+
+static int send_command_immediate(struct iax_session *i, char type, int command, unsigned int ts, unsigned char *data, int datalen, int seqno)
+{
+       return __send_command(i, type, command, ts, data, datalen, seqno, 1, 0, 0, 0);
+}
+
+static int send_command_transfer(struct iax_session *i, char type, int command, unsigned int ts, unsigned char *data, int datalen)
+{
+       return __send_command(i, type, command, ts, data, datalen, 0, 0, 1, 0, 0);
+}
+
+static int send_command_samples(struct iax_session *i, char type, int command, unsigned int ts, unsigned char *data, int datalen, int seqno, int samples)
+{
+       return __send_command(i, type, command, ts, data, datalen, seqno, 0, 0, 0, samples);
+}
+
+
+int iax_transfer(struct iax_session *session, char *number)
+{      
+       static int res;                         //Return Code
+       struct iax_ie_data ied;                 //IE Data Structure (Stuff To Send)
+
+       // Clear The Memory Used For IE Buffer
+       memset(&ied, 0, sizeof(ied));
+       
+       // Copy The Transfer Destination Into The IE Structure
+       iax_ie_append_str(&ied, IAX_IE_CALLED_NUMBER, (unsigned char *) number);
+       
+       // Send The Transfer Command - Asterisk Will Handle The Rest!                   
+       res = send_command(session, AST_FRAME_IAX, IAX_COMMAND_TRANSFER, 0, ied.buf, ied.pos, -1);
+       
+       // Return Success
+       return 0;       
+}
+
+static void stop_transfer(struct iax_session *session)
+{
+       struct iax_sched *sch;
+
+       sch = schedq;
+       while(sch) {
+               if (sch->frame && (sch->frame->session == session))
+                                       sch->frame->retries = -1;
+               sch = sch->next;
+       }
+}      /* stop_transfer */
+
+static void complete_transfer(struct iax_session *session, int peercallno, int xfr2peer, int preserveSeq)
+{
+       session->peercallno = peercallno;
+       /* Change from transfer to session now */
+       if (xfr2peer) {
+               memcpy(&session->peeraddr, &session->transfer, sizeof(session->peeraddr));
+               memset(&session->transfer, 0, sizeof(session->transfer));
+               session->transferring = TRANSFER_NONE;
+               session->transferpeer = 0;
+               session->transfer_moh = 0;
+               /* Force retransmission of a real voice packet, and reset all timing */
+               session->svoiceformat = -1;
+               session->voiceformat = 0;
+       }
+       session->rxcore = session->offset = 0;
+       memset(&session->history, 0, sizeof(session->history));
+#ifdef NEWJB
+       { /* Reset jitterbuffer */
+           jb_frame frame;
+           while(jb_getall(session->jb,&frame) == JB_OK) 
+               iax_event_free(frame.data);
+       
+           jb_reset(session->jb);
+       }
+#endif
+       session->jitterbuffer = 0;
+       session->jitter = 0;
+       session->lag = 0;
+
+       if (! preserveSeq)
+       {
+               /* Reset sequence numbers */
+               session->aseqno = 0;
+               session->oseqno = 0;
+               session->iseqno = 0;
+       }
+
+       session->lastsent = 0;
+       session->last_ts = 0;
+       session->lastvoicets = 0;
+       session->pingtime = 30;
+       /* We have to dump anything we were going to (re)transmit now that we've been
+          transferred since they're all invalid and for the old host. */
+       stop_transfer(session);
+}      /* complete_transfer */
+
+int iax_setup_transfer(struct iax_session *org_session, struct iax_session *new_session)
+{
+       int res;
+       struct iax_ie_data ied0;
+       struct iax_ie_data ied1;
+
+       struct iax_session *s0 = org_session;
+       struct iax_session *s1 = new_session;
+
+       memset(&ied0, 0, sizeof(ied0));
+       memset(&ied1, 0, sizeof(ied1));
+
+       /* reversed setup */
+       iax_ie_append_addr(&ied0, IAX_IE_APPARENT_ADDR, &s1->peeraddr);
+       iax_ie_append_short(&ied0, IAX_IE_CALLNO, s1->peercallno);
+       iax_ie_append_int(&ied0, IAX_IE_TRANSFERID, transfer_id);
+
+       iax_ie_append_addr(&ied1, IAX_IE_APPARENT_ADDR, &s0->peeraddr);
+       iax_ie_append_short(&ied1, IAX_IE_CALLNO, s0->peercallno);
+       iax_ie_append_int(&ied1, IAX_IE_TRANSFERID, transfer_id);
+
+       s0->transfer = s1->peeraddr;
+       s1->transfer = s0->peeraddr;
+
+       s0->transferid = transfer_id;
+       s1->transferid = transfer_id;
+
+       s0->transfercallno = s0->peercallno;
+       s1->transfercallno = s1->peercallno;
+
+       s0->transferring = TRANSFER_BEGIN;
+       s1->transferring = TRANSFER_BEGIN;
+
+       s0->transferpeer = s1->callno;
+       s1->transferpeer = s0->callno;
+
+       transfer_id++;
+
+       if (transfer_id > 32767)
+               transfer_id = 1;
+
+       res = send_command(s0, AST_FRAME_IAX, IAX_COMMAND_TXREQ, 0, ied0.buf, ied0.pos, -1);
+       if (res < 0) {
+               return -1;
+       }
+
+       res = send_command(s1, AST_FRAME_IAX, IAX_COMMAND_TXREQ, 0, ied1.buf, ied1.pos, -1);
+       if (res < 0) {
+               return -1;
+       }
+
+       return 0;
+}
+
+static int iax_finish_transfer(struct iax_session *s, short new_peer)
+{
+       int res;
+       struct iax_ie_data ied;
+
+       memset(&ied, 0, sizeof(ied));
+
+       iax_ie_append_short(&ied, IAX_IE_CALLNO, new_peer);
+
+       res = send_command(s, AST_FRAME_IAX, IAX_COMMAND_TXREL, 0, ied.buf, ied.pos, -1);
+
+       complete_transfer(s, new_peer, 0, 1);
+
+       return res;
+
+}
+
+static struct iax_session *iax_find_session2(short callno)
+{
+       struct iax_session *cur = sessions;
+
+       while(cur) {
+               if (callno == cur->callno && callno != 0)  {
+                       return cur;
+               }
+               cur = cur->next;
+       }
+
+       return NULL;
+}
+
+static int iax_handle_txready(struct iax_session *s)
+{
+       struct iax_session *s0, *s1;
+       short   s0_org_peer, s1_org_peer;
+
+       if (s->transfer_moh) {
+               s->transfer_moh = 0;
+               iax_unquelch(s);
+       }
+
+       complete_transfer(s, s->peercallno, 0, 1);
+
+       s->transferring = TRANSFER_REL;
+
+       s0 = s;
+       s1 = iax_find_session2(s0->transferpeer);
+
+       if (s1 != NULL &&
+           s1->callno == s0->transferpeer &&
+                s0->transferring == TRANSFER_REL &&
+                s1->transferring == TRANSFER_REL) {
+
+               s0_org_peer = s0->peercallno;
+               s1_org_peer = s1->peercallno;
+
+               iax_finish_transfer(s0, s1_org_peer);
+               iax_finish_transfer(s1, s0_org_peer);
+               return 1;
+       }
+
+       return 0;
+}
+
+static void iax_handle_txreject(struct iax_session *s)
+{
+       struct iax_session *s0, *s1;
+
+       s0 = s;
+       s1 = iax_find_session2(s0->transferpeer);
+       if (s1 != NULL &&
+                s0->transferpeer == s1->callno &&
+                s1->transferring) {
+               if (s1->transfer_moh) {
+                       s1->transfer_moh = 0;
+                       send_command_immediate(s1, AST_FRAME_IAX, IAX_COMMAND_UNQUELCH, 0, NULL, 0, s1->iseqno);
+               }
+       }
+       if (s0->transfer_moh) {
+               s0->transfer_moh = 0;
+               send_command_immediate(s0, AST_FRAME_IAX, IAX_COMMAND_UNQUELCH, 0, NULL, 0, s0->iseqno);
+       }
+
+       memset(&s->transfer, 0, sizeof(s->transfer));
+       s->transferring = TRANSFER_NONE;
+       s->transferpeer = 0;
+       s->transfer_moh = 0;
+}
+
+static void destroy_session(struct iax_session *session)
+{
+       struct iax_session *cur, *prev=NULL;
+       struct iax_sched *curs, *prevs=NULL, *nexts=NULL;
+       int    loop_cnt=0;
+       curs = schedq;
+       while(curs) {
+               nexts = curs->next;
+               if (curs->frame && curs->frame->session == session) {
+                       /* Just mark these frames as if they've been sent */
+                       curs->frame->retries = -1;
+               } else if (curs->event && curs->event->session == session) {
+                       if (prevs)
+                               prevs->next = nexts;
+                       else
+                               schedq = nexts;
+                       if (curs->event)
+                               iax_event_free(curs->event);
+                       free(curs);
+               } else {
+                       prevs = curs;
+               }
+               curs = nexts;
+               loop_cnt++;
+       }
+               
+       cur = sessions;
+       while(cur) {
+               if (cur == session) {
+                       if (prev)
+                               prev->next = session->next;
+                       else
+                               sessions = session->next;
+#ifdef NEWJB
+                       {
+                           jb_frame frame;
+                           while(jb_getall(session->jb,&frame) == JB_OK) 
+                               iax_event_free(frame.data);
+                       
+                           jb_destroy(session->jb);
+                       }
+#endif
+                       free(session);
+                       return;
+               }
+               prev = cur;
+               cur = cur->next;
+       }
+}
+
+static int iax_send_lagrp(struct iax_session *session, unsigned int ts);
+static int iax_send_pong(struct iax_session *session, unsigned int ts);
+
+static struct iax_event *handle_event(struct iax_event *event)
+{
+       /* We have a candidate event to be delievered.  Be sure
+          the session still exists. */
+       if (event) {
+               if (iax_session_valid(event->session)) {
+                       /* Lag requests are never actually sent to the client, but
+                          other than that are handled as normal packets */
+                       switch(event->etype) {
+                               /* the user on the outside may need to look at the session so we will not free 
+                                  it here anymore we will test for hangup event in iax_event_free and do it
+                                  there.
+                                */
+                       case IAX_EVENT_REJECT:
+                       case IAX_EVENT_HANGUP:
+                               return event;
+                       case IAX_EVENT_LAGRQ:
+                               event->etype = IAX_EVENT_LAGRP;
+                               iax_send_lagrp(event->session, event->ts);
+                               iax_event_free(event);
+                               break;
+                       case IAX_EVENT_PING:
+                               event->etype = IAX_EVENT_PONG;
+                               iax_send_pong(event->session, event->ts);
+                               iax_event_free(event);
+                               break;
+                       default:
+                               return event;
+                       }
+               } else 
+                       iax_event_free(event);
+       }
+       return NULL;
+}
+
+static int iax2_vnak(struct iax_session *session)
+{
+       return send_command_immediate(session, AST_FRAME_IAX, IAX_COMMAND_VNAK, 0, NULL, 0, session->iseqno);
+}
+
+int iax_send_dtmf(struct iax_session *session, char digit)
+{
+       return send_command(session, AST_FRAME_DTMF, digit, 0, NULL, 0, -1);
+}
+
+int iax_send_voice(struct iax_session *session, int format, unsigned char *data, int datalen, int samples)
+{
+       /* Send a (possibly compressed) voice frame */
+       if (!session->quelch)
+               return send_command_samples(session, AST_FRAME_VOICE, format, 0, data, datalen, -1, samples);
+       return 0;
+}
+
+int iax_send_cng(struct iax_session *session, int level, unsigned char *data, int datalen)
+{    
+       session->notsilenttx = 0;
+       return send_command(session, AST_FRAME_CNG, level, 0, data, datalen, -1);
+}
+
+int iax_send_image(struct iax_session *session, int format, unsigned char *data, int datalen)
+{
+       /* Send an image frame */
+       return send_command(session, AST_FRAME_IMAGE, format, 0, data, datalen, -1);
+}
+
+int iax_register(struct iax_session *session, char *server, char *peer, char *secret, int refresh)
+{
+       /* Send a registration request */
+       char tmp[256];
+       char *p;
+       int res;
+       int portno = IAX_DEFAULT_PORTNO;
+       struct iax_ie_data ied;
+       struct hostent *hp;
+       
+       tmp[255] = '\0';
+       strncpy(tmp, server, sizeof(tmp) - 1);
+       p = strchr(tmp, ':');
+       if (p) {
+               *p = '\0';
+               portno = atoi(p+1);
+       }
+       
+       memset(&ied, 0, sizeof(ied));
+       if (secret)
+               strncpy(session->secret, secret, sizeof(session->secret) - 1);
+       else
+               strcpy(session->secret, "");
+
+       /* Connect first */
+       hp = gethostbyname(tmp);
+       if (!hp) {
+               snprintf(iax_errstr, sizeof(iax_errstr), "Invalid hostname: %s", tmp);
+               return -1;
+       }
+       memcpy(&session->peeraddr.sin_addr, hp->h_addr, sizeof(session->peeraddr.sin_addr));
+       session->peeraddr.sin_port = htons(portno);
+       session->peeraddr.sin_family = AF_INET;
+       strncpy(session->username, peer, sizeof(session->username) - 1);
+       session->refresh = refresh;
+       iax_ie_append_str(&ied, IAX_IE_USERNAME, (unsigned char *) peer);
+       iax_ie_append_short(&ied, IAX_IE_REFRESH, refresh);
+       res = send_command(session, AST_FRAME_IAX, IAX_COMMAND_REGREQ, 0, ied.buf, ied.pos, -1);
+       return res;
+}
+
+int iax_reject(struct iax_session *session, char *reason)
+{
+       struct iax_ie_data ied;
+       memset(&ied, 0, sizeof(ied));
+       iax_ie_append_str(&ied, IAX_IE_CAUSE, reason ? (unsigned char *) reason : (unsigned char *) "Unspecified");
+       return send_command_final(session, AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied.buf, ied.pos, -1);
+}
+
+int iax_hangup(struct iax_session *session, char *byemsg)
+{
+       struct iax_ie_data ied;
+       iax_sched_del(NULL, NULL, send_ping, (void *) session, 1);
+       memset(&ied, 0, sizeof(ied));
+       iax_ie_append_str(&ied, IAX_IE_CAUSE, byemsg ? (unsigned char *) byemsg : (unsigned char *) "Normal clearing");
+       return send_command_final(session, AST_FRAME_IAX, IAX_COMMAND_HANGUP, 0, ied.buf, ied.pos, -1);
+}
+
+int iax_sendurl(struct iax_session *session, char *url)
+{
+       return send_command(session, AST_FRAME_HTML, AST_HTML_URL, 0, (unsigned char *) url, strlen(url), -1);
+}
+
+int iax_ring_announce(struct iax_session *session)
+{
+       return send_command(session, AST_FRAME_CONTROL, AST_CONTROL_RINGING, 0, NULL, 0, -1);
+}
+
+int iax_lag_request(struct iax_session *session)
+{
+       return send_command(session, AST_FRAME_IAX, IAX_COMMAND_LAGRQ, 0, NULL, 0, -1);
+}
+
+int iax_busy(struct iax_session *session)
+{
+       return send_command(session, AST_FRAME_CONTROL, AST_CONTROL_BUSY, 0, NULL, 0, -1);
+}
+
+int iax_congestion(struct iax_session *session)
+{
+       return send_command(session, AST_FRAME_CONTROL, AST_CONTROL_CONGESTION, 0, NULL, 0, -1);
+}
+
+
+int iax_accept(struct iax_session *session, int format)
+{
+       struct iax_ie_data ied;
+       memset(&ied, 0, sizeof(ied));
+       iax_ie_append_int(&ied, IAX_IE_FORMAT, format);
+       return send_command(session, AST_FRAME_IAX, IAX_COMMAND_ACCEPT, 0, ied.buf, ied.pos, -1);
+}
+
+int iax_answer(struct iax_session *session)
+{
+       return send_command(session, AST_FRAME_CONTROL, AST_CONTROL_ANSWER, 0, NULL, 0, -1);
+}
+
+int iax_load_complete(struct iax_session *session)
+{
+       return send_command(session, AST_FRAME_HTML, AST_HTML_LDCOMPLETE, 0, NULL, 0, -1);
+}
+
+int iax_send_url(struct iax_session *session, char *url, int link)
+{
+       return send_command(session, AST_FRAME_HTML, link ? AST_HTML_LINKURL : AST_HTML_URL, 0, (unsigned char *) url, strlen(url), -1);
+}
+
+int iax_send_text(struct iax_session *session, char *text)
+{
+       return send_command(session, AST_FRAME_TEXT, 0, 0, (unsigned char *) text, strlen(text) + 1, -1);
+}
+
+int iax_send_unlink(struct iax_session *session)
+{
+       return send_command(session, AST_FRAME_HTML, AST_HTML_UNLINK, 0, NULL, 0, -1);
+}
+
+int iax_send_link_reject(struct iax_session *session)
+{
+       return send_command(session, AST_FRAME_HTML, AST_HTML_LINKREJECT, 0, NULL, 0, -1);
+}
+
+static int iax_send_pong(struct iax_session *session, unsigned int ts)
+{
+        struct iax_ie_data ied;
+
+        memset(&ied, 0, sizeof(ied));
+#ifdef NEWJB
+       {
+           jb_info stats;
+           jb_getinfo(session->jb, &stats);
+
+           iax_ie_append_int(&ied,IAX_IE_RR_JITTER, stats.jitter);
+           /* XXX: should be short-term loss pct.. */
+           if(stats.frames_in == 0) stats.frames_in = 1;
+           iax_ie_append_int(&ied,IAX_IE_RR_LOSS, 
+               ((0xff & (stats.losspct/1000)) << 24 | (stats.frames_lost & 0x00ffffff)));
+           iax_ie_append_int(&ied,IAX_IE_RR_PKTS, stats.frames_in);
+           iax_ie_append_short(&ied,IAX_IE_RR_DELAY, stats.current - stats.min);
+           iax_ie_append_int(&ied,IAX_IE_RR_DROPPED, stats.frames_dropped);
+           iax_ie_append_int(&ied,IAX_IE_RR_OOO, stats.frames_ooo);
+       }
+#else
+           iax_ie_append_int(&ied,IAX_IE_RR_JITTER, session->jitter);
+           /* don't know, don't send! iax_ie_append_int(&ied,IAX_IE_RR_LOSS, 0); */
+           /* don't know, don't send! iax_ie_append_int(&ied,IAX_IE_RR_PKTS, stats.frames_in); */
+           /* don't know, don't send! iax_ie_append_short(&ied,IAX_IE_RR_DELAY, stats.current - stats.min); */
+#endif
+
+       return send_command(session, AST_FRAME_IAX, IAX_COMMAND_PONG, ts, ied.buf, ied.pos, -1);
+}
+
+/* external API; deprecated since we send pings ourselves now (finally) */
+int iax_send_ping(struct iax_session *session)
+{
+       return send_command(session, AST_FRAME_IAX, IAX_COMMAND_PING, 0, NULL, 0, -1);
+}
+
+/* scheduled ping sender; sends ping, then reschedules */
+static void send_ping(void *s)
+{
+       struct iax_session *session = (struct iax_session *)s;
+
+       /* important, eh? */
+       if(!iax_session_valid(session)) return;
+
+       send_command(session, AST_FRAME_IAX, IAX_COMMAND_PING, 0, NULL, 0, -1);
+       session->pingid = iax_sched_add(NULL,NULL, send_ping, (void *)session, ping_time * 1000);
+       return;
+}
+
+static int iax_send_lagrp(struct iax_session *session, unsigned int ts)
+{
+       return send_command(session, AST_FRAME_IAX, IAX_COMMAND_LAGRP, ts, NULL, 0, -1);
+}
+
+static int iax_send_txcnt(struct iax_session *session)
+{
+       struct iax_ie_data ied;
+       memset(&ied, 0, sizeof(ied));
+       iax_ie_append_int(&ied, IAX_IE_TRANSFERID, session->transferid);
+       return send_command_transfer(session, AST_FRAME_IAX, IAX_COMMAND_TXCNT, 0, ied.buf, ied.pos);
+}
+
+static int iax_send_txrej(struct iax_session *session)
+{
+       struct iax_ie_data ied;
+       memset(&ied, 0, sizeof(ied));
+       iax_ie_append_int(&ied, IAX_IE_TRANSFERID, session->transferid);
+       return send_command_transfer(session, AST_FRAME_IAX, IAX_COMMAND_TXREJ, 0, ied.buf, ied.pos);
+}
+
+static int iax_send_txaccept(struct iax_session *session)
+{
+       struct iax_ie_data ied;
+       memset(&ied, 0, sizeof(ied));
+       iax_ie_append_int(&ied, IAX_IE_TRANSFERID, session->transferid);
+       return send_command_transfer(session, AST_FRAME_IAX, IAX_COMMAND_TXACC, 0, ied.buf, ied.pos);
+}
+
+static int iax_send_txready(struct iax_session *session)
+{
+       struct iax_ie_data ied;
+       memset(&ied, 0, sizeof(ied));
+       /* see asterisk chan_iax2.c */
+       iax_ie_append_short(&ied, IAX_IE_CALLNO, session->callno);
+       return send_command(session, AST_FRAME_IAX, IAX_COMMAND_TXREADY, 0, ied.buf, ied.pos, -1);
+}
+
+int iax_auth_reply(struct iax_session *session, char *password, char *challenge, int methods)
+{
+       char reply[16];
+       struct MD5Context md5;
+       char realreply[256];
+       struct iax_ie_data ied;
+       memset(&ied, 0, sizeof(ied));
+       if ((methods & IAX_AUTH_MD5) && challenge) {
+               MD5Init(&md5);
+               MD5Update(&md5, (const unsigned char *) challenge, strlen(challenge));
+               MD5Update(&md5, (const unsigned char *) password, strlen(password));
+               MD5Final((unsigned char *) reply, &md5);
+               memset(realreply, 0, sizeof(realreply));
+               convert_reply(realreply, (unsigned char *) reply);
+               iax_ie_append_str(&ied, IAX_IE_MD5_RESULT, (unsigned char *) realreply);
+       } else {
+               iax_ie_append_str(&ied, IAX_IE_MD5_RESULT, (unsigned char *) password);
+       }
+       return send_command(session, AST_FRAME_IAX, IAX_COMMAND_AUTHREP, 0, ied.buf, ied.pos, -1);
+}
+
+static int iax_regauth_reply(struct iax_session *session, char *password, char *challenge, int methods)
+{
+       char reply[16];
+       struct MD5Context md5;
+       char realreply[256];
+       struct iax_ie_data ied;
+       memset(&ied, 0, sizeof(ied));
+       iax_ie_append_str(&ied, IAX_IE_USERNAME, (unsigned char *) session->username);
+       iax_ie_append_short(&ied, IAX_IE_REFRESH, session->refresh);
+       if ((methods & IAX_AUTHMETHOD_MD5) && challenge) {
+               MD5Init(&md5);
+               MD5Update(&md5, (const unsigned char *) challenge, strlen(challenge));
+               MD5Update(&md5, (const unsigned char *) password, strlen(password));
+               MD5Final((unsigned char *) reply, &md5);
+               memset(realreply, 0, sizeof(realreply));
+               convert_reply(realreply, (unsigned char *) reply);
+               iax_ie_append_str(&ied, IAX_IE_MD5_RESULT, (unsigned char *) realreply);
+       } else {
+               iax_ie_append_str(&ied, IAX_IE_MD5_RESULT, (unsigned char *) password);
+       }
+       return send_command(session, AST_FRAME_IAX, IAX_COMMAND_REGREQ, 0, ied.buf, ied.pos, -1);
+}
+
+
+int iax_dial(struct iax_session *session, char *number)
+{
+       struct iax_ie_data ied;
+       memset(&ied, 0, sizeof(ied));
+       iax_ie_append_str(&ied, IAX_IE_CALLED_NUMBER, (unsigned char *) number);
+       return send_command(session, AST_FRAME_IAX, IAX_COMMAND_DIAL, 0, ied.buf, ied.pos, -1);
+}
+
+int iax_quelch(struct iax_session *session)
+{
+       return send_command(session, AST_FRAME_IAX, IAX_COMMAND_QUELCH, 0, NULL, 0, -1);
+}
+
+int iax_unquelch(struct iax_session *session)
+{
+       return send_command(session, AST_FRAME_IAX, IAX_COMMAND_UNQUELCH, 0, NULL, 0, -1);
+}
+
+int iax_dialplan_request(struct iax_session *session, char *number)
+{
+       struct iax_ie_data ied;
+       memset(&ied, 0, sizeof(ied));
+       iax_ie_append_str(&ied, IAX_IE_CALLED_NUMBER, (unsigned char *) number);
+       return send_command(session, AST_FRAME_IAX, IAX_COMMAND_DPREQ, 0, ied.buf, ied.pos, -1);
+}
+
+static inline int which_bit(unsigned int i)
+{
+    char x;
+    for(x = 0; x < 32; x++) {
+        if ((1 << x) == i) {
+            return x + 1;
+        }
+    }
+    return 0;
+}
+
+char iax_pref_codec_add(struct iax_session *session, unsigned int format)
+{
+       int diff = (int) 'A';
+       session->codec_order[session->codec_order_len++] = (which_bit(format)) + diff;
+       session->codec_order[session->codec_order_len] = '\0';
+       return session->codec_order[session->codec_order_len-1];
+}
+
+
+void iax_pref_codec_del(struct iax_session *session, unsigned int format)
+{
+       int diff = (int) 'A';
+       int x;
+       char old[32];
+       char remove = which_bit(format) + diff;
+
+       strncpy(old, session->codec_order, sizeof(old));
+       session->codec_order_len = 0;
+
+       for (x = 0; x < strlen(old) ; x++) {
+               if (old[x] != remove) {
+                       session->codec_order[session->codec_order_len++] = old[x];
+               }
+       }
+       session->codec_order[session->codec_order_len] = '\0';
+}
+
+int iax_pref_codec_get(struct iax_session *session, unsigned int *array, int len)
+{
+       int diff = (int) 'A';
+       int x;
+       
+       for (x = 0; x < session->codec_order_len && x < len; x++) {
+               array[x] = (1 << (session->codec_order[x] - diff - 1));
+       }
+
+       return x;
+}
+
+int iax_call(struct iax_session *session, char *cidnum, char *cidname, char *ich, char *lang, int wait, int formats, int capabilities)
+{
+       char tmp[256]="";
+       char *part1, *part2;
+       int res;
+       int portno;
+       char *username, *hostname, *secret, *context, *exten, *dnid;
+       struct iax_ie_data ied;
+       struct hostent *hp;
+       /* We start by parsing up the temporary variable which is of the form of:
+          [user@]peer[:portno][/exten[@context]] */
+       if (!ich) {
+               IAXERROR "Invalid IAX Call Handle\n");
+               DEBU(G "Invalid IAX Call Handle\n");
+               return -1;
+       }
+       memset(&ied, 0, sizeof(ied));
+       strncpy(tmp, ich, sizeof(tmp) - 1);     
+       iax_ie_append_short(&ied, IAX_IE_VERSION, IAX_PROTO_VERSION);
+       if (cidnum)
+               iax_ie_append_str(&ied, IAX_IE_CALLING_NUMBER, (unsigned char *) cidnum);
+       if (cidname)
+               iax_ie_append_str(&ied, IAX_IE_CALLING_NAME, (unsigned char *) cidname);
+
+       if (session->codec_order_len) {
+               iax_ie_append_str(&ied, IAX_IE_CODEC_PREFS, (unsigned char *) session->codec_order);
+       }
+
+       session->capability = capabilities;
+       session->pingid = iax_sched_add(NULL,NULL, send_ping, (void *)session, 2 * 1000);
+
+       /* XXX We should have a preferred format XXX */
+       iax_ie_append_int(&ied, IAX_IE_FORMAT, formats);
+       iax_ie_append_int(&ied, IAX_IE_CAPABILITY, capabilities);
+       if (lang)
+               iax_ie_append_str(&ied, IAX_IE_LANGUAGE, (unsigned char *) lang);
+       
+       /* Part 1 is [user[:password]@]peer[:port] */
+       part1 = strtok(tmp, "/");
+
+       /* Part 2 is exten[@context] if it is anything all */
+       part2 = strtok(NULL, "/");
+       
+       if (strchr(part1, '@')) {
+               username = strtok(part1, "@");
+               hostname = strtok(NULL, "@");
+       } else {
+               username = NULL;
+               hostname = part1;
+       }
+       
+       if (username && strchr(username, ':')) {
+               username = strtok(username, ":");
+               secret = strtok(NULL, ":");
+       } else
+               secret = NULL;
+
+       if(username)
+         strncpy(session->username, username, sizeof(session->username) - 1);
+
+       if(secret)
+         strncpy(session->secret, secret, sizeof(session->secret) - 1);
+       
+       if (strchr(hostname, ':')) {
+               strtok(hostname, ":");
+               portno = atoi(strtok(NULL, ":"));
+       } else {
+               portno = IAX_DEFAULT_PORTNO;
+       }
+       if (part2) {
+               exten = strtok(part2, "@");
+               dnid = exten;
+               context = strtok(NULL, "@");
+       } else {
+               exten = NULL;
+               dnid = NULL;
+               context = NULL;
+       }
+       if (username)
+               iax_ie_append_str(&ied, IAX_IE_USERNAME, (unsigned char *) username);
+       if (exten && strlen(exten))
+               iax_ie_append_str(&ied, IAX_IE_CALLED_NUMBER, (unsigned char *) exten);
+       if (dnid && strlen(dnid))
+               iax_ie_append_str(&ied, IAX_IE_DNID, (unsigned char *) dnid);
+       if (context && strlen(context))
+               iax_ie_append_str(&ied, IAX_IE_CALLED_CONTEXT, (unsigned char *) context);
+
+       /* Setup host connection */
+       hp = gethostbyname(hostname);
+       if (!hp) {
+               snprintf(iax_errstr, sizeof(iax_errstr), "Invalid hostname: %s", hostname);
+               return -1;
+       }
+       memcpy(&session->peeraddr.sin_addr, hp->h_addr, sizeof(session->peeraddr.sin_addr));
+       session->peeraddr.sin_port = htons(portno);
+       session->peeraddr.sin_family = AF_INET;
+       res = send_command(session, AST_FRAME_IAX, IAX_COMMAND_NEW, 0, ied.buf, ied.pos, -1);
+       if (res < 0)
+               return res;
+       if (wait) {
+               DEBU(G "Waiting not yet implemented\n");
+               return -1;
+       }
+       return res;
+}
+
+static int calc_rxstamp(struct iax_session *session)
+{
+       time_in_ms_t time_in_ms;
+
+       time_in_ms = current_time_in_ms();
+
+       if (!session->rxcore) {
+               session->rxcore = time_in_ms;
+       }
+
+       return time_in_ms - session->rxcore;
+}
+
+#ifdef notdef_cruft
+static int match(struct sockaddr_in *sin, short callno, short dcallno, struct iax_session *cur)
+{
+       if ((cur->peeraddr.sin_addr.s_addr == sin->sin_addr.s_addr) &&
+               (cur->peeraddr.sin_port == sin->sin_port)) {
+               /* This is the main host */
+               if ((cur->peercallno == callno) || 
+                       ((dcallno == cur->callno) && !cur->peercallno)) {
+                       /* That's us.  Be sure we keep track of the peer call number */
+                       cur->peercallno = callno;
+                       return 1;
+               }
+       }
+       if ((cur->transfer.sin_addr.s_addr == sin->sin_addr.s_addr) &&
+           (cur->transfer.sin_port == sin->sin_port) && (cur->transferring)) {
+               /* We're transferring */
+               if (dcallno == cur->callno)
+                       return 1;
+       }
+       return 0;
+}
+#endif
+
+/* splitted match into 2 passes otherwise causing problem of matching
+   up the wrong session using the dcallno and the peercallno because
+   during a transfer (2 IAX channels on the same client/system) the
+   same peercallno (from two different asterisks) exist in more than
+       one session.
+ */
+static int forward_match(struct sockaddr_in *sin, short callno, short dcallno, struct iax_session *cur)
+{
+       if ((cur->transfer.sin_addr.s_addr == sin->sin_addr.s_addr) &&
+               (cur->transfer.sin_port == sin->sin_port) && (cur->transferring)) {
+               /* We're transferring */
+               if (dcallno == cur->callno)
+               {
+                       return 1;
+               }
+       }
+
+       if ((cur->peeraddr.sin_addr.s_addr == sin->sin_addr.s_addr) &&
+               (cur->peeraddr.sin_port == sin->sin_port)) {
+               if (dcallno == cur->callno && dcallno != 0)  {
+                                       /* That's us.  Be sure we keep track of the peer call number */
+                       if (cur->peercallno == 0) {
+                               cur->peercallno = callno;
+                       }
+                       return 1;
+               }
+       }
+
+       return 0;
+}
+
+static int reverse_match(struct sockaddr_in *sin, short callno, struct iax_session *cur)
+{
+       if ((cur->transfer.sin_addr.s_addr == sin->sin_addr.s_addr) &&
+               (cur->transfer.sin_port == sin->sin_port) && (cur->transferring)) {
+               /* We're transferring */
+               if (callno == cur->peercallno)  {
+                       return 1;
+               }
+       }
+       if ((cur->peeraddr.sin_addr.s_addr == sin->sin_addr.s_addr) &&
+               (cur->peeraddr.sin_port == sin->sin_port)) {
+               if (callno == cur->peercallno)  {
+                       return 1;
+               }
+       }
+
+       return 0;
+}
+
+static struct iax_session *iax_find_session(struct sockaddr_in *sin, 
+                                                                                       short callno, 
+                                                                                       short dcallno,
+                                                                                       int makenew)
+{
+       struct iax_session *cur = sessions;
+       while(cur) {
+               if (forward_match(sin, callno, dcallno, cur)) {
+                       return cur;
+               }
+               cur = cur->next;
+       }
+
+       cur = sessions;
+       while(cur) {
+               if (reverse_match(sin, callno, cur)) {
+                       return cur;
+               }
+               cur = cur->next;
+       }
+
+       if (makenew && !dcallno) {
+               cur = iax_session_new();
+               cur->peercallno = callno;
+               cur->peeraddr.sin_addr.s_addr = sin->sin_addr.s_addr;
+               cur->peeraddr.sin_port = sin->sin_port;
+               cur->peeraddr.sin_family = AF_INET;
+               cur->pingid = iax_sched_add(NULL,NULL, send_ping, (void *)cur, 2 * 1000);
+               DEBU(G "Making new session, peer callno %d, our callno %d\n", callno, cur->callno);
+       } else {
+               DEBU(G "No session, peer = %d, us = %d\n", callno, dcallno);
+       }
+       return cur;     
+}
+
+#ifdef EXTREME_DEBUG
+static int display_time(int ms)
+{
+       static int oldms = -1;
+       if (oldms < 0) {
+               DEBU(G "First measure\n");
+               oldms = ms;
+               return 0;
+       }
+       DEBU(G "Time from last frame is %d ms\n", ms - oldms);
+       oldms = ms;
+       return 0;
+}
+#endif
+
+#define FUDGE 1
+
+#ifdef NEWJB
+/* From chan_iax2/steve davies:  need to get permission from steve or digium, I guess */
+static time_in_ms_t unwrap_timestamp(time_in_ms_t ts, time_in_ms_t last)
+{
+        int x;
+
+        if ( (ts & 0xFFFF0000) == (last & 0xFFFF0000) ) {
+                x = ts - last;
+                if (x < -50000) {
+                        /* Sudden big jump backwards in timestamp:
+                           What likely happened here is that miniframe timestamp has circled but we haven't
+                           gotten the update from the main packet.  We'll just pretend that we did, and
+                           update the timestamp appropriately. */
+                        ts = ( (last & 0xFFFF0000) + 0x10000) | (ts & 0xFFFF);
+                                DEBU(G "schedule_delivery: pushed forward timestamp\n");
+                }
+                if (x > 50000) {
+                        /* Sudden apparent big jump forwards in timestamp:
+                           What's likely happened is this is an old miniframe belonging to the previous
+                           top-16-bit timestamp that has turned up out of order.
+                           Adjust the timestamp appropriately. */
+                        ts = ( (last & 0xFFFF0000) - 0x10000) | (ts & 0xFFFF);
+                                DEBU(G "schedule_delivery: pushed back timestamp\n");
+                }
+        }
+       return ts;
+}
+#endif
+
+
+static struct iax_event *schedule_delivery(struct iax_event *e, unsigned int ts, int updatehistory)
+{
+       /* 
+        * This is the core of the IAX jitterbuffer delivery mechanism: 
+        * Dynamically adjust the jitterbuffer and decide how time_in_ms_t to wait
+        * before delivering the packet.
+        */
+#ifndef NEWJB
+       int ms, x;
+       int drops[MEMORY_SIZE];
+       int min, max=0, maxone=0, y, z, match;
+#endif
+
+#ifdef EXTREME_DEBUG   
+       DEBU(G "[%p] We are at %d, packet is for %d\n", e->session, calc_rxstamp(e->session), ts);
+#endif
+       
+#ifdef VOICE_SMOOTHING
+       if (e->etype == IAX_EVENT_VOICE) {
+               /* Smooth voices if we know enough about the format */
+               switch(e->event.voice.format) {
+               case AST_FORMAT_GSM:
+                       /* GSM frames are 20 ms long, although there could be periods of 
+                          silence.  If the time is < 50 ms, assume it ought to be 20 ms */
+                       if (ts - e->session->lastts < 50)  
+                               ts = e->session->lastts + 20;
+#ifdef EXTREME_DEBUG
+                       display_time(ts);
+#endif
+                       break;
+               default:
+                       /* Can't do anything */
+               }
+               e->session->lastts = ts;
+       }
+#endif
+
+#ifdef NEWJB
+       {
+           int type = JB_TYPE_CONTROL;
+           int len = 0;
+
+           if(e->etype == IAX_EVENT_VOICE) {
+             type = JB_TYPE_VOICE;
+             len = get_sample_cnt(e) / 8;
+           } else if(e->etype == IAX_EVENT_CNG) {
+             type = JB_TYPE_SILENCE;   
+           }
+
+           /* unwrap timestamp */
+           ts = unwrap_timestamp(ts,e->session->last_ts);
+
+           /* move forward last_ts if it's greater.  We do this _after_ unwrapping, because
+            * asterisk _still_ has cases where it doesn't send full frames when it ought to */
+           if(ts > e->session->last_ts) {
+               e->session->last_ts = ts;               
+           }
+
+
+           /* insert into jitterbuffer */
+           /* TODO: Perhaps we could act immediately if it's not droppable and late */
+           if(jb_put(e->session->jb, e, type, len, ts, calc_rxstamp(e->session)) == JB_DROP) {
+                 iax_event_free(e);
+           }
+
+       }
+#else
+       
+       /* How many ms from now should this packet be delivered? (remember
+          this can be a negative number, too */
+       ms = calc_rxstamp(e->session) - ts;
+
+       /* Drop voice frame if timestamp is way off */
+       if ((e->etype == IAX_EVENT_VOICE) && ((ms > 65536) || (ms < -65536))) {
+           DEBU(G "Dropping a voice packet with odd ts (ts = %d; ms = %d)\n", ts, ms);
+           free(e);
+           return NULL;
+       }
+
+       /* Adjust if voice frame timestamp is off by a step */
+       if (ms > 32768) {
+               /* What likely happened here is that our counter has circled but we haven't
+                  gotten the update from the main packet.  We'll just pretend that we did, and
+                  update the timestamp appropriately. */
+               ms -= 65536;
+       }
+       if (ms < -32768) {
+               /* We got this packet out of order.  Lets add 65536 to it to bring it into our new
+                  time frame */
+               ms += 65536;
+       }
+
+#if 0  
+       printf("rxstamp is %d, timestamp is %d, ms is %d\n", calc_rxstamp(e->session), ts, ms);
+#endif
+       /* Rotate history queue.  Leading 0's are irrelevant. */
+       if (updatehistory) {
+           for (x=0; x < MEMORY_SIZE - 1; x++) 
+                   e->session->history[x] = e->session->history[x+1];
+           
+           /* Add new entry for this time */
+           e->session->history[x] = ms;
+       }
+       
+       /* We have to find the maximum and minimum time delay we've had to deliver. */
+       min = e->session->history[0];
+       for (z=0;z < iax_dropcount + 1; z++) {
+               /* We drop the top iax_dropcount entries.  iax_dropcount represents
+                  a tradeoff between quality of voice and latency.  3% drop seems to
+                  be unnoticable to the client and can significantly improve latency.  
+                  We add one more to our droplist, but that's the one we actually use, 
+                  and don't drop.  */
+               max = -99999999;
+               for (x=0;x<MEMORY_SIZE;x++) {
+                       if (max < e->session->history[x]) {
+                               /* New candidate value.  Make sure we haven't dropped it. */
+                               match=0;
+                               for(y=0;!match && (y<z); y++) 
+                                       match |= (drops[y] == x);
+                               /* If there is no match, this is our new maximum */
+                               if (!match) {
+                                       max = e->session->history[x];
+                                       maxone = x;
+                               }
+                       }
+                       if (!z) {
+                               /* First pass, calcualte our minimum, too */
+                               if (min > e->session->history[x])
+                                       min = e->session->history[x];
+                       }
+               }
+               drops[z] = maxone;
+       }
+       /* Again, just for reference.  The "jitter buffer" is the max.  The difference
+          is the perceived jitter correction. */
+       e->session->jitter = max - min;
+       
+       /* If the jitter buffer is substantially too large, shrink it, slowly enough
+          that the client won't notice ;-) . */
+       if (max < e->session->jitterbuffer - max_extra_jitterbuffer) {
+#ifdef EXTREME_DEBUG
+               DEBU(G "Shrinking jitterbuffer (target = %d, current = %d...\n", max, e->session->jitterbuffer);
+#endif
+               e->session->jitterbuffer -= 1;
+       }
+               
+       /* Keep the jitter buffer from becoming unreasonably large */
+       if (max > min + max_jitterbuffer) {
+               DEBU(G "Constraining jitter buffer (min = %d, max = %d)...\n", min, max);
+               max = min + max_jitterbuffer;
+       }
+       
+       /* If the jitter buffer is too small, we immediately grow our buffer to
+          accomodate */
+       if (max > e->session->jitterbuffer)
+               e->session->jitterbuffer = max;
+       
+       /* Start with our jitter buffer delay, and subtract the lateness (or earliness).
+          Remember these times are all relative to the first packet, so their absolute
+          values are really irrelevant. */
+       ms = e->session->jitterbuffer - ms - IAX_SCHEDULE_FUZZ;
+       
+       /* If the jitterbuffer is disabled, always deliver immediately */
+       if (!iax_use_jitterbuffer)
+               ms = 0;
+       
+       if (ms < 1) {
+#ifdef EXTREME_DEBUG
+               DEBU(G "Calculated delay is only %d\n", ms);
+#endif
+               if ((ms > -4) || (e->etype != IAX_EVENT_VOICE)) {
+                       /* Return the event immediately if it's it's less than 3 milliseconds
+                          too late, or if it's not voice (believe me, you don't want to
+                          just drop a hangup frame because it's late, or a ping, or some such.
+                          That kinda ruins retransmissions too ;-) */
+                       /* Queue for immediate delivery */
+                       iax_sched_add(e, NULL, NULL, NULL, 0);
+                       return NULL;
+                       //return e;
+               }
+               DEBU(G "(not so) Silently dropping a packet (ms = %d)\n", ms);
+               /* Silently discard this as if it were to be delivered */
+               free(e);
+               return NULL;
+       }
+       /* We need this to be delivered in the future, so we use our scheduler */
+       iax_sched_add(e, NULL, NULL, NULL, ms);
+#ifdef EXTREME_DEBUG
+       DEBU(G "Delivering packet in %d ms\n", ms);
+#endif
+#endif /* NEWJB */
+       return NULL;
+       
+}
+
+static int uncompress_subclass(unsigned char csub)
+{
+       /* If the SC_LOG flag is set, return 2^csub otherwise csub */
+       if (csub & IAX_FLAG_SC_LOG)
+               return 1 << (csub & ~IAX_FLAG_SC_LOG & IAX_MAX_SHIFT);
+       else
+               return csub;
+}
+
+static inline char *extract(char *src, char *string)
+{
+       /* Extract and duplicate what we need from a string */
+       char *s, *t;
+       s = strstr(src, string);
+       if (s) {
+               s += strlen(string);
+               s = strdup(s);
+               /* End at ; */
+               t = strchr(s, ';');
+               if (t) {
+                       *t = '\0';
+               }
+       }
+       return s;
+               
+}
+
+static struct iax_event *iax_header_to_event(struct iax_session *session,
+                                                                                        struct ast_iax2_full_hdr *fh,
+                                                                                        int datalen, struct sockaddr_in *sin)
+{
+       struct iax_event *e;
+       struct iax_sched *sch;
+       unsigned int ts;
+       int subclass = uncompress_subclass(fh->csub);
+       int nowts;
+       int updatehistory = 1;
+       ts = ntohl(fh->ts);
+       /* don't run last_ts backwards; i.e. for retransmits and the like */
+       if (ts > session->last_ts &&
+           (fh->type == AST_FRAME_IAX && 
+            subclass != IAX_COMMAND_ACK &&
+            subclass != IAX_COMMAND_PONG &&
+            subclass != IAX_COMMAND_LAGRP)) {
+           session->last_ts = ts;
+       }
+
+
+#ifdef DEBUG_SUPPORT
+       iax_showframe(NULL, fh, 1, sin, datalen);
+#endif
+
+       /* Get things going with it, timestamp wise, if we
+          haven't already. */
+
+               /* Handle implicit ACKing unless this is an INVAL, and only if this is 
+                  from the real peer, not the transfer peer */
+               if (!inaddrcmp(sin, &session->peeraddr) && 
+                       (((subclass != IAX_COMMAND_INVAL)) ||
+                       (fh->type != AST_FRAME_IAX))) {
+                       unsigned char x;
+                       /* XXX This code is not very efficient.  Surely there is a better way which still
+                              properly handles boundary conditions? XXX */
+                       /* First we have to qualify that the ACKed value is within our window */
+                       for (x=session->rseqno; x != session->oseqno; x++)
+                               if (fh->iseqno == x)
+                                       break;
+                       if ((x != session->oseqno) || (session->oseqno == fh->iseqno)) {
+                               /* The acknowledgement is within our window.  Time to acknowledge everything
+                                  that it says to */
+                               for (x=session->rseqno; x != fh->iseqno; x++) {
+                                       /* Ack the packet with the given timestamp */
+                                       DEBU(G "Cancelling transmission of packet %d\n", x);
+                                       sch = schedq;
+                                       while(sch) {
+                                               if (sch->frame && (sch->frame->session == session) && 
+                                                   (sch->frame->oseqno == x)) 
+                                                       sch->frame->retries = -1;
+                                               sch = sch->next;
+                                       }
+                               }
+                               /* Note how much we've received acknowledgement for */
+                               session->rseqno = fh->iseqno;
+                       } else
+                               DEBU(G "Received iseqno %d not within window %d->%d\n", fh->iseqno, session->rseqno, session->oseqno);
+               }
+
+       /* Check where we are */
+               if ((ntohs(fh->dcallno) & IAX_FLAG_RETRANS) || (fh->type != AST_FRAME_VOICE))
+                       updatehistory = 0;
+               if ((session->iseqno != fh->oseqno) &&
+                       (session->iseqno ||
+                          ((subclass != IAX_COMMAND_TXREADY) &&
+                           (subclass != IAX_COMMAND_TXREL) &&
+                               (subclass != IAX_COMMAND_TXCNT) &&
+                               (subclass != IAX_COMMAND_TXACC)) ||
+                         (fh->type != AST_FRAME_IAX))) {
+                       if (
+                        ((subclass != IAX_COMMAND_ACK) &&
+                         (subclass != IAX_COMMAND_INVAL) &&
+                         (subclass != IAX_COMMAND_TXREADY) &&
+                         (subclass != IAX_COMMAND_TXREL) &&
+                         (subclass != IAX_COMMAND_TXCNT) &&
+                         (subclass != IAX_COMMAND_TXACC) &&
+                         (subclass != IAX_COMMAND_VNAK)) ||
+                         (fh->type != AST_FRAME_IAX)) {
+                               /* If it's not an ACK packet, it's out of order. */
+                               DEBU(G "Packet arrived out of order (expecting %d, got %d) (frametype = %d, subclass = %d)\n", 
+                                       session->iseqno, fh->oseqno, fh->type, subclass);
+                               if (session->iseqno > fh->oseqno) {
+                                       /* If we've already seen it, ack it XXX There's a border condition here XXX */
+                                       if ((fh->type != AST_FRAME_IAX) || 
+                                                       ((subclass != IAX_COMMAND_ACK) && (subclass != IAX_COMMAND_INVAL))) {
+                                               DEBU(G "Acking anyway\n");
+                                               /* XXX Maybe we should handle its ack to us, but then again, it's probably outdated anyway, and if
+                                                  we have anything to send, we'll retransmit and get an ACK back anyway XXX */
+                                               send_command_immediate(session, AST_FRAME_IAX, IAX_COMMAND_ACK, ts, NULL, 0,fh->iseqno);
+                                       }
+                               } else {
+                                       /* Send a VNAK requesting retransmission */
+                                       iax2_vnak(session);
+                               }
+                               return NULL;
+                       }
+               } else {
+                       /* Increment unless it's an ACK or VNAK */
+                       if (((subclass != IAX_COMMAND_ACK) &&
+                           (subclass != IAX_COMMAND_INVAL) &&
+                           (subclass != IAX_COMMAND_TXCNT) &&
+                           (subclass != IAX_COMMAND_TXACC) &&
+                               (subclass != IAX_COMMAND_VNAK)) ||
+                           (fh->type != AST_FRAME_IAX))
+                               session->iseqno++;
+               }
+                       
+       e = (struct iax_event *)malloc(sizeof(struct iax_event) + datalen + 1);
+
+       if (e) {
+               memset(e, 0, sizeof(struct iax_event) + datalen);
+               /* Set etype to some unknown value so do not inavertently
+                  sending IAX_EVENT_CONNECT event, which is 0 to application.
+                */
+               e->etype = -1;
+               e->session = session;
+               switch(fh->type) {
+               case AST_FRAME_DTMF:
+                       e->etype = IAX_EVENT_DTMF;
+                       e->subclass = subclass;
+                       /* 
+                        We want the DTMF event deliver immediately so all I/O can be
+                        terminate quickly in an IVR system.
+                       e = schedule_delivery(e, ts, updatehistory); */
+                       break;
+               case AST_FRAME_VOICE:
+                       e->etype = IAX_EVENT_VOICE;
+                       e->subclass = subclass;
+                       session->voiceformat = subclass;
+                       if (datalen) {
+                               memcpy(e->data, fh->iedata, datalen);
+                               e->datalen = datalen;
+                       }
+                       e = schedule_delivery(e, ts, updatehistory);
+                       break;
+               case AST_FRAME_CNG:
+                       e->etype = IAX_EVENT_CNG;
+                       e->subclass = subclass;
+                        if (datalen) {
+                                memcpy(e->data, fh->iedata, datalen);
+                                e->datalen = datalen;
+                        }
+                        e = schedule_delivery(e, ts, updatehistory);
+                        break;
+               case AST_FRAME_IAX:
+                       /* Parse IE's */
+                       if (datalen) {
+                               memcpy(e->data, fh->iedata, datalen);
+                               e->datalen = datalen;
+                       }
+                       if (iax_parse_ies(&e->ies, e->data, e->datalen)) {
+                               IAXERROR "Unable to parse IE's");
+                               free(e);
+                               e = NULL;
+                               break;
+                       }
+                       switch(subclass) {
+                       case IAX_COMMAND_NEW:
+                               /* This is a new, incoming call */
+                               /* save the capability for validation */
+                               session->capability = e->ies.capability;
+                               if (e->ies.codec_prefs) {
+                                       strncpy(session->codec_order, e->ies.codec_prefs, sizeof(session->codec_order));
+                                       session->codec_order_len = strlen(session->codec_order);
+                               }
+                               e->etype = IAX_EVENT_CONNECT;
+                               e = schedule_delivery(e, ts, updatehistory);
+                               break;
+                       case IAX_COMMAND_AUTHREQ:
+                               /* This is a request for a call */
+                               e->etype = IAX_EVENT_AUTHRQ;
+                               if (strlen(session->username) && !strcmp(e->ies.username, session->username) &&
+                                       strlen(session->secret)) {
+                                               /* Hey, we already know this one */
+                                               iax_auth_reply(session, session->secret, e->ies.challenge, e->ies.authmethods);
+                                               free(e);
+                                               e = NULL;
+                                               break;
+                               }
+                               e = schedule_delivery(e, ts, updatehistory);
+                               break;
+                       case IAX_COMMAND_HANGUP:
+                               e->etype = IAX_EVENT_HANGUP;
+                               e = schedule_delivery(e, ts, updatehistory);
+                               break;
+                       case IAX_COMMAND_INVAL:
+                               e->etype = IAX_EVENT_HANGUP;
+                               e = schedule_delivery(e, ts, updatehistory);
+                               break;
+                       case IAX_COMMAND_REJECT:
+                               e->etype = IAX_EVENT_REJECT;
+                               e = schedule_delivery(e, ts, updatehistory);
+                               break;
+                       case IAX_COMMAND_ACK:
+                               free(e);
+                               e = NULL;
+                               break;
+                       case IAX_COMMAND_LAGRQ:
+                               /* Pass this atime_in_ms_t for later handling */
+                               e->etype = IAX_EVENT_LAGRQ;
+                               e->ts = ts;
+                               e = schedule_delivery(e, ts, updatehistory);
+                               break;
+                       case IAX_COMMAND_PING:
+                       case IAX_COMMAND_POKE:
+                               /* PINGS and PONGS don't get scheduled; */
+                               e->etype = IAX_EVENT_PING;
+                               e->ts = ts;
+                               break;
+                       case IAX_COMMAND_PONG:
+                               e->etype = IAX_EVENT_PONG;
+                               /* track weighted average of ping time */
+                               session->pingtime = ((2 * session->pingtime) + (calc_timestamp(session,0,NULL) - ts)) / 3;
+                               session->remote_netstats.jitter = e->ies.rr_jitter;
+                               session->remote_netstats.losspct = e->ies.rr_loss >> 24;;
+                               session->remote_netstats.losscnt = e->ies.rr_loss & 0xffffff;
+                               session->remote_netstats.packets = e->ies.rr_pkts;
+                               session->remote_netstats.delay = e->ies.rr_delay;
+                               session->remote_netstats.dropped = e->ies.rr_dropped;
+                               session->remote_netstats.ooo = e->ies.rr_ooo;
+                               break;
+                       case IAX_COMMAND_ACCEPT:
+                               if (e->ies.format & session->capability) {
+                                       e->etype = IAX_EVENT_ACCEPT;
+                               }
+                               else {
+                                       struct iax_ie_data ied;
+                                       /* Although this should not happen, we added this to make sure
+                                          the negotiation protocol is enforced.
+                                               For lack of event to notify the application we use the defined
+                                               REJECT event.
+                                        */
+                                       memset(&ied, 0, sizeof(ied));
+                                       iax_ie_append_str(&ied, IAX_IE_CAUSE, (unsigned char *) "Unable to negotiate codec");
+                                       send_command_final(session, AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied.buf, ied.pos, -1);
+                                       e->etype = IAX_EVENT_REJECT;
+                               }
+                               e = schedule_delivery(e, ts, updatehistory);
+                               break;
+                       case IAX_COMMAND_REGACK:
+                               e->etype = IAX_EVENT_REGACK;
+                               e = schedule_delivery(e, ts, updatehistory);
+                               break;
+                       case IAX_COMMAND_REGAUTH:
+                               iax_regauth_reply(session, session->secret, e->ies.challenge, e->ies.authmethods);
+                               free(e);
+                               e = NULL;
+                               break;
+                       case IAX_COMMAND_REGREJ:
+                               e->etype = IAX_EVENT_REGREJ;
+                               e = schedule_delivery(e, ts, updatehistory);
+                               break;
+                       case IAX_COMMAND_LAGRP:
+                               e->etype = IAX_EVENT_LAGRP;
+                               nowts = calc_timestamp(session, 0, NULL);
+                               e->ts = nowts - ts;
+                               e->subclass = session->jitter;
+                               /* Can't call schedule_delivery since timestamp is non-normal */
+                               break;;
+                       case IAX_COMMAND_TXREQ:
+                               /* added check for defensive programming
+                                * - in case the asterisk server
+                                * or another client does not send the
+                                *  apparent transfer address
+                                */
+                               if (e->ies.apparent_addr != NULL) {
+                                   /* so a full voice frame is sent on the 
+                                      next voice output */
+                                   session->svoiceformat = -1; 
+                                   session->transfer = *e->ies.apparent_addr;
+                                   session->transfer.sin_family = AF_INET;
+                                   session->transfercallno = e->ies.callno;
+                                   session->transferring = TRANSFER_BEGIN;
+                                   session->transferid = e->ies.transferid;
+                                   iax_send_txcnt(session);
+                               }
+                               free(e);
+                               e = NULL;
+                               break;
+                       case IAX_COMMAND_DPREP:
+                               /* Received dialplan reply */
+                               e->etype = IAX_EVENT_DPREP;
+                               /* Return immediately, makes no sense to schedule */
+                               break;
+                       case IAX_COMMAND_TXCNT:
+                               if (session->transferring)  {
+                                       session->transfer = *sin;
+                                       iax_send_txaccept(session);
+                               }
+                               free(e);
+                               e = NULL;
+                               break;
+                       case IAX_COMMAND_TXACC:
+                               if (session->transferring) {
+                                       stop_transfer(session);
+                                       session->transferring = TRANSFER_READY;
+                                       iax_send_txready(session);
+                               }
+                               free(e);
+                               e = NULL;
+                               break;
+                       case IAX_COMMAND_TXREL:
+                               /* Release the transfer */
+                          send_command_immediate(session, AST_FRAME_IAX, IAX_COMMAND_ACK, fh->ts, NULL, 0, fh->iseqno);
+                               if (session->transferring) {
+                                       complete_transfer(session, e->ies.callno, 1, 0);
+                               }
+                               else {
+                                       complete_transfer(session, session->peercallno, 0, 1);
+                               }
+                               e->etype = IAX_EVENT_TRANSFER;
+                               /* notify that asterisk no longer sitting between peers */
+                               e = schedule_delivery(e, ts, updatehistory);
+                               break;
+                       case IAX_COMMAND_QUELCH:
+                               e->etype = IAX_EVENT_QUELCH;
+                               session->quelch = 1;
+                               break;
+                       case IAX_COMMAND_UNQUELCH:
+                               e->etype = IAX_EVENT_UNQUELCH;
+                               session->quelch = 0;
+                               break;
+                       case IAX_COMMAND_TXREJ:
+                               e->etype = IAX_EVENT_TXREJECT;
+                               iax_handle_txreject(session);
+                               break;
+
+                       case IAX_COMMAND_TXREADY:
+                               send_command_immediate(session, AST_FRAME_IAX, IAX_COMMAND_ACK, ts, NULL, 0, fh->iseqno);
+                               if (iax_handle_txready(session)) {
+                                       e->etype = IAX_EVENT_TXREADY;
+                               }
+                               else {
+                                       free(e);
+                                       e = NULL;
+                               }
+                               break;
+                       default:
+                               DEBU(G "Don't know what to do with IAX command %d\n", subclass);
+                               free(e);
+                               e = NULL;
+                       }
+                       break;
+               case AST_FRAME_CONTROL:
+                       switch(subclass) {
+                       case AST_CONTROL_ANSWER:
+                               e->etype = IAX_EVENT_ANSWER;
+                               e = schedule_delivery(e, ts, updatehistory);
+                               break;
+                       case AST_CONTROL_CONGESTION:
+                       case AST_CONTROL_BUSY:
+                               e->etype = IAX_EVENT_BUSY;
+                               e = schedule_delivery(e, ts, updatehistory);
+                               break;
+                       case AST_CONTROL_RINGING:
+                               e->etype = IAX_EVENT_RINGA;
+                               e = schedule_delivery(e, ts, updatehistory);
+                               break;
+                       default:
+                               DEBU(G "Don't know what to do with AST control %d\n", subclass);
+                               free(e);
+                               return NULL;
+                       }
+                       break;
+               case AST_FRAME_IMAGE:
+                       e->etype = IAX_EVENT_IMAGE;
+                       e->subclass = subclass;
+                       if (datalen) {
+                               memcpy(e->data, fh->iedata, datalen);
+                       }
+                       e = schedule_delivery(e, ts, updatehistory);
+                       break;
+
+               case AST_FRAME_TEXT:
+                       e->etype = IAX_EVENT_TEXT;
+                       if (datalen) {
+                               memcpy(e->data, fh->iedata, datalen);
+                       }
+                       e = schedule_delivery(e, ts, updatehistory);
+                       break;
+
+               case AST_FRAME_HTML:
+                       switch(fh->csub) {
+                       case AST_HTML_LINKURL:
+                               e->etype = IAX_EVENT_LINKURL;
+                               /* Fall through */
+                       case AST_HTML_URL:
+                               if (e->etype == -1)
+                                       e->etype = IAX_EVENT_URL;
+                               e->subclass = fh->csub;
+                               e->datalen = datalen;
+                               if (datalen) {
+                                       memcpy(e->data, fh->iedata, datalen);
+                               }
+                               e = schedule_delivery(e, ts, updatehistory);
+                               break;
+                       case AST_HTML_LDCOMPLETE:
+                               e->etype = IAX_EVENT_LDCOMPLETE;
+                               e = schedule_delivery(e, ts, updatehistory);
+                               break;
+                       case AST_HTML_UNLINK:
+                               e->etype = IAX_EVENT_UNLINK;
+                               e = schedule_delivery(e, ts, updatehistory);
+                               break;
+                       case AST_HTML_LINKREJECT:
+                               e->etype = IAX_EVENT_LINKREJECT;
+                               e = schedule_delivery(e, ts, updatehistory);
+                               break;
+                       default:
+                               DEBU(G "Don't know how to handle HTML type %d frames\n", fh->csub);
+                               free(e);
+                               return NULL;
+                       }
+                       break;
+               default:
+                       DEBU(G "Don't know what to do with frame type %d\n", fh->type);
+                       free(e);
+                       return NULL;
+               }
+       } else
+               DEBU(G "Out of memory\n");
+           
+       /* Already ack'd iax frames */
+       if (session->aseqno != session->iseqno) {
+           send_command_immediate(session, AST_FRAME_IAX, IAX_COMMAND_ACK, ts, NULL, 0, fh->iseqno);
+       }
+       return e;
+}
+
+static struct iax_event *iax_miniheader_to_event(struct iax_session *session,
+                                               struct ast_iax2_mini_hdr *mh,
+                                               int datalen)
+{
+       struct iax_event *e;
+       unsigned int ts;
+       int updatehistory = 1;
+       e = (struct iax_event *)malloc(sizeof(struct iax_event) + datalen);
+       if (e) {
+               if (session->voiceformat > 0) {
+                       e->etype = IAX_EVENT_VOICE;
+                       e->session = session;
+                       e->subclass = session->voiceformat;
+                       e->datalen = datalen;
+                       if (datalen) {
+#ifdef EXTREME_DEBUG
+                               DEBU(G "%d bytes of voice\n", datalen);
+#endif
+                               memcpy(e->data, mh->data, datalen);
+                       }
+                       ts = (session->last_ts & 0xFFFF0000) | ntohs(mh->ts);
+                       return schedule_delivery(e, ts, updatehistory);
+               } else {
+                       DEBU(G "No last format received on session %d\n", session->callno);
+                       free(e);
+                       e = NULL;
+               }
+       } else
+               DEBU(G "Out of memory\n");
+       return e;
+}
+
+void iax_destroy(struct iax_session *session)
+{
+       destroy_session(session);
+}
+
+static struct iax_event *iax_net_read(void)
+{
+       unsigned char buf[65536];
+       int res;
+       struct sockaddr_in sin;
+       unsigned int sinlen;
+       sinlen = sizeof(sin);
+       res = iax_recvfrom(netfd, buf, sizeof(buf), 0, (struct sockaddr *) &sin, &sinlen);
+       if (res < 0) {
+#ifdef WIN32
+               if (WSAGetLastError() != WSAEWOULDBLOCK) {
+                       DEBU(G "Error on read: %d\n", WSAGetLastError());
+                       IAXERROR "Read error on network socket: %s", strerror(errno));
+               }
+#else
+               if (errno != EAGAIN) {
+                       DEBU(G "Error on read: %s\n", strerror(errno));
+                       IAXERROR "Read error on network socket: %s", strerror(errno));
+               }
+#endif
+               return NULL;
+       }
+       return iax_net_process(buf, res, &sin);
+}
+
+static struct iax_session *iax_txcnt_session(struct ast_iax2_full_hdr *fh, int datalen,
+                               struct sockaddr_in *sin, short callno, short dcallno)
+{
+       int subclass = uncompress_subclass(fh->csub);
+       unsigned char buf[ 65536 ]; /* allocated on stack with same size as iax_net_read() */
+       struct iax_ies ies;
+       struct iax_session *cur;
+
+       if ((fh->type != AST_FRAME_IAX) || (subclass != IAX_COMMAND_TXCNT) || (!datalen)) {
+               return NULL; /* special handling for TXCNT only */
+       }
+       memcpy(buf, fh->iedata, datalen);       /* prepare local buf for iax_parse_ies() */
+
+       if (iax_parse_ies(&ies, buf, datalen)) {
+               return NULL;    /* Unable to parse IE's */
+       }
+       if (!ies.transferid) {
+               return NULL;    /* TXCNT without proper IAX_IE_TRANSFERID */
+       }
+       for( cur=sessions; cur; cur=cur->next ) {
+               if ((cur->transferring) && (cur->transferid == ies.transferid) &&
+                       (cur->callno == dcallno) && (cur->transfercallno == callno)) {
+                       /* We're transferring ---
+                        *      skip address/port checking which would fail while remote peer behind symmetric NAT
+                        *      verify transferid instead
+                        */
+                       cur->transfer.sin_addr.s_addr = sin->sin_addr.s_addr;   /* setup for further handling */
+                       cur->transfer.sin_port = sin->sin_port;
+                       break;          
+               }
+       }
+       return cur;
+}
+
+struct iax_event *iax_net_process(unsigned char *buf, int len, struct sockaddr_in *sin)
+{
+       struct ast_iax2_full_hdr *fh = (struct ast_iax2_full_hdr *)buf;
+       struct ast_iax2_mini_hdr *mh = (struct ast_iax2_mini_hdr *)buf;
+       struct iax_session *session;
+       
+       if (ntohs(fh->scallno) & IAX_FLAG_FULL) {
+               /* Full size header */
+               if (len < sizeof(struct ast_iax2_full_hdr)) {
+                       DEBU(G "Short header received from %s\n", inet_ntoa(sin->sin_addr));
+                       IAXERROR "Short header received from %s\n", inet_ntoa(sin->sin_addr));
+               }
+               /* We have a full header, process appropriately */
+               session = iax_find_session(sin, ntohs(fh->scallno) & ~IAX_FLAG_FULL, ntohs(fh->dcallno) & ~IAX_FLAG_RETRANS, 1);
+               if (!session)
+                       session = iax_txcnt_session(fh, len-sizeof(struct ast_iax2_full_hdr), sin, ntohs(fh->scallno) & ~IAX_FLAG_FULL, ntohs(fh->dcallno) & ~IAX_FLAG_RETRANS);
+               if (session) 
+                       return iax_header_to_event(session, fh, len - sizeof(struct ast_iax2_full_hdr), sin);
+               DEBU(G "No session?\n");
+               return NULL;
+       } else {
+               if (len < sizeof(struct ast_iax2_mini_hdr)) {
+                       DEBU(G "Short header received from %s\n", inet_ntoa(sin->sin_addr));
+                       IAXERROR "Short header received from %s\n", inet_ntoa(sin->sin_addr));
+               }
+               /* Miniature, voice frame */
+               session = iax_find_session(sin, ntohs(fh->scallno), 0, 0);
+               if (session)
+                       return iax_miniheader_to_event(session, mh, len - sizeof(struct ast_iax2_mini_hdr));
+               DEBU(G "No session?\n");
+               return NULL;
+       }
+}
+
+static struct iax_sched *iax_get_sched(time_in_ms_t time_in_ms)
+{
+       struct iax_sched *cur, *prev=NULL;
+       cur = schedq;
+       /* Check the event schedule first. */
+       while(cur) {
+               if (time_in_ms > cur->when) {
+                       /* Take it out of the event queue */
+                       if (prev) {
+                               prev->next = cur->next;
+                       } else {
+                               schedq = cur->next;
+                       }
+                       return cur;
+               }
+               cur = cur->next;
+       }
+       return NULL;
+}
+
+struct iax_event *iax_get_event(int blocking)
+{
+       struct iax_event *event;
+       struct iax_frame *frame;
+       time_in_ms_t time_in_ms;
+       struct iax_sched *cur;
+       
+       if (do_shutdown) {
+               __iax_shutdown();
+               do_shutdown = 0;
+               return NULL;
+       }
+       time_in_ms = current_time_in_ms();
+       while((cur = iax_get_sched(time_in_ms))) {
+
+               event = cur->event;
+               frame = cur->frame;
+               if (event) {
+
+                       /* See if this is an event we need to handle */
+                       event = handle_event(event);
+                       if (event) {
+                               free(cur);
+                               return event;
+                       }
+               } else if(frame) {
+                       /* It's a frame, transmit it and schedule a retry */
+                       if (frame->retries < 0) {
+                               /* It's been acked.  No need to send it.   Destroy the old
+                                  frame. If final, destroy the session. */
+                               if (frame->final)
+                                       destroy_session(frame->session);
+                               if (frame->data)
+                                       free(frame->data);
+                               free(frame);
+                       } else if (frame->retries == 0) {
+                               if (frame->transfer) {
+                                       /* Send a transfer reject since we weren't able to connect */
+                                       iax_send_txrej(frame->session);
+                                       if (frame->data)
+                                               free(frame->data);
+                                       free(frame);
+                                       free(cur);
+                                       break;
+                               } else {
+                                       /* We haven't been able to get an ACK on this packet. If a 
+                                          final frame, destroy the session, otherwise, pass up timeout */
+                                       if (frame->final) {
+                                               destroy_session(frame->session);
+                                               if (frame->data)
+                                                       free(frame->data);
+                                               free(frame);
+                                       } else {
+                                               event = (struct iax_event *)malloc(sizeof(struct iax_event));
+                                               if (event) {
+                                                       event->etype = IAX_EVENT_TIMEOUT;
+                                                       event->session = frame->session;
+                                                       if (frame->data)
+                                                               free(frame->data);
+                                                       free(frame);
+                                                       free(cur);
+                                                       return handle_event(event);
+                                               }
+                                       }
+                               }
+                       } else {
+                               struct ast_iax2_full_hdr *fh;
+                               /* Decrement remaining retries */
+                               frame->retries--;
+                               /* Multiply next retry time by 4, not above MAX_RETRY_TIME though */
+                               frame->retrytime *= 4;
+                               /* Keep under 1000 ms if this is a transfer packet */
+                               if (!frame->transfer) {
+                                       if (frame->retrytime > MAX_RETRY_TIME)
+                                               frame->retrytime = MAX_RETRY_TIME;
+                               } else if (frame->retrytime > 1000)
+                                       frame->retrytime = 1000;
+                               fh = (struct ast_iax2_full_hdr *)(frame->data);
+                               fh->dcallno = htons(IAX_FLAG_RETRANS | frame->dcallno);
+                               iax_xmit_frame(frame);
+                               /* Schedule another retransmission */
+                               DEBU(G "Scheduling retransmission %d\n", frame->retries);
+                               iax_sched_add(NULL, frame, NULL, NULL, frame->retrytime);
+                       }
+               } else if (cur->func) {
+                   cur->func(cur->arg);
+               }
+               free(cur);
+       }
+
+#ifdef NEWJB
+       /* get jitterbuffer-scheduled events */
+       {
+           struct iax_session *cur;
+           jb_frame frame;
+           for(cur=sessions; cur; cur=cur->next) {
+               int ret;
+               time_in_ms_t now;
+               time_in_ms_t next;
+
+               now = time_in_ms - cur->rxcore;
+               if(now > (next = jb_next(cur->jb))) {
+                   /* FIXME don't hardcode interpolation frame length in jb_get */
+                   ret = jb_get(cur->jb,&frame,now,20);
+                   switch(ret) {
+                       case JB_OK:
+//                         if(frame.type == JB_TYPE_VOICE && next + 20 != jb_next(cur->jb)) fprintf(stderr, "NEXT %ld is not %ld+20!\n", jb_next(cur->jb), next);
+                           event = frame.data;
+                           event = handle_event(event);
+                           if (event) {
+                                   return event;
+                           }
+                       break;
+                       case JB_INTERP:
+//                         if(next + 20 != jb_next(cur->jb)) fprintf(stderr, "NEXT %ld is not %ld+20!\n", jb_next(cur->jb), next);
+                           /* create an interpolation frame */
+                           //fprintf(stderr, "Making Interpolation frame\n");
+                           event = (struct iax_event *)malloc(sizeof(struct iax_event));
+                           if (event) {
+                                   event->etype    = IAX_EVENT_VOICE;
+                                   event->subclass = cur->voiceformat;
+                                   event->ts       = now; /* XXX: ??? applications probably ignore this anyway */
+                                   event->session  = cur;
+                                   event->datalen  = 0;
+                                   event = handle_event(event);
+                                   if(event)
+                                       return event;
+                           }
+                       break;
+                       case JB_DROP:
+//                         if(next != jb_next(cur->jb)) fprintf(stderr, "NEXT %ld is not next %ld!\n", jb_next(cur->jb), next);
+                           iax_event_free(frame.data);
+                       break;
+                       case JB_NOFRAME:
+                       case JB_EMPTY:
+                           /* do nothing */
+                       break;
+                       default:
+                           /* shouldn't happen */
+                       break;
+                   }
+               }
+           }
+       }
+
+#endif
+       /* Now look for networking events */
+       if (blocking) {
+               /* Block until there is data if desired */
+               fd_set fds;
+               int nextEventTime;
+               
+               FD_ZERO(&fds);
+               FD_SET(netfd, &fds);
+
+               nextEventTime = iax_time_to_next_event(); 
+
+               if(nextEventTime < 0) 
+               select(netfd + 1, &fds, NULL, NULL, NULL);
+               else 
+               { 
+                       struct timeval nextEvent; 
+
+                       nextEvent.tv_sec = nextEventTime / 1000; 
+                       nextEvent.tv_usec = (nextEventTime % 1000) * 1000;
+
+                       select(netfd + 1, &fds, NULL, NULL, &nextEvent); 
+               } 
+
+       }
+       event = iax_net_read();
+       
+       return handle_event(event);
+}
+
+struct sockaddr_in iax_get_peer_addr(struct iax_session *session)
+{
+       return session->peeraddr;
+}
+
+void iax_session_destroy(struct iax_session **session) 
+{
+       destroy_session(*session);
+       *session = NULL;
+}
+
+void iax_event_free(struct iax_event *event)
+{
+       /* 
+          We gave the user a chance to play with the session now we need to destroy it 
+          if you are not calling this function on every event you read you are now going
+          to leak sessions as well as events!
+       */
+       switch(event->etype) {
+       case IAX_EVENT_REJECT:
+       case IAX_EVENT_HANGUP:
+               /* Destroy this session -- it's no longer valid */
+               if (event->session) { /* maybe the user did it already */
+                       destroy_session(event->session);
+               }
+               break;
+       }
+       free(event);
+}
+
+int iax_get_fd(void) 
+{
+       /* Return our network file descriptor.  The client can select on this (probably with other
+          things, or can add it to a network add sort of gtk_input_add for example */
+       return netfd;
+}
+
+int iax_quelch_moh(struct iax_session *session, int MOH)
+{
+       
+       struct iax_ie_data ied;                 //IE Data Structure (Stuff To Send)
+       memset(&ied, 0, sizeof(ied));   
+       
+       // You can't quelch the quelched
+       if (session->quelch == 1)
+               return -1;
+               
+       if (MOH) {
+               iax_ie_append(&ied, IAX_IE_MUSICONHOLD);
+               session->transfer_moh = 1;
+       }
+               
+       return send_command(session, AST_FRAME_IAX, IAX_COMMAND_QUELCH, 0, ied.buf, ied.pos, -1);
+}
diff --git a/libs/iax/src/iax.h b/libs/iax/src/iax.h
new file mode 100644 (file)
index 0000000..7c2806b
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * libIAX
+ *
+ * Implementation of Inter-IAXerisk eXchange
+ * 
+ * Copyright (C) 1999, Mark Spencer
+ *
+ * Mark Spencer <markster@linux-support.net>
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License
+ */
+#ifndef _IAX_H
+#define _IAX_H
+
+/* Max version of IAX protocol we support */
+#define IAX_PROTO_VERSION 1
+
+#define IAX_MAX_CALLS 32768
+
+#define IAX_FLAG_FULL          0x8000
+
+#define IAX_FLAG_SC_LOG                0x80
+
+#define IAX_MAX_SHIFT          0x1F
+
+/* Maximum size of an IAX frame (max size of UDP frame) */
+#define IAX_MAX_BUF_SIZE 65536
+
+/* Subclass for IAX_FRAME_IAX */
+#define IAX_COMMAND_NEW                1
+#define IAX_COMMAND_PING       2
+#define IAX_COMMAND_PONG       3
+#define IAX_COMMAND_ACK                4
+#define IAX_COMMAND_HANGUP     5
+#define IAX_COMMAND_REJECT     6
+#define IAX_COMMAND_ACCEPT     7
+#define IAX_COMMAND_AUTHREQ    8
+#define IAX_COMMAND_AUTHREP    9
+#define IAX_COMMAND_INVAL      10
+#define IAX_COMMAND_LAGRQ      11
+#define IAX_COMMAND_LAGRP      12
+#define IAX_COMMAND_REGREQ     13      /* Registration request */
+#define IAX_COMMAND_REGAUTH    14      /* Registration authentication required */
+#define IAX_COMMAND_REGACK     15      /* Registration accepted */
+#define IAX_COMMAND_REGREJ     16      /* Registration rejected */
+#define IAX_COMMAND_REGREL     17      /* Force release of registration */
+#define IAX_COMMAND_VNAK       18      /* If we receive voice before valid first voice frame, send this */
+#define IAX_COMMAND_DPREQ      19      /* Request status of a dialplan entry */
+#define IAX_COMMAND_DPREP      20      /* Request status of a dialplan entry */
+#define IAX_COMMAND_DIAL       21      /* Request a dial on channel brought up TBD */
+#define IAX_COMMAND_TXREQ      22      /* Transfer Request */
+#define IAX_COMMAND_TXCNT      23      /* Transfer Connect */
+#define IAX_COMMAND_TXACC      24      /* Transfer Accepted */
+#define IAX_COMMAND_TXREADY    25      /* Transfer ready */
+#define IAX_COMMAND_TXREL      26      /* Transfer release */
+#define IAX_COMMAND_TXREJ      27      /* Transfer reject */
+#define IAX_COMMAND_QUELCH     28      /* Stop audio/video transmission */
+#define IAX_COMMAND_UNQUELCH 29        /* Resume audio/video transmission */
+
+#define IAX_DEFAULT_REG_EXPIRE         60
+
+#define IAX_DEFAULT_PORTNO             5036
+
+/* Full frames are always delivered reliably */
+struct iax_full_hdr {
+       short callno;                   /* Source call number -- high bit must be 1 */
+       short dcallno;                  /* Destination call number */
+       unsigned int ts;                /* 32-bit timestamp in milliseconds */
+       unsigned short seqno;   /* Packet number */
+       char type;                              /* Frame type */
+       unsigned char csub;             /* Compressed subclass */
+       char data[0];
+};
+
+/* Mini header is used only for voice frames -- delivered unreliably */
+struct iax_mini_hdr {
+       short callno;                   /* Source call number -- high bit must be 0 */
+       unsigned short ts;              /* 16-bit Timestamp (high 16 bits from last IAX_full_hdr) */
+                                                       /* Frametype implicitly VOICE_FRAME */
+                                                       /* subclass implicit from last IAX_full_hdr */
+       char data[0];
+};
+
+#endif
diff --git a/libs/iax/src/iax2-parser.c b/libs/iax/src/iax2-parser.c
new file mode 100644 (file)
index 0000000..1c91be3
--- /dev/null
@@ -0,0 +1,838 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
+ * Implementation of Inter-Asterisk eXchange
+ * 
+ * Copyright (C) 2003-2004, Digium
+ *
+ * Mark Spencer <markster@digium.com>
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU Lesser (Library) General Public License
+ */
+
+#ifdef WIN32
+#include <winsock.h>
+#define snprintf _snprintf
+#else
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#endif
+
+#ifndef _MSC_VER
+#include <unistd.h>
+#endif
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "frame.h"
+#include "iax2.h"
+#include "iax2-parser.h"
+
+static int frames = 0;
+static int iframes = 0;
+static int oframes = 0;
+
+#ifdef ALIGN32
+static unsigned int get_uint32(unsigned char *p)
+{
+  return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
+}
+
+static unsigned short get_uint16(unsigned char *p)
+{
+  return (p[0] << 8) | p[1] ;
+}
+
+#else
+#define get_uint32(p) (*((unsigned int *)(p)))
+#define get_uint16(p) (*((unsigned short *)(p)))
+#endif
+
+
+static void internaloutput(const char *str)
+{
+       printf(str);
+}
+
+static void internalerror(const char *str)
+{
+       fprintf(stderr, "WARNING: %s", str);
+}
+
+static void (*outputf)(const char *str) = internaloutput;
+static void (*errorf)(const char *str) = internalerror;
+
+static void dump_addr(char *output, int maxlen, void *value, int len)
+{
+       struct sockaddr_in sin;
+       if (len == sizeof(sin)) {
+               memcpy(&sin, value, len);
+               snprintf(output, maxlen, "IPV4 %s:%d", inet_ntoa(sin.sin_addr), ntohs(sin.sin_port));
+       } else {
+               snprintf(output, maxlen, "Invalid Address");
+       }
+}
+
+static void dump_string(char *output, int maxlen, void *value, int len)
+{
+       maxlen--;
+       if (maxlen > len)
+               maxlen = len;
+       strncpy(output,value, maxlen);
+       output[maxlen] = '\0';
+}
+
+static void dump_int(char *output, int maxlen, void *value, int len)
+{
+       if (len == (int)sizeof(unsigned int))
+               snprintf(output, maxlen, "%lu", (unsigned long)ntohl(get_uint32(value)));
+       else
+               snprintf(output, maxlen, "Invalid INT");
+}
+
+static void dump_short(char *output, int maxlen, void *value, int len)
+{
+       if (len == (int)sizeof(unsigned short))
+               snprintf(output, maxlen, "%d", ntohs(get_uint16(value)));
+       else
+               snprintf(output, maxlen, "Invalid SHORT");
+}
+
+static void dump_byte(char *output, int maxlen, void *value, int len)
+{
+       if (len == (int)sizeof(unsigned char))
+               snprintf(output, maxlen, "%d", *((unsigned char *)value));
+       else
+               snprintf(output, maxlen, "Invalid BYTE");
+}
+
+static void dump_ipaddr(char *output, int maxlen, void *value, int len)
+{
+       struct sockaddr_in sin;
+       if (len == (int)sizeof(unsigned int)) {
+               memcpy(&sin.sin_addr, value, len);
+               snprintf(output, maxlen, "%s", inet_ntoa(sin.sin_addr));
+       } else
+               snprintf(output, maxlen, "Invalid IPADDR");
+}
+
+
+static void dump_prov_flags(char *output, int maxlen, void *value, int len)
+{
+       if (len == (int)sizeof(unsigned int))
+               snprintf(output, maxlen, "%lu (%s)", (unsigned long)ntohl(get_uint32(value)),
+                       "PROVISION_PARSING_NOT_IMPLEMENTED");
+       else
+               snprintf(output, maxlen, "Invalid INT");
+}
+
+static void dump_samprate(char *output, int maxlen, void *value, int len)
+{
+       char tmp[256]="";
+       int sr;
+       if (len == (int)sizeof(unsigned short)) {
+               sr = ntohs(*((unsigned short *)value));
+               if (sr & IAX_RATE_8KHZ)
+                       strcat(tmp, ",8khz");
+               if (sr & IAX_RATE_11KHZ)
+                       strcat(tmp, ",11.025khz");
+               if (sr & IAX_RATE_16KHZ)
+                       strcat(tmp, ",16khz");
+               if (sr & IAX_RATE_22KHZ)
+                       strcat(tmp, ",22.05khz");
+               if (sr & IAX_RATE_44KHZ)
+                       strcat(tmp, ",44.1khz");
+               if (sr & IAX_RATE_48KHZ)
+                       strcat(tmp, ",48khz");
+               if (strlen(tmp))
+                       strncpy(output, &tmp[1], maxlen - 1);
+               else
+                       strncpy(output, "None specified!\n", maxlen - 1);
+       } else
+               snprintf(output, maxlen, "Invalid SHORT");
+
+}
+
+static void dump_prov_ies(char *output, int maxlen, unsigned char *iedata, int len);
+static void dump_prov(char *output, int maxlen, void *value, int len)
+{
+       dump_prov_ies(output, maxlen, value, len);
+}
+
+static struct iax2_ie {
+       int ie;
+       char *name;
+       void (*dump)(char *output, int maxlen, void *value, int len);
+} ies[] = {
+       { IAX_IE_CALLED_NUMBER, "CALLED NUMBER", dump_string },
+       { IAX_IE_CALLING_NUMBER, "CALLING NUMBER", dump_string },
+       { IAX_IE_CALLING_ANI, "ANI", dump_string },
+       { IAX_IE_CALLING_NAME, "CALLING NAME", dump_string },
+       { IAX_IE_CALLED_CONTEXT, "CALLED CONTEXT", dump_string },
+       { IAX_IE_USERNAME, "USERNAME", dump_string },
+       { IAX_IE_PASSWORD, "PASSWORD", dump_string },
+       { IAX_IE_CAPABILITY, "CAPABILITY", dump_int },
+       { IAX_IE_FORMAT, "FORMAT", dump_int },
+       { IAX_IE_LANGUAGE, "LANGUAGE", dump_string },
+       { IAX_IE_CODEC_PREFS, "CODEC_PREFS", dump_string },
+       { IAX_IE_VERSION, "VERSION", dump_short },
+       { IAX_IE_ADSICPE, "ADSICPE", dump_short },
+       { IAX_IE_DNID, "DNID", dump_string },
+       { IAX_IE_AUTHMETHODS, "AUTHMETHODS", dump_short },
+       { IAX_IE_CHALLENGE, "CHALLENGE", dump_string },
+       { IAX_IE_MD5_RESULT, "MD5 RESULT", dump_string },
+       { IAX_IE_RSA_RESULT, "RSA RESULT", dump_string },
+       { IAX_IE_APPARENT_ADDR, "APPARENT ADDRESS", dump_addr },
+       { IAX_IE_REFRESH, "REFRESH", dump_short },
+       { IAX_IE_DPSTATUS, "DIALPLAN STATUS", dump_short },
+       { IAX_IE_CALLNO, "CALL NUMBER", dump_short },
+       { IAX_IE_CAUSE, "CAUSE", dump_string },
+       { IAX_IE_IAX_UNKNOWN, "UNKNOWN IAX CMD", dump_byte },
+       { IAX_IE_MSGCOUNT, "MESSAGE COUNT", dump_short },
+       { IAX_IE_AUTOANSWER, "AUTO ANSWER REQ" },
+       { IAX_IE_TRANSFERID, "TRANSFER ID", dump_int },
+       { IAX_IE_RDNIS, "REFERRING DNIS", dump_string },
+       { IAX_IE_PROVISIONING, "PROVISIONING", dump_prov },
+       { IAX_IE_AESPROVISIONING, "AES PROVISIONG" },
+       { IAX_IE_DATETIME, "DATE TIME", dump_int },
+       { IAX_IE_DEVICETYPE, "DEVICE TYPE", dump_string },
+       { IAX_IE_SERVICEIDENT, "SERVICE IDENT", dump_string },
+       { IAX_IE_FIRMWAREVER, "FIRMWARE VER", dump_short },
+       { IAX_IE_FWBLOCKDESC, "FW BLOCK DESC", dump_int },
+       { IAX_IE_FWBLOCKDATA, "FW BLOCK DATA" },
+       { IAX_IE_PROVVER, "PROVISIONG VER", dump_int },
+       { IAX_IE_CALLINGPRES, "CALLING PRESNTN", dump_byte },
+       { IAX_IE_CALLINGTON, "CALLING TYPEOFNUM", dump_byte },
+       { IAX_IE_CALLINGTNS, "CALLING TRANSITNET", dump_short },
+       { IAX_IE_SAMPLINGRATE, "SAMPLINGRATE", dump_samprate },
+       { IAX_IE_CODEC_PREFS, "CODEC_PREFS", dump_string },
+       { IAX_IE_RR_JITTER, "RR_JITTER", dump_int },
+       { IAX_IE_RR_LOSS, "RR_LOSS", dump_int },
+       { IAX_IE_RR_PKTS, "RR_PKTS", dump_int },
+       { IAX_IE_RR_DELAY, "RR_DELAY", dump_short },
+       { IAX_IE_RR_DROPPED, "RR_DROPPED", dump_int },
+       { IAX_IE_RR_OOO, "RR_OOO", dump_int },
+};
+
+const char *iax_ie2str(int ie)
+{
+       int x;
+       for (x=0;x<(int)sizeof(ies) / (int)sizeof(ies[0]); x++) {
+               if (ies[x].ie == ie)
+                       return ies[x].name;
+       }
+       return "Unknown IE";
+}
+
+
+static void dump_prov_ies(char *output, int maxlen, unsigned char *iedata, int len)
+{
+       int ielen;
+       int ie;
+       int found;
+       char tmp[256];
+       if (len < 2)
+               return;
+       strcpy(output, "\n"); 
+       maxlen -= strlen(output); output += strlen(output);
+       while(len > 2) {
+               ie = iedata[0];
+               ielen = iedata[1];
+               if (ielen + 2> len) {
+                       snprintf(tmp, (int)sizeof(tmp), "Total Prov IE length of %d bytes exceeds remaining prov frame length of %d bytes\n", ielen + 2, len);
+                       strncpy(output, tmp, maxlen - 1);
+                       maxlen -= strlen(output); output += strlen(output);
+                       return;
+               }
+               found = 0;
+               if (!found) {
+                       snprintf(tmp, (int)sizeof(tmp), "       Unknown Prov IE %03d  : Present\n", ie);
+                       strncpy(output, tmp, maxlen - 1);
+                       maxlen -= strlen(output); output += strlen(output);
+               }
+               iedata += (2 + ielen);
+               len -= (2 + ielen);
+       }
+}
+
+static void dump_ies(unsigned char *iedata, int len)
+{
+       int ielen;
+       int ie;
+       int x;
+       int found;
+       char interp[1024];
+       char tmp[1024];
+       if (len < 2)
+               return;
+       while(len > 2) {
+               ie = iedata[0];
+               ielen = iedata[1];
+               if (ielen + 2> len) {
+                       snprintf(tmp, (int)sizeof(tmp), "Total IE length of %d bytes exceeds remaining frame length of %d bytes\n", ielen + 2, len);
+                       outputf(tmp);
+                       return;
+               }
+               found = 0;
+               for (x=0;x<(int)sizeof(ies) / (int)sizeof(ies[0]); x++) {
+                       if (ies[x].ie == ie) {
+                               if (ies[x].dump) {
+                                       ies[x].dump(interp, (int)sizeof(interp), iedata + 2, ielen);
+                                       snprintf(tmp, (int)sizeof(tmp), "   %-15.15s : %s\n", ies[x].name, interp);
+                                       outputf(tmp);
+                               } else {
+                                       if (ielen)
+                                               snprintf(interp, (int)sizeof(interp), "%d bytes", ielen);
+                                       else
+                                               strcpy(interp, "Present");
+                                       snprintf(tmp, (int)sizeof(tmp), "   %-15.15s : %s\n", ies[x].name, interp);
+                                       outputf(tmp);
+                               }
+                               found++;
+                       }
+               }
+               if (!found) {
+                       snprintf(tmp, (int)sizeof(tmp), "   Unknown IE %03d  : Present\n", ie);
+                       outputf(tmp);
+               }
+               iedata += (2 + ielen);
+               len -= (2 + ielen);
+       }
+       outputf("\n");
+}
+
+void iax_showframe(struct iax_frame *f, struct ast_iax2_full_hdr *fhi, int rx, struct sockaddr_in *sin, int datalen)
+{
+       const char *frames[] = {
+               "(0?)",
+               "DTMF   ",
+               "VOICE  ",
+               "VIDEO  ",
+               "CONTROL",
+               "NULL   ",
+               "IAX    ",
+               "TEXT   ",
+               "IMAGE  " };
+       const char *iaxs[] = {
+               "(0?)",
+               "NEW    ",
+               "PING   ",
+               "PONG   ",
+               "ACK    ",
+               "HANGUP ",
+               "REJECT ",
+               "ACCEPT ",
+               "AUTHREQ",
+               "AUTHREP",
+               "INVAL  ",
+               "LAGRQ  ",
+               "LAGRP  ",
+               "REGREQ ",
+               "REGAUTH",
+               "REGACK ",
+               "REGREJ ",
+               "REGREL ",
+               "VNAK   ",
+               "DPREQ  ",
+               "DPREP  ",
+               "DIAL   ",
+               "TXREQ  ",
+               "TXCNT  ",
+               "TXACC  ",
+               "TXREADY",
+               "TXREL  ",
+               "TXREJ  ",
+               "QUELCH ",
+               "UNQULCH",
+               "POKE",
+               "PAGE",
+               "MWI",
+               "UNSUPPORTED",
+               "TRANSFER",
+               "PROVISION",
+               "FWDOWNLD",
+               "FWDATA"
+       };
+       const char *cmds[] = {
+               "(0?)",
+               "HANGUP ",
+               "RING   ",
+               "RINGING",
+               "ANSWER ",
+               "BUSY   ",
+               "TKOFFHK ",
+               "OFFHOOK" };
+       struct ast_iax2_full_hdr *fh;
+       char retries[20];
+       char class2[20];
+       char subclass2[20];
+       const char *class;
+       const char *subclass;
+       char tmp[256];
+
+       if (f) {
+               fh = f->data;
+               snprintf(retries, (int)sizeof(retries), "%03d", f->retries);
+       } else {
+               fh = fhi;
+               if (ntohs(fh->dcallno) & IAX_FLAG_RETRANS)
+                       strcpy(retries, "Yes");
+               else
+                       strcpy(retries, " No");
+       }
+       if (!(ntohs(fh->scallno) & IAX_FLAG_FULL)) {
+               /* Don't mess with mini-frames */
+               return;
+       }
+       if (fh->type > (int)sizeof(frames)/(int)sizeof(char *)) {
+               snprintf(class2, (int)sizeof(class2), "(%d?)", fh->type);
+               class = class2;
+       } else {
+               class = frames[(int)fh->type];
+       }
+       if (fh->type == AST_FRAME_DTMF) {
+               sprintf(subclass2, "%c", fh->csub);
+               subclass = subclass2;
+       } else if (fh->type == AST_FRAME_IAX) {
+               if (fh->csub >= (int)sizeof(iaxs)/(int)sizeof(iaxs[0])) {
+                       snprintf(subclass2, (int)sizeof(subclass2), "(%d?)", fh->csub);
+                       subclass = subclass2;
+               } else {
+                       subclass = iaxs[(int)fh->csub];
+               }
+       } else if (fh->type == AST_FRAME_CONTROL) {
+               if (fh->csub > (int)sizeof(cmds)/(int)sizeof(char *)) {
+                       snprintf(subclass2, (int)sizeof(subclass2), "(%d?)", fh->csub);
+                       subclass = subclass2;
+               } else {
+                       subclass = cmds[(int)fh->csub];
+               }
+       } else {
+               snprintf(subclass2, (int)sizeof(subclass2), "%d", fh->csub);
+               subclass = subclass2;
+       }
+snprintf(tmp, (int)sizeof(tmp), 
+"%s-Frame Retry[%s] -- OSeqno: %3.3d ISeqno: %3.3d Type: %s Subclass: %s\n",
+       (rx ? "Rx" : "Tx"),
+       retries, fh->oseqno, fh->iseqno, class, subclass);
+       outputf(tmp);
+snprintf(tmp, (int)sizeof(tmp), 
+"   Timestamp: %05lums  SCall: %5.5d  DCall: %5.5d [%s:%d]\n",
+       (unsigned long)ntohl(fh->ts),
+       ntohs(fh->scallno) & ~IAX_FLAG_FULL, ntohs(fh->dcallno) & ~IAX_FLAG_RETRANS,
+               inet_ntoa(sin->sin_addr), ntohs(sin->sin_port));
+       outputf(tmp);
+       if (fh->type == AST_FRAME_IAX)
+               dump_ies(fh->iedata, datalen);
+}
+
+int iax_ie_append_raw(struct iax_ie_data *ied, unsigned char ie, void *data, int datalen)
+{
+       char tmp[256];
+       if (datalen > ((int)sizeof(ied->buf) - ied->pos)) {
+               snprintf(tmp, (int)sizeof(tmp), "Out of space for ie '%s' (%d), need %d have %d\n", iax_ie2str(ie), ie, datalen, (int)sizeof(ied->buf) - ied->pos);
+               errorf(tmp);
+               return -1;
+       }
+       ied->buf[ied->pos++] = ie;
+       ied->buf[ied->pos++] = datalen;
+       memcpy(ied->buf + ied->pos, data, datalen);
+       ied->pos += datalen;
+       return 0;
+}
+
+int iax_ie_append_addr(struct iax_ie_data *ied, unsigned char ie, struct sockaddr_in *sin)
+{
+       return iax_ie_append_raw(ied, ie, sin, (int)sizeof(struct sockaddr_in));
+}
+
+int iax_ie_append_int(struct iax_ie_data *ied, unsigned char ie, unsigned int value) 
+{
+       unsigned int newval;
+       newval = htonl(value);
+       return iax_ie_append_raw(ied, ie, &newval, (int)sizeof(newval));
+}
+
+int iax_ie_append_short(struct iax_ie_data *ied, unsigned char ie, unsigned short value) 
+{
+       unsigned short newval;
+       newval = htons(value);
+       return iax_ie_append_raw(ied, ie, &newval, (int)sizeof(newval));
+}
+
+int iax_ie_append_str(struct iax_ie_data *ied, unsigned char ie, unsigned char *str)
+{
+       return iax_ie_append_raw(ied, ie, str, strlen((char *) str));
+}
+
+int iax_ie_append_byte(struct iax_ie_data *ied, unsigned char ie, unsigned char dat)
+{
+       return iax_ie_append_raw(ied, ie, &dat, 1);
+}
+
+int iax_ie_append(struct iax_ie_data *ied, unsigned char ie) 
+{
+       return iax_ie_append_raw(ied, ie, NULL, 0);
+}
+
+void iax_set_output(void (*func)(const char *))
+{
+       outputf = func;
+}
+
+void iax_set_error(void (*func)(const char *))
+{
+       errorf = func;
+}
+
+int iax_parse_ies(struct iax_ies *ies, unsigned char *data, int datalen)
+{
+       /* Parse data into information elements */
+       int len;
+       int ie;
+       char tmp[256];
+       memset(ies, 0, (int)sizeof(struct iax_ies));
+       ies->msgcount = -1;
+       ies->firmwarever = -1;
+       ies->calling_ton = -1;
+       ies->calling_tns = -1;
+       ies->calling_pres = -1;
+       ies->samprate = IAX_RATE_8KHZ;
+       while(datalen >= 2) {
+               ie = data[0];
+               len = data[1];
+               if (len > datalen - 2) {
+                       errorf("Information element length exceeds message size\n");
+                       return -1;
+               }
+               switch(ie) {
+               case IAX_IE_CALLED_NUMBER:
+                       ies->called_number = (char *) data + 2;
+                       break;
+               case IAX_IE_CALLING_NUMBER:
+                       ies->calling_number = (char *) data + 2;
+                       break;
+               case IAX_IE_CALLING_ANI:
+                       ies->calling_ani = (char *) data + 2;
+                       break;
+               case IAX_IE_CALLING_NAME:
+                       ies->calling_name = (char *) data + 2;
+                       break;
+               case IAX_IE_CALLED_CONTEXT:
+                       ies->called_context = (char *) data + 2;
+                       break;
+               case IAX_IE_USERNAME:
+                       ies->username = (char *) data + 2;
+                       break;
+               case IAX_IE_PASSWORD:
+                       ies->password = (char *) data + 2;
+                       break;
+               case IAX_IE_CAPABILITY:
+                       if (len != (int)sizeof(unsigned int)) {
+                               snprintf(tmp, (int)sizeof(tmp), "Expecting capability to be %d bytes long but was %d\n", (int)sizeof(unsigned int), len);
+                               errorf(tmp);
+                       } else
+                               ies->capability = ntohl(get_uint32(data + 2));
+                       break;
+               case IAX_IE_FORMAT:
+                       if (len != (int)sizeof(unsigned int)) {
+                               snprintf(tmp, (int)sizeof(tmp), "Expecting format to be %d bytes long but was %d\n", (int)sizeof(unsigned int), len);
+                               errorf(tmp);
+                       } else
+                               ies->format = ntohl(get_uint32(data + 2));
+                       break;
+               case IAX_IE_LANGUAGE:
+                       ies->language = (char *) data + 2;
+                       break;
+               case IAX_IE_CODEC_PREFS:
+                       ies->codec_prefs = (char *) data + 2;
+                       break;
+               case IAX_IE_VERSION:
+                       if (len != (int)sizeof(unsigned short)) {
+                               snprintf(tmp, (int)sizeof(tmp),  "Expecting version to be %d bytes long but was %d\n", (int)sizeof(unsigned short), len);
+                               errorf(tmp);
+                       } else
+                               ies->version = ntohs(get_uint16(data + 2));
+                       break;
+               case IAX_IE_ADSICPE:
+                       if (len != (int)sizeof(unsigned short)) {
+                               snprintf(tmp, (int)sizeof(tmp), "Expecting adsicpe to be %d bytes long but was %d\n", (int)sizeof(unsigned short), len);
+                               errorf(tmp);
+                       } else
+                               ies->adsicpe = ntohs(get_uint16(data + 2));
+                       break;
+               case IAX_IE_SAMPLINGRATE:
+                       if (len != (int)sizeof(unsigned short)) {
+                               snprintf(tmp, (int)sizeof(tmp), "Expecting samplingrate to be %d bytes long but was %d\n", (int)sizeof(unsigned short), len);
+                               errorf(tmp);
+                       } else
+                               ies->samprate = ntohs(get_uint16(data + 2));
+                       break;
+               case IAX_IE_DNID:
+                       ies->dnid = (char *) data + 2;
+                       break;
+               case IAX_IE_RDNIS:
+                       ies->rdnis = (char *) data + 2;
+                       break;
+               case IAX_IE_AUTHMETHODS:
+                       if (len != (int)sizeof(unsigned short))  {
+                               snprintf(tmp, (int)sizeof(tmp), "Expecting authmethods to be %d bytes long but was %d\n", (int)sizeof(unsigned short), len);
+                               errorf(tmp);
+                       } else
+                               ies->authmethods = ntohs(get_uint16(data + 2));
+                       break;
+               case IAX_IE_CHALLENGE:
+                       ies->challenge = (char *) data + 2;
+                       break;
+               case IAX_IE_MD5_RESULT:
+                       ies->md5_result = (char *) data + 2;
+                       break;
+               case IAX_IE_RSA_RESULT:
+                       ies->rsa_result = (char *) data + 2;
+                       break;
+               case IAX_IE_APPARENT_ADDR:
+                       ies->apparent_addr = ((struct sockaddr_in *)(data + 2));
+                       break;
+               case IAX_IE_REFRESH:
+                       if (len != (int)sizeof(unsigned short)) {
+                               snprintf(tmp, (int)sizeof(tmp),  "Expecting refresh to be %d bytes long but was %d\n", (int)sizeof(unsigned short), len);
+                               errorf(tmp);
+                       } else
+                               ies->refresh = ntohs(get_uint16(data + 2));
+                       break;
+               case IAX_IE_DPSTATUS:
+                       if (len != (int)sizeof(unsigned short)) {
+                               snprintf(tmp, (int)sizeof(tmp),  "Expecting dpstatus to be %d bytes long but was %d\n", (int)sizeof(unsigned short), len);
+                               errorf(tmp);
+                       } else
+                               ies->dpstatus = ntohs(get_uint16(data + 2));
+                       break;
+               case IAX_IE_CALLNO:
+                       if (len != (int)sizeof(unsigned short)) {
+                               snprintf(tmp, (int)sizeof(tmp),  "Expecting callno to be %d bytes long but was %d\n", (int)sizeof(unsigned short), len);
+                               errorf(tmp);
+                       } else
+                               ies->callno = ntohs(get_uint16(data + 2));
+                       break;
+               case IAX_IE_CAUSE:
+                       ies->cause = (char *) data + 2;
+                       break;
+               case IAX_IE_CAUSECODE:
+                       if (len != 1) {
+                               snprintf(tmp, (int)sizeof(tmp), "Expecting causecode to be single byte but was %d\n", len);
+                               errorf(tmp);
+                       } else {
+                               ies->causecode = data[2];
+                       }
+                       break;
+               case IAX_IE_IAX_UNKNOWN:
+                       if (len == 1)
+                               ies->iax_unknown = data[2];
+                       else {
+                               snprintf(tmp, (int)sizeof(tmp), "Expected single byte Unknown command, but was %d long\n", len);
+                               errorf(tmp);
+                       }
+                       break;
+               case IAX_IE_MSGCOUNT:
+                       if (len != (int)sizeof(unsigned short)) {
+                               snprintf(tmp, (int)sizeof(tmp), "Expecting msgcount to be %d bytes long but was %d\n", (int)sizeof(unsigned short), len);
+                               errorf(tmp);
+                       } else
+                               ies->msgcount = ntohs(get_uint16(data + 2));    
+                       break;
+               case IAX_IE_AUTOANSWER:
+                       ies->autoanswer = 1;
+                       break;
+               case IAX_IE_MUSICONHOLD:
+                       ies->musiconhold = 1;
+                       break;
+               case IAX_IE_TRANSFERID:
+                       if (len != (int)sizeof(unsigned int)) {
+                               snprintf(tmp, (int)sizeof(tmp), "Expecting transferid to be %d bytes long but was %d\n", (int)sizeof(unsigned int), len);
+                               errorf(tmp);
+                       } else
+                               ies->transferid = ntohl(get_uint32(data + 2));
+                       break;
+               case IAX_IE_DATETIME:
+                       if (len != (int)sizeof(unsigned int)) {
+                               snprintf(tmp, (int)sizeof(tmp), "Expecting date/time to be %d bytes long but was %d\n", (int)sizeof(unsigned int), len);
+                               errorf(tmp);
+                       } else
+                               ies->datetime = ntohl(get_uint32(data + 2));
+                       break;
+               case IAX_IE_FIRMWAREVER:
+                       if (len != (int)sizeof(unsigned short)) {
+                               snprintf(tmp, (int)sizeof(tmp), "Expecting firmwarever to be %d bytes long but was %d\n", (int)sizeof(unsigned short), len);
+                               errorf(tmp);
+                       } else
+                               ies->firmwarever = ntohs(get_uint16(data + 2)); 
+                       break;
+               case IAX_IE_DEVICETYPE:
+                       ies->devicetype = (char *) data + 2;
+                       break;
+               case IAX_IE_SERVICEIDENT:
+                       ies->serviceident = (char *) data + 2;
+                       break;
+               case IAX_IE_FWBLOCKDESC:
+                       if (len != (int)sizeof(unsigned int)) {
+                               snprintf(tmp, (int)sizeof(tmp), "Expected block desc to be %d bytes long but was %d\n", (int)sizeof(unsigned int), len);
+                               errorf(tmp);
+                       } else
+                               ies->fwdesc = ntohl(get_uint32(data + 2));
+                       break;
+               case IAX_IE_FWBLOCKDATA:
+                       ies->fwdata = data + 2;
+                       ies->fwdatalen = len;
+                       break;
+               case IAX_IE_PROVVER:
+                       if (len != (int)sizeof(unsigned int)) {
+                               snprintf(tmp, (int)sizeof(tmp), "Expected provisioning version to be %d bytes long but was %d\n", (int)sizeof(unsigned int), len);
+                               errorf(tmp);
+                       } else {
+                               ies->provverpres = 1;
+                               ies->provver = ntohl(get_uint32(data + 2));
+                       }
+                       break;
+               case IAX_IE_CALLINGPRES:
+                       if (len == 1)
+                               ies->calling_pres = data[2];
+                       else {
+                               snprintf(tmp, (int)sizeof(tmp), "Expected single byte callingpres, but was %d long\n", len);
+                               errorf(tmp);
+                       }
+                       break;
+               case IAX_IE_CALLINGTON:
+                       if (len == 1)
+                               ies->calling_ton = data[2];
+                       else {
+                               snprintf(tmp, (int)sizeof(tmp), "Expected single byte callington, but was %d long\n", len);
+                               errorf(tmp);
+                       }
+                       break;
+               case IAX_IE_CALLINGTNS:
+                       if (len != (int)sizeof(unsigned short)) {
+                               snprintf(tmp, (int)sizeof(tmp), "Expecting callingtns to be %d bytes long but was %d\n", (int)sizeof(unsigned short), len);
+                               errorf(tmp);
+                       } else
+                               ies->calling_tns = ntohs(get_uint16(data + 2)); 
+                       break;
+               case IAX_IE_RR_JITTER:
+                       if (len != (int)sizeof(unsigned int)) {
+                               snprintf(tmp, (int)sizeof(tmp), "Expected jitter rr to be %d bytes long but was %d\n", (int)sizeof(unsigned int), len);
+                               errorf(tmp);
+                       } else {
+                               ies->rr_jitter = ntohl(get_uint32(data + 2));
+                       }
+                       break;
+               case IAX_IE_RR_LOSS:
+                       if (len != (int)sizeof(unsigned int)) {
+                               snprintf(tmp, (int)sizeof(tmp), "Expected loss rr to be %d bytes long but was %d\n", (int)sizeof(unsigned int), len);
+                               errorf(tmp);
+                       } else {
+                               ies->rr_loss = ntohl(get_uint32(data + 2));
+                       }
+                       break;
+               case IAX_IE_RR_PKTS:
+                       if (len != (int)sizeof(unsigned int)) {
+                               snprintf(tmp, (int)sizeof(tmp), "Expected packets rr to be %d bytes long but was %d\n", (int)sizeof(unsigned int), len);
+                               errorf(tmp);
+                       } else {
+                               ies->rr_pkts = ntohl(get_uint32(data + 2));
+                       }
+                       break;
+               case IAX_IE_RR_DELAY:
+                       if (len != (int)sizeof(unsigned short)) {
+                               snprintf(tmp, (int)sizeof(tmp), "Expected loss rr to be %d bytes long but was %d\n", (int)sizeof(unsigned short), len);
+                               errorf(tmp);
+                       } else {
+                               ies->rr_delay = ntohs(get_uint16(data + 2));
+                       }
+                       break;
+               case IAX_IE_RR_DROPPED:
+                       if (len != (int)sizeof(unsigned int)) {
+                               snprintf(tmp, (int)sizeof(tmp), "Expected packets rr to be %d bytes long but was %d\n", (int)sizeof(unsigned int), len);
+                               errorf(tmp);
+                       } else {
+                               ies->rr_dropped = ntohl(get_uint32(data + 2));
+                       }
+                       break;
+               case IAX_IE_RR_OOO:
+                       if (len != (int)sizeof(unsigned int)) {
+                               snprintf(tmp, (int)sizeof(tmp), "Expected packets rr to be %d bytes long but was %d\n", (int)sizeof(unsigned int), len);
+                               errorf(tmp);
+                       } else {
+                               ies->rr_ooo = ntohl(get_uint32(data + 2));
+                       }
+                       break;
+               default:
+                       snprintf(tmp, (int)sizeof(tmp), "Ignoring unknown information element '%s' (%d) of length %d\n", iax_ie2str(ie), ie, len);
+                       outputf(tmp);
+               }
+               /* Overwrite information element with 0, to null terminate previous portion */
+               data[0] = 0;
+               datalen -= (len + 2);
+               data += (len + 2);
+       }
+       /* Null-terminate last field */
+       *data = '\0';
+       if (datalen) {
+               errorf("Invalid information element contents, strange boundary\n");
+               return -1;
+       }
+       return 0;
+}
+
+void iax_frame_wrap(struct iax_frame *fr, struct ast_frame *f)
+{
+       fr->af.frametype = f->frametype;
+       fr->af.subclass = f->subclass;
+       fr->af.mallocd = 0;                             /* Our frame is static relative to the container */
+       fr->af.datalen = f->datalen;
+       fr->af.samples = f->samples;
+       fr->af.offset = AST_FRIENDLY_OFFSET;
+       fr->af.src = f->src;
+       fr->af.data = fr->afdata;
+       if (fr->af.datalen) 
+               memcpy(fr->af.data, f->data, fr->af.datalen);
+}
+
+struct iax_frame *iax_frame_new(int direction, int datalen)
+{
+       struct iax_frame *fr;
+       fr = malloc((int)sizeof(struct iax_frame) + datalen);
+       if (fr) {
+               fr->direction = direction;
+               fr->retrans = -1;
+               frames++;
+               if (fr->direction == DIRECTION_INGRESS)
+                       iframes++;
+               else
+                       oframes++;
+       }
+       return fr;
+}
+
+void iax_frame_free(struct iax_frame *fr)
+{
+       /* Note: does not remove from scheduler! */
+       if (fr->direction == DIRECTION_INGRESS)
+               iframes--;
+       else if (fr->direction == DIRECTION_OUTGRESS)
+               oframes--;
+       else {
+               errorf("Attempt to double free frame detected\n");
+               return;
+       }
+       fr->direction = 0;
+       free(fr);
+       frames--;
+}
+
+int iax_get_frames(void) { return frames; }
+int iax_get_iframes(void) { return iframes; }
+int iax_get_oframes(void) { return oframes; }
diff --git a/libs/iax/src/iax2-parser.h b/libs/iax/src/iax2-parser.h
new file mode 100644 (file)
index 0000000..0a97e46
--- /dev/null
@@ -0,0 +1,146 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
+ * Implementation of Inter-Asterisk eXchange
+ * 
+ * Copyright (C) 2003, Digium
+ *
+ * Mark Spencer <markster@digium.com>
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License
+ */
+#ifndef _IAX2_PARSER_H
+#define _IAX2_PARSER_H
+
+struct iax_ies {
+       char *called_number;
+       char *calling_number;
+       char *calling_ani;
+       char *calling_name;
+       int calling_ton;
+       int calling_tns;
+       int calling_pres;
+       char *called_context;
+       char *username;
+       char *password;
+       unsigned int capability;
+       unsigned int format;
+       char *codec_prefs;
+       char *language;
+       int version;
+       unsigned short adsicpe;
+       char *dnid;
+       char *rdnis;
+       unsigned int authmethods;
+       char *challenge;
+       char *md5_result;
+       char *rsa_result;
+       struct sockaddr_in *apparent_addr;
+       unsigned short refresh;
+       unsigned short dpstatus;
+       unsigned short callno;
+       char *cause;
+       unsigned char causecode;
+       unsigned char iax_unknown;
+       int msgcount;
+       int autoanswer;
+       int musiconhold;
+       unsigned int transferid;
+       unsigned int datetime;
+       char *devicetype;
+       char *serviceident;
+       int firmwarever;
+       unsigned int fwdesc;
+       unsigned char *fwdata;
+       unsigned char fwdatalen;
+       unsigned int provver;
+       unsigned short samprate;
+       unsigned int provverpres;
+       unsigned int rr_jitter;
+       unsigned int rr_loss;
+       unsigned int rr_pkts;
+       unsigned short rr_delay;
+       unsigned int rr_dropped;
+       unsigned int rr_ooo;
+};
+
+#define DIRECTION_INGRESS 1
+#define DIRECTION_OUTGRESS 2
+
+struct iax_frame {
+#ifdef LIBIAX
+       struct iax_session *session;
+       struct iax_event *event;
+#endif
+
+       /* /Our/ call number */
+       unsigned short callno;
+       /* /Their/ call number */
+       unsigned short dcallno;
+       /* Start of raw frame (outgoing only) */
+       void *data;
+       /* Length of frame (outgoing only) */
+       int datalen;
+       /* How many retries so far? */
+       int retries;
+       /* Outgoing relative timestamp (ms) */
+       unsigned int ts;
+       /* How long to wait before retrying */
+       int retrytime;
+       /* Are we received out of order?  */
+       int outoforder;
+       /* Have we been sent at all yet? */
+       int sentyet;
+       /* Outgoing Packet sequence number */
+       int oseqno;
+       /* Next expected incoming packet sequence number */
+       int iseqno;
+       /* Non-zero if should be sent to transfer peer */
+       int transfer;
+       /* Non-zero if this is the final message */
+       int final;
+       /* Ingress or outgres */
+       int direction;
+       /* Retransmission ID */
+       int retrans;
+       /* Easy linking */
+       struct iax_frame *next;
+       struct iax_frame *prev;
+       /* Actual, isolated frame header */
+       struct ast_frame af;
+       unsigned char unused[AST_FRIENDLY_OFFSET];
+       unsigned char afdata[0];        /* Data for frame */
+};
+
+struct iax_ie_data {
+       unsigned char buf[1024];
+       int pos;
+};
+
+/* Choose a different function for output */
+extern void iax_set_output(void (*output)(const char *data));
+/* Choose a different function for errors */
+extern void iax_set_error(void (*output)(const char *data));
+extern void iax_showframe(struct iax_frame *f, struct ast_iax2_full_hdr *fhi, int rx, struct sockaddr_in *sin, int datalen);
+
+extern const char *iax_ie2str(int ie);
+
+extern int iax_ie_append_raw(struct iax_ie_data *ied, unsigned char ie, void *data, int datalen);
+extern int iax_ie_append_addr(struct iax_ie_data *ied, unsigned char ie, struct sockaddr_in *sin);
+extern int iax_ie_append_int(struct iax_ie_data *ied, unsigned char ie, unsigned int value);
+extern int iax_ie_append_short(struct iax_ie_data *ied, unsigned char ie, unsigned short value);
+extern int iax_ie_append_str(struct iax_ie_data *ied, unsigned char ie, unsigned char *str);
+extern int iax_ie_append_byte(struct iax_ie_data *ied, unsigned char ie, unsigned char dat);
+extern int iax_ie_append(struct iax_ie_data *ied, unsigned char ie);
+extern int iax_parse_ies(struct iax_ies *ies, unsigned char *data, int datalen);
+
+extern int iax_get_frames(void);
+extern int iax_get_iframes(void);
+extern int iax_get_oframes(void);
+
+extern void iax_frame_wrap(struct iax_frame *fr, struct ast_frame *f);
+extern struct iax_frame *iax_frame_new(int direction, int datalen);
+extern void iax_frame_free(struct iax_frame *fr);
+#endif
diff --git a/libs/iax/src/iax2.h b/libs/iax/src/iax2.h
new file mode 100644 (file)
index 0000000..c06da16
--- /dev/null
@@ -0,0 +1,223 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
+ * Implementation of Inter-Asterisk eXchange
+ * 
+ * Copyright (C) 2003, Digium
+ *
+ * Mark Spencer <markster@linux-support.net>
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License
+ */
+#ifndef _IAX2_H
+#define _IAX2_H
+
+/* Max version of IAX protocol we support */
+#define IAX_PROTO_VERSION 2
+
+#define IAX_MAX_CALLS 32768
+
+#define IAX_FLAG_FULL          0x8000
+
+#define IAX_FLAG_RETRANS       0x8000
+
+#define IAX_FLAG_SC_LOG                0x80
+
+#define IAX_MAX_SHIFT          0x1F
+
+#define IAX_WINDOW                     64
+
+/* Subclass for AST_FRAME_IAX */
+#define IAX_COMMAND_NEW                1
+#define IAX_COMMAND_PING       2
+#define IAX_COMMAND_PONG       3
+#define IAX_COMMAND_ACK                4
+#define IAX_COMMAND_HANGUP     5
+#define IAX_COMMAND_REJECT     6
+#define IAX_COMMAND_ACCEPT     7
+#define IAX_COMMAND_AUTHREQ    8
+#define IAX_COMMAND_AUTHREP    9
+#define IAX_COMMAND_INVAL      10
+#define IAX_COMMAND_LAGRQ      11
+#define IAX_COMMAND_LAGRP      12
+#define IAX_COMMAND_REGREQ     13      /* Registration request */
+#define IAX_COMMAND_REGAUTH    14      /* Registration authentication required */
+#define IAX_COMMAND_REGACK     15      /* Registration accepted */
+#define IAX_COMMAND_REGREJ     16      /* Registration rejected */
+#define IAX_COMMAND_REGREL     17      /* Force release of registration */
+#define IAX_COMMAND_VNAK       18      /* If we receive voice before valid first voice frame, send this */
+#define IAX_COMMAND_DPREQ      19      /* Request status of a dialplan entry */
+#define IAX_COMMAND_DPREP      20      /* Request status of a dialplan entry */
+#define IAX_COMMAND_DIAL       21      /* Request a dial on channel brought up TBD */
+#define IAX_COMMAND_TXREQ      22      /* Transfer Request */
+#define IAX_COMMAND_TXCNT      23      /* Transfer Connect */
+#define IAX_COMMAND_TXACC      24      /* Transfer Accepted */
+#define IAX_COMMAND_TXREADY    25      /* Transfer ready */
+#define IAX_COMMAND_TXREL      26      /* Transfer release */
+#define IAX_COMMAND_TXREJ      27      /* Transfer reject */
+#define IAX_COMMAND_QUELCH     28      /* Stop audio/video transmission */
+#define IAX_COMMAND_UNQUELCH 29        /* Resume audio/video transmission */
+#define IAX_COMMAND_POKE    30  /* Like ping, but does not require an open connection */
+#define IAX_COMMAND_PAGE       31      /* Paging description */
+#define IAX_COMMAND_MWI        32      /* Stand-alone message waiting indicator */
+#define IAX_COMMAND_UNSUPPORT  33      /* Unsupported message received */
+#define IAX_COMMAND_TRANSFER   34      /* Request remote transfer */
+#define IAX_COMMAND_PROVISION  35      /* Provision device */
+#define IAX_COMMAND_FWDOWNL    36      /* Download firmware */
+#define IAX_COMMAND_FWDATA     37      /* Firmware Data */
+
+#define IAX_DEFAULT_REG_EXPIRE  60     /* By default require re-registration once per minute */
+
+#define IAX_LINGER_TIMEOUT             10 /* How long to wait before closing bridged call */
+
+#define IAX_DEFAULT_PORTNO             4569
+
+/* IAX Information elements */
+#define IAX_IE_CALLED_NUMBER           1               /* Number/extension being called - string */
+#define IAX_IE_CALLING_NUMBER          2               /* Calling number - string */
+#define IAX_IE_CALLING_ANI                     3               /* Calling number ANI for billing  - string */
+#define IAX_IE_CALLING_NAME                    4               /* Name of caller - string */
+#define IAX_IE_CALLED_CONTEXT          5               /* Context for number - string */
+#define IAX_IE_USERNAME                                6               /* Username (peer or user) for authentication - string */
+#define IAX_IE_PASSWORD                                7               /* Password for authentication - string */
+#define IAX_IE_CAPABILITY                      8               /* Actual codec capability - unsigned int */
+#define IAX_IE_FORMAT                          9               /* Desired codec format - unsigned int */
+#define IAX_IE_LANGUAGE                                10              /* Desired language - string */
+#define IAX_IE_VERSION                         11              /* Protocol version - short */
+#define IAX_IE_ADSICPE                         12              /* CPE ADSI capability - short */
+#define IAX_IE_DNID                                    13              /* Originally dialed DNID - string */
+#define IAX_IE_AUTHMETHODS                     14              /* Authentication method(s) - short */
+#define IAX_IE_CHALLENGE                       15              /* Challenge data for MD5/RSA - string */
+#define IAX_IE_MD5_RESULT                      16              /* MD5 challenge result - string */
+#define IAX_IE_RSA_RESULT                      17              /* RSA challenge result - string */
+#define IAX_IE_APPARENT_ADDR           18              /* Apparent address of peer - struct sockaddr_in */
+#define IAX_IE_REFRESH                         19              /* When to refresh registration - short */
+#define IAX_IE_DPSTATUS                                20              /* Dialplan status - short */
+#define IAX_IE_CALLNO                          21              /* Call number of peer - short */
+#define IAX_IE_CAUSE                           22              /* Cause - string */
+#define IAX_IE_IAX_UNKNOWN                     23              /* Unknown IAX command - byte */
+#define IAX_IE_MSGCOUNT                                24              /* How many messages waiting - short */
+#define IAX_IE_AUTOANSWER                      25              /* Request auto-answering -- none */
+#define IAX_IE_MUSICONHOLD                     26              /* Request musiconhold with QUELCH -- none or string */
+#define IAX_IE_TRANSFERID                      27              /* Transfer Request Identifier -- int */
+#define IAX_IE_RDNIS                           28              /* Referring DNIS -- string */
+#define IAX_IE_PROVISIONING                    29              /* Provisioning info */
+#define IAX_IE_AESPROVISIONING                 30              /* AES Provisioning info */
+#define IAX_IE_DATETIME                                31              /* Date/Time */
+#define IAX_IE_DEVICETYPE                       32              /* Device Type -- string */
+#define IAX_IE_SERVICEIDENT                     33              /* Service Identifier -- string */
+#define IAX_IE_FIRMWAREVER                      34              /* Firmware revision -- u16 */
+#define IAX_IE_FWBLOCKDESC                      35              /* Firmware block description -- u32 */
+#define IAX_IE_FWBLOCKDATA                      36              /* Firmware block of data -- raw */
+#define IAX_IE_PROVVER                          37              /* Provisioning Version (u32) */
+#define IAX_IE_CALLINGPRES                      38              /* Calling presentation (u8) */
+#define IAX_IE_CALLINGTON                       39              /* Calling type of number (u8) */
+#define IAX_IE_CALLINGTNS                       40              /* Calling transit network select (u16) */
+#define IAX_IE_SAMPLINGRATE                     41              /* Supported sampling rates (u16) */
+#define IAX_IE_CAUSECODE                        42              /* Hangup cause (u8) */
+#define IAX_IE_ENCRYPTION                       43              /* Encryption format (u16) */
+#define IAX_IE_ENCKEY                           44              /* Encryption key (raw) */
+#define IAX_IE_CODEC_PREFS          45      /* Codec Negotiation */
+
+#define IAX_IE_RR_JITTER                        46              /* Received jitter (as in RFC1889) u32 */
+#define IAX_IE_RR_LOSS                          47              /* Received loss (high byte loss pct, low 24 bits loss count, as in rfc1889 */
+#define IAX_IE_RR_PKTS                          48              /* Received frames (total frames received) u32 */
+#define IAX_IE_RR_DELAY                         49              /* Max playout delay for received frames (in ms) u16 */
+#define IAX_IE_RR_DROPPED                       50              /* Dropped frames (presumably by jitterbuf) u32 */
+#define IAX_IE_RR_OOO                           51              /* Frames received Out of Order u32 */
+
+
+
+#define IAX_AUTH_PLAINTEXT                     (1 << 0)
+#define IAX_AUTH_MD5                           (1 << 1)
+#define IAX_AUTH_RSA                           (1 << 2)
+
+#define IAX_META_TRUNK                         1               /* Trunk meta-message */
+#define IAX_META_VIDEO                         2               /* Video frame */
+
+#define IAX_RATE_8KHZ                          (1 << 0) /* 8khz sampling (default if absent) */
+#define IAX_RATE_11KHZ                         (1 << 1) /* 11.025khz sampling */
+#define IAX_RATE_16KHZ                         (1 << 2) /* 16khz sampling */
+#define IAX_RATE_22KHZ                         (1 << 3) /* 22.05khz sampling */
+#define IAX_RATE_44KHZ                         (1 << 4) /* 44.1khz sampling */
+#define IAX_RATE_48KHZ                         (1 << 5) /* 48khz sampling */
+
+#define IAX_DPSTATUS_EXISTS                    (1 << 0)
+#define IAX_DPSTATUS_CANEXIST          (1 << 1)
+#define IAX_DPSTATUS_NONEXISTANT       (1 << 2)
+#define IAX_DPSTATUS_IGNOREPAT         (1 << 14)
+#define IAX_DPSTATUS_MATCHMORE         (1 << 15)
+
+#if defined(_MSC_VER)
+#pragma pack(push,1)
+#define __PACKED
+#else
+#define __PACKED __attribute__ ((__packed__))
+#endif
+
+/* Full frames are always delivered reliably */
+struct ast_iax2_full_hdr {
+       unsigned short scallno; /* Source call number -- high bit must be 1 */
+       unsigned short dcallno; /* Destination call number -- high bit is 1 if retransmission */
+       unsigned int ts;                /* 32-bit timestamp in milliseconds (from 1st transmission) */
+       unsigned char oseqno;   /* Packet number (outgoing) */
+       unsigned char iseqno;   /* Packet number (next incoming expected) */
+       char type;                              /* Frame type */
+       unsigned char csub;             /* Compressed subclass */
+       unsigned char iedata[0];
+} __PACKED;
+
+/* Mini header is used only for voice frames -- delivered unreliably */
+struct ast_iax2_mini_hdr {
+       unsigned short callno;  /* Source call number -- high bit must be 0, rest must be non-zero */
+       unsigned short ts;              /* 16-bit Timestamp (high 16 bits from last ast_iax2_full_hdr) */
+                                                       /* Frametype implicitly VOICE_FRAME */
+                                                       /* subclass implicit from last ast_iax2_full_hdr */
+       unsigned char data[0];
+} __PACKED;
+
+struct ast_iax2_meta_hdr {
+       unsigned short zeros;                   /* Zeros field -- must be zero */
+       unsigned char metacmd;                  /* Meta command */
+       unsigned char cmddata;                  /* Command Data */
+       unsigned char data[0];
+} __PACKED;
+
+struct ast_iax2_video_hdr {
+       unsigned short zeros;                   /* Zeros field -- must be zero */
+       unsigned short callno;                  /* Video call number */
+       unsigned short ts;                              /* Timestamp and mark if present */
+       unsigned char data[0];
+} __PACKED;
+
+struct ast_iax2_meta_trunk_hdr {
+       unsigned int ts;                                /* 32-bit timestamp for all messages */
+       unsigned char data[0];
+} __PACKED;
+
+struct ast_iax2_meta_trunk_entry {
+       unsigned short callno;                  /* Call number */
+       unsigned short len;                             /* Length of data for this callno */
+} __PACKED;
+
+#define IAX_FIRMWARE_MAGIC 0x69617879
+
+struct ast_iax2_firmware_header {
+       unsigned int magic;             /* Magic number */
+       unsigned short version;         /* Software version */
+       unsigned char devname[16];      /* Device */
+       unsigned int datalen;           /* Data length of file beyond header */
+       unsigned char chksum[16];       /* Checksum of all data */
+       unsigned char data[0];
+} __PACKED;
+
+
+#if defined(_MSC_VER)
+#pragma pack(pop)
+#endif
+
+#undef __PACKED
+
+#endif
diff --git a/libs/iax/src/jitterbuf.c b/libs/iax/src/jitterbuf.c
new file mode 100644 (file)
index 0000000..7501481
--- /dev/null
@@ -0,0 +1,809 @@
+/*
+ * jitterbuf: an application-independent jitterbuffer
+ *
+ * Copyrights:
+ * Copyright (C) 2004-2005, Horizon Wimba, Inc.
+ *
+ * Contributors:
+ * Steve Kann <stevek@stevek.com>
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU Lesser (Library) General Public License
+ *
+ * Copyright on this file is disclaimed to Digium for inclusion in Asterisk
+ */
+
+#include "jitterbuf.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* define these here, just for ancient compiler systems */
+#define JB_LONGMAX 2147483647L
+#define JB_LONGMIN (-JB_LONGMAX - 1L)
+
+/* MS VC can't do __VA_ARGS__ */
+#if defined(WIN32) && defined(_MSC_VER)
+#define jb_warn if (warnf) warnf
+#define jb_err if (errf) errf
+#define jb_dbg if (dbgf) dbgf
+
+#ifdef DEEP_DEBUG
+  #define jb_dbg2 if (dbgf) dbgf
+#else
+  #define jb_dbg2 if (0) dbgf
+#endif
+
+#else
+
+#define jb_warn(...) (warnf ? warnf(__VA_ARGS__) : (void)0)
+#define jb_err(...) (errf ? errf(__VA_ARGS__) : (void)0)
+#define jb_dbg(...) (dbgf ? dbgf(__VA_ARGS__) : (void)0)
+
+#ifdef DEEP_DEBUG
+#define jb_dbg2(...) (dbgf ? dbgf(__VA_ARGS__) : (void)0)
+#else
+#define jb_dbg2(...) ((void)0)
+#endif
+
+#endif
+
+static jb_output_function_t warnf, errf, dbgf;
+
+void jb_setoutput(jb_output_function_t err, jb_output_function_t warn, jb_output_function_t dbg) 
+{
+       errf = err;
+       warnf = warn;
+       dbgf = dbg;
+}
+
+static void increment_losspct(jitterbuf *jb) 
+{
+    jb->info.losspct = (100000 + 499 * jb->info.losspct)/500;    
+}
+
+static void decrement_losspct(jitterbuf *jb) 
+{
+    jb->info.losspct = (499 * jb->info.losspct)/500;    
+}
+
+void jb_reset(jitterbuf *jb) 
+{
+       /* only save settings */
+       jb_conf s = jb->info.conf;
+       memset(jb,0,sizeof(jitterbuf));
+       jb->info.conf = s;
+
+       /* initialize length */
+       jb->info.current = jb->info.target = JB_TARGET_EXTRA; 
+       jb->info.silence_begin_ts = -1; 
+}
+
+jitterbuf * jb_new() 
+{
+    jitterbuf *jb;
+
+
+    jb = malloc(sizeof(jitterbuf));
+    if(!jb) return NULL;
+
+    jb_reset(jb);
+
+    jb_dbg2("jb_new() = %x\n", jb);
+    return jb;
+}
+
+void jb_destroy(jitterbuf *jb) 
+{
+    jb_frame *frame; 
+    jb_dbg2("jb_destroy(%x)\n", jb);
+
+    /* free all the frames on the "free list" */
+    frame = jb->free;
+    while(frame != NULL) {
+      jb_frame *next = frame->next;
+      free(frame);
+      frame = next;
+    }
+
+    /* free ourselves! */ 
+    free(jb);
+}
+
+
+
+/* simple history manipulation */
+/* maybe later we can make the history buckets variable size, or something? */
+/* drop parameter determines whether we will drop outliers to minimize
+ * delay */
+#if 0
+static int longcmp(const void *a, const void *b) 
+{
+    return *(long *)a - *(long *)b;
+}
+#endif
+
+static int history_put(jitterbuf *jb, long ts, long now, long ms) 
+{
+       long delay = now - (ts - jb->info.resync_offset);
+       long threshold = 2 * jb->info.jitter + jb->info.conf.resync_threshold;
+       long kicked;
+
+       /* don't add special/negative times to history */
+       if (ts <= 0) 
+               return 0;
+
+       /* check for drastic change in delay */
+       if (jb->info.conf.resync_threshold != -1) {
+               if (abs(delay - jb->info.last_delay) > threshold) {
+                       jb->info.cnt_delay_discont++;
+                       if (jb->info.cnt_delay_discont > 3) {
+                               /* resync the jitterbuffer */
+                               jb->info.cnt_delay_discont = 0;
+                               jb->hist_ptr = 0;
+                               jb->hist_maxbuf_valid = 0;
+
+                               jb_warn("Resyncing the jb. last_delay %ld, this delay %ld, threshold %ld, new offset %ld\n", jb->info.last_delay, delay, threshold, ts - now);
+                               jb->info.resync_offset = ts - now;
+                               jb->info.last_delay = delay = 0; /* after resync, frame is right on time */
+                       } else {
+                               return -1;
+                       }
+               } else {
+                       jb->info.last_delay = delay;
+                       jb->info.cnt_delay_discont = 0;
+               }
+       }
+
+    kicked = jb->history[jb->hist_ptr & JB_HISTORY_SZ];
+
+    jb->history[(jb->hist_ptr++) % JB_HISTORY_SZ] = delay;
+
+    /* optimization; the max/min buffers don't need to be recalculated, if this packet's
+     * entry doesn't change them.  This happens if this packet is not involved, _and_ any packet
+     * that got kicked out of the history is also not involved 
+     * We do a number of comparisons, but it's probably still worthwhile, because it will usually
+     * succeed, and should be a lot faster than going through all 500 packets in history */
+    if(!jb->hist_maxbuf_valid)
+      return 0;
+
+    /* don't do this until we've filled history 
+     * (reduces some edge cases below) */
+    if(jb->hist_ptr < JB_HISTORY_SZ)
+      goto invalidate;
+
+    /* if the new delay would go into min */
+    if(delay < jb->hist_minbuf[JB_HISTORY_MAXBUF_SZ-1])
+      goto invalidate;
+    
+    /* or max.. */
+    if(delay > jb->hist_maxbuf[JB_HISTORY_MAXBUF_SZ-1])
+      goto invalidate;
+
+    /* or the kicked delay would be in min */
+    if(kicked <= jb->hist_minbuf[JB_HISTORY_MAXBUF_SZ-1]) 
+      goto invalidate;
+
+    if(kicked >= jb->hist_maxbuf[JB_HISTORY_MAXBUF_SZ-1]) 
+      goto invalidate;
+
+    /* if we got here, we don't need to invalidate, 'cause this delay didn't 
+     * affect things */
+    return 0;
+    /* end optimization */
+
+
+invalidate:
+    jb->hist_maxbuf_valid = 0;
+    return 0;
+}
+
+static void history_calc_maxbuf(jitterbuf *jb) 
+{
+    int i,j;
+
+    if(jb->hist_ptr == 0) return;
+
+
+    /* initialize maxbuf/minbuf to the latest value */
+    for(i=0;i<JB_HISTORY_MAXBUF_SZ;i++) {
+/*
+ * jb->hist_maxbuf[i] = jb->history[(jb->hist_ptr-1) % JB_HISTORY_SZ];
+ * jb->hist_minbuf[i] = jb->history[(jb->hist_ptr-1) % JB_HISTORY_SZ];
+ */
+      jb->hist_maxbuf[i] = JB_LONGMIN;
+      jb->hist_minbuf[i] = JB_LONGMAX;
+    }
+
+    /* use insertion sort to populate maxbuf */
+    /* we want it to be the top "n" values, in order */
+
+    /* start at the beginning, or JB_HISTORY_SZ frames ago */
+    i = (jb->hist_ptr > JB_HISTORY_SZ) ? (jb->hist_ptr - JB_HISTORY_SZ) : 0; 
+
+    for(;i<jb->hist_ptr;i++) {
+       long toins = jb->history[i % JB_HISTORY_SZ];
+
+       /* if the maxbuf should get this */
+       if(toins > jb->hist_maxbuf[JB_HISTORY_MAXBUF_SZ-1])  {
+
+           /* insertion-sort it into the maxbuf */
+           for(j=0;j<JB_HISTORY_MAXBUF_SZ;j++) {
+               /* found where it fits */
+               if(toins > jb->hist_maxbuf[j]) {
+                   /* move over */
+                   memmove(jb->hist_maxbuf+j+1,jb->hist_maxbuf+j, (JB_HISTORY_MAXBUF_SZ-(j+1)) * sizeof(long));
+                   /* insert */
+                   jb->hist_maxbuf[j] = toins;
+
+                   break;
+               }
+           }
+       }
+
+       /* if the minbuf should get this */
+       if(toins < jb->hist_minbuf[JB_HISTORY_MAXBUF_SZ-1])  {
+
+           /* insertion-sort it into the maxbuf */
+           for(j=0;j<JB_HISTORY_MAXBUF_SZ;j++) {
+               /* found where it fits */
+               if(toins < jb->hist_minbuf[j]) {
+                   /* move over */
+                   memmove(jb->hist_minbuf+j+1,jb->hist_minbuf+j, (JB_HISTORY_MAXBUF_SZ-(j+1)) * sizeof(long));
+                   /* insert */
+                   jb->hist_minbuf[j] = toins;
+
+                   break;
+               }
+           }
+       }
+
+       if(0) { 
+         int k;
+         fprintf(stderr, "toins = %ld\n", toins);
+         fprintf(stderr, "maxbuf =");
+         for(k=0;k<JB_HISTORY_MAXBUF_SZ;k++) 
+             fprintf(stderr, "%ld ", jb->hist_maxbuf[k]);
+         fprintf(stderr, "\nminbuf =");
+         for(k=0;k<JB_HISTORY_MAXBUF_SZ;k++) 
+             fprintf(stderr, "%ld ", jb->hist_minbuf[k]);
+         fprintf(stderr, "\n");
+       }
+    }
+
+    jb->hist_maxbuf_valid = 1;
+}
+
+static void history_get(jitterbuf *jb) 
+{
+    long max, min, jitter;
+    int index;
+    int count;
+
+    if(!jb->hist_maxbuf_valid) 
+      history_calc_maxbuf(jb);
+
+    /* count is how many items in history we're examining */
+    count = (jb->hist_ptr < JB_HISTORY_SZ) ? jb->hist_ptr : JB_HISTORY_SZ;
+
+    /* index is the "n"ths highest/lowest that we'll look for */
+    index = count * JB_HISTORY_DROPPCT / 100;
+
+    /* sanity checks for index */
+    if(index > (JB_HISTORY_MAXBUF_SZ - 1)) index = JB_HISTORY_MAXBUF_SZ - 1;
+
+
+    if(index < 0) {
+      jb->info.min = 0;
+      jb->info.jitter = 0;
+      return;
+    }
+
+    max = jb->hist_maxbuf[index];
+    min = jb->hist_minbuf[index];
+
+    jitter = max - min;
+
+    /* these debug stmts compare the difference between looking at the absolute jitter, and the
+     * values we get by throwing away the outliers */
+    /*
+    fprintf(stderr, "[%d] min=%d, max=%d, jitter=%d\n", index, min, max, jitter);
+    fprintf(stderr, "[%d] min=%d, max=%d, jitter=%d\n", 0, jb->hist_minbuf[0], jb->hist_maxbuf[0], jb->hist_maxbuf[0]-jb->hist_minbuf[0]);
+    */
+
+    jb->info.min = min;
+    jb->info.jitter = jitter;
+}
+
+/* returns 1 if frame was inserted into head of queue, 0 otherwise */
+static int queue_put(jitterbuf *jb, void *data, int type, long ms, long ts) 
+{
+    jb_frame *frame;
+    jb_frame *p;
+       int head = 0;
+       long resync_ts = ts - jb->info.resync_offset;
+
+    frame = jb->free;
+    if(frame) {
+       jb->free = frame->next;
+    } else {
+       frame = malloc(sizeof(jb_frame));
+    }
+
+    if(!frame) {
+       jb_err("cannot allocate frame\n");
+       return 0;
+    }
+
+    jb->info.frames_cur++;
+
+    frame->data = data;
+       frame->ts = resync_ts;
+    frame->ms = ms;
+    frame->type = type;
+
+    /* 
+     * frames are a circular list, jb-frames points to to the lowest ts, 
+     * jb->frames->prev points to the highest ts
+     */
+
+    if(!jb->frames) {  /* queue is empty */
+       jb->frames = frame;
+       frame->next = frame;
+       frame->prev = frame;
+               head = 1;
+       } else if (resync_ts < jb->frames->ts) {
+       frame->next = jb->frames;
+       frame->prev = jb->frames->prev;
+
+       frame->next->prev = frame;
+       frame->prev->next = frame;
+
+       /* frame is out of order */
+       jb->info.frames_ooo++;
+
+       jb->frames = frame;
+               head = 1;
+    } else { 
+       p = jb->frames;
+
+       /* frame is out of order */
+       if(ts < p->prev->ts) jb->info.frames_ooo++;
+
+               while (resync_ts < p->prev->ts && p->prev != jb->frames) 
+           p = p->prev;
+
+       frame->next = p;
+       frame->prev = p->prev;
+
+       frame->next->prev = frame;
+       frame->prev->next = frame;
+    }
+       return head;
+}
+
+static long queue_next(jitterbuf *jb) 
+{
+    if(jb->frames) return jb->frames->ts;
+    else return -1;
+}
+
+static long queue_last(jitterbuf *jb) 
+{
+    if(jb->frames) return jb->frames->prev->ts;
+    else return -1;
+}
+
+static jb_frame *_queue_get(jitterbuf *jb, long ts, int all) 
+{
+    jb_frame *frame;
+    frame = jb->frames;
+
+    if(!frame)
+       return NULL;
+
+    /*jb_warn("queue_get: ASK %ld FIRST %ld\n", ts, frame->ts); */
+
+    if(all || ts >= frame->ts) {
+       /* remove this frame */
+       frame->prev->next = frame->next;
+       frame->next->prev = frame->prev;
+
+       if(frame->next == frame)
+         jb->frames = NULL;
+       else
+         jb->frames = frame->next;
+
+
+       /* insert onto "free" single-linked list */
+       frame->next = jb->free;
+       jb->free = frame;
+
+       jb->info.frames_cur--;
+
+       /* we return the frame pointer, even though it's on free list, 
+        * but caller must copy data */
+       return frame;
+    } 
+
+    return NULL;
+}
+
+static jb_frame *queue_get(jitterbuf *jb, long ts) 
+{
+    return _queue_get(jb,ts,0);
+}
+
+static jb_frame *queue_getall(jitterbuf *jb) 
+{
+    return _queue_get(jb,0,1);
+}
+
+#if 0
+/* some diagnostics */
+static void jb_dbginfo(jitterbuf *jb) 
+{
+    if(dbgf == NULL) return;
+
+    jb_dbg("\njb info: fin=%ld fout=%ld flate=%ld flost=%ld fdrop=%ld fcur=%ld\n",
+           jb->info.frames_in, jb->info.frames_out, jb->info.frames_late, jb->info.frames_lost, jb->info.frames_dropped, jb->info.frames_cur);
+       
+    jb_dbg("   jitter=%ld current=%ld target=%ld min=%ld sil=%d len=%d len/fcur=%ld\n",
+           jb->info.jitter, jb->info.current, jb->info.target, jb->info.min, jb->info.silence_begin_ts, jb->info.current - jb->info.min, 
+           jb->info.frames_cur ? (jb->info.current - jb->info.min)/jb->info.frames_cur : -8);
+    if(jb->info.frames_in > 0) 
+       jb_dbg("jb info: Loss PCT = %ld%%, Late PCT = %ld%%\n",
+           jb->info.frames_lost * 100/(jb->info.frames_in + jb->info.frames_lost), 
+           jb->info.frames_late * 100/jb->info.frames_in);
+       jb_dbg("jb info: queue %d -> %d.  last_ts %d (queue len: %d) last_ms %d\n",
+           queue_next(jb), 
+           queue_last(jb),
+           jb->info.next_voice_ts, 
+           queue_last(jb) - queue_next(jb),
+           jb->info.last_voice_ms);
+}
+#endif
+
+#ifdef DEEP_DEBUG
+static void jb_chkqueue(jitterbuf *jb) 
+{
+    int i=0;
+    jb_frame *p = jb->frames;
+
+    if(!p) {
+      return;
+    }
+
+    do {
+       if(p->next == NULL)  {
+         jb_err("Queue is BROKEN at item [%d]", i);    
+       }
+       i++;
+       p=p->next;
+    } while (p->next != jb->frames);
+}
+
+static void jb_dbgqueue(jitterbuf *jb) 
+{
+    int i=0;
+    jb_frame *p = jb->frames;
+
+    jb_dbg("queue: ");
+
+    if(!p) {
+      jb_dbg("EMPTY\n");
+      return;
+    }
+
+    do {
+       jb_dbg("[%d]=%ld ", i++, p->ts);
+       p=p->next;
+    } while (p->next != jb->frames);
+
+    jb_dbg("\n");
+}
+#endif
+
+int jb_put(jitterbuf *jb, void *data, int type, long ms, long ts, long now) 
+{
+    jb_dbg2("jb_put(%x,%x,%ld,%ld,%ld)\n", jb, data, ms, ts, now);
+
+    jb->info.frames_in++;
+
+    if(type == JB_TYPE_VOICE) {
+      /* presently, I'm only adding VOICE frames to history and drift calculations; mostly because with the
+       * IAX integrations, I'm sending retransmitted control frames with their awkward timestamps through */
+               if (history_put(jb,ts,now,ms))
+                       return JB_DROP;
+    }
+
+       /* if put into head of queue, caller needs to reschedule */
+       if (queue_put(jb,data,type,ms,ts)) {
+               return JB_SCHED;
+       }
+
+    return JB_OK;
+}
+
+
+static int _jb_get(jitterbuf *jb, jb_frame *frameout, long now, long interpl) 
+{
+    jb_frame *frame;
+    long diff;
+
+    /*if((now - jb_next(jb)) > 2 * jb->info.last_voice_ms) jb_warn("SCHED: %ld", (now - jb_next(jb))); */
+    /* get jitter info */
+    history_get(jb);
+
+
+    /* target */
+    jb->info.target = jb->info.jitter + jb->info.min + JB_TARGET_EXTRA; 
+
+    /* if a hard clamp was requested, use it */
+    if((jb->info.conf.max_jitterbuf) && ((jb->info.target - jb->info.min) > jb->info.conf.max_jitterbuf)) {
+       jb_dbg("clamping target from %d to %d\n", (jb->info.target - jb->info.min), jb->info.conf.max_jitterbuf);
+       jb->info.target = jb->info.min + jb->info.conf.max_jitterbuf;
+    }
+
+    diff = jb->info.target - jb->info.current;
+
+    /*    jb_warn("diff = %d lms=%d last = %d now = %d\n", diff,  */
+    /* jb->info.last_voice_ms, jb->info.last_adjustment, now); */
+
+    /* let's work on non-silent case first */
+    if(!jb->info.silence_begin_ts) { 
+      /* we want to grow */
+      if( (diff > 0) && 
+         /* we haven't grown in the delay length */
+         (((jb->info.last_adjustment + JB_ADJUST_DELAY) < now) || 
+          /* we need to grow more than the "length" we have left */
+          (diff > queue_last(jb)  - queue_next(jb)) ) ) {
+              /* grow by interp frame len */
+             jb->info.current += interpl;
+              jb->info.next_voice_ts += interpl;
+              jb->info.last_voice_ms = interpl;
+             jb->info.last_adjustment = now;
+              jb->info.cnt_contig_interp++;
+             jb_dbg("G");
+              /* assume silence instead of continuing to interpolate */
+              if (jb->info.conf.max_contig_interp && jb->info.cnt_contig_interp >= jb->info.conf.max_contig_interp)
+                  jb->info.silence_begin_ts = jb->info.next_voice_ts - jb->info.current;
+             return JB_INTERP;
+      }
+
+      frame = queue_get(jb, jb->info.next_voice_ts - jb->info.current);
+
+      /* not a voice frame; just return it. */
+      if(frame && frame->type != JB_TYPE_VOICE) {
+        /* track start of silence */
+       if(frame->type == JB_TYPE_SILENCE) {
+         jb->info.silence_begin_ts = frame->ts;
+          jb->info.cnt_contig_interp = 0;
+        }
+
+       *frameout = *frame;
+       jb->info.frames_out++;
+       jb_dbg("o");
+       return JB_OK;
+      }
+
+      /* voice frame is later than expected */
+      if(frame && frame->ts + jb->info.current < jb->info.next_voice_ts) {
+        if (frame->ts + jb->info.current > jb->info.next_voice_ts - jb->info.last_voice_ms) {
+            /* either we interpolated past this frame in the last jb_get */
+            /* or the frame is still in order, but came a little too quick */ 
+            *frameout = *frame;
+            /* reset expectation for next frame */
+            jb->info.next_voice_ts = frame->ts + jb->info.current + frame->ms;
+            jb->info.frames_out++;
+            decrement_losspct(jb);
+            jb->info.cnt_contig_interp = 0;
+            jb_dbg("v");
+            return JB_OK;
+        } else {
+           /* voice frame is late */
+            *frameout = *frame;
+            jb->info.frames_out++;
+            decrement_losspct(jb);
+            jb->info.frames_late++;
+            jb->info.frames_lost--;
+            jb_dbg("l");
+            /*jb_warn("\nlate: wanted=%ld, this=%ld, next=%ld\n", jb->info.next_voice_ts - jb->info.current, frame->ts, queue_next(jb));
+            jb_warninfo(jb); */
+            return JB_DROP;
+        }
+      }
+
+      /* keep track of frame sizes, to allow for variable sized-frames */
+      if(frame && frame->ms > 0) {
+       jb->info.last_voice_ms = frame->ms;
+      }
+
+      /* we want to shrink; shrink at 1 frame / 500ms */
+      /* unless we don't have a frame, then shrink 1 frame */
+      /* every 80ms (though perhaps we can shrink even faster */
+      /* in this case) */
+      if(diff < -JB_TARGET_EXTRA && 
+               ((!frame && jb->info.last_adjustment + 80 < now) || 
+                (jb->info.last_adjustment + 500 < now))) {
+       jb->info.last_adjustment = now;
+        jb->info.cnt_contig_interp = 0;
+
+       if(frame)  {
+         *frameout = *frame;
+          /* shrink by frame size we're throwing out */
+          jb->info.current -= frame->ms;
+         jb->info.frames_out++;
+         decrement_losspct(jb);
+         jb->info.frames_dropped++;
+         jb_dbg("s");
+         return JB_DROP;
+       } else {
+          /* shrink by last_voice_ms */
+          jb->info.current -= jb->info.last_voice_ms;
+         jb->info.frames_lost++;
+         increment_losspct(jb);
+         jb_dbg("S");
+         return JB_NOFRAME;
+       }
+      }
+
+      /* lost frame */
+      if(!frame) {
+         /* this is a bit of a hack for now, but if we're close to
+          * target, and we find a missing frame, it makes sense to
+          * grow, because the frame might just be a bit late;
+          * otherwise, we presently get into a pattern where we return
+          * INTERP for the lost frame, then it shows up next, and we
+          * throw it away because it's late */
+         /* I've recently only been able to replicate this using
+          * iaxclient talking to app_echo on asterisk.  In this case,
+          * my outgoing packets go through asterisk's (old)
+          * jitterbuffer, and then might get an unusual increasing delay 
+          * there if it decides to grow?? */
+         /* Update: that might have been a different bug, that has been fixed..
+          * But, this still seemed like a good idea, except that it ended up making a single actual
+          * lost frame get interpolated two or more times, when there was "room" to grow, so it might
+          * be a bit of a bad idea overall */
+         /*if(diff > -1 * jb->info.last_voice_ms) { 
+             jb->info.current += jb->info.last_voice_ms;
+             jb->info.last_adjustment = now;
+             jb_warn("g");
+             return JB_INTERP;
+         } */
+         jb->info.frames_lost++;
+         increment_losspct(jb);
+          jb->info.next_voice_ts += interpl;
+          jb->info.last_voice_ms = interpl;
+          jb->info.cnt_contig_interp++;
+          /* assume silence instead of continuing to interpolate */
+          if (jb->info.conf.max_contig_interp && jb->info.cnt_contig_interp >= jb->info.conf.max_contig_interp)
+            jb->info.silence_begin_ts = jb->info.next_voice_ts - jb->info.current;
+         jb_dbg("L");
+         return JB_INTERP;
+      }
+
+      /* normal case; return the frame, increment stuff */
+      *frameout = *frame;
+      jb->info.next_voice_ts += frame->ms;
+      jb->info.frames_out++;
+      decrement_losspct(jb);
+      jb->info.cnt_contig_interp = 0;
+      jb_dbg("v");
+      return JB_OK;
+  } else {     
+      /* TODO: after we get the non-silent case down, we'll make the
+       * silent case -- basically, we'll just grow and shrink faster
+       * here, plus handle next_voice_ts a bit differently */
+      
+      /* to disable silent special case altogether, just uncomment this: */
+       /* jb->info.silence_begin_ts = 0; */
+
+       /* shrink interpl len every 10ms during silence */
+       if (diff < -JB_TARGET_EXTRA &&
+           jb->info.last_adjustment + 10 <= now) {
+         jb->info.current -= interpl;
+         jb->info.last_adjustment = now;
+       }
+
+       frame = queue_get(jb, now - jb->info.current);
+       if(!frame) {
+         return JB_NOFRAME;
+       } else if (frame->type != JB_TYPE_VOICE) {
+          /* normal case; in silent mode, got a non-voice frame */
+          *frameout = *frame;
+         jb->info.frames_out++;
+          return JB_OK;
+       }
+       if (frame->ts < jb->info.silence_begin_ts) {
+          /* voice frame is late */
+         *frameout = *frame;
+         jb->info.frames_out++;
+         decrement_losspct(jb);
+         jb->info.frames_late++;
+         jb->info.frames_lost--;
+         jb_dbg("l");
+         /*jb_warn("\nlate: wanted=%ld, this=%ld, next=%ld\n", jb->info.next_voice_ts - jb->info.current, frame->ts, queue_next(jb));
+       jb_warninfo(jb); */
+         return JB_DROP;
+       } else { 
+          /* voice frame */
+         /* try setting current to target right away here */
+         jb->info.current = jb->info.target;
+         jb->info.silence_begin_ts = 0;
+         jb->info.next_voice_ts = frame->ts + jb->info.current + frame->ms;
+         jb->info.last_voice_ms = frame->ms;
+         jb->info.frames_out++;
+         decrement_losspct(jb);
+         *frameout = *frame;
+         jb_dbg("V");
+         return JB_OK;
+       }
+  }
+}
+
+long jb_next(jitterbuf *jb) 
+{
+    if(jb->info.silence_begin_ts) {
+      long next = queue_next(jb);
+      if(next > 0) { 
+        /* shrink during silence */
+        if (jb->info.target - jb->info.current < -JB_TARGET_EXTRA)
+          return jb->info.last_adjustment + 10;
+        return next + jb->info.target;
+      }
+      else return JB_LONGMAX;
+    } else {
+      return jb->info.next_voice_ts;
+    }
+}
+
+int jb_get(jitterbuf *jb, jb_frame *frameout, long now, long interpl) 
+{
+    int ret = _jb_get(jb,frameout,now,interpl);
+#if 0
+    static int lastts=0;
+    int thists = ((ret == JB_OK) || (ret == JB_DROP)) ? frameout->ts : 0;
+    jb_warn("jb_get(%x,%x,%ld) = %d (%d)\n", jb, frameout, now, ret, thists);
+    if(thists && thists < lastts) jb_warn("XXXX timestamp roll-back!!!\n");
+    lastts = thists;
+#endif
+    return ret;
+}
+
+int jb_getall(jitterbuf *jb, jb_frame *frameout) 
+{
+    jb_frame *frame;
+    frame = queue_getall(jb);
+
+    if(!frame) {
+      return JB_NOFRAME;
+    }
+
+    *frameout = *frame;
+    return JB_OK;
+}
+
+
+int jb_getinfo(jitterbuf *jb, jb_info *stats) 
+{
+
+    history_get(jb);
+
+    *stats = jb->info;
+
+  return JB_OK;
+}
+
+int jb_setconf(jitterbuf *jb, jb_conf *conf) 
+{
+  /* take selected settings from the struct */
+
+       jb->info.conf.max_jitterbuf = conf->max_jitterbuf;
+       jb->info.conf.resync_threshold = conf->resync_threshold;
+       jb->info.conf.max_contig_interp = conf->max_contig_interp;
+
+  return JB_OK;
+}
+
+
diff --git a/libs/iax/src/jitterbuf.h b/libs/iax/src/jitterbuf.h
new file mode 100644 (file)
index 0000000..0160383
--- /dev/null
@@ -0,0 +1,160 @@
+/*
+ * jitterbuf: an application-independent jitterbuffer
+ *
+ * Copyrights:
+ * Copyright (C) 2004-2005, Horizon Wimba, Inc.
+ *
+ * Contributors:
+ * Steve Kann <stevek@stevek.com>
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU Lesser (Library) General Public License
+ *
+ * Copyright on this file is disclaimed to Digium for inclusion in Asterisk
+ */
+
+#ifndef _JITTERBUF_H_
+#define _JITTERBUF_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* configuration constants */
+       /* Number of historical timestamps to use in calculating jitter and drift */
+#define JB_HISTORY_SZ          500     
+       /* what percentage of timestamps should we drop from the history when we examine it;
+        * this might eventually be something made configurable */
+#define JB_HISTORY_DROPPCT     3
+       /* the maximum droppct we can handle (say it was configurable). */
+#define JB_HISTORY_DROPPCT_MAX 4
+       /* the size of the buffer we use to keep the top and botton timestamps for dropping */
+#define JB_HISTORY_MAXBUF_SZ   JB_HISTORY_SZ * JB_HISTORY_DROPPCT_MAX / 100 
+       /* amount of additional jitterbuffer adjustment  */
+#define JB_TARGET_EXTRA 40
+       /* ms between growing and shrinking; may not be honored if jitterbuffer runs out of space */
+#define JB_ADJUST_DELAY 40
+
+
+/* return codes */
+#define JB_OK          0
+#define JB_EMPTY       1
+#define JB_NOFRAME     2
+#define JB_INTERP      3
+#define JB_DROP                4
+#define JB_SCHED       5
+
+/* frame types */
+#define JB_TYPE_CONTROL        0
+#define JB_TYPE_VOICE  1
+#define JB_TYPE_VIDEO  2  /* reserved */
+#define JB_TYPE_SILENCE        3
+
+
+typedef struct jb_conf {
+       /* settings */
+       long max_jitterbuf;     /* defines a hard clamp to use in setting the jitter buffer delay */
+       long resync_threshold;  /* the jb will resync when delay increases to (2 * jitter) + this param */
+       long max_contig_interp; /* the max interp frames to return in a row */
+} jb_conf;
+
+typedef struct jb_info {
+       jb_conf conf;
+
+       /* statistics */
+       long frames_in;         /* number of frames input to the jitterbuffer.*/
+       long frames_out;        /* number of frames output from the jitterbuffer.*/
+       long frames_late;       /* number of frames which were too late, and dropped.*/
+       long frames_lost;       /* number of missing frames.*/
+       long frames_dropped;    /* number of frames dropped (shrinkage) */
+       long frames_ooo;        /* number of frames received out-of-order */
+       long frames_cur;        /* number of frames presently in jb, awaiting delivery.*/
+       long jitter;            /* jitter measured within current history interval*/
+       long min;               /* minimum lateness within current history interval */
+       long current;           /* the present jitterbuffer adjustment */
+       long target;            /* the target jitterbuffer adjustment */
+       long losspct;           /* recent lost frame percentage (* 1000) */
+       long next_voice_ts;     /* the ts of the next frame to be read from the jb - in receiver's time */
+       long last_voice_ms;     /* the duration of the last voice frame */
+       long silence_begin_ts;  /* the time of the last CNG frame, when in silence */
+       long last_adjustment;   /* the time of the last adjustment */
+       long last_delay;        /* the last now added to history */
+       long cnt_delay_discont; /* the count of discontinuous delays */
+       long resync_offset;     /* the amount to offset ts to support resyncs */
+       long cnt_contig_interp; /* the number of contiguous interp frames returned */
+} jb_info;
+
+typedef struct jb_frame {
+       void *data;             /* the frame data */
+       long ts;        /* the relative delivery time expected */
+       long ms;        /* the time covered by this frame, in sec/8000 */
+       int  type;      /* the type of frame */
+       struct jb_frame *next, *prev;
+} jb_frame;
+
+typedef struct jitterbuf {
+       jb_info info;
+
+       /* history */
+       long history[JB_HISTORY_SZ];            /* history */
+       int  hist_ptr;                          /* points to index in history for next entry */
+       long hist_maxbuf[JB_HISTORY_MAXBUF_SZ]; /* a sorted buffer of the max delays (highest first) */
+       long hist_minbuf[JB_HISTORY_MAXBUF_SZ]; /* a sorted buffer of the min delays (lowest first) */
+       int  hist_maxbuf_valid;                 /* are the "maxbuf"/minbuf valid? */
+
+
+       jb_frame *frames;               /* queued frames */
+       jb_frame *free;                 /* free frames (avoid malloc?) */
+} jitterbuf;
+
+
+/* new jitterbuf */
+extern jitterbuf *             jb_new(void);
+
+/* destroy jitterbuf */
+extern void                    jb_destroy(jitterbuf *jb);
+
+/* reset jitterbuf */
+/* NOTE:  The jitterbuffer should be empty before you call this, otherwise
+ * you will leak queued frames, and some internal structures */
+extern void                    jb_reset(jitterbuf *jb);
+
+/* queue a frame data=frame data, timings (in ms): ms=length of frame (for voice), ts=ts (sender's time) 
+ * now=now (in receiver's time) return value is one of 
+ * JB_OK: Frame added. Last call to jb_next() still valid
+ * JB_DROP: Drop this frame immediately
+ * JB_SCHED: Frame added. Call jb_next() to get a new time for the next frame
+ */
+extern int                     jb_put(jitterbuf *jb, void *data, int type, long ms, long ts, long now);
+
+/* get a frame for time now (receiver's time)  return value is one of
+ * JB_OK:  You've got frame!
+ * JB_DROP: Here's an audio frame you should just drop.  Ask me again for this time..
+ * JB_NOFRAME: There's no frame scheduled for this time.
+ * JB_INTERP: Please interpolate an interpl-length frame for this time (either we need to grow, or there was a lost frame) 
+ * JB_EMPTY: The jb is empty.
+ */
+extern int                     jb_get(jitterbuf *jb, jb_frame *frame, long now, long interpl);
+
+/* unconditionally get frames from jitterbuf until empty */
+extern int jb_getall(jitterbuf *jb, jb_frame *frameout);
+
+/* when is the next frame due out, in receiver's time (0=EMPTY) 
+ * This value may change as frames are added (esp non-audio frames) */
+extern long                    jb_next(jitterbuf *jb);
+
+/* get jitterbuf info: only "statistics" may be valid */
+extern int                     jb_getinfo(jitterbuf *jb, jb_info *stats);
+
+/* set jitterbuf conf */
+extern int                     jb_setconf(jitterbuf *jb, jb_conf *conf);
+
+typedef                void (*jb_output_function_t)(const char *fmt, ...);
+extern void                    jb_setoutput(jb_output_function_t err, jb_output_function_t warn, jb_output_function_t dbg);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/libs/iax/src/md5.c b/libs/iax/src/md5.c
new file mode 100644 (file)
index 0000000..b969ee6
--- /dev/null
@@ -0,0 +1,285 @@
+/* MD5 checksum routines used for authentication.  Not covered by GPL, but
+   in the public domain as per the copyright below */
+
+#ifdef FREEBSD
+# include <machine/endian.h>
+#elif defined(LINUX)  
+# include <endian.h>
+# include <features.h>
+# include <sys/types.h>
+#elif defined(SOLARIS)
+  /* each solaris is different -- this won't work on 2.6 or 2.7 */
+# include <sys/isa_defs.h> /* Defines either _LITTLE_ENDIAN or _BIG_ENDIAN */
+#  define __BIG_ENDIAN         4321
+#  define __LITTLE_ENDIAN      1234
+#  define BIG_ENDIAN           4321
+#  define LITTLE_ENDIAN                1234
+#  ifdef _LITTLE_ENDIAN
+#    define __BYTE_ORDER       __LITTLE_ENDIAN
+#    define BYTE_ORDER         LITTLE_ENDIAN
+#  else
+#    define __BYTE_ORDER       __BIG_ENDIAN
+#    define BYTE_ORDER         BIG_ENDIAN
+#  endif
+#endif
+
+#if __BYTE_ORDER == __BIG_ENDIAN || BYTE_ORDER == BIG_ENDIAN
+# define HIGHFIRST 1
+#elif __BYTE_ORDER == __LITTLE_ENDIAN || BYTE_ORDER == LITLE_ENDIAN
+# undef HIGHFIRST
+#else
+# error "Please fix <bits/endian.h>"
+#endif
+
+/*
+ * This code implements the MD5 message-digest algorithm.
+ * The algorithm is due to Ron Rivest.  This code was
+ * written by Colin Plumb in 1993, no copyright is claimed.
+ * This code is in the public domain; do with it what you wish.
+ *
+ * Equivalent code is available from RSA Data Security, Inc.
+ * This code has been tested against that, and is equivalent,
+ * except that you don't need to include two pages of legalese
+ * with every copy.
+ *
+ * To compute the message digest of a chunk of bytes, declare an
+ * MD5Context structure, pass it to MD5Init, call MD5Update as
+ * needed on buffers full of bytes, and then call MD5Final, which
+ * will fill a supplied 16-byte array with the digest.
+ */
+#include <string.h>            /* for memcpy() */
+#include "md5.h"
+
+#ifndef HIGHFIRST
+#define byteReverse(buf, len)  /* Nothing */
+#else
+void byteReverse(unsigned char *buf, unsigned longs);
+
+#ifndef ASM_MD5
+/*
+ * Note: this code is harmless on little-endian machines.
+ */
+void byteReverse(unsigned char *buf, unsigned longs)
+{
+    uint32 t;
+    do {
+       t = (uint32) ((unsigned) buf[3] << 8 | buf[2]) << 16 |
+           ((unsigned) buf[1] << 8 | buf[0]);
+       *(uint32 *) buf = t;
+       buf += 4;
+    } while (--longs);
+}
+#endif
+#endif
+
+/*
+ * Start MD5 accumulation.  Set bit count to 0 and buffer to mysterious
+ * initialization constants.
+ */
+void MD5Init(struct MD5Context *ctx)
+{
+    ctx->buf[0] = 0x67452301;
+    ctx->buf[1] = 0xefcdab89;
+    ctx->buf[2] = 0x98badcfe;
+    ctx->buf[3] = 0x10325476;
+
+    ctx->bits[0] = 0;
+    ctx->bits[1] = 0;
+}
+
+/*
+ * Update context to reflect the concatenation of another buffer full
+ * of bytes.
+ */
+void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len)
+{
+    uint32 t;
+
+    /* Update bitcount */
+
+    t = ctx->bits[0];
+    if ((ctx->bits[0] = t + ((uint32) len << 3)) < t)
+       ctx->bits[1]++;         /* Carry from low to high */
+    ctx->bits[1] += len >> 29;
+
+    t = (t >> 3) & 0x3f;       /* Bytes already in shsInfo->data */
+
+    /* Handle any leading odd-sized chunks */
+
+    if (t) {
+       unsigned char *p = (unsigned char *) ctx->in + t;
+
+       t = 64 - t;
+       if (len < t) {
+           memcpy(p, buf, len);
+           return;
+       }
+       memcpy(p, buf, t);
+       byteReverse(ctx->in, 16);
+       MD5Transform(ctx->buf, (uint32 *) ctx->in);
+       buf += t;
+       len -= t;
+    }
+    /* Process data in 64-byte chunks */
+
+    while (len >= 64) {
+       memcpy(ctx->in, buf, 64);
+       byteReverse(ctx->in, 16);
+       MD5Transform(ctx->buf, (uint32 *) ctx->in);
+       buf += 64;
+       len -= 64;
+    }
+
+    /* Handle any remaining bytes of data. */
+
+    memcpy(ctx->in, buf, len);
+}
+
+/*
+ * Final wrapup - pad to 64-byte boundary with the bit pattern 
+ * 1 0* (64-bit count of bits processed, MSB-first)
+ */
+void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
+{
+    unsigned count;
+    unsigned char *p;
+
+    /* Compute number of bytes mod 64 */
+    count = (ctx->bits[0] >> 3) & 0x3F;
+
+    /* Set the first char of padding to 0x80.  This is safe since there is
+       always at least one byte free */
+    p = ctx->in + count;
+    *p++ = 0x80;
+
+    /* Bytes of padding needed to make 64 bytes */
+    count = 64 - 1 - count;
+
+    /* Pad out to 56 mod 64 */
+    if (count < 8) {
+       /* Two lots of padding:  Pad the first block to 64 bytes */
+       memset(p, 0, count);
+       byteReverse(ctx->in, 16);
+       MD5Transform(ctx->buf, (uint32 *) ctx->in);
+
+       /* Now fill the next block with 56 bytes */
+       memset(ctx->in, 0, 56);
+    } else {
+       /* Pad block to 56 bytes */
+       memset(p, 0, count - 8);
+    }
+    byteReverse(ctx->in, 14);
+
+    /* Append length in bits and transform */
+    ((uint32 *) ctx->in)[14] = ctx->bits[0];
+    ((uint32 *) ctx->in)[15] = ctx->bits[1];
+
+    MD5Transform(ctx->buf, (uint32 *) ctx->in);
+    byteReverse((unsigned char *) ctx->buf, 4);
+    memcpy(digest, ctx->buf, 16);
+    memset(ctx, 0, sizeof(ctx));       /* In case it's sensitive */
+}
+
+#ifndef ASM_MD5
+
+/* The four core functions - F1 is optimized somewhat */
+
+/* #define F1(x, y, z) (x & y | ~x & z) */
+#define F1(x, y, z) (z ^ (x & (y ^ z)))
+#define F2(x, y, z) F1(z, x, y)
+#define F3(x, y, z) (x ^ y ^ z)
+#define F4(x, y, z) (y ^ (x | ~z))
+
+/* This is the central step in the MD5 algorithm. */
+#define MD5STEP(f, w, x, y, z, data, s) \
+       ( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
+
+/*
+ * The core of the MD5 algorithm, this alters an existing MD5 hash to
+ * reflect the addition of 16 longwords of new data.  MD5Update blocks
+ * the data and converts bytes into longwords for this routine.
+ */
+void MD5Transform(uint32 buf[4], uint32 const in[16])
+{
+    register uint32 a, b, c, d;
+
+    a = buf[0];
+    b = buf[1];
+    c = buf[2];
+    d = buf[3];
+
+    MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7);
+    MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
+    MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17);
+    MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
+    MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
+    MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12);
+    MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17);
+    MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22);
+    MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7);
+    MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
+    MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
+    MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22);
+    MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7);
+    MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12);
+    MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17);
+    MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22);
+
+    MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5);
+    MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9);
+    MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14);
+    MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
+    MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5);
+    MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9);
+    MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
+    MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
+    MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
+    MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9);
+    MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
+    MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20);
+    MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
+    MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
+    MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14);
+    MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
+
+    MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4);
+    MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11);
+    MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
+    MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23);
+    MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4);
+    MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
+    MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
+    MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
+    MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
+    MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
+    MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
+    MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23);
+    MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
+    MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
+    MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
+    MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
+
+    MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6);
+    MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10);
+    MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15);
+    MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21);
+    MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6);
+    MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
+    MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15);
+    MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21);
+    MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
+    MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
+    MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15);
+    MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
+    MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6);
+    MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
+    MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
+    MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21);
+
+    buf[0] += a;
+    buf[1] += b;
+    buf[2] += c;
+    buf[3] += d;
+}
+
+#endif
diff --git a/libs/iax/src/md5.h b/libs/iax/src/md5.h
new file mode 100644 (file)
index 0000000..e264f68
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef MD5_H
+#define MD5_H
+
+#ifdef __alpha
+typedef unsigned int uint32;
+#else
+typedef unsigned long uint32;
+#endif
+
+struct MD5Context {
+       uint32 buf[4];
+       uint32 bits[2];
+       unsigned char in[64];
+};
+
+void MD5Init(struct MD5Context *context);
+void MD5Update(struct MD5Context *context, unsigned char const *buf,
+              unsigned len);
+void MD5Final(unsigned char digest[16], struct MD5Context *context);
+void MD5Transform(uint32 buf[4], uint32 const in[16]);
+
+/*
+ * This is needed to make RSAREF happy on some MS-DOS compilers.
+ */
+typedef struct MD5Context MD5_CTX;
+
+#endif /* !MD5_H */
diff --git a/libs/iax/src/miniphone.c b/libs/iax/src/miniphone.c
new file mode 100644 (file)
index 0000000..ab0dd84
--- /dev/null
@@ -0,0 +1,776 @@
+/*
+ * Miniphone: A simple, command line telephone
+ *
+ * IAX Support for talking to Asterisk and other Gnophone clients
+ *
+ * Copyright (C) 1999, Linux Support Services, Inc.
+ *
+ * Mark Spencer <markster@linux-support.net>
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <errno.h>
+#include <sys/ioctl.h>
+#include <iax-client.h>
+#include <linux/soundcard.h>
+#include <errno.h>
+#include <sys/time.h>
+#include <sys/signal.h>
+#include <sys/time.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <gsm.h>
+#include <miniphone.h>
+#include <time.h>
+
+#include "busy.h"
+#include "dialtone.h"
+#include "answer.h"
+#include "ringtone.h"
+#include "ring10.h"
+#include "options.h"
+
+#define FRAME_SIZE 160
+
+static char callerid[80];
+
+struct peer {
+       int time;
+       gsm gsmin;
+       gsm gsmout;
+
+       struct iax_session *session;
+       struct peer *next;
+};
+
+static char *audiodev = "/dev/dsp";
+static int audiofd = -1;
+static struct peer *peers;
+static int answered_call = 0;
+
+static struct peer *find_peer(struct iax_session *);
+static int audio_setup(char *);
+static void sighandler(int);
+static void parse_args(FILE *, unsigned char *);
+void do_iax_event(FILE *);
+void call(FILE *, char *);
+void answer_call(void);
+void reject_call(void);
+static void handle_event(FILE *, struct iax_event *e, struct peer *p);
+void parse_cmd(FILE *, int, char **);
+void issue_prompt(FILE *);
+void dump_array(FILE *, char **);
+
+struct sound {
+       short *data;
+       int datalen;
+       int samplen;
+       int silencelen;
+       int repeat;
+};
+
+static int cursound = -1;
+
+static int sampsent = 0;
+static int offset = 0;
+static int silencelen = 0;
+static int nosound = 0;
+
+static int offhook = 0;
+static int ringing = 0;
+
+static int writeonly = 0;
+
+static struct iax_session *registry = NULL;
+static struct timeval regtime;
+
+#define TONE_NONE     -1
+#define TONE_RINGTONE 0
+#define TONE_BUSY     1
+#define TONE_CONGEST  2
+#define TONE_RINGER   3
+#define TONE_ANSWER   4
+#define TONE_DIALTONE  5
+
+#define OUTPUT_NONE    0
+#define OUTPUT_SPEAKER 1
+#define OUTPUT_HANDSET 2
+#define OUTPUT_BOTH    3
+
+static struct sound sounds[] = {
+       { ringtone, sizeof(ringtone)/2, 16000, 32000, 1 },
+       { busy, sizeof(busy)/2, 4000, 4000, 1 },
+       { busy, sizeof(busy)/2, 2000, 2000, 1 },
+       { ring10, sizeof(ring10)/2, 16000, 32000, 1 },
+       { answer, sizeof(answer)/2, 2200, 0, 0 },
+       { dialtone, sizeof(dialtone)/2, 8000, 0, 1 },
+};
+
+static char *help[] = {
+"Welcome to the miniphone telephony client, the commands are as follows:\n",
+"Help\t\t-\tDisplays this screen.",
+"Help <Command>\t-\tInqueries specific information on a command.",
+"Dial <Number>\t-\tDials the number supplied in the first arguement",
+"Status\t\t-\tLists the current sessions and their current status.",
+"Quit\t\t-\tShuts down the client.",
+"",
+0
+};
+
+static short silence[FRAME_SIZE];
+
+static struct peer *most_recent_answer;
+static struct iax_session *newcall = 0;
+
+static struct peer *find_peer(struct iax_session *session)
+{
+       struct peer *cur = peers;
+       while(cur) {
+               if (cur->session == session)
+                       return cur;
+               cur = cur->next;
+       }
+       return NULL;
+}
+
+static int audio_setup(char *dev)
+{
+       int fd; 
+       int fmt = AFMT_S16_LE;
+       int channels = 1;
+       int speed = 8000;
+       int fragsize = (40 << 16) | 6;
+       if ( (fd = open(dev, O_RDWR | O_NONBLOCK)) < 0) {
+               fprintf(stderr, "Unable to open audio device %s: %s\n", dev, strerror(errno));
+               return -1;
+       }
+       if (ioctl(fd, SNDCTL_DSP_SETFMT, &fmt) || (fmt != AFMT_S16_LE)) {
+               fprintf(stderr, "Unable to set in signed linear format.\n");
+               return -1;
+       }
+       if (ioctl(fd, SNDCTL_DSP_SETDUPLEX, 0)) {
+               fprintf(stderr, "Unable to set full duplex operation.\n");
+               writeonly = 1;
+               /* return -1; */
+       }
+       if (ioctl(fd, SNDCTL_DSP_CHANNELS, &channels) || (channels != 1)) {
+               fprintf(stderr, "Unable to set to mono\n");
+               return -1;
+       }
+       if (ioctl(fd, SNDCTL_DSP_SPEED, &speed) || (speed != 8000)) {
+               fprintf(stderr, "Unable to set speed to 8000 hz\n");
+               return -1;
+       }
+       if (ioctl(fd, SNDCTL_DSP_SETFRAGMENT, &fragsize)) {
+               fprintf(stderr, "Unable to set fragment size...\n");
+               return -1;
+       }
+
+       return fd;
+}
+
+static int send_sound(int soundfd)
+{
+       /* Send FRAME_SIZE samples of whatever */
+       short myframe[FRAME_SIZE];
+       short *frame = NULL;
+       int total = FRAME_SIZE;
+       int amt=0;
+       int res;
+       int myoff;
+       audio_buf_info abi;
+       if (cursound > -1) {
+               res = ioctl(soundfd, SNDCTL_DSP_GETOSPACE ,&abi);
+               if (res) {
+                       fprintf(stderr,"Unable to read output space\n");
+                       return -1;
+               }
+               /* Calculate how many samples we can send, max */
+               if (total > (abi.fragments * abi.fragsize / 2)) 
+                       total = abi.fragments * abi.fragsize / 2;
+               res = total;
+               if (sampsent < sounds[cursound].samplen) {
+                       myoff=0;
+                       while(total) {
+                               amt = total;
+                               if (amt > (sounds[cursound].datalen - offset)) 
+                                       amt = sounds[cursound].datalen - offset;
+                               memcpy(myframe + myoff, sounds[cursound].data + offset, amt * 2);
+                               total -= amt;
+                               offset += amt;
+                               sampsent += amt;
+                               myoff += amt;
+                               if (offset >= sounds[cursound].datalen)
+                                       offset = 0;
+                       }
+                       /* Set it up for silence */
+                       if (sampsent >= sounds[cursound].samplen) 
+                               silencelen = sounds[cursound].silencelen;
+                       frame = myframe;
+               } else {
+                       if (silencelen > 0) {
+                               frame = silence;
+                               silencelen -= res;
+                       } else {
+                               if (sounds[cursound].repeat) {
+                                       /* Start over */
+                                       sampsent = 0;
+                                       offset = 0;
+                               } else {
+                                       cursound = -1;
+                                       nosound = 0;
+                               }
+                       }
+               }
+#if 0
+               if (frame)
+                       printf("res is %d, frame[0] is %d\n", res, frame[0]);
+#endif         
+               res = write(soundfd, frame, res * 2);
+               if (res > 0)
+                       return 0;
+               return res;
+       }
+       return 0;
+}
+
+static int iax_regtimeout(int timeout)
+{
+       if (timeout) {
+               gettimeofday(&regtime, NULL);
+               regtime.tv_sec += timeout;
+       } else {
+               regtime.tv_usec = 0;
+               regtime.tv_sec = 0;
+       }
+       return 0;
+}
+
+static int check_iax_register(void)
+{
+       int res;
+       if (strlen(regpeer) && strlen(server)) {
+               registry = iax_session_new();
+       
+               res = iax_register(registry, server,regpeer,regsecret, refresh);
+       
+               if (res) {
+                       fprintf(stderr, "Failed registration: %s\n", iax_errstr);
+                       return -1;
+               }
+               iax_regtimeout(5 * refresh / 6);
+       } else {
+               iax_regtimeout(0);
+               refresh = 60;
+       }
+       return 0;
+}
+
+static int check_iax_timeout(void)
+{
+       struct timeval tv;
+       int ms;
+       if (!regtime.tv_usec || !regtime.tv_sec)
+               return -1;
+       gettimeofday(&tv, NULL);
+       if ((tv.tv_usec >= regtime.tv_usec) && (tv.tv_sec >= regtime.tv_sec)) {
+               check_iax_register();
+               /* Have it check again soon */
+               return 100;
+       }
+       ms = (regtime.tv_sec - tv.tv_sec) * 1000 + (regtime.tv_usec - tv.tv_usec) / 1000;
+       return ms;
+}
+
+static int gentone(int sound, int uninterruptible)
+{
+       cursound = sound;
+       sampsent = 0;
+       offset = 0;
+       silencelen = 0;
+       nosound = uninterruptible;
+       printf("Sending tone %d\n", sound);
+       return 0;
+}
+
+void
+sighandler(int sig)
+{
+       if(sig == SIGHUP) {
+               puts("rehashing!");
+       } else if(sig == SIGINT) {
+               static int prev = 0;
+               int cur;
+               
+               if ( (cur = time(0))-prev <= 5) {
+                       printf("Terminating!\n");
+                       exit(0);
+               } else {
+                       prev = cur;
+                       printf("Press interrupt key again in the next %d seconds to really terminate\n", 5-(cur-prev));
+               }
+       }
+}
+
+void
+parse_args(FILE *f, unsigned char *cmd)
+{
+       static char *argv[MAXARGS];
+       unsigned char *parse = cmd;
+       int argc = 0, t = 0;
+
+       // Don't mess with anything that doesn't exist...
+       if(!*parse)
+               return;
+
+       bzero(argv, sizeof(argv));
+       while(*parse) {
+               if(*parse < 33 || *parse > 128) {
+                       *parse = 0, t++;
+                       if(t > MAXARG) {
+                               fprintf(f, "Warning: Argument exceeds maximum argument size, command ignored!\n");
+                               return;
+                       }
+               } else if(t || !argc) {
+                       if(argc == MAXARGS) {
+                               fprintf(f, "Warning: Command ignored, too many arguments\n");
+                               return;
+                       }
+                       argv[argc++] = parse;
+                       t = 0;
+               }
+
+               parse++;
+       }
+
+       if(argc)
+               parse_cmd(f, argc, argv);
+}
+
+int
+main(int argc, char *argv[])
+{
+       int port;
+       int netfd;
+       int c, h=0, m, regm;
+       FILE *f;
+       int fd = STDIN_FILENO;
+       char rcmd[RBUFSIZE];
+       fd_set readfd;
+       fd_set writefd;
+       struct timeval timer;
+       struct timeval *timerptr = NULL;
+       gsm_frame fo;
+
+       load_options();
+
+       if (!strlen(callerid))
+               gethostname(callerid, sizeof(callerid));
+
+       signal(SIGHUP, sighandler);
+       signal(SIGINT, sighandler);
+
+       if ( !(f = fdopen(fd, "w+"))) {
+               fprintf(stderr, "Unable to create file on fd %d\n", fd);
+               return -1;
+       }
+
+       if ( (audiofd = audio_setup(audiodev)) == -1) {
+               fprintf(stderr, "Fatal error: failed to open sound device");
+               return -1;
+       }
+
+       if ( (port = iax_init(0) < 0)) {
+               fprintf(stderr, "Fatal error: failed to initialize iax with port %d\n", port);
+               return -1;
+       }
+
+       iax_set_formats(AST_FORMAT_GSM);
+       netfd = iax_get_fd();
+
+       check_iax_register();
+
+       fprintf(f, "Text Based Telephony Client.\n\n");
+       issue_prompt(f);
+
+       timer.tv_sec = 0;
+       timer.tv_usec = 0;
+
+       while(1) {
+               FD_ZERO(&readfd);
+               FD_ZERO(&writefd);
+               FD_SET(fd, &readfd);
+                       if(fd > h)
+                               h = fd;
+               if(answered_call && !writeonly) {
+                       FD_SET(audiofd, &readfd);
+                               if(audiofd > h)
+                                       h = audiofd;
+               }
+               if (cursound > -1) {
+                       FD_SET(audiofd, &writefd);
+                       if (audiofd > h)
+                               h = audiofd;
+               }
+               FD_SET(netfd, &readfd);
+               if(netfd > h)
+                       h = netfd;
+
+               if ( (c = select(h+1, &readfd, &writefd, 0, timerptr)) >= 0) {
+                       if(FD_ISSET(fd, &readfd)) {
+                               if ( ( fgets(&*rcmd, 256, f))) {
+                                       rcmd[strlen(rcmd)-1] = 0;
+                                       parse_args(f, &*rcmd);
+                               } else fprintf(f, "Fatal error: failed to read data!\n");
+
+                               issue_prompt(f);
+                       }
+                       if(answered_call) {
+                               if(FD_ISSET(audiofd, &readfd)) {
+                               static int ret, rlen = 0;
+                                       static short rbuf[FRAME_SIZE];
+
+                                       if ( (ret = read(audiofd, rbuf + rlen, 2 * (FRAME_SIZE-rlen))) == -1) {
+                                               puts("Failed to read audio.");
+                                               return -1;
+                                       }
+                                       rlen += ret/2;
+                                       if(rlen == FRAME_SIZE) {
+                                               rlen = 0;
+
+                                               if(!most_recent_answer->gsmout)
+                                                       most_recent_answer->gsmout = gsm_create();
+
+                                               gsm_encode(most_recent_answer->gsmout, rbuf, fo);
+                                               if(iax_send_voice(most_recent_answer->session,
+                                               AST_FORMAT_GSM, (char *)fo, sizeof(fo)) == -1)
+                                                       puts("Failed to send voice!");
+                                       }
+                               }
+                       }
+                       do_iax_event(f);
+                       m = iax_time_to_next_event();
+                       if(m > -1) {
+                               timerptr = &timer;
+                               timer.tv_sec = m /1000;
+                               timer.tv_usec = (m % 1000) * 1000;
+                       } else 
+                               timerptr = 0;
+                       regm = check_iax_timeout();
+                       if (!timerptr || (m > regm)) {
+                               timerptr = &timer;
+                               timer.tv_sec = regm /1000;
+                               timer.tv_usec = (regm % 1000) * 1000;
+                       }
+                       if (FD_ISSET(audiofd, &writefd)) {
+                               send_sound(audiofd);
+                       }
+               } else {
+                       if(errno == EINTR)
+                               continue;
+                       fprintf(stderr, "Fatal error in select(): %s\n", strerror(errno));
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+void
+do_iax_event(FILE *f) {
+       int sessions = 0;
+       struct iax_event *e = 0;
+       struct peer *peer;
+
+       while ( (e = iax_get_event(0))) {
+               peer = find_peer(e->session);
+               if(peer) {
+                       handle_event(f, e, peer);
+               } else if (e->session == registry) {
+                       fprintf(stderr, "Registration complete: %s (%d)\n",
+                               (e->event.regreply.status == IAX_REG_SUCCESS) ? "Success" : "Failed",
+                               e->event.regreply.status);
+                       registry = NULL;
+               } else {
+                       if(e->etype != IAX_EVENT_CONNECT) {
+                               fprintf(stderr, "Huh? This is an event for a non-existant session?\n");
+                               continue;
+                       }
+                       sessions++;
+
+                       if(sessions >= MAX_SESSIONS) {
+                               fprintf(f, "Missed a call... too many sessions open.\n");
+                       }
+
+
+                       if(e->event.connect.callerid && e->event.connect.dnid)
+                               fprintf(f, "Call from '%s' for '%s'", e->event.connect.callerid, 
+                               e->event.connect.dnid);
+                       else if(e->event.connect.dnid) {
+                               fprintf(f, "Call from '%s'", e->event.connect.dnid);
+                       } else if(e->event.connect.callerid) {
+                               fprintf(f, "Call from '%s'", e->event.connect.callerid);
+                       } else printf("Call from");
+                       fprintf(f, " (%s)\n", inet_ntoa(iax_get_peer_addr(e->session).sin_addr));
+
+                       if(most_recent_answer) {
+                               fprintf(f, "Incoming call ignored, there's already a call waiting for answer... \
+please accept or reject first\n");
+                               iax_reject(e->session, "Too many calls, we're busy!");
+                       } else {
+                               if ( !(peer = malloc(sizeof(struct peer)))) {
+                                       fprintf(f, "Warning: Unable to allocate memory!\n");
+                                       return;
+                               }
+
+                               peer->time = time(0);
+                               peer->session = e->session;
+                               if (peer->gsmin)
+                                       free(peer->gsmin);
+                               peer->gsmin = 0;
+                               if (peer->gsmout)
+                                       free(peer->gsmout);
+                               peer->gsmout = 0;
+
+                               peer->next = peers;
+                               peers = peer;
+
+                               iax_accept(peer->session);
+                               iax_ring_announce(peer->session);
+                               most_recent_answer = peer;
+                               ringing = 1;
+                               gentone(TONE_RINGER, 0);
+                               fprintf(f, "Incoming call!\n");
+                       }
+                       issue_prompt(f);
+               }
+               iax_event_free(e);
+       }
+}
+
+void
+call(FILE *f, char *num)
+{
+       struct peer *peer;
+
+       if(!newcall)
+               newcall = iax_session_new();
+       else {
+               fprintf(f, "Already attempting to call somewhere, please cancel first!\n");
+               return;
+       }
+
+       if ( !(peer = malloc(sizeof(struct peer)))) {
+               fprintf(f, "Warning: Unable to allocate memory!\n");
+               return;
+       }
+
+       peer->time = time(0);
+       peer->session = newcall;
+       peer->gsmin = 0;
+       peer->gsmout = 0;
+
+       peer->next = peers;
+       peers = peer;
+
+       most_recent_answer = peer;
+
+       offhook = 1;
+       
+       iax_call(peer->session, callerid, num, NULL, 10);
+}
+
+void
+answer_call(void)
+{
+       if(most_recent_answer)
+               iax_answer(most_recent_answer->session);
+       printf("Answering call!\n");
+       answered_call = 1;
+       offhook = 1;
+       ringing = 0;
+       gentone(TONE_ANSWER, 1);
+}
+
+void
+reject_call(void)
+{
+       iax_reject(most_recent_answer->session, "Call rejected manually.");
+       most_recent_answer = 0;
+       ringing = 0;
+       gentone(TONE_NONE, 1);
+}
+
+void
+handle_event(FILE *f, struct iax_event *e, struct peer *p)
+{
+       short fr[FRAME_SIZE];
+       int len;
+
+       switch(e->etype) {
+               case IAX_EVENT_HANGUP:
+                       iax_hangup(most_recent_answer->session, "Byeee!");
+                       fprintf(f, "Call disconnected by peer\n");
+                       free(most_recent_answer);
+                       most_recent_answer = 0;
+                       answered_call = 0;
+                       peers = 0;
+                       newcall = 0;
+                       if (offhook)
+                               gentone(TONE_CONGEST, 0);
+                       break;
+
+               case IAX_EVENT_REJECT:
+                       fprintf(f, "Authentication was rejected\n");
+                       break;
+               case IAX_EVENT_ACCEPT:
+                       fprintf(f, "Accepted...\n");
+                       issue_prompt(f);
+                       break;
+               case IAX_EVENT_RINGA:
+                       fprintf(f, "Ringing...\n");
+                       issue_prompt(f);
+                       gentone(TONE_RINGTONE, 0);
+                       break;
+               case IAX_EVENT_ANSWER:
+                       answer_call();
+                       gentone(TONE_ANSWER, 1);
+                       break;
+               case IAX_EVENT_VOICE:
+                       switch(e->event.voice.format) {
+                               case AST_FORMAT_GSM:
+                                       if(e->event.voice.datalen % 33) {
+                                               fprintf(stderr, "Weird gsm frame, not a multiple of 33.\n");
+                                               break;
+                                       }
+
+                                       if (!p->gsmin)
+                                               p->gsmin = gsm_create();
+
+                                       len = 0;
+                                       while(len < e->event.voice.datalen) {
+                                               if(gsm_decode(p->gsmin, e->event.voice.data + len, fr)) {
+                                                       fprintf(stderr, "Bad GSM data\n");
+                                                       break;
+                                               } else {
+                                                       int res;
+
+                                                       res = write(audiofd, fr, sizeof(fr));
+                                                       if (res < 0) 
+                                                               fprintf(f, "Write failed: %s\n", strerror(errno));
+                                               }
+                                               len += 33;
+                                       }
+                                       break;
+                               default :
+                                       fprintf(f, "Don't know how to handle that format %d\n", e->event.voice.format);
+                       }
+                       break;
+               default:
+                       fprintf(f, "Unknown event: %d\n", e->etype);
+       }
+}
+
+void
+dump_call(void)
+{
+        if(most_recent_answer)
+        {
+               printf("Dumping call!\n");
+            iax_hangup(most_recent_answer->session,"");
+            free(most_recent_answer);
+        }
+        answered_call = 0;
+        most_recent_answer = 0;
+        answered_call = 0;
+        peers = 0;
+        newcall = 0;
+               offhook = 0;
+               ringing = 0;
+               gentone(TONE_NONE, 0);
+}                                                                               
+
+void
+parse_cmd(FILE *f, int argc, char **argv)
+{
+       if(!strcasecmp(argv[0], "HELP")) {
+               if(argc == 1)
+                       dump_array(f, help);
+               else if(argc == 2) {
+                       if(!strcasecmp(argv[1], "HELP"))
+                               fprintf(f, "Help <Command>\t-\tDisplays general help or specific help on command if supplied an arguement\n");
+                       else if(!strcasecmp(argv[1], "QUIT"))
+                               fprintf(f, "Quit\t\t-\tShuts down the miniphone\n");
+                       else fprintf(f, "No help available on %s\n", argv[1]);
+               } else {
+                       fprintf(f, "Too many arguements for command help.\n");
+               }
+       } else if(!strcasecmp(argv[0], "STATUS")) {
+               if(argc == 1) {
+                       int c = 0;
+                       struct peer *peerptr = peers;
+
+                       if(!peerptr)
+                               fprintf(f, "No session matches found.\n");
+                       else while(peerptr) {
+                               fprintf(f, "Listing sessions:\n\n");
+                               fprintf(f, "Session %d\n", ++c);
+                               fprintf(f, "Session existed for %d seconds\n", (int)time(0)-peerptr->time);
+                               if(answered_call)
+                                       fprintf(f, "Call answered.\n");
+                               else fprintf(f, "Call ringing.\n");
+
+                               peerptr = peerptr->next;
+                       }
+               } else fprintf(f, "Too many arguments for command status.\n");
+       } else if(!strcasecmp(argv[0], "ANSWER")) {
+               if(argc > 1)
+                       fprintf(f, "Too many arguements for command answer\n");
+               else answer_call();
+       } else if(!strcasecmp(argv[0], "REJECT")) {
+               if(argc > 1)
+                       fprintf(f, "Too many arguements for command reject\n");
+               else {
+                       fprintf(f, "Rejecting current phone call.\n");
+                       reject_call();
+               }
+       } else if (!strcasecmp(argv[0], "DUMP")) {
+               dump_call();
+       } else if (!strcasecmp(argv[0], "HANGUP")) {
+               dump_call();
+       } else if(!strcasecmp(argv[0], "CALL")) {
+               if(argc > 2)
+                       fprintf(f, "Too many arguements for command call\n");
+               else {
+                       call(f, argv[1]);
+               }
+       } else if(!strcasecmp(argv[0], "QUIT")) {
+               if(argc > 1)
+                       fprintf(f, "Too many arguements for command quit\n");
+               else {
+                       fprintf(f, "Good bye!\n");
+                       exit(1);
+               }
+       } else fprintf(f, "Unknown command of %s\n", argv[0]);
+}
+
+void
+issue_prompt(FILE *f)
+{
+       fprintf(f, "TeleClient> ");
+       fflush(f);
+}
+
+void
+dump_array(FILE *f, char **array) {
+       while(*array)
+               fprintf(f, "%s\n", *array++);
+}
diff --git a/libs/iax/src/miniphone.h b/libs/iax/src/miniphone.h
new file mode 100644 (file)
index 0000000..6e3677a
--- /dev/null
@@ -0,0 +1,6 @@
+#define RBUFSIZE 256
+#define MAXARGS 10
+#define MAXARG 256
+#define MAX_SESSIONS 4
+
+extern void parse_cmd(FILE *, int, char **);
diff --git a/libs/iax/src/options.c b/libs/iax/src/options.c
new file mode 100644 (file)
index 0000000..a01e3f8
--- /dev/null
@@ -0,0 +1,137 @@
+/*
+ * Snomphone: IAX software for SNOM 100 Phone
+ *
+ * IAX Support for talking to Asterisk and other Gnophone clients
+ *
+ * Copyright (C) 1999, Linux Support Services, Inc.
+ *
+ * Mark Spencer <markster@linux-support.net>
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License
+ */
+
+#define CONFIG_FILE "/etc/miniphone.conf"
+#define USER_FILE "%s/.miniphone-conf"
+
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#include <stdlib.h>
+
+char regpeer[256];
+char regsecret[256];
+char server[256];
+int refresh = 60;
+char context[256];
+char language[256];
+
+#define TYPE_STRING 0
+#define TYPE_INT    1
+
+struct opt {
+       char *name;
+       void *where;
+       int len;
+       int type;
+};
+
+static struct opt opts[] =  {
+       { "regpeer", regpeer, sizeof(regpeer), TYPE_STRING },
+       { "regsecret", regsecret, sizeof(regsecret), TYPE_STRING },
+       { "server", server, sizeof(server), TYPE_STRING },
+       { "context", context, sizeof(context), TYPE_STRING },
+       { "language", language, sizeof(language), TYPE_STRING },
+       { "refresh", &refresh, sizeof(refresh), TYPE_INT },
+};
+
+static int __load_options(char *filename)
+{
+       FILE *f;
+       int lineno = 0;
+       char buf[256];
+       char *var, *value;
+       int x;
+       char *c;
+       f = fopen(filename, "r");
+       if (!f) {
+               fprintf(stderr, "Failed to open '%s': %s\n", filename, strerror(errno));
+               return -1;
+       }
+       while(!feof(f)) {
+               fgets(buf, sizeof(buf), f);
+               if (!feof(f)) {
+                       /* Ditch comments */
+                       if ((c = strchr(buf, '#')))
+                               *c = 0;
+                       lineno++;
+                       /* Strip CR */
+                       buf[strlen(buf)-1] = '\0';
+                       if (strlen(buf)) {
+                               var = strtok(buf, "=");
+                               value = strtok(NULL, "=");
+                               if (!var || !value) {
+                                       fprintf(stderr, "Syntax error line %d\n", lineno);
+                                       continue;
+                               }
+                               for (x=0;x<sizeof(opts) / sizeof(opts[0]); x++) {
+                                       if (!strcasecmp(var, opts[x].name)) {
+                                               switch(opts[x].type) {
+                                               case TYPE_STRING:
+                                                       strncpy((char *)opts[x].where, value, opts[x].len);
+                                                       break;
+                                               case TYPE_INT:
+                                                       if (sscanf(value, "%i", (int *)opts[x].where) != 1) {
+                                                               fprintf(stderr, "Not a number at line %d\n", lineno);
+                                                       }
+                                                       break;
+                                               default:
+                                                       fprintf(stderr, "Don't know what to do about type %d\n", opts[x].type);
+                                               }
+                                               break;
+                                       }
+                               }
+                               if (!(x < sizeof(opts) / sizeof(opts[0]))) {
+                                       fprintf(stderr, "Dunno keyword '%s'\n", var);
+                                       continue;
+                               }
+                       }
+               }
+       }
+       fclose(f);
+       return 0;
+}
+
+int load_options(void)
+{
+       char fn[256];
+       __load_options(CONFIG_FILE);
+       if (getenv("HOME")) {
+               snprintf(fn, sizeof(fn), USER_FILE, getenv("HOME"));
+               __load_options(fn);
+       }
+       return 0;
+}
+
+static int __save_options(char *filename)
+{
+       FILE *f;
+       f = fopen(filename, "w");
+       if (!f) {
+               fprintf(stderr, "Failed to open '%s': %s\n", filename, strerror(errno));
+               return -1;
+       }
+       fclose(f);
+       return 0;
+}
+
+int save_options(void)
+{
+       char fn[256];
+       if (getenv("HOME")) {
+               snprintf(fn, sizeof(fn), USER_FILE, getenv("HOME"));
+               return __save_options(fn);
+       } else
+               return __save_options(CONFIG_FILE);
+       
+}
diff --git a/libs/iax/src/options.h b/libs/iax/src/options.h
new file mode 100644 (file)
index 0000000..b9f791d
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Snomphone: IAX software for SNOM 100 Phone
+ *
+ * IAX Support for talking to Asterisk and other Gnophone clients
+ *
+ * Copyright (C) 1999, Linux Support Services, Inc.
+ *
+ * Mark Spencer <markster@linux-support.net>
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License
+ */
+
+extern char regpeer[256];
+extern char regsecret[256];
+extern char regpeer[256];
+extern char server[256];
+extern int refresh;
+extern char context[256];
+extern char language[256];
+
+int save_options(void);
+int load_options(void);
diff --git a/libs/iax/src/ring10.h b/libs/iax/src/ring10.h
new file mode 100644 (file)
index 0000000..13fce37
--- /dev/null
@@ -0,0 +1,1752 @@
+/*
+  * Signed 16-bit audio data
+  *
+  * Source: /home/markster/ring10.raw
+  *
+  * Copyright (C) 1999, Mark Spencer and Linux Support Services
+  *
+  * Distributed under the terms of the GNU General Public License
+  *
+  */
+
+static signed short ring10[] = {
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 0x82a0, 0x8dc7, 0x607e, 0xc0c6, 0x2bd3, 
+0x8df5, 0x828d, 0x0716, 0xaca6, 0xcefe, 0x41df, 0xd185, 0x8aa3, 0x8b1a, 0x789b, 
+0x82a2, 0x804f, 0x7ea8, 0x8113, 0x7f7d, 0x7fff, 0x801e, 0x801d, 0x7f32, 0x82ec, 
+0x83e1, 0x7fb0, 0x7f71, 0x80de, 0x7f3d, 0x7fe3, 0x81b4, 0x7c37, 0x8553, 0x7b29, 
+0x7ede, 0xde6e, 0x0e64, 0xf9f4, 0x015e, 0x00f6, 0xfe56, 0x0019, 0xf8bb, 0xfd90, 
+0x08cc, 0x05ab, 0xfd0b, 0xf9c6, 0xf875, 0xf789, 0xfc74, 0x032e, 0xf97a, 0xf4bb, 
+0x0212, 0x006e, 0x03df, 0x17c5, 0x0f50, 0xfb23, 0xfdbd, 0xf7cf, 0xdf5b, 0xe2d3, 
+0xf111, 0xef27, 0x11c5, 0x33a4, 0x168d, 0x0145, 0x0494, 0xe85c, 0xdac3, 0xf0c7, 
+0xeea8, 0x0023, 0x3036, 0x252a, 0xffb7, 0x01d1, 0xf637, 0xd506, 0xe8eb, 0xf5ff, 
+0xe5ca, 0x1ec5, 0x3fa4, 0x0e3c, 0x1570, 0x2b37, 0xea23, 0xca43, 0xf392, 0xdf0e, 
+0xde40, 0x2e7c, 0x276f, 0x035c, 0x2ccc, 0x1acf, 0xcf4a, 0xeb5b, 0x0fb1, 0xe01a, 
+0x0c69, 0x3a97, 0xfb54, 0x0751, 0x20f1, 0xdce9, 0xd2a2, 0x19b3, 0x096f, 0xf1b6, 
+0x38de, 0x1f70, 0xf32b, 0x2569, 0x0650, 0xc3d7, 0xf1ad, 0x1aa5, 0xe87e, 0x0c7f, 
+0x406d, 0xffaa, 0x0ba8, 0x2e02, 0xe545, 0xcebb, 0x10fc, 0x0102, 0xded8, 0x2b7c, 
+0x2053, 0xec6f, 0x266e, 0x1770, 0xcb63, 0xf18e, 0x2015, 0xe6ef, 0xfe64, 0x3700, 
+0xf628, 0xfb00, 0x2e43, 0xee48, 0xcd4a, 0x1867, 0x0ec3, 0xdd77, 0x2291, 0x1c80, 
+0xe325, 0x19b7, 0x1719, 0xcb88, 0xeded, 0x258c, 0xe7e8, 0xf0c6, 0x2d21, 0xf3d5, 
+0xf494, 0x290d, 0xef7b, 0xca28, 0x12c8, 0x0d8d, 0xd5f3, 0x171d, 0x1994, 0xe0c0, 
+0x1348, 0x1929, 0xcf9b, 0xe6fb, 0x20ae, 0xe921, 0xed2b, 0x2c54, 0xf96e, 0xf19f, 
+0x21b6, 0xf12e, 0xc8b4, 0x0907, 0x0964, 0xd049, 0x0eb8, 0x1fa6, 0xe6b5, 0x0cec, 
+0x16b6, 0xcd0c, 0xda57, 0x17c9, 0xe440, 0xe2a2, 0x2b4d, 0xffa2, 0xec7e, 0x1ee9, 
+0xf674, 0xbfcb, 0xf769, 0x0402, 0xcfe8, 0x104b, 0x2734, 0xe7e9, 0x07d9, 0x19f4, 
+0xd032, 0xd00b, 0x0e46, 0xe17d, 0xe2d8, 0x3456, 0x0781, 0xed01, 0x238d, 0xfa72, 
+0xbb51, 0xf543, 0x050b, 0xccd5, 0x1491, 0x3358, 0xedad, 0x10c4, 0x283b, 0xd051, 
+0xc9e9, 0x11f8, 0xe2cb, 0xe534, 0x43aa, 0x1090, 0xf11b, 0x3267, 0x02c3, 0xb72d, 
+0xf9ac, 0x0fbd, 0xce45, 0x1d7b, 0x4389, 0xef2e, 0x1593, 0x348e, 0xd0cb, 0xca8c, 
+0x1f61, 0xe981, 0xdef7, 0x4774, 0x15ae, 0xefab, 0x3b28, 0x0a9e, 0xb2f6, 0xf9e9, 
+0x1976, 0xcc08, 0x15ab, 0x4534, 0xee6c, 0x159b, 0x3753, 0xcf09, 0xc69a, 0x2270, 
+0xf15c, 0xdee6, 0x48ce, 0x1af4, 0xf169, 0x3da0, 0x0d68, 0xb573, 0xff9e, 0x20ba, 
+0xcbfe, 0x142d, 0x4879, 0xed49, 0x1434, 0x3d96, 0xd714, 0xca99, 0x298b, 0xf708, 
+0xd92c, 0x4632, 0x1acc, 0xea6e, 0x3d2c, 0x1412, 0xb534, 0xfbfa, 0x24f9, 0xcd72, 
+0x0df9, 0x48f8, 0xeb87, 0x0bca, 0x3dd5, 0xd6cc, 0xc015, 0x2605, 0xfa87, 0xd1a9, 
+0x40d0, 0x1c59, 0xe0de, 0x34f9, 0x14c6, 0xaf61, 0xf2a5, 0x23e6, 0xc929, 0x01be, 
+0x4423, 0xe53b, 0x0182, 0x3c3a, 0xd758, 0xbb9d, 0x1fa9, 0xf454, 0xc611, 0x36e8, 
+0x18f7, 0xdac9, 0x2e8a, 0x126d, 0xac14, 0xead6, 0x2215, 0xc990, 0xf9f5, 0x43cb, 
+0xea01, 0xfcbf, 0x38fd, 0xd9f3, 0xb7cd, 0x1bc4, 0xfd41, 0xca56, 0x31e3, 0x1d4b, 
+0xdca2, 0x2a9f, 0x1c24, 0xb8aa, 0xeb59, 0x25d5, 0xd2d0, 0xfa10, 0x44fa, 0xefe0, 
+0xfced, 0x3ef4, 0xe9a1, 0xbdf0, 0x19ac, 0x0198, 0xca6f, 0x2f04, 0x25b6, 0xe187, 
+0x29ba, 0x250a, 0xbe42, 0xe40e, 0x24ef, 0xd75d, 0xf476, 0x44f8, 0xf719, 0xf7a1, 
+0x3c94, 0xf20e, 0xbcdf, 0x16a3, 0x07e8, 0xc8d4, 0x2a3e, 0x2b3f, 0xdf4e, 0x235d, 
+0x2c92, 0xc2c7, 0xdf39, 0x2873, 0xd790, 0xea2a, 0x47fd, 0xfd0e, 0xf0e3, 0x3bd8, 
+0xf4e9, 0xb265, 0x0c2c, 0x0751, 0xc302, 0x29bb, 0x37bd, 0xe138, 0x1e0c, 0x2d09, 
+0xbddb, 0xd246, 0x24c4, 0xd87a, 0xe5df, 0x4ff6, 0x08d6, 0xf0d8, 0x3d61, 0xf8bf, 
+0xaede, 0x0a36, 0x0df3, 0xc0f5, 0x23ec, 0x3e92, 0xe3d7, 0x1cad, 0x348e, 0xc0d6, 
+0xcd4e, 0x265c, 0xd9b6, 0xdf83, 0x510e, 0x0c41, 0xeece, 0x4153, 0xfeeb, 0xa9f6, 
+0x04b3, 0x12a4, 0xbf2f, 0x20d1, 0x42f4, 0xe1b1, 0x1b1e, 0x3980, 0xc2b4, 0xcb50, 
+0x2b74, 0xded0, 0xd835, 0x4e7a, 0x0b46, 0xe555, 0x4015, 0x0517, 0xaa54, 0x0504, 
+0x1932, 0xbc34, 0x1a77, 0x48b1, 0xe0bb, 0x149b, 0x3ba7, 0xc34a, 0xc481, 0x2bc2, 
+0xe401, 0xd20e, 0x4f53, 0x1389, 0xe3b7, 0x418b, 0x0a15, 0xa70d, 0x0024, 0x1f9f, 
+0xbf65, 0x142d, 0x4a81, 0xe0ca, 0x1152, 0x4325, 0xcb03, 0xc18a, 0x2b95, 0xeb45, 
+0xcf92, 0x4c54, 0x18ad, 0xe08b, 0x3f12, 0x1264, 0xa9fc, 0xfd97, 0x246f, 0xbf86, 
+0x0ce2, 0x4e7c, 0xe4f3, 0x0c20, 0x44e0, 0xd069, 0xbdcb, 0x2b8e, 0xf32d, 0xcad4, 
+0x464f, 0x1e76, 0xdf62, 0x3b07, 0x17ea, 0xaafb, 0xf5a0, 0x2835, 0xc7c2, 0x0842, 
+0x4d2b, 0xe634, 0x03ef, 0x42bc, 0xd7f2, 0xbb73, 0x2662, 0xf892, 0xc8b3, 0x3e30, 
+0x1f20, 0xdcca, 0x354a, 0x1c6b, 0xaf75, 0xf0f7, 0x2963, 0xc908, 0xfdbf, 0x4c3c, 
+0xebe5, 0x00e3, 0x44c4, 0xdf15, 0xb9e9, 0x243b, 0x00e9, 0xcb76, 0x3b53, 0x248e, 
+0xdc27, 0x2fcb, 0x22e5, 0xb66c, 0xec96, 0x2b19, 0xd0ef, 0xf97b, 0x48ae, 0xecc0, 
+0xf8b4, 0x411d, 0xe769, 0xb9f7, 0x1c41, 0x0022, 0xc369, 0x2ced, 0x23ac, 0xd8eb, 
+0x2522, 0x232a, 0xb611, 0xe19f, 0x2738, 0xd013, 0xece5, 0x434c, 0xf00e, 0xefcc, 
+0x3b79, 0xeb32, 0xb19c, 0x135e, 0x04ef, 0xc1b9, 0x27a8, 0x2992, 0xd7b3, 0x1ba5, 
+0x2481, 0xb8c5, 0xd97d, 0x246f, 0xd113, 0xe45d, 0x4486, 0xf7f7, 0xeb36, 0x395a, 
+0xf122, 0xaea5, 0x0c28, 0x05eb, 0xbde4, 0x2585, 0x36a2, 0xde67, 0x1b86, 0x2dac, 
+0xbd03, 0xd2b8, 0x2624, 0xd8b8, 0xe802, 0x521b, 0x0855, 0xefbc, 0x4048, 0xfad2, 
+0xafe2, 0x0fb1, 0x12b2, 0xc62c, 0x2c2a, 0x43f5, 0xe562, 0x1fcb, 0x3791, 0xc2ac, 
+0xd4d1, 0x2dfd, 0xde0a, 0xe53f, 0x5578, 0x0f49, 0xf2b6, 0x4609, 0x0105, 0xabf5, 
+0x09a8, 0x157e, 0xc286, 0x23e7, 0x425f, 0xe36a, 0x1d93, 0x3580, 0xbf80, 0xcaf2, 
+0x2a04, 0xf16e, 0xd92b, 0x0eaa, 0xf1a7, 0x1ddb, 0x5b52, 0x0665, 0xd2e3, 0x15f8, 
+0xf606, 0x9d42, 0xdba7, 0xf312, 0xd349, 0x21ed, 0x576a, 0x34e8, 0x2450, 0x2679, 
+0xdc01, 0xb506, 0xcb0f, 0xa454, 0xccf3, 0x2c13, 0x1673, 0xf8ca, 0x4ff1, 0x63ac, 
+0xec26, 0xd77c, 0xf1f9, 0xc268, 0xb11a, 0xdfe4, 0x02e7, 0x10f5, 0x3512, 0x19dd, 
+0x0edc, 0x3568, 0xf6f7, 0xbe10, 0xda93, 0xf4fe, 0xda03, 0xe293, 0x15dd, 0x15f3, 
+0x1ba5, 0x1521, 0x12e8, 0x23ab, 0x0fc3, 0xdb3e, 0xb671, 0xe960, 0xe13c, 0xc695, 
+0x1a81, 0x3d23, 0x1c56, 0x190d, 0x4234, 0x1970, 0xd784, 0xd86b, 0xb5e8, 0xc9f3, 
+0xeb89, 0xe344, 0x17ae, 0x5713, 0x37fc, 0xffe2, 0x36b3, 0x1dfe, 0xb963, 0xbf9c, 
+0xc9a1, 0xcc7b, 0xe409, 0x08a6, 0x2077, 0x3b4d, 0x3cba, 0x0553, 0x220e, 0x226e, 
+0xd219, 0xb7ec, 0xcb8b, 0xdf2a, 0xd0c7, 0xf5be, 0x2ff0, 0x42a6, 0x3c24, 0x25ae, 
+0x2d6d, 0x0d94, 0xde80, 0xb78b, 0xb12b, 0xdf7a, 0xde33, 0x0046, 0x47b1, 0x5170, 
+0x29c0, 0x2945, 0x3ab5, 0xf08f, 0xc806, 0xc229, 0xbbf4, 0xe40d, 0xf365, 0x0bfe, 
+0x448d, 0x5cd8, 0x1e52, 0x10ba, 0x3908, 0xefa4, 0xc243, 0xcf89, 0xd02d, 0xde92, 
+0xf8e0, 0x191e, 0x2f7b, 0x48e6, 0x1e38, 0x1074, 0x3785, 0xf8be, 0xbd1c, 0xc06b, 
+0xdc36, 0xdb97, 0xe3c0, 0x2042, 0x37c5, 0x36ff, 0x1b73, 0x2064, 0x2c9a, 0xefa2, 
+0xbf0c, 0xb7f0, 0xe221, 0xe243, 0xd998, 0x2263, 0x4bae, 0x3596, 0x18aa, 0x3763, 
+0x27d0, 0xdcc6, 0xcacc, 0xc06f, 0xd83d, 0xecfe, 0xeefa, 0x1ffa, 0x5052, 0x393f, 
+0x0af5, 0x3c9e, 0x316b, 0xd2df, 0xc575, 0xd3c8, 0xddd2, 0xdf98, 0xfbd7, 0x2929, 
+0x4879, 0x4052, 0x160c, 0x3708, 0x2b31, 0xdac6, 0xc0c3, 0xcfc0, 0xe71d, 0xddec, 
+0x0145, 0x3847, 0x457c, 0x356b, 0x214a, 0x3a5f, 0x1474, 0xd892, 0xc579, 0xc6a7, 
+0xe77a, 0xe4dc, 0x00ab, 0x3b89, 0x4eba, 0x290a, 0x16ea, 0x3dc6, 0x0956, 0xcc12, 
+0xc3bd, 0xc9e9, 0xe4be, 0xe60b, 0x0561, 0x3707, 0x4c82, 0x2444, 0x1406, 0x3a8e, 
+0xff5b, 0xc494, 0xbf9f, 0xcb26, 0xdfef, 0xe755, 0x1060, 0x334f, 0x40e5, 0x1f87, 
+0x16b9, 0x33e8, 0xfa6e, 0xc670, 0xb774, 0xcc17, 0xe18f, 0xdd0f, 0x102c, 0x3f0d, 
+0x4098, 0x1b95, 0x24b2, 0x315a, 0xe9d8, 0xc459, 0xb314, 0xc524, 0xe2a6, 0xe1cf, 
+0x100a, 0x44af, 0x455c, 0x1551, 0x264f, 0x2ab1, 0xd681, 0xb90c, 0xb4d6, 0xc68d, 
+0xddac, 0xef74, 0x1f57, 0x4357, 0x4192, 0x0e60, 0x1bcb, 0x20fd, 0xd477, 0xb435, 
+0xb3e3, 0xcdc3, 0xd9c4, 0xef97, 0x2384, 0x3b60, 0x34c9, 0x119d, 0x1f15, 0x0fb3, 
+0xd15d, 0xb30d, 0xa9e3, 0xd431, 0xdc02, 0xe98a, 0x2987, 0x4204, 0x290c, 0x1181, 
+0x2d0c, 0x0800, 0xcb55, 0xb8f5, 0xaaa6, 0xd49f, 0xe57c, 0xf063, 0x281c, 0x4c65, 
+0x2d19, 0x0cd2, 0x2ddb, 0xfefe, 0xc171, 0xbd4c, 0xb7c2, 0xd4c5, 0xe6f3, 0x0040, 
+0x2b86, 0x4b6d, 0x2ed1, 0x0ce3, 0x2d97, 0x01f9, 0xc2ad, 0xb8fc, 0xc53e, 0xe1cf, 
+0xea35, 0x0eb0, 0x38b8, 0x4a3b, 0x2a1e, 0x1457, 0x2a1e, 0xfbca, 0xcdf1, 0xbc93, 
+0xcc0b, 0xec27, 0xeb05, 0x144b, 0x4443, 0x496d, 0x2233, 0x2180, 0x30b2, 0xf03c, 
+0xcced, 0xbf0d, 0xcc55, 0xeec3, 0xf367, 0x186f, 0x45cd, 0x4e7d, 0x215a, 0x2485, 
+0x3122, 0xe7a8, 0xc40a, 0xbf85, 0xd4dd, 0xebe8, 0xf32b, 0x2121, 0x49bb, 0x4c61, 
+0x1af5, 0x1f88, 0x2c32, 0xe8c5, 0xc512, 0xc0b7, 0xdbf9, 0xe9ea, 0xf2f4, 0x2584, 
+0x43e2, 0x3e1b, 0x19cf, 0x28d2, 0x2442, 0xe27b, 0xc589, 0xbe8a, 0xdddc, 0xe567, 
+0xed4e, 0x27f2, 0x48cd, 0x3505, 0x0e88, 0x2cd5, 0x207d, 0xda54, 0xc1cf, 0xb8c1, 
+0xd925, 0xe569, 0xefd0, 0x2723, 0x4dd1, 0x38b2, 0x0de5, 0x2d90, 0x155b, 0xca06, 
+0xbab6, 0xbf37, 0xdd46, 0xe3fd, 0xfb50, 0x2e5d, 0x487b, 0x343e, 0x0abe, 0x25e9, 
+0x0f65, 0xcb83, 0xb474, 0xbc50, 0xe2ab, 0xe1df, 0xfd3e, 0x3672, 0x458b, 0x294e, 
+0x10fd, 0x2afa, 0x027f, 0xcae8, 0xb95b, 0xbc6f, 0xe536, 0xe3af, 0xfd1c, 0x3b18, 
+0x4cb1, 0x23ff, 0x13eb, 0x3353, 0xfb34, 0xc4aa, 0xb71a, 0xb9f2, 0xe1d7, 0xe97f, 
+0x058d, 0x3a0f, 0x4fcd, 0x2408, 0x11a3, 0x2fb9, 0xf271, 0xbb7f, 0xb447, 0xc317, 
+0xde44, 0xe56a, 0x110a, 0x3ccc, 0x494a, 0x1f80, 0x11af, 0x26a1, 0xeb09, 0xbcd0, 
+0xaf90, 0xc8d4, 0xe63f, 0xe47d, 0x1435, 0x3f4f, 0x3fbe, 0x17c7, 0x1a4f, 0x2393, 
+0xe191, 0xbfa1, 0xb0e4, 0xc7c9, 0xe2d9, 0xe363, 0x1625, 0x4320, 0x3da9, 0x11c4, 
+0x1e02, 0x1d1b, 0xd6be, 0xbe96, 0xb123, 0xc8a4, 0xe6ce, 0xef2e, 0x1c03, 0x4584, 
+0x3fd1, 0x1006, 0x20d8, 0x197b, 0xcf64, 0xb99e, 0xb693, 0xd396, 0xe8eb, 0xfb01, 
+0x2aca, 0x4b38, 0x3f87, 0x0de0, 0x1f2f, 0x1503, 0xd574, 0xba46, 0xb72d, 0xf07a, 
+0xfa16, 0xf608, 0x29c0, 0x3a7e, 0x42a7, 0x43ac, 0x2717, 0xec6f, 0xd732, 0xc1ac, 
+0xa146, 0xef37, 0x122b, 0x05c1, 0x5c67, 0x8e8c, 0x3d5e, 0x0043, 0x00d0, 0xb9ef, 
+0xa38d, 0xc8dd, 0xc921, 0x15c9, 0x5fe3, 0x531a, 0x477d, 0x5852, 0x1b9f, 0xb930, 
+0xd1b6, 0xde60, 0xbcce, 0xe7f7, 0x16b1, 0x2aeb, 0x4605, 0x3592, 0xfe8c, 0x0c1d, 
+0x1b24, 0xd084, 0xd667, 0x2736, 0x06f7, 0xdfa7, 0x1976, 0x0df9, 0xc5e8, 0x032b, 
+0x324e, 0xea0e, 0x1ab4, 0x46e4, 0xf72e, 0x0369, 0x0ef3, 0xbe35, 0xbd17, 0x10fd, 
+0xfb35, 0xeb3f, 0x4e43, 0x2da4, 0xfe31, 0x2f50, 0xf64c, 0xafd6, 0xe267, 0xfd01, 
+0xca77, 0x1087, 0x48c1, 0xfcf4, 0x1bb0, 0x31af, 0xd234, 0xc0cb, 0x054e, 0xec6b, 
+0xce29, 0x29db, 0x1bb4, 0xf0fd, 0x3608, 0x12eb, 0xbb40, 0xeaa8, 0x190f, 0xce00, 
+0xed59, 0x39ef, 0xf1f0, 0xfb2a, 0x3535, 0xe3b3, 0xbf33, 0x1a9b, 0x013b, 0xc2ab, 
+0x2976, 0x21e0, 0xd3d8, 0x1ca6, 0x14ae, 0xb242, 0xe538, 0x2958, 0xd98c, 0xf279, 
+0x4106, 0xf13e, 0xf68b, 0x3379, 0xe023, 0xb4a8, 0x104b, 0x0685, 0xcca4, 0x2e61, 
+0x2d96, 0xe2b8, 0x26ac, 0x2510, 0xc114, 0xd9e5, 0x1f91, 0xdbc9, 0xe515, 0x40bd, 
+0x0693, 0xff44, 0x3c5e, 0xf664, 0xb8dc, 0x0b37, 0x1314, 0xc29c, 0x161f, 0x3582, 
+0xe32e, 0x17c0, 0x2de6, 0xc7c1, 0xcfeb, 0x23a6, 0xe644, 0xe65f, 0x4256, 0xf765, 
+0xe698, 0x4148, 0xfbe1, 0xa6b4, 0x03fa, 0x1c92, 0xcb85, 0x1a54, 0x37af, 0xe830, 
+0x1b0b, 0x255d, 0xc13f, 0xd3d9, 0x205e, 0xde69, 0xe2ab, 0x48d5, 0x0931, 0xee2f, 
+0x3d79, 0x0658, 0xb36c, 0xf59e, 0x11f4, 0xd042, 0x110b, 0x2e1b, 0xe763, 0x2269, 
+0x3bda, 0xcefb, 0xd37b, 0x2d7f, 0xe9d7, 0xd48e, 0x3fd2, 0x0e86, 0xea62, 0x3cd5, 
+0x11e0, 0xc1dc, 0x08e0, 0x1f68, 0xd3f1, 0x1fc8, 0x3da6, 0xe12f, 0x1d62, 0x4060, 
+0xccb6, 0xd211, 0x316f, 0xf370, 0xe20e, 0x4657, 0x1280, 0xf30a, 0x3df0, 0x07fc, 
+0xb956, 0x023e, 0x1978, 0xcbba, 0x137d, 0x3ff7, 0xecbc, 0x1698, 0x3f29, 0xdf9f, 
+0xcc1c, 0x1bdc, 0xef17, 0xd3da, 0x346b, 0x1296, 0xeb25, 0x3885, 0x190f, 0xbf13, 
+0xfb71, 0x1df2, 0xc509, 0xffa2, 0x3a66, 0xe5fd, 0x04f6, 0x36be, 0xda99, 0xc67e, 
+0x1fc2, 0xef95, 0xcfa8, 0x39df, 0x0f1a, 0xd986, 0x2d7b, 0x0e88, 0xb2a2, 0xf40f, 
+0x1bd3, 0xc95c, 0x0511, 0x408d, 0xec48, 0x03d2, 0x3281, 0xd7a0, 0xb9a0, 0x13ab, 
+0xf02d, 0xc92c, 0x3af6, 0x26c0, 0xe5f8, 0x2de7, 0x18b9, 0xafd8, 0xddbf, 0x15bc, 
+0xc4d3, 0xf6dc, 0x4b73, 0xf89f, 0x018a, 0x3c4e, 0xdf11, 0xb20d, 0x12d7, 0xf511, 
+0xbf7e, 0x33aa, 0x286f, 0xe309, 0x3107, 0x1f74, 0xb1c3, 0xe10f, 0x1fd3, 0xc7d4, 
+0xef6e, 0x4b78, 0xf32f, 0xf8e5, 0x43cb, 0xe7da, 0xaf46, 0x115a, 0xfeb2, 0xbf7a, 
+0x2e9a, 0x2ed7, 0xde2f, 0x2807, 0x259c, 0xb09f, 0xd3d4, 0x2606, 0xd544, 0xeb3d, 
+0x5107, 0xfecf, 0xf63f, 0x4304, 0xedfe, 0xae0d, 0x0d7f, 0x0957, 0xc47d, 0x2f62, 
+0x3b51, 0xdfea, 0x2a01, 0x3390, 0xb825, 0xd3e9, 0x29f1, 0xd82e, 0xe2e3, 0x509a, 
+0x061c, 0xf530, 0x48b1, 0xf740, 0xabeb, 0x0d93, 0x0ed4, 0xbed0, 0x274e, 0x3e3b, 
+0xddc2, 0x2168, 0x35a1, 0xbbb0, 0xcedb, 0x2b94, 0xdd5b, 0xdd2d, 0x4e6a, 0x068d, 
+0xe741, 0x3eef, 0xfe34, 0xad12, 0x0bb7, 0x1a73, 0xbea5, 0x1c31, 0x4269, 0xdc1a, 
+0x1611, 0x37d6, 0xc048, 0xcaa3, 0x2f7e, 0xe59c, 0xd94c, 0x4ed8, 0x0af6, 0xe225, 
+0x3c84, 0xfd49, 0xa4b2, 0x048d, 0x1ed5, 0xc496, 0x1caa, 0x4641, 0xddd4, 0x1578, 
+0x37dc, 0xc13b, 0xcab7, 0x30dc, 0xfec0, 0xd462, 0x1387, 0x07dd, 0x14c1, 0x4b92, 
+0x0d74, 0xda49, 0x12de, 0x02fe, 0xb8fe, 0xeaae, 0x0363, 0xdab0, 0x23b0, 0x68fb, 
+0x3681, 0x1351, 0x29fc, 0xf22e, 0xb781, 0xd225, 0xc11d, 0xd7d8, 0x354d, 0x26b8, 
+0x09af, 0x60fa, 0x5f8c, 0xe302, 0xde80, 0xff6a, 0xbb95, 0xafec, 0x029f, 0x161d, 
+0x0fee, 0x3924, 0x2b6c, 0x1ed5, 0x24fe, 0xec7b, 0xc1fe, 0xe22b, 0xfbcd, 0xdc4d, 
+0xf3f7, 0x210f, 0x1d01, 0x1305, 0x1342, 0x1f6c, 0x0852, 0xfea5, 0xdd42, 0xc083, 
+0xf243, 0xde95, 0xd818, 0x23f7, 0x3eab, 0x0891, 0x1381, 0x52fd, 0xff10, 0xc983, 
+0xe091, 0xc3b8, 0xcafc, 0xe7d7, 0xfc8d, 0x2043, 0x559d, 0x2c2e, 0x0418, 0x4485, 
+0x0b4c, 0xb4e5, 0xc68e, 0xddbf, 0xd0b6, 0xdc81, 0x1e4b, 0x2d10, 0x365b, 0x2c50, 
+0x170a, 0x303e, 0x0a60, 0xcc89, 0xb88a, 0xdbc7, 0xe3e7, 0xcdd2, 0x0b38, 0x3c7e, 
+0x392b, 0x254c, 0x3272, 0x2fc9, 0xf0ee, 0xd4d8, 0xb5b4, 0xc03b, 0xdef0, 0xd8e9, 
+0x0edc, 0x533e, 0x46e4, 0x0fc4, 0x358a, 0x34b8, 0xd1c3, 0xbf29, 0xbb64, 0xbeea, 
+0xdb1c, 0xf31b, 0x17f1, 0x44fa, 0x4bfb, 0x0a36, 0x1fe2, 0x2ce9, 0xcf0d, 0xb605, 
+0xc6c6, 0xcc96, 0xcf30, 0xf9cd, 0x25fb, 0x36d1, 0x4086, 0x1499, 0x21d8, 0x287f, 
+0xde77, 0xb0fd, 0xba6d, 0xe0f5, 0xd3e4, 0xee77, 0x3561, 0x4077, 0x2baa, 0x1d38, 
+0x3753, 0x1587, 0xd2e2, 0xb252, 0xb44b, 0xe5a7, 0xdbb5, 0xe778, 0x3790, 0x55cb, 
+0x234e, 0x10ab, 0x42e9, 0x083e, 0xc15a, 0xc2a9, 0xbe30, 0xd7d1, 0xe76a, 0xfa22, 
+0x2b37, 0x53cb, 0x29a6, 0x0950, 0x4086, 0x0f68, 0xbba0, 0xb824, 0xcc9c, 0xd743, 
+0xd665, 0x06ae, 0x3597, 0x44f1, 0x2854, 0x19d4, 0x3395, 0xfe8f, 0xc1b9, 0xad2d, 
+0xc39d, 0xde05, 0xd850, 0x0bf2, 0x4266, 0x457f, 0x1d4b, 0x2284, 0x337f, 0xe442, 
+0xbc43, 0xb8ba, 0xc33a, 0xe0e4, 0xe8f8, 0x10b5, 0x4262, 0x4afc, 0x1744, 0x1d2b, 
+0x3125, 0xe2b5, 0xbcb6, 0xbdea, 0xccfd, 0xdfe5, 0xefed, 0x1bae, 0x3f5e, 0x451d, 
+0x167c, 0x1ea7, 0x2848, 0xdf70, 0xbb35, 0xbbfc, 0xd959, 0xe266, 0xec2b, 0x20e3, 
+0x435c, 0x3878, 0x0fee, 0x25e8, 0x1ba1, 0xdaf0, 0xc061, 0xb76f, 0xdd9c, 0xe727, 
+0xece4, 0x247e, 0x48ee, 0x303d, 0x099a, 0x320b, 0x19b9, 0xd0b8, 0xc508, 0xbe20, 
+0xd52c, 0xe430, 0xf5f1, 0x21d1, 0x4aae, 0x3670, 0x0bc4, 0x349a, 0x16c6, 0xc9e1, 
+0xbb8f, 0xc44e, 0xdbed, 0xde26, 0x03b2, 0x34c9, 0x4689, 0x30a8, 0x17ea, 0x33bd, 
+0x0b87, 0xcd79, 0xb9b9, 0xc3c1, 0xe227, 0xdffc, 0x07ae, 0x3deb, 0x4732, 0x25e8, 
+0x1ef9, 0x370f, 0xfb29, 0xcc78, 0xbf32, 0xc5c0, 0xe807, 0xe571, 0x074b, 0x4121, 
+0x4902, 0x1968, 0x206c, 0x3da5, 0xf467, 0xc9c7, 0xc240, 0xc6d8, 0xe2b1, 0xeca9, 
+0x0f7d, 0x3a80, 0x4ac1, 0x1bda, 0x1cdc, 0x3836, 0xee35, 0xc32e, 0xc0a2, 0xce3e, 
+0xdfd7, 0xe9c8, 0x162c, 0x3eb5, 0x48b0, 0x1a61, 0x1e8f, 0x2cf5, 0xe5c6, 0xbb80, 
+0xb378, 0xd228, 0xe3dd, 0xeba5, 0x2266, 0x46f5, 0x3e1f, 0x13fa, 0x26ea, 0x21ec, 
+0xd925, 0xbdc7, 0xb66d, 0xd76b, 0xe81e, 0xf025, 0x269d, 0x4d69, 0x3d40, 0x1027, 
+0x2c58, 0x1cc9, 0xd265, 0xbfd4, 0xbabe, 0xd919, 0xe822, 0xf931, 0x2bc9, 0x4c69, 
+0x3d20, 0x158d, 0x31ca, 0x1821, 0xce8a, 0xb8af, 0xba0f, 0xdfb6, 0xe677, 0xfd3b, 
+0x385e, 0x53d9, 0x3764, 0x14a8, 0x30af, 0x0a51, 0xcb95, 0xbad7, 0xbc48, 0xe366, 
+0xea7e, 0x06cf, 0x3f08, 0x53c7, 0x2fe0, 0x189d, 0x383f, 0x00fd, 0xc5f3, 0xbf0d, 
+0xc38f, 0xe4a3, 0xecee, 0x0ef5, 0x432c, 0x54a7, 0x2a15, 0x190d, 0x3675, 0xf7bc, 
+0xc3e0, 0xbc22, 0xc381, 0xe210, 0xec59, 0x15ed, 0x4300, 0x4fd8, 0x269c, 0x1bda, 
+0x324a, 0xed57, 0xbb9c, 0xb705, 0xceb8, 0xeb30, 0xed72, 0x1baa, 0x48ad, 0x4bd3, 
+0x1fde, 0x1ea9, 0x2826, 0xe505, 0xc2b3, 0xb577, 0xceec, 0xeeb9, 0xef73, 0x1fd5, 
+0x4c99, 0x41f7, 0x12c7, 0x24ad, 0x22eb, 0xd504, 0xbfe3, 0xba2a, 0xd063, 0xea6f, 
+0xf037, 0x1c9c, 0x4acf, 0x430c, 0x0b68, 0x200d, 0x1c9e, 0xcce4, 0xb9ad, 0xbc29, 
+0xd211, 0xe475, 0xfc21, 0x2910, 0x443b, 0x3a83, 0x0ef1, 0x2295, 0x15ac, 0xd00d, 
+0xb774, 0xbaff, 0xded3, 0xe41e, 0xf945, 0x331e, 0x49b7, 0x3276, 0x128d, 0x28c7, 
+0x08f2, 0xce8e, 0xbb2e, 0xb907, 0xe4c0, 0xe9f8, 0xf98a, 0x3323, 0x4a75, 0x2718, 
+0x0ddc, 0x3369, 0x0795, 0xc936, 0xc192, 0xc3cc, 0xe2b9, 0xe583, 0xfce9, 0x312f, 
+0x4951, 0x266f, 0x0ffe, 0x3698, 0x0679, 0xca63, 0xc301, 0xc844, 0xde4c, 0xe26e, 
+0x076e, 0x3283, 0x4507, 0x259a, 0x11af, 0x30ff, 0xfd1c, 0xc1b2, 0xb384, 0xc924, 
+0xe414, 0xde8f, 0x0781, 0x295f, 0x51b4, 0x5b09, 0x17c9, 0xf17b, 0xd9cd, 0xb11a, 
+0x8396, 0xbd98, 0x073f, 0x0598, 0x5258, 0x7bf8, 0x3dd3, 0x096d, 0xe7f8, 0xa966, 
+0x9271, 0xc3c7, 0xb173, 0xf5d9, 0x6db2, 0x3b89, 0x2231, 0x4aaf, 0x1c3b, 0xc115, 
+0xcb06, 0xd460, 0xbb98, 0x03f6, 0xf9d7, 0xecaf, 0x4aa5, 0x27cf, 0xcf8c, 0x0764, 
+0x3489, 0xd9cb, 0xf31b, 0x39b5, 0xebc3, 0xeb7f, 0x1192, 0xceee, 0xbd72, 0x16f9, 
+0x1b5a, 0xf888, 0x4a44, 0x34a8, 0xedd8, 0x18bb, 0xf8d6, 0xa74c, 0xd19c, 0x139c, 
+0xeaf7, 0x0d0b, 0x5317, 0x0e81, 0x0c44, 0x35bd, 0xe010, 0xb51d, 0x075b, 0xfc77, 
+0xc9ae, 0x2b95, 0x35a1, 0xf0e8, 0x2c61, 0x2481, 0xc370, 0xe826, 0x20b5, 0xd95a, 
+0xf832, 0x43e0, 0xf261, 0xf7ef, 0x414e, 0xf14b, 0xbf9e, 0x1c6c, 0x1380, 0xd3d1, 
+0x2650, 0x1f52, 0xd592, 0x1ddb, 0x2414, 0xc347, 0xebd1, 0x3e70, 0xf240, 0xeb89, 
+0x3d66, 0xf738, 0xe57b, 0x2fe8, 0xf22d, 0xbd68, 0x1e7b, 0x2466, 0xd858, 0x2613, 
+0x3122, 0xdc86, 0x16b9, 0x277b, 0xc324, 0xdb13, 0x2c78, 0xe8ab, 0xed0b, 0x49bb, 
+0x0342, 0xf02a, 0x3b6c, 0xf7d9, 0xb9c6, 0x0fd8, 0x1192, 0xc763, 0x12e5, 0x2738, 
+0xe26c, 0x1a89, 0x2a72, 0xcd72, 0xdca7, 0x27a9, 0xe962, 0xd98a, 0x271e, 0xf948, 
+0xe783, 0x29f0, 0x000e, 0xc137, 0x064c, 0x17e6, 0xcd48, 0x0efb, 0x329b, 0xdc50, 
+0xf9d6, 0x28fd, 0xd866, 0xc34b, 0x13df, 0xefa3, 0xdcbf, 0x3578, 0x09a7, 0xe33f, 
+0x2c3f, 0x02a6, 0xaa76, 0xf3eb, 0x1870, 0xc21d, 0x029e, 0x3d07, 0xedbb, 0x0a92, 
+0x33dc, 0xd94f, 0xc985, 0x15a5, 0xdf1c, 0xd3f5, 0x3f5e, 0x0fca, 0xe50f, 0x3b04, 
+0x1a3d, 0xb99b, 0xf6d1, 0x1c75, 0xcc21, 0x0987, 0x3e95, 0xed51, 0x0dcf, 0x3b32, 
+0xd980, 0xc6f7, 0x280e, 0xf587, 0xd3c2, 0x4871, 0x233c, 0xe02f, 0x3039, 0x183d, 
+0xaecf, 0xf137, 0x2776, 0xcc66, 0x0bf0, 0x5162, 0xeddf, 0x088c, 0x4536, 0xd457, 
+0xb205, 0x2315, 0xf51a, 0xc60d, 0x4281, 0x2682, 0xe5d9, 0x3aad, 0x1cab, 0xb02d, 
+0xf294, 0x20af, 0xbecb, 0x0084, 0x4c16, 0xeaf2, 0x054e, 0x449f, 0xdf02, 0xbd48, 
+0x25bf, 0xfda9, 0xcb15, 0x3a93, 0x1e9b, 0xddd4, 0x3408, 0x1f70, 0xb333, 0xf3df, 
+0x32ab, 0xd133, 0x014e, 0x52b2, 0xf138, 0xfe00, 0x4260, 0xe1f2, 0xbbac, 0x28bf, 
+0x0404, 0xcc81, 0x4649, 0x2e56, 0xdee8, 0x3677, 0x23ef, 0xabc0, 0xea62, 0x3159, 
+0xcf59, 0xfdcf, 0x575a, 0xf403, 0xfe40, 0x4759, 0xe094, 0xb225, 0x1ffa, 0xfefc, 
+0xc26f, 0x3a61, 0x2be1, 0xdb44, 0x2efe, 0x2504, 0xadcb, 0xe074, 0x2713, 0xc6d3, 
+0xecc2, 0x48d6, 0xea4d, 0xf2ec, 0x43a0, 0xe1fc, 0xaa5f, 0x1825, 0xffd7, 0xba38, 
+0x2bdb, 0x24a3, 0xce10, 0x1cd8, 0x1cfc, 0xab2e, 0xdc4d, 0x276d, 0xca22, 0xeb01, 
+0x4a08, 0xeb0e, 0xe94c, 0x3cd7, 0xe45f, 0xa6c6, 0x0f8c, 0x066f, 0xc2d2, 0x2a01, 
+0x2aea, 0xd9bf, 0x251a, 0x2933, 0xb64d, 0xd9b5, 0x26a1, 0xd2ba, 0xe822, 0x4af1, 
+0xfec7, 0xf323, 0x3fdf, 0xf78e, 0xb4c1, 0x0f7f, 0x0e1c, 0xc7ce, 0x25fb, 0x3129, 
+0xdeb5, 0x2268, 0x3385, 0xc266, 0xd9b6, 0x2efc, 0xddb0, 0xe00f, 0x45ac, 0x0168, 
+0xea8d, 0x3cd9, 0xfeda, 0xb603, 0x13c5, 0x166b, 0xc192, 0x1f5a, 0x3804, 0xda94, 
+0x15a3, 0x35b3, 0xc729, 0xd3ae, 0x2e68, 0xe359, 0xde70, 0x4764, 0x0725, 0xe6b1, 
+0x3882, 0xfed4, 0xad23, 0x0819, 0x16c2, 0xc15b, 0x1c91, 0x4358, 0xe49c, 0x1162, 
+0x35d1, 0xc8f8, 0xc74f, 0x2676, 0xe0e9, 0xd0d7, 0x4b09, 0x1cea, 0xedea, 0x3f3b, 
+0x11f4, 0xb09a, 0xfc73, 0x177b, 0xba40, 0x109f, 0x4fcb, 0xf285, 0x1d0f, 0x3dc2, 
+0xc588, 0xc98d, 0x329a, 0xfd8a, 0xcc33, 0x1573, 0x1810, 0x1532, 0x434e, 0x102d, 
+0xd555, 0x08d4, 0x0011, 0xb77c, 0xec37, 0x098c, 0xd4fc, 0x2033, 0x7926, 0x32be, 
+0xfe95, 0x28ab, 0xef9c, 0xa428, 0xcffc, 0xcbdf, 0xd07c, 0x3681, 0x2f87, 0x0680, 
+0x626e, 0x5e9c, 0xd624, 0xd9e4, 0x080a, 0xadfe, 0xa2f5, 0x12af, 0x142c, 0xffde, 
+0x3703, 0x3570, 0x269e, 0x24fb, 0xe8a1, 0xb7ec, 0xe753, 0xf82a, 0xce4d, 0x001a, 
+0x2e98, 0x1f84, 0x0eb8, 0x1beb, 0x2603, 0xfcff, 0xfd98, 0xd8c0, 0xc719, 0xfc52, 
+0xddd2, 0xe3ec, 0x2ee0, 0x4393, 0x042b, 0x1929, 0x569a, 0xef83, 0xc35d, 0xd9e5, 
+0xc6ce, 0xd1e0, 0xed86, 0x0b2a, 0x23b2, 0x504c, 0x20ad, 0x029d, 0x3b72, 0xf5a5, 
+0xad6b, 0xbe54, 0xddfc, 0xd162, 0xddcd, 0x2952, 0x324b, 0x3156, 0x1d3f, 0x12f5, 
+0x235b, 0xf27f, 0xc001, 0xb250, 0xdfdd, 0xe3f3, 0xd455, 0x14e4, 0x3c06, 0x3326, 
+0x1a60, 0x30e7, 0x24a0, 0xe2c3, 0xcd08, 0xb21c, 0xc75c, 0xdc66, 0xe088, 0x1e09, 
+0x54ef, 0x4197, 0x0dca, 0x356f, 0x22ce, 0xcaf2, 0xc0ce, 0xbc3d, 0xcfda, 0xe59b, 
+0xfe5c, 0x27b1, 0x4caa, 0x45a1, 0x0add, 0x274f, 0x1c6c, 0xcde6, 0xc343, 0xd011, 
+0xdf48, 0xe021, 0x0b0c, 0x335a, 0x3c8e, 0x345d, 0x0d86, 0x278e, 0x1b8f, 0xdc12, 
+0xbc28, 0xc6ff, 0xead3, 0xdba0, 0xfdee, 0x39b8, 0x3f03, 0x2143, 0x1858, 0x376b, 
+0x021b, 0xcaa8, 0xbb59, 0xc6f6, 0xef67, 0xe041, 0xf9ba, 0x3cd7, 0x4cfd, 0x168d, 
+0x1037, 0x3fec, 0xf71d, 0xbed3, 0xc8d6, 0xcbc6, 0xdd8f, 0xea8c, 0x09b1, 0x2e92, 
+0x4701, 0x1829, 0x091c, 0x3ad7, 0xfd4b, 0xb999, 0xbe68, 0xdc50, 0xdc39, 0xd663, 
+0x1009, 0x330e, 0x37f3, 0x1ad3, 0x1cca, 0x3476, 0xf66a, 0xc5e8, 0xbb6f, 0xd5e8, 
+0xe008, 0xd5ea, 0x10b5, 0x3f63, 0x3725, 0x1102, 0x2911, 0x3855, 0xe9cb, 0xc610, 
+0xc44b, 0xd547, 0xdd89, 0xe4aa, 0x195d, 0x4084, 0x3d9b, 0x10ab, 0x2a1f, 0x3667, 
+0xe38c, 0xc1a0, 0xc4c5, 0xdd94, 0xe21b, 0xe99c, 0x1f49, 0x4312, 0x3b69, 0x0f14, 
+0x2b3d, 0x2eaa, 0xdeab, 0xc00a, 0xc634, 0xe225, 0xe0e3, 0xf311, 0x2b9a, 0x44fd, 
+0x3881, 0x11ee, 0x2f2a, 0x2428, 0xdc87, 0xc347, 0xc2d0, 0xe6e0, 0xe5b0, 0xf196, 
+0x2d4e, 0x4a97, 0x3366, 0x1388, 0x3ae0, 0x1bf8, 0xd058, 0xc212, 0xc09b, 0xdbf3, 
+0xe25c, 0xfa1f, 0x3093, 0x4e94, 0x31f0, 0x12fe, 0x3bde, 0x11ad, 0xc841, 0xb8bd, 
+0xbe0b, 0xdd25, 0xdd7e, 0x0138, 0x3ac9, 0x4ccb, 0x2ba2, 0x1359, 0x3033, 0xfbc6, 
+0xc14d, 0xb543, 0xbd7e, 0xdcf8, 0xde2b, 0x0754, 0x388b, 0x409a, 0x1e0d, 0x134a, 
+0x2ba8, 0xeee4, 0xbe5b, 0xafaf, 0xbb90, 0xe059, 0xde74, 0x0736, 0x3d1c, 0x4310, 
+0x16f1, 0x1686, 0x2f2a, 0xe9de, 0xbe17, 0xb446, 0xc0ca, 0xdd27, 0xe1a0, 0x0ccd, 
+0x3c13, 0x4661, 0x1949, 0x196a, 0x2a50, 0xdf8d, 0xb6a7, 0xb25a, 0xc8aa, 0xdf0e, 
+0xe6dc, 0x19c8, 0x411d, 0x423f, 0x15db, 0x1a0d, 0x2316, 0xdf69, 0xba97, 0xb2a9, 
+0xd092, 0xe29a, 0xebf2, 0x2556, 0x4a3b, 0x3fb1, 0x16cb, 0x2603, 0x1c1b, 0xd67d, 
+0xbcf3, 0xb765, 0xdad1, 0xea4b, 0xf176, 0x27e4, 0x4d31, 0x3b4c, 0x0fab, 0x2ad5, 
+0x1a4d, 0xd10b, 0xbc49, 0xba78, 0xda1f, 0xe903, 0xffda, 0x308c, 0x4a2f, 0x38ce, 
+0x11cc, 0x299c, 0x105c, 0xcdc3, 0xba31, 0xc03e, 0xe616, 0xe849, 0xfec7, 0x37e1, 
+0x4e98, 0x3198, 0x12d8, 0x2aeb, 0x03e5, 0xcb29, 0xbccb, 0xc232, 0xe734, 0xeb9c, 
+0x07ed, 0x3d12, 0x4b48, 0x2515, 0x14e8, 0x330c, 0xfd19, 0xc86d, 0xc241, 0xca17, 
+0xe64b, 0xe918, 0x09ed, 0x3ba3, 0x4eee, 0x25e2, 0x167a, 0x38a6, 0xffcf, 0xcb0e, 
+0xc615, 0xd055, 0xe3d3, 0xeafc, 0x1602, 0x3e86, 0x49c2, 0x257e, 0x2166, 0x3bcd, 
+0xfc55, 0xc4ad, 0xbb87, 0xd6e3, 0xe7a1, 0xe64f, 0x1ddd, 0x4682, 0x4516, 0x1dee, 
+0x1dc5, 0x2b0d, 0xed86, 0xc590, 0xb97d, 0xd84f, 0xec06, 0xe368, 0x1c7f, 0x4cee, 
+0x3f07, 0x13c3, 0x289d, 0x28fb, 0xdcf0, 0xc5b7, 0xbdb7, 0xd4a7, 0xec46, 0xecd0, 
+0x1bda, 0x48cc, 0x4019, 0x0cd7, 0x23a7, 0x2698, 0xd5be, 0xbc3e, 0xb90e, 0xcc6c, 
+0xddf3, 0xf12b, 0x24f1, 0x4448, 0x3b5c, 0x118e, 0x2441, 0x1c2b, 0xd270, 0xb368, 
+0xb6c7, 0xdd46, 0xdf51, 0xefbb, 0x3138, 0x49d2, 0x3667, 0x1864, 0x2b86, 0x1073, 
+0xd35e, 0xbbf4, 0xb47a, 0xdfb4, 0xe8bb, 0xf6b2, 0x353a, 0x4fd4, 0x2e9f, 0x12a8, 
+0x323d, 0x07c8, 0xcb04, 0xc1fa, 0xbd57, 0xdf17, 0xe6e8, 0xfa82, 0x3052, 0x4c63, 
+0x2d83, 0x12bf, 0x3366, 0x0318, 0xc6dd, 0xbd85, 0xbc4f, 0xd9e1, 0xe604, 0x0814, 
+0x34df, 0x4a09, 0x2d9d, 0x148f, 0x2e79, 0xfba1, 0xc12c, 0xb277, 0xbf95, 0xdeb7, 
+0xe211, 0x10bc, 0x423c, 0x4956, 0x24f7, 0x1571, 0x2434, 0xebbb, 0xc333, 0xb587, 
+0xc733, 0xedc0, 0xebba, 0x0854, 0x3f2e, 0x6f7e, 0x4a81, 0x0e5e, 0x03fe, 0xcb43, 
+0xa313, 0xa8c3, 0xd5fe, 0x0fe0, 0x3ce3, 0x6922, 0x5cb3, 0x4541, 0x10b8, 0xc5c1, 
+0xb7c8, 0xca44, 0xca38, 0xd7f7, 0x38e7, 0x4e53, 0x1cb5, 0x3dfb, 0x3d19, 0x06ab, 
+0xeda0, 0xe9ef, 0xd83d, 0xf9bf, 0x0ebe, 0xca2a, 0x0a79, 0x510e, 0xf01d, 0xe7eb, 
+0x3be6, 0x1a2e, 0xf989, 0x353e, 0x099c, 0xe538, 0x16d7, 0xd697, 0xa93c, 0x0407, 
+0x1bee, 0xf75f, 0x46c6, 0x50e3, 0xf430, 0x1813, 0x169b, 0xaf5d, 0xc57c, 0x0fb5, 
+0xe638, 0xf7e9, 0x459c, 0x122e, 0x0654, 0x352e, 0xfc93, 0xc262, 0xf99c, 0x072c, 
+0xc8f1, 0x0bf2, 0x32cd, 0xf85b, 0x1790, 0x25c1, 0xde96, 0xd882, 0x18ea, 0xe834, 
+0xd77c, 0x3995, 0x1231, 0xeab1, 0x28e3, 0x0cfc, 0xc5ef, 0xf7bd, 0x18f1, 0xd03e, 
+0x057e, 0x320a, 0xe5e4, 0x07c7, 0x2d5d, 0xd88a, 0xc884, 0x2072, 0xfd6c, 0xd3d0, 
+0x2a59, 0x1066, 0xe564, 0x22a2, 0x047a, 0xb2ee, 0xeaad, 0x1c28, 0xcc6c, 0xf7e5, 
+0x3c36, 0xee88, 0xfbfb, 0x3085, 0xddf6, 0xb28a, 0x0aaf, 0xf456, 0xbc45, 0x223a, 
+0x21ed, 0xe31c, 0x2214, 0x1882, 0xb51a, 0xdbdc, 0x18ba, 0xc1ce, 0xe1c3, 0x397c, 
+0xed39, 0xf426, 0x3690, 0xe68c, 0xb498, 0x0e83, 0x00c5, 0xc494, 0x1ef7, 0x1b31, 
+0xdc33, 0x1f84, 0x1b7f, 0xb9c1, 0xdc07, 0x2246, 0xd5fb, 0xeaf7, 0x4a41, 0x042a, 
+0xed8c, 0x29a9, 0xf4c4, 0xbbf5, 0xffbd, 0x02b3, 0xd089, 0x2a98, 0x349a, 0xe5f4, 
+0x231d, 0x3682, 0xc042, 0xc757, 0x28ee, 0xe56b, 0xda47, 0x3eac, 0x0d7c, 0xfc17, 
+0x4512, 0x05d1, 0xbb63, 0x0fc8, 0x0da5, 0xb98f, 0x1ecc, 0x3aea, 0xdbbd, 0x1bd6, 
+0x4041, 0xd007, 0xd35e, 0x2aaf, 0xea38, 0xe711, 0x3e4a, 0xfa47, 0xef65, 0x3f02, 
+0xf730, 0xae98, 0x0fae, 0x1e19, 0xc953, 0x1ea3, 0x3db2, 0xe20d, 0x1043, 0x2d87, 
+0xc8ab, 0xca8a, 0x2270, 0xe769, 0xe021, 0x4751, 0x0a42, 0xed5b, 0x468e, 0x0a0e, 
+0xa823, 0xfc1e, 0x19ce, 0xc19e, 0x0fd8, 0x3c33, 0xe854, 0x1d91, 0x3f3f, 0xd03c, 
+0xd290, 0x2d60, 0xe292, 0xd443, 0x4229, 0x0590, 0xe446, 0x3c78, 0x0d2e, 0xbba0, 
+0x0b10, 0x1fdc, 0xccc6, 0x142f, 0x3174, 0xdc18, 0x1061, 0x371b, 0xd368, 0xd200, 
+0x2d59, 0xf1a5, 0xdc23, 0x3edd, 0x0fb6, 0xe812, 0x2f6f, 0x0a77, 0xb941, 0xfe00, 
+0x1d36, 0xcc9c, 0x11f2, 0x404a, 0xe70a, 0x0abc, 0x3965, 0xd3be, 0xbed2, 0x1fe7, 
+0xee09, 0xd03e, 0x3f07, 0x1799, 0xe33b, 0x342f, 0x1443, 0xb44b, 0xf906, 0x1979, 
+0xbeaf, 0x0a9f, 0x45b3, 0xe73c, 0x0a6f, 0x3e78, 0xd655, 0xc03d, 0x2087, 0xeb0b, 
+0xcf7a, 0x4395, 0x1915, 0xe1a6, 0x34d0, 0x134e, 0xac96, 0xeeeb, 0x1aa0, 0xc459, 
+0x0965, 0x4852, 0xe8bd, 0x0151, 0x3569, 0xd16f, 0xb855, 0x1c6f, 0xed54, 0xcabb, 
+0x428e, 0x1dfb, 0xdf3c, 0x323b, 0x15f0, 0xab84, 0xe597, 0x18a2, 0xc34f, 0x0120, 
+0x48dd, 0xedf1, 0x07d1, 0x3f6b, 0xd521, 0xb0ac, 0x1903, 0xf0c7, 0xc122, 0x3959, 
+0x22ad, 0xe010, 0x2ec7, 0x1837, 0xaaf6, 0xe170, 0x1e2b, 0xc7b9, 0xfdb5, 0x4c53, 
+0xebef, 0xfb34, 0x3ee4, 0xdef9, 0xb297, 0x1b34, 0xfd76, 0xc42a, 0x391e, 0x2b29, 
+0xde3f, 0x2dc8, 0x2491, 0xb2a5, 0xe544, 0x2b06, 0xcad8, 0xf507, 0x54ba, 0xf673, 
+0xfa92, 0x48ca, 0xe9a8, 0xafd3, 0x1ef7, 0x084a, 0xc383, 0x3a6e, 0x3354, 0xdbff, 
+0x2c3f, 0x2b2a, 0xb115, 0xe1c4, 0x348d, 0xd2d5, 0xf3b1, 0x5801, 0xf84b, 0xf5dc, 
+0x4897, 0xeba9, 0xac5a, 0x1d11, 0x0bb4, 0xbcd7, 0x32ed, 0x3809, 0xdc0a, 0x2aa8, 
+0x3035, 0xb63c, 0xddf9, 0x3359, 0xe1e6, 0xdc8c, 0x1666, 0xf007, 0x2428, 0x5dbe, 
+0x00c2, 0xd781, 0x22f0, 0xf405, 0xa1af, 0xed74, 0xf64b, 0xd808, 0x304e, 0x5c2f, 
+0x2e87, 0x2aaf, 0x32b5, 0xdc5e, 0xbf90, 0xd852, 0xad5b, 0xdde3, 0x38e2, 0x1923, 
+0x04d1, 0x62c4, 0x5bb8, 0xe529, 0xeaaf, 0xfd61, 0xc422, 0xc0df, 0xfa6b, 0x0d7b, 
+0x16ff, 0x3f3e, 0x1d78, 0x1a46, 0x3b1d, 0xf55f, 0xc829, 0xeeb5, 0x0157, 0xdd55, 
+0xf41a, 0x20b5, 0x1533, 0x2329, 0x1f7c, 0x1523, 0x1e43, 0x1419, 0xdc00, 0xbfc2, 
+0xfbcf, 0xe187, 0xd1ef, 0x2a18, 0x3c8b, 0x1862, 0x2179, 0x4380, 0x06a1, 0xdc67, 
+0xe0e4, 0xb854, 0xda4e, 0xf2b5, 0xe744, 0x1f54, 0x57ea, 0x2932, 0xfa55, 0x3961, 
+0x0fd9, 0xbac6, 0xcdda, 0xd258, 0xcf89, 0xe3ab, 0x0707, 0x1a3e, 0x3967, 0x30cc, 
+0x0264, 0x2d4f, 0x1e6c, 0xcc01, 0xb70b, 0xd1c4, 0xdac0, 0xca7b, 0xfba8, 0x26c2, 
+0x371b, 0x359b, 0x23c6, 0x2fb4, 0x0da1, 0xd9bd, 0xae9d, 0xb89c, 0xdb61, 0xcb90, 
+0x0132, 0x482d, 0x42cd, 0x1e49, 0x2e1f, 0x3691, 0xe7fa, 0xc93c, 0xba66, 0xbb0a, 
+0xe251, 0xe472, 0x0383, 0x3f08, 0x4cc8, 0x1215, 0x1c80, 0x3b71, 0xe4f3, 0xc431, 
+0xcbb0, 0xc403, 0xd2f9, 0xf12b, 0x1313, 0x2f50, 0x4774, 0x1313, 0x18c4, 0x4058, 
+0xed5d, 0xb643, 0xc25a, 0xd92a, 0xcdc3, 0xe267, 0x25f0, 0x37bf, 0x38e3, 0x1db0, 
+0x2909, 0x2dab, 0xe635, 0xb3fb, 0xb52f, 0xe71a, 0xdad1, 0xdbe5, 0x2dd4, 0x4a45, 
+0x2f11, 0x15fc, 0x375b, 0x1edc, 0xd95e, 0xc7dd, 0xb91d, 0xdb9a, 0xe8d2, 0xea7d, 
+0x243c, 0x50aa, 0x347a, 0x0b10, 0x3f2c, 0x24ae, 0xc984, 0xc48d, 0xccec, 0xd726, 
+0xda77, 0xf845, 0x2782, 0x491b, 0x3bb7, 0x1233, 0x3698, 0x200c, 0xcd29, 0xb25f, 
+0xc2ef, 0xdd85, 0xd457, 0xfe96, 0x3830, 0x43f0, 0x2e94, 0x1a60, 0x3369, 0x07e9, 
+0xcb4f, 0xb645, 0xba73, 0xdbb8, 0xdb8f, 0xffae, 0x3a33, 0x48d7, 0x2211, 0x15da, 
+0x362f, 0xfbd5, 0xc39a, 0xb7fb, 0xc2cf, 0xe1cd, 0xe2d2, 0x0604, 0x36c9, 0x495d, 
+0x209d, 0x15d2, 0x37e6, 0xf91a, 0xc431, 0xbe00, 0xccf7, 0xe3be, 0xe90a, 0x14f8, 
+0x3bed, 0x4775, 0x22c5, 0x1a55, 0x2eb8, 0xf7ab, 0xcbee, 0xbb0a, 0xd4b7, 0xea3e, 
+0xe43a, 0x18fd, 0x455e, 0x429e, 0x1d75, 0x27b4, 0x2e04, 0xeadd, 0xca0c, 0xb834, 
+0xcf7e, 0xebe8, 0xec12, 0x1d2b, 0x4ce6, 0x4388, 0x1410, 0x2882, 0x2863, 0xdbfa, 
+0xc201, 0xbc64, 0xd1a8, 0xe40d, 0xf23c, 0x21f6, 0x44ac, 0x3ed5, 0x105b, 0x1f33, 
+0x1ab9, 0xd393, 0xb879, 0xb8a2, 0xd559, 0xdf87, 0xf31b, 0x2555, 0x3b7c, 0x3066, 
+0x0f9b, 0x206c, 0x1043, 0xd352, 0xb6fe, 0xb4ae, 0xdacb, 0xdd79, 0xed28, 0x2944, 
+0x40cc, 0x26e3, 0x1073, 0x2c6d, 0x0a8e, 0xd1fe, 0xbe7c, 0xb79c, 0xdbb0, 0xe28f, 
+0xf1b8, 0x2782, 0x45d6, 0x288a, 0x146e, 0x3752, 0x08d7, 0xccea, 0xc003, 0xbd89, 
+0xda98, 0xe4f4, 0x0193, 0x3341, 0x4c65, 0x29eb, 0x1665, 0x385c, 0x0502, 0xcaf3, 
+0xbfdd, 0xc859, 0xe1b4, 0xe85f, 0x0f40, 0x394b, 0x49b1, 0x2907, 0x1adb, 0x324c, 
+0xf922, 0xc6e9, 0xb961, 0xcbdd, 0xe7b2, 0xe6bd, 0x11f6, 0x3fef, 0x46fb, 0x1df6, 
+0x1d0f, 0x2f40, 0xeef5, 0xc4a6, 0xb575, 0xcb9f, 0xe637, 0xea22, 0x1afc, 0x450f, 
+0x486c, 0x1ca2, 0x2081, 0x27c1, 0xe170, 0xbe81, 0xb610, 0xd4bd, 0xe951, 0xed82, 
+0x22d8, 0x4920, 0x44fd, 0x1967, 0x24be, 0x230d, 0xdd5b, 0xbd48, 0xb2b2, 0xd74f, 
+0xebd6, 0xf51e, 0x2d0e, 0x4f15, 0x406d, 0x18ea, 0x2d32, 0x1b37, 0xd68b, 0xc044, 
+0xb935, 0xdd2b, 0xe8ca, 0xf474, 0x309b, 0x54b6, 0x3c42, 0x14ba, 0x347b, 0x1910, 
+0xd0a8, 0xbcba, 0xb8c9, 0xdc46, 0xe9fe, 0xfff4, 0x3532, 0x5389, 0x3988, 0x14af, 
+0x3504, 0x102d, 0xc848, 0xb929, 0xbe6f, 0xdd0e, 0xe430, 0x059c, 0x3ba7, 0x4f58, 
+0x2e33, 0x10f0, 0x2a2f, 0xfdb9, 0xc2f6, 0xafbb, 0xbb99, 0xe4f6, 0xe5f2, 0x07f0, 
+0x3ce6, 0x4606, 0x2206, 0x1803, 0x2b80, 0xee52, 0xc24f, 0xb46d, 0xbb4a, 0xe32e, 
+0xe633, 0x0953, 0x4238, 0x4b00, 0x1a28, 0x1723, 0x280d, 0xe191, 0xbf29, 0xb512, 
+0xbb95, 0xe083, 0xee77, 0x11e1, 0x3d02, 0x4905, 0x18fb, 0x175c, 0x25d3, 0xdaba, 
+0xb4bd, 0xb51c, 0xcc2b, 0xe1c5, 0xed1f, 0x1d15, 0x42ae, 0x42e0, 0x12aa, 0x15c7, 
+0x1ce6, 0xdd86, 0xbb2e, 0xb339, 0xd4c6, 0xe6a3, 0xee5c, 0x246d, 0x4599, 0x378a, 
+0x117f, 0x247f, 0x1587, 0xd40f, 0xc211, 0xba12, 0xda04, 0xe9d2, 0xf097, 0x2593, 
+0x4a0d, 0x33f2, 0x0e58, 0x2f92, 0x1796, 0xd23e, 0xc5d1, 0xbd1d, 0xd6a8, 0xea03, 
+0xfd4b, 0x2b76, 0x4d07, 0x372b, 0x12c1, 0x3610, 0x1455, 0xc9fa, 0xc082, 0xc65f, 
+0xdbf3, 0xe5fa, 0x0864, 0x3695, 0x4d6d, 0x3441, 0x13be, 0x2f2f, 0x090c, 0xce34, 
+0xb830, 0xc505, 0xfada, 0xec81, 0xfb68, 0x2eba, 0x319e, 0x3ce2, 0x44fb, 0x1d01, 
+0xdd9d, 0xd66a, 0xb232, 0xa016, 0xf64b, 0xfff6, 0x09d5, 0x7376, 0x8570, 0x20f6, 
+0xfe82, 0xf200, 0x9a52, 0xa325, 0xc4f5, 0xcbde, 0x2c79, 0x67bb, 0x4c8f, 0x46a8, 
+0x523c, 0xf79d, 0xabd0, 0xda12, 0xcc15, 0xb71c, 0xf62d, 0x1e60, 0x327a, 0x4b18, 
+0x2770, 0xf598, 0x157f, 0x094e, 0xbe89, 0xebf7, 0x2a77, 0xf098, 0xe9ee, 0x28e2, 
+0xf32a, 0xc056, 0x237c, 0x271d, 0xe4a4, 0x3978, 0x35ba, 0xe536, 0x10f5, 0xfdaa, 
+0xa68b, 0xd3ea, 0x212f, 0xea07, 0x08a6, 0x5e96, 0x0ae2, 0x07c6, 0x37b6, 0xd70c, 
+0xb092, 0xfe7d, 0xf21a, 0xcad9, 0x34d2, 0x36e9, 0xf083, 0x37da, 0x22a5, 0xbc01, 
+0xdc00, 0x1395, 0xd553, 0xe5e3, 0x3bac, 0xfd08, 0xfe92, 0x3f5c, 0xee23, 0xbc45, 
+0x0d39, 0x0a9c, 0xc61a, 0x146f, 0x2951, 0xdb39, 0x171e, 0x293d, 0xc2e7, 0xdd20, 
+0x32b9, 0xe330, 0xd7b9, 0x3cc5, 0xf7d9, 0xdcad, 0x311b, 0xf1df, 0xb0b8, 0x105b, 
+0x1a8c, 0xca51, 0x1be5, 0x2f80, 0xd616, 0x11ca, 0x2652, 0xbc4e, 0xcb96, 0x21a7, 
+0xe4b4, 0xe253, 0x4487, 0x0196, 0xe674, 0x3516, 0xfb04, 0xb3bc, 0xfeb8, 0x1079, 
+0xc24e, 0x088e, 0x3298, 0xe80b, 0x14c1, 0x2ed3, 0xd1a8, 0xcf82, 0x2207, 0xee50, 
+0xcf02, 0x2dec, 0x08af, 0xe42a, 0x344d, 0x0fb2, 0xb971, 0xfa3f, 0x1df7, 0xd32e, 
+0x11cc, 0x3722, 0xda30, 0x07ac, 0x3d3f, 0xd7ab, 0xc34d, 0x271b, 0xfe76, 0xdbb3, 
+0x3d61, 0x18ed, 0xed9b, 0x3389, 0x0c14, 0xba7c, 0xf987, 0x187e, 0xcd50, 0x1066, 
+0x476b, 0xf480, 0x1314, 0x42bb, 0xe5fe, 0xc3be, 0x1389, 0xf39f, 0xd575, 0x3648, 
+0x1e47, 0xf2fa, 0x3e74, 0x234a, 0xbf4c, 0xf288, 0x221b, 0xc710, 0xfa3c, 0x5035, 
+0xfb9e, 0x0502, 0x44eb, 0xeee6, 0xc43e, 0x1d61, 0xfb1c, 0xc9de, 0x3c74, 0x2aae, 
+0xe190, 0x3674, 0x2619, 0xaff2, 0xe8b6, 0x2937, 0xc78c, 0xf5df, 0x540b, 0xfb05, 
+0x020b, 0x434b, 0xe0e6, 0xacc1, 0x10fc, 0xf91d, 0xbcee, 0x3592, 0x3566, 0xe36e, 
+0x337d, 0x30bf, 0xb32f, 0xd426, 0x2162, 0xc820, 0xe042, 0x4c56, 0xfe46, 0xf61f, 
+0x4a89, 0xf803, 0xad4d, 0x11a6, 0x0a6c, 0xb6d1, 0x253a, 0x3311, 0xd5a0, 0x2667, 
+0x3498, 0xb800, 0xd872, 0x2f83, 0xd41e, 0xe4e1, 0x5463, 0xf738, 0xea30, 0x492c, 
+0xf007, 0xaab2, 0x16ec, 0x11da, 0xc262, 0x2e37, 0x3e3b, 0xdd03, 0x22dd, 0x30e8, 
+0xb674, 0xd170, 0x2e2c, 0xdcd6, 0xe399, 0x56b9, 0x04f1, 0xea52, 0x4a44, 0xfd31, 
+0xa60d, 0x09bf, 0x162d, 0xbcc9, 0x1f55, 0x4352, 0xde68, 0x1cd9, 0x3c0d, 0xbf98, 
+0xc8d8, 0x2a1f, 0xdc64, 0xd503, 0x4d6c, 0x0785, 0xe7a8, 0x476e, 0xff01, 0xa5cd, 
+0x064f, 0x17bf, 0xbe55, 0x1800, 0x3b7b, 0xd4d9, 0x10f0, 0x3690, 0xbf8d, 0xc71e, 
+0x297a, 0xe393, 0xd729, 0x47fe, 0x0285, 0xda51, 0x391b, 0xfeb3, 0xa48e, 0xfbc3, 
+0x19a9, 0xc3a0, 0x108e, 0x3eae, 0xdebc, 0x0f12, 0x36a2, 0xc4c0, 0xbf91, 0x1e2f, 
+0xe5de, 0xd395, 0x4354, 0x10d5, 0xe319, 0x39c0, 0x0a87, 0xace4, 0xf7d2, 0x18b7, 
+0xc582, 0x0b6f, 0x3da5, 0xe290, 0x0dde, 0x3c3e, 0xcfe6, 0xc55b, 0x253d, 0xeca1, 
+0xcf94, 0x3b7a, 0x0f41, 0xdf74, 0x366b, 0x1370, 0xb644, 0xfb14, 0x1f1e, 0xc7c9, 
+0x07b4, 0x41e9, 0xe70d, 0x071d, 0x3d77, 0xdb66, 0xc478, 0x265f, 0xf916, 0xd180, 
+0x3ee6, 0x1beb, 0xdeb9, 0x31d9, 0x191a, 0xb479, 0xf52c, 0x2801, 0xccf7, 0x03d4, 
+0x4bd7, 0xedac, 0x016a, 0x3a65, 0xd6fc, 0xbe27, 0x2266, 0x07f4, 0xd0c6, 0x0dcf, 
+0x1281, 0x0eb0, 0x45e8, 0x1d9a, 0xd8e3, 0x05c1, 0x084a, 0xb5be, 0xdaec, 0x09a2, 
+0xe1b9, 0x11ee, 0x6086, 0x43d5, 0x17db, 0x2892, 0xfb50, 0xb60e, 0xc9f7, 0xc054, 
+0xc68d, 0x23e0, 0x2ffe, 0x062b, 0x4e99, 0x701f, 0xf80e, 0xd329, 0xff2c, 0xcb90, 
+0xa2d6, 0xed8c, 0x1910, 0x0699, 0x2f80, 0x3089, 0x1d1c, 0x374f, 0x03b2, 0xc14c, 
+0xd8b6, 0xfb3d, 0xd617, 0xe1a7, 0x22a2, 0x2021, 0x1a55, 0x1dcb, 0x2025, 0x150c, 
+0x0753, 0xe11c, 0xb5ad, 0xeb4f, 0xe450, 0xcc01, 0x1b1d, 0x3faa, 0x18aa, 0x0e6d, 
+0x4970, 0x17e5, 0xcba3, 0xd80b, 0xbb23, 0xc5d9, 0xe755, 0xf01c, 0x158e, 0x5028, 
+0x3e7d, 0xfcdb, 0x3482, 0x21eb, 0xbae5, 0xbfbe, 0xd2fb, 0xcfc4, 0xd821, 0x0aca, 
+0x27bb, 0x3924, 0x3d1e, 0x0e86, 0x271a, 0x205b, 0xd16c, 0xaf53, 0xc9df, 0xe377, 
+0xce6f, 0xfa21, 0x34f1, 0x4083, 0x3410, 0x259d, 0x319d, 0x06b6, 0xd9dc, 0xb750, 
+0xb2df, 0xde42, 0xd8e4, 0xfe96, 0x4970, 0x54f6, 0x25ba, 0x2520, 0x3c2e, 0xedea, 
+0xc061, 0xba0d, 0xba48, 0xde9c, 0xeb84, 0x0af2, 0x401e, 0x56b2, 0x1aa5, 0x0f66, 
+0x36cf, 0xe844, 0xb80e, 0xc1dd, 0xc246, 0xcece, 0xe9fe, 0x177a, 0x32d2, 0x4547, 
+0x1818, 0x0c52, 0x30b6, 0xec12, 0xaf1a, 0xb2f2, 0xcfa8, 0xd2b1, 0xdf9e, 0x2116, 
+0x3ab2, 0x35ab, 0x1b48, 0x247c, 0x25e1, 0xdedd, 0xb1e5, 0xaf2b, 0xdb4a, 0xe17b, 
+0xdfc7, 0x27da, 0x4f71, 0x34be, 0x0ed1, 0x2d58, 0x1ef5, 0xd091, 0xc1bb, 0xbe47, 
+0xd524, 0xeaee, 0xf469, 0x2112, 0x4cf4, 0x3d3e, 0x0aff, 0x304c, 0x281a, 0xcdc7, 
+0xbbed, 0xd088, 0xe04a, 0xdeea, 0xfee9, 0x2f94, 0x47fc, 0x3dff, 0x1a27, 0x31e9, 
+0x1deb, 0xd894, 0xbec6, 0xc6e8, 0xe5fc, 0xe340, 0x014d, 0x3cd1, 0x4e2f, 0x32bd, 
+0x1d0c, 0x372e, 0x0af1, 0xce88, 0xc502, 0xc97d, 0xe495, 0xeb9c, 0x0798, 0x374a, 
+0x4e4d, 0x2a7e, 0x16b3, 0x3ddd, 0x08ed, 0xc949, 0xc5ee, 0xce08, 0xdf28, 0xe8b7, 
+0x0fe9, 0x3689, 0x490a, 0x2817, 0x1714, 0x38c1, 0x0109, 0xc527, 0xc1af, 0xd087, 
+0xdced, 0xe41e, 0x12dc, 0x3476, 0x3cd2, 0x201b, 0x1cbb, 0x2e40, 0xf269, 0xc5fe, 
+0xb844, 0xcaac, 0xdf7f, 0xe02f, 0x0f09, 0x373a, 0x383b, 0x13eb, 0x21ef, 0x2cbc, 
+0xe41a, 0xc568, 0xb82e, 0xc319, 0xdca2, 0xe63b, 0x0f93, 0x3ca2, 0x4202, 0x11af, 
+0x2392, 0x2ac6, 0xd906, 0xb7d3, 0xb715, 0xce35, 0xdb89, 0xef49, 0x2213, 0x3ff6, 
+0x3f4b, 0x14d9, 0x2398, 0x1f27, 0xd7ab, 0xb866, 0xb50a, 0xd74b, 0xe11e, 0xf58b, 
+0x2ece, 0x467f, 0x3963, 0x1933, 0x2caa, 0x1426, 0xd5d8, 0xbe81, 0xb620, 0xdf76, 
+0xe789, 0xf65e, 0x349f, 0x505c, 0x3366, 0x16ea, 0x3646, 0x0f5a, 0xd18a, 0xc1b2, 
+0xb7f7, 0xdd2a, 0xeb2f, 0xfd79, 0x30f5, 0x516e, 0x31d6, 0x12af, 0x388a, 0x0be7, 
+0xca82, 0xbdf0, 0xbc89, 0xda3c, 0xe687, 0x06e8, 0x3695, 0x5204, 0x3323, 0x158c, 
+0x3447, 0x05f1, 0xca02, 0xb88d, 0xc1cf, 0xe381, 0xea5c, 0x110d, 0x40c6, 0x4e27, 
+0x2a69, 0x1e8c, 0x30b5, 0xf349, 0xc5eb, 0xb6f0, 0xc440, 0xe7cd, 0xebf2, 0x1281, 
+0x4308, 0x4ce7, 0x1f25, 0x1bf5, 0x2d5c, 0xe897, 0xc291, 0xb85f, 0xc6be, 0xe556, 
+0xf257, 0x1cc0, 0x442d, 0x4d14, 0x200a, 0x1f36, 0x26a6, 0xdf96, 0xbef2, 0xb898, 
+0xd0e1, 0xe9a1, 0xf513, 0x2536, 0x486a, 0x4666, 0x1bd4, 0x216e, 0x1a61, 0xd966, 
+0xbfd6, 0xb46f, 0xd414, 0xeb0f, 0xf5c1, 0x2917, 0x4b03, 0x3b01, 0x120a, 0x279d, 
+0x127b, 0xce60, 0xc0b2, 0xbaa1, 0xd93a, 0xea16, 0xf79d, 0x29e1, 0x4e28, 0x3952, 
+0x0c9b, 0x2918, 0x0da3, 0xc8e3, 0xbf5d, 0xbd5b, 0xd7be, 0xe6b5, 0xff78, 0x2bfe, 
+0x474e, 0x30ea, 0x0afb, 0x2996, 0x09da, 0xc618, 0xb66b, 0xc002, 0xde8f, 0xe009, 
+0x0068, 0x34b1, 0x479e, 0x290d, 0x1057, 0x2cf4, 0x0037, 0xc901, 0xba19, 0xc161, 
+0xe4c1, 0xe626, 0x06b7, 0x3bce, 0x46e6, 0x1fc6, 0x1c43, 0x37dd, 0xf4a3, 0xc6e9, 
+0xc0da, 0xc57a, 0xe45d, 0xe96e, 0x0b68, 0x3e09, 0x4c53, 0x1c9e, 0x1978, 0x350c, 
+0xec82, 0xc2fd, 0xc069, 0xc683, 0xdf64, 0xee42, 0x1619, 0x39da, 0x4685, 0x1dc8, 
+0x1c78, 0x2de4, 0xe52f, 0xbb56, 0xb88c, 0xd10f, 0xe424, 0xed39, 0x226e, 0x45c9, 
+0x4373, 0x1798, 0x1d16, 0x2213, 0xe050, 0xbf9c, 0xb315, 0xd32f, 0xe7c5, 0xec31, 
+0x23d2, 0x48dd, 0x38f4, 0x0de0, 0x25fc, 0x1996, 0xcef8, 0xbc82, 0xb55a, 0xd59c, 
+0xe89f, 0xefe0, 0x23a4, 0x4993, 0x37a4, 0x0c32, 0x2be5, 0x17d1, 0xcddd, 0xc07a, 
+0xb8e9, 0xd329, 0xe54b, 0xfb4e, 0x2cfc, 0x4d3a, 0x3bad, 0x0fee, 0x2b2b, 0x1047, 
+0xc712, 0xb4f7, 0xbbf0, 0xdc5f, 0xe2f3, 0xfef6, 0x224e, 0x4c36, 0x6c76, 0x2b5c, 
+0xfa57, 0xe594, 0xbdb1, 0x8b0a, 0xa7ca, 0x0160, 0x0786, 0x400c, 0x8424, 0x5796, 
+0x1be9, 0xf540, 0xbdf9, 0x9768, 0xc4df, 0xbd3d, 0xdd3d, 0x63d3, 0x4e65, 0x1fea, 
+0x4e57, 0x38bb, 0xd91b, 0xcd56, 0xe3ad, 0xbffd, 0xfbd6, 0x0607, 0xdb8e, 0x3ccb, 
+0x4192, 0xd6b0, 0xf73b, 0x42bf, 0xeff1, 0xe330, 0x3dbd, 0xfa84, 0xdccf, 0x13df, 
+0xde74, 0xb718, 0x0b45, 0x28d2, 0xfb25, 0x3fa0, 0x4276, 0xedb2, 0x1335, 0x0954, 
+0xadc9, 0xc6fc, 0x1522, 0xf53c, 0xfe45, 0x4b87, 0x18e7, 0x04a7, 0x3412, 0xee3f, 
+0xb321, 0xfd48, 0x04c9, 0xc508, 0x15a8, 0x372c, 0xeb2f, 0x165c, 0x2ca0, 0xce55, 
+0xd34d, 0x1c95, 0xe2fd, 0xdd7e, 0x3294, 0xf905, 0xe452, 0x34a4, 0x04d0, 0xbdd7, 
+0x0a01, 0x1d14, 0xce45, 0x0c02, 0x2888, 0xd716, 0x03dc, 0x2b4a, 0xd5cd, 0xd68c, 
+0x2ef2, 0xfc10, 0xda6f, 0x316f, 0x0773, 0xda8e, 0x2215, 0x0507, 0xb6f3, 0xfe70, 
+0x2a5d, 0xd6c8, 0x0b84, 0x4188, 0xe8c4, 0xfdd0, 0x2ec5, 0xd794, 0xc3a2, 0x2279, 
+0xf779, 0xd09d, 0x423d, 0x27fc, 0xe6f8, 0x2f40, 0x1b5a, 0xbc8b, 0xf157, 0x1fb4, 
+0xcaa0, 0xfa3a, 0x4232, 0xf922, 0x0ecb, 0x3f09, 0xe3ee, 0xc318, 0x1cef, 0xfdc1, 
+0xca4c, 0x2a22, 0x20f1, 0xe87d, 0x279c, 0x1afc, 0xbe72, 0xe720, 0x2220, 0xd1d4, 
+0xf6a7, 0x4e3e, 0xf5f4, 0xecca, 0x3b54, 0xf567, 0xb06f, 0x0a45, 0x0b98, 0xc973, 
+0x28f0, 0x2f21, 0xdfeb, 0x24a0, 0x2810, 0xaef4, 0xd207, 0x2ab3, 0xcd51, 0xdc82, 
+0x4ca3, 0xfdde, 0xef82, 0x40ab, 0xf143, 0xac33, 0x082b, 0xfdac, 0xb9b7, 0x28f3, 
+0x2b71, 0xd054, 0x2723, 0x3651, 0xb6cf, 0xd176, 0x2ba8, 0xd75d, 0xdb92, 0x450f, 
+0xfd8f, 0xec9c, 0x3e23, 0xf598, 0xaf02, 0x111a, 0x135a, 0xbd2d, 0x2334, 0x3d0a, 
+0xd3d8, 0x1768, 0x3bb0, 0xbab9, 0xc676, 0x311a, 0xe06f, 0xd889, 0x5018, 0x070b, 
+0xe756, 0x4942, 0xfd09, 0x9d71, 0x0bcc, 0x1bed, 0xb4ce, 0x1c66, 0x47ec, 0xdc5f, 
+0x1b74, 0x4238, 0xc481, 0xcf1b, 0x32f5, 0xe1ce, 0xda85, 0x4e4d, 0x0437, 0xe474, 
+0x4777, 0x07ed, 0xaff9, 0x127d, 0x24cd, 0xc370, 0x199d, 0x3e29, 0xd8bf, 0x14fd, 
+0x3d8b, 0xc8ea, 0xd1b6, 0x3766, 0xecd3, 0xda6f, 0x4fa7, 0x0ce7, 0xdddd, 0x4019, 
+0x0c05, 0xaedb, 0x0dbc, 0x2b4c, 0xcdd3, 0x1ddc, 0x470d, 0xe283, 0x1764, 0x40d4, 
+0xcabb, 0xcd66, 0x3585, 0xf1c2, 0xdda9, 0x4ffb, 0x11e4, 0xe28a, 0x415d, 0x12d2, 
+0xb486, 0x055e, 0x1fd4, 0xc66e, 0x12ca, 0x417e, 0xe4e2, 0x1229, 0x3e2a, 0xd10c, 
+0xc800, 0x29e0, 0xed4e, 0xd10c, 0x3fcc, 0x11a3, 0xe1f9, 0x3ad7, 0x16ca, 0xb727, 
+0x0155, 0x2400, 0xc8c6, 0x0c22, 0x40bf, 0xe1dc, 0x06e9, 0x3e89, 0xd924, 0xc59a, 
+0x27a2, 0xf22c, 0xcfad, 0x3f51, 0x14cd, 0xda51, 0x2f15, 0x1235, 0xae68, 0xedef, 
+0x1983, 0xc602, 0x06d9, 0x46e6, 0xe9de, 0x01cd, 0x3928, 0xd470, 0xb512, 0x15ff, 
+0xec31, 0xc9cd, 0x3f78, 0x243a, 0xe15e, 0x29ed, 0x1245, 0xaba1, 0xe5e9, 0x199e, 
+0xc296, 0xfe39, 0x4ac5, 0xeb5f, 0xfa56, 0x3c11, 0xd94f, 0xae50, 0x1511, 0xf001, 
+0xbde3, 0x36c2, 0x230d, 0xd7fe, 0x2c17, 0x1e3a, 0xaa06, 0xe31f, 0x226e, 0xc144, 
+0xf626, 0x4f4e, 0xeb1e, 0xf4dd, 0x3e8c, 0xdc0a, 0xaf47, 0x1e56, 0xfed8, 0xc48e, 
+0x3d56, 0x2b0f, 0xd682, 0x2918, 0x1dec, 0xa955, 0xe5bb, 0x2b6b, 0xc9b8, 0xfa77, 
+0x56f8, 0xf481, 0xfb61, 0x4479, 0xdf2e, 0xabca, 0x1c70, 0xffe7, 0xbc88, 0x3a59, 
+0x3826, 0xe054, 0x2f4b, 0x2c11, 0xb1dd, 0xe03e, 0x2b29, 0xc998, 0xf18d, 0x59ee, 
+0xf7ac, 0xf73d, 0x4d8e, 0xed67, 0xb1d8, 0x21a9, 0x1848, 0xccda, 0x07a8, 0xffcd, 
+0xfa23, 0x5aea, 0x3797, 0xd62f, 0x0ab0, 0x245e, 0xb225, 0xc27c, 0x09d2, 0xd863, 
+0xfe56, 0x5bb6, 0x4ddb, 0x2aa0, 0x3bda, 0x0b4a, 0xc172, 0xdcc2, 0xc178, 0xb04a, 
+0x211f, 0x3a69, 0xf99a, 0x3316, 0x7dfa, 0x1afe, 0xd954, 0x046d, 0xdf49, 0xb051, 
+0xdb3e, 0x09de, 0x0f9f, 0x347e, 0x2f84, 0x0af2, 0x3895, 0x1ade, 0xc5b6, 0xd468, 
+0xfe63, 0xe6d0, 0xddae, 0x14b5, 0x175e, 0x16c3, 0x1fae, 0x122e, 0x1fcb, 0x16f5, 
+0xef7f, 0xbe99, 0xdd8a, 0xf61b, 0xc6ce, 0x019a, 0x43c3, 0x2909, 0x1168, 0x39ad, 
+0x2f76, 0xde14, 0xddd2, 0xc963, 0xbd2a, 0xea45, 0xea62, 0x0266, 0x4616, 0x4e1c, 
+0x015e, 0x18de, 0x36f6, 0xcf20, 0xb656, 0xd210, 0xd017, 0xd8b3, 0xfb2f, 0x1950, 
+0x2b27, 0x3c69, 0x095e, 0x0ec5, 0x2d9c, 0xe85e, 0xb75b, 0xc4ac, 0xe1a3, 0xcfe0, 
+0xdf2a, 0x1a10, 0x3183, 0x376b, 0x1d4c, 0x237d, 0x185c, 0xe4f3, 0xbf7b, 0xab18, 
+0xcfc2, 0xd346, 0xe11c, 0x2903, 0x45ea, 0x24aa, 0x102b, 0x353d, 0x080f, 0xc677, 
+0xbdeb, 0xb32e, 0xd477, 0xe331, 0xef66, 0x2325, 0x4c5c, 0x27b3, 0xfaf5, 0x3106, 
+0x1252, 0xc709, 0xca81, 0xcbe5, 0xd04d, 0xdd4e, 0xfd3c, 0x1a5f, 0x3c21, 0x2935, 
+0x0252, 0x3750, 0x1e8e, 0xc8e4, 0xb83e, 0xd48f, 0xdc6e, 0xce04, 0x0585, 0x31bc, 
+0x360a, 0x2009, 0x14c2, 0x394e, 0x10a3, 0xc93d, 0xafa5, 0xd6b1, 0xef04, 0xcd94, 
+0x0467, 0x48be, 0x4051, 0x1437, 0x1fb5, 0x3cd3, 0xf79e, 0xcc8f, 0xc153, 0xcd1f, 
+0xeeb7, 0xe37c, 0x03cf, 0x4174, 0x4958, 0x1000, 0x1d3b, 0x4853, 0xf289, 0xbea9, 
+0xc9e2, 0xd4e7, 0xde7b, 0xe633, 0x1461, 0x3e75, 0x4911, 0x1b5a, 0x2106, 0x4059, 
+0xf467, 0xbf92, 0xc1f8, 0xd995, 0xdcf6, 0xe0ba, 0x1eb5, 0x4600, 0x4167, 0x1d25, 
+0x2ef9, 0x3639, 0xe56b, 0xc105, 0xc027, 0xd70a, 0xe1eb, 0xea01, 0x247e, 0x4c66, 
+0x3f10, 0x14c8, 0x3245, 0x3094, 0xdd32, 0xc132, 0xc147, 0xd9a1, 0xe18c, 0xeeb8, 
+0x2824, 0x4a69, 0x395c, 0x1015, 0x3040, 0x238d, 0xd48a, 0xc21b, 0xc53b, 0xdc6d, 
+0xe1ce, 0xf6ef, 0x2ad6, 0x46b7, 0x34da, 0x1114, 0x34eb, 0x1e8c, 0xd361, 0xbe8c, 
+0xc1c6, 0xe012, 0xdf71, 0xf81f, 0x3359, 0x4a06, 0x2d71, 0x1454, 0x38da, 0x0f58, 
+0xccf4, 0xbea1, 0xbbb5, 0xdb25, 0xe2c4, 0xfd77, 0x3627, 0x5121, 0x2c35, 0x15a0, 
+0x3989, 0x0018, 0xc03f, 0xbaf5, 0xc3cd, 0xe02b, 0xe6c9, 0x0e3d, 0x3eb5, 0x4d58, 
+0x26cb, 0x1318, 0x2fe0, 0xf891, 0xc27d, 0xb828, 0xc71e, 0xe21d, 0xe699, 0x15c5, 
+0x4058, 0x45ef, 0x2262, 0x1985, 0x28bc, 0xeca7, 0xc32c, 0xb7e4, 0xcfc1, 0xea07, 
+0xe4ac, 0x173a, 0x461c, 0x3eba, 0x15fa, 0x2087, 0x2703, 0xe29a, 0xc4b3, 0xb600, 
+0xc8f7, 0xe687, 0xe9ba, 0x15c4, 0x426b, 0x3e74, 0x0edd, 0x1f75, 0x23b8, 0xd925, 
+0xc0ab, 0xba1f, 0xcb2d, 0xe095, 0xeca2, 0x1990, 0x40e5, 0x3c5d, 0x1023, 0x24d2, 
+0x1ebd, 0xd280, 0xbab7, 0xba30, 0xd226, 0xe0d0, 0xf39a, 0x22d6, 0x4063, 0x34fc, 
+0x0f3b, 0x2825, 0x190f, 0xd310, 0xbcd9, 0xbd2e, 0xd80b, 0xdd5a, 0xf3ce, 0x2b22, 
+0x4783, 0x32fb, 0x13a4, 0x3361, 0x1484, 0xcf84, 0xc067, 0xc184, 0xdb6a, 0xe3e8, 
+0x0230, 0x3122, 0x4768, 0x320a, 0x16c1, 0x3427, 0x0aed, 0xc9bb, 0xba81, 0xc328, 
+0xe12c, 0xe1e3, 0x07e1, 0x3ec1, 0x4f67, 0x2ddc, 0x15f0, 0x2f32, 0xfe24, 0xc964, 
+0xbbfd, 0xc754, 0xe848, 0xe9ef, 0x1196, 0x41b3, 0x4b5f, 0x2760, 0x1f91, 0x35ce, 
+0xf3d5, 0xc722, 0xbfad, 0xcade, 0xe85a, 0xeaa5, 0x1660, 0x4809, 0x4c60, 0x1f11, 
+0x212f, 0x36b0, 0xefd1, 0xc764, 0xbc28, 0xc837, 0xe455, 0xec50, 0x1c88, 0x4b3c, 
+0x4de3, 0x2041, 0x28c6, 0x32d7, 0xe1ea, 0xbea7, 0xbd29, 0xd1a9, 0xe60c, 0xf02d, 
+0x2433, 0x4c51, 0x4811, 0x1816, 0x23ce, 0x292b, 0xdf35, 0xbcec, 0xb6b3, 0xd50d, 
+0xe49a, 0xee6a, 0x2b0c, 0x4b27, 0x39f9, 0x15f5, 0x29d8, 0x1859, 0xd36e, 0xc04c, 
+0xb5ab, 0xd4b0, 0xe461, 0xec0c, 0x2803, 0x4fb2, 0x371f, 0x0f49, 0x2de8, 0x1063, 
+0xc7dd, 0xbbcc, 0xb195, 0xcdad, 0xe2b5, 0xf6ed, 0x29d0, 0x4ac5, 0x31e4, 0x0aa9, 
+0x2acb, 0x0735, 0xbe72, 0xb39c, 0xb620, 0xd1d9, 0xdc5c, 0xfcdd, 0x307a, 0x46be, 
+0x2c7c, 0x0a2b, 0x22ab, 0xfca8, 0xc0ac, 0xafc4, 0xb815, 0xde74, 0xe13f, 0x0269, 
+0x370e, 0x4107, 0x21c4, 0x13c8, 0x26a3, 0xf061, 0xc3ac, 0xb5ad, 0xbbea, 0xe2b6, 
+0xe314, 0x03cd, 0x3a8a, 0x453e, 0x1c0b, 0x167a, 0x2afd, 0xe8ae, 0xc330, 0xbb1d, 
+0xbd71, 0xdff6, 0xea8c, 0x0cd6, 0x3cc1, 0x4b59, 0x1e08, 0x1762, 0x288a, 0xe327, 
+0xbcf5, 0xbc04, 0xcc41, 0xe3b8, 0xf214, 0x1f63, 0x40b7, 0x4556, 0x1932, 0x14e9, 
+0x22d4, 0xe5af, 0xc176, 0xbaf1, 0xd516, 0xeaa3, 0xed1a, 0x10a5, 0x4490, 0x6d0e, 
+0x387d, 0x06ad, 0xf979, 0xc011, 0x9e3c, 0xad92, 0xe582, 0x1234, 0x4531, 0x6a71, 
+0x4d3b, 0x3443, 0xfe14, 0xbf35, 0xb76f, 0xcbe7, 0xc8b4, 0xe9aa, 0x501f, 0x43d8, 
+0x1d18, 0x4560, 0x2e0d, 0xf4de, 0xea75, 0xe7b7, 0xd73f, 0x0fdc, 0x11cd, 0xd145, 
+0x29c3, 0x44d4, 0xdad6, 0xf4f0, 0x3e51, 0x092e, 0x07b6, 0x43ce, 0xfd5a, 0xf591, 
+0x1f19, 0xc2ea, 0xb2d7, 0x198e, 0x140f, 0xfa53, 0x5e12, 0x4564, 0xf1ae, 0x2e33, 
+0x0b49, 0xa4bb, 0xdaed, 0x1485, 0xdc90, 0x0cbf, 0x4f0d, 0x0854, 0x15b5, 0x3b75, 
+0xe6b5, 0xbe4e, 0x0981, 0xfc23, 0xc6c6, 0x22a2, 0x2984, 0xf1db, 0x27f9, 0x1ab0, 
+0xc60e, 0xe49e, 0x21a8, 0xd681, 0xe953, 0x41f4, 0xf337, 0xeb9d, 0x3560, 0xf514, 
+0xbd12, 0x135a, 0x1144, 0xc99f, 0x21e0, 0x2271, 0xd155, 0x1a35, 0x25a3, 0xbec7, 
+0xdc7d, 0x31ed, 0xe802, 0xe46d, 0x3ef6, 0xfc72, 0xeb7d, 0x2fc5, 0xecf1, 0xb132, 
+0x0d6d, 0x171d, 0xcaf3, 0x20be, 0x36cd, 0xdeff, 0x1430, 0x2c97, 0xc49c, 0xcab8, 
+0x247c, 0xe2b5, 0xd3f1, 0x3d93, 0x0c22, 0xee37, 0x3907, 0x01ea, 0xb32c, 0x07e5, 
+0x153f, 0xb7d0, 0x0a61, 0x333d, 0xdb8a, 0x1138, 0x3892, 0xcfca, 0xccd1, 0x2831, 
+0xeb12, 0xd73f, 0x357e, 0xfe1d, 0xe21b, 0x300a, 0xfded, 0xaf91, 0xffaf, 0x1ba1, 
+0xc5b1, 0x0c52, 0x3c73, 0xe33f, 0xfac8, 0x2338, 0xd7bc, 0xc7f4, 0x0f99, 0xe739, 
+0xd9e0, 0x3980, 0x0e6d, 0xe382, 0x335e, 0x15f9, 0xae82, 0xe698, 0x1c86, 0xca1d, 
+0xf6f1, 0x34d2, 0xf14d, 0x0fec, 0x3c9a, 0xdef1, 0xc8df, 0x20f3, 0xea68, 0xc50a, 
+0x33ef, 0x1185, 0xd7d4, 0x2ebc, 0x2178, 0xc1c1, 0xf72b, 0x2354, 0xd2eb, 0x0168, 
+0x30db, 0xe0a6, 0x05a6, 0x3bad, 0xdc09, 0xc45f, 0x276d, 0xfd11, 0xcf0a, 0x363e, 
+0x204b, 0xe4d0, 0x2851, 0x199c, 0xbc3c, 0xe9df, 0x1c38, 0xcf05, 0x03b3, 0x4c0e, 
+0xf6ee, 0x068d, 0x44a0, 0xe3e0, 0xb163, 0x17fa, 0xfdee, 0xc709, 0x37cd, 0x2e63, 
+0xea1c, 0x3531, 0x2ca0, 0xbf9e, 0xeeec, 0x2b06, 0xc5f7, 0xf1c8, 0x5385, 0xfc84, 
+0x0002, 0x49cb, 0xf52b, 0xbfbf, 0x204d, 0x04c6, 0xc649, 0x35e9, 0x30b9, 0xe658, 
+0x31b2, 0x2cb7, 0xb96b, 0xe5a8, 0x2f24, 0xd410, 0xf6ab, 0x5771, 0x04b9, 0xfc36, 
+0x3ec2, 0xecd7, 0xb28a, 0x1904, 0x0954, 0xc24d, 0x3764, 0x3ade, 0xddf2, 0x29ce, 
+0x3445, 0xb4d5, 0xd352, 0x2d79, 0xd037, 0xe09a, 0x535a, 0x01a5, 0xf095, 0x48ef, 
+0xf767, 0xa8aa, 0x11b3, 0x097b, 0xb15c, 0x2a36, 0x3db4, 0xd6cd, 0x24b8, 0x3712, 
+0xb430, 0xcdb4, 0x2b60, 0xd3aa, 0xe09b, 0x53eb, 0xfc4a, 0xea6b, 0x4b2a, 0xf90e, 
+0xa8c8, 0x1124, 0x129b, 0xbaac, 0x269d, 0x4030, 0xda96, 0x20e1, 0x3a2e, 0xbd1c, 
+0xd0d8, 0x3158, 0xdd88, 0xdee5, 0x57dc, 0x0a22, 0xeb70, 0x4be8, 0x027e, 0xa602, 
+0x0680, 0x1714, 0xbfed, 0x242e, 0x47b1, 0xe011, 0x1d8e, 0x3eca, 0xc029, 0xc616, 
+0x2e06, 0xe28f, 0xd4aa, 0x4f9e, 0x0f06, 0xe649, 0x438d, 0x0564, 0xa6f1, 0x02f6, 
+0x1bd3, 0xc020, 0x18b7, 0x4204, 0xd71b, 0x0fc8, 0x3e52, 0xc2b8, 0xbf78, 0x2bd7, 
+0xe6d3, 0xce7b, 0x47d7, 0x0a5d, 0xd7d4, 0x39c7, 0x074e, 0xa273, 0xfc77, 0x1fef, 
+0xbcf9, 0x0cec, 0x426a, 0xd4f2, 0x044f, 0x3d93, 0xc6ea, 0xbcdf, 0x2bd1, 0xed0b, 
+0xce10, 0x43d0, 0x0ca2, 0xd5d2, 0x35c4, 0x0c15, 0xa646, 0xfa2d, 0x2097, 0xc0dd, 
+0x0c2b, 0x439b, 0xdc9c, 0x059f, 0x3b30, 0xca4a, 0xbbcb, 0x2337, 0xe7a3, 0xc717, 
+0x3dae, 0x1491, 0xdc09, 0x3229, 0x0f3e, 0xac38, 0xf62a, 0x25d7, 0xcda9, 0xe86a, 
+0x0ccd, 0xe87d, 0x2a51, 0x46ee, 0xea42, 0xe40d, 0x22b1, 0xd631, 0xa84b, 0xf868, 
+0xe4f9, 0xdc35, 0x395d, 0x50be, 0x1fd6, 0x25ac, 0x1e57, 0xc641, 0xc358, 0xd0f2, 
+0xac56, 0xf1aa, 0x385d, 0x08e0, 0x0c0c, 0x6c90, 0x3d9a, 0xd534, 0xf575, 0xf32f, 
+0xb660, 0xc715, 0x00c3, 0x060a, 0x1cc0, 0x3bee, 0x0fef, 0x2648, 0x390e, 0xe520, 
+0xcaa4, 0xfc07, 0xfa8c, 0xcfc3, 0xff3b, 0x2146, 0x0eaa, 0x22f7, 0x21eb, 0x22a5, 
+0x2b3f, 0x140f, 0xd035, 0xce0d, 0x018b, 0xcdfd, 0xe402, 0x4024, 0x35a0, 0x11b4, 
+0x30f7, 0x48c6, 0xfc36, 0xe429, 0xd9e4, 0xb819, 0xe9ae, 0xecf6, 0xeaac, 0x339b, 
+0x5af6, 0x18c2, 0x0a7d, 0x49f9, 0xfaf8, 0xba8d, 0xd5ae, 0xd0dc, 0xd43b, 0xee6d, 
+0x117b, 0x23d1, 0x46ee, 0x29ad, 0x0339, 0x3a96, 0x1314, 0xc110, 0xbad0, 0xd9cf, 
+0xd706, 0xcd74, 0x0d91, 0x315e, 0x3f9c, 0x359b, 0x2190, 0x2aef, 0x0433, 0xcdb2, 
+0xa574, 0xc711, 0xe12e, 0xcf40, 0x197f, 0x5324, 0x3d77, 0x20a5, 0x375c, 0x2d03, 
+0xe262, 0xca54, 0xb0b0, 0xc640, 0xed6e, 0xe3a9, 0x14a7, 0x559a, 0x4789, 0x0af5, 
+0x2c0d, 0x3078, 0xd574, 0xc8f1, 0xc60c, 0xc4a3, 0xddbb, 0xf434, 0x12bf, 0x3a4f, 
+0x46b5, 0x0de9, 0x28f8, 0x3a3e, 0xd862, 0xb36e, 0xc4b9, 0xd290, 0xcc9e, 0xf150, 
+0x28e5, 0x36b7, 0x3727, 0x1942, 0x296a, 0x1f3b, 0xd304, 0xaa50, 0xb7e0, 0xe064, 
+0xcd60, 0xe774, 0x36d2, 0x4354, 0x256f, 0x16b9, 0x32a9, 0x04e9, 0xc94b, 0xbd89, 
+0xb4e8, 0xde63, 0xe6b3, 0xefc2, 0x2c99, 0x4d30, 0x244c, 0x0dd9, 0x4013, 0x0a25, 
+0xbf81, 0xc647, 0xc8d3, 0xd098, 0xddd7, 0x0729, 0x2f46, 0x49fe, 0x3186, 0x11dd, 
+0x33c9, 0x0a1a, 0xc455, 0xb4fe, 0xcbf9, 0xe01f, 0xd9c3, 0x0d63, 0x3ca9, 0x40e4, 
+0x2597, 0x1f85, 0x2fee, 0xf6c7, 0xc763, 0xb733, 0xcbd2, 0xe734, 0xe337, 0x11ef, 
+0x4379, 0x4377, 0x1865, 0x216c, 0x32c8, 0xee0c, 0xca47, 0xc04a, 0xd076, 0xe70b, 
+0xebed, 0x16a9, 0x3f81, 0x44ae, 0x16f6, 0x2266, 0x31f0, 0xe6d6, 0xc30d, 0xc333, 
+0xd87e, 0xe495, 0xf14b, 0x1f91, 0x3ab4, 0x3a37, 0x1822, 0x291b, 0x2bcf, 0xea2c, 
+0xc762, 0xbf57, 0xdd08, 0xe181, 0xec7b, 0x28f2, 0x456d, 0x366d, 0x1d72, 0x3891, 
+0x2266, 0xe229, 0xcd55, 0xbe26, 0xdad8, 0xe6b2, 0xf1ad, 0x2a59, 0x4ce7, 0x346f, 
+0x18da, 0x3eb3, 0x1a5c, 0xd0e6, 0xc45c, 0xbfe1, 0xd4d3, 0xe11f, 0x014a, 0x2f81, 
+0x4863, 0x3408, 0x1268, 0x31f4, 0x0ec8, 0xca3c, 0xb9fc, 0xc1dc, 0xdd52, 0xe093, 
+0x05ff, 0x33c3, 0x43d7, 0x2da7, 0x1671, 0x2bf0, 0x0034, 0xc97d, 0xb0c3, 0xbe5e, 
+0xe43b, 0xdb68, 0x0387, 0x3ae6, 0x3ee7, 0x1b43, 0x174b, 0x2d76, 0xf26e, 0xc68d, 
+0xb289, 0xbb76, 0xe0fe, 0xde57, 0x0305, 0x3b0e, 0x44f7, 0x17e8, 0x1ae0, 0x2e9e, 
+0xe6b9, 0xc23e, 0xb5b3, 0xbe35, 0xde8a, 0xe55c, 0x0e04, 0x3e2d, 0x4749, 0x1891, 
+0x1cce, 0x2c46, 0xe31a, 0xbc10, 0xb2be, 0xc7d4, 0xe1b0, 0xec58, 0x1b5f, 0x42a4, 
+0x4577, 0x18af, 0x206d, 0x2610, 0xe0cf, 0xbee7, 0xb63b, 0xd3ec, 0xe4ab, 0xed6c, 
+0x253f, 0x4a99, 0x42a8, 0x18da, 0x2a90, 0x2130, 0xd967, 0xc013, 0xb623, 0xd3d0, 
+0xe7d4, 0xf7c7, 0x2d1b, 0x4df4, 0x3dfe, 0x18d3, 0x2e94, 0x12e1, 0xceb7, 0xbc8b, 
+0xb721, 0xd9e6, 0xe7b6, 0xfe42, 0x37c7, 0x5256, 0x3916, 0x14fa, 0x2b19, 0x0829, 
+0xcbbc, 0xbc11, 0xba4e, 0xe0c8, 0xec3c, 0x04ba, 0x39d7, 0x4f48, 0x314f, 0x1b2a, 
+0x320f, 0xfbd4, 0xc7ad, 0xbe46, 0xbcb0, 0xdfec, 0xea9d, 0x0a76, 0x3eae, 0x51ce, 
+0x28b8, 0x15c7, 0x32b1, 0xf736, 0xc436, 0xbbe2, 0xc2bd, 0xe357, 0xecf4, 0x10c4, 
+0x40f6, 0x524e, 0x25cd, 0x19ce, 0x301e, 0xec1e, 0xbc6a, 0xbace, 0xd1d8, 0xe825, 
+0xec23, 0x1b1b, 0x4400, 0x482a, 0x1bce, 0x1896, 0x260d, 0xe7f6, 0xc325, 0xb5e4, 
+0xd101, 0xeabf, 0xea0d, 0x1d52, 0x47b3, 0x3cf0, 0x1282, 0x235d, 0x2050, 0xd9ae, 
+0xc4d9, 0xb970, 0xd086, 0xe87d, 0xea86, 0x1b23, 0x48b1, 0x3c02, 0x0e92, 0x2cb2, 
+0x2472, 0xd2cb, 0xbff8, 0xbc43, 0xce22, 0xe2d3, 0xf745, 0x2364, 0x47bb, 0x3e11, 
+0x1209, 0x2f53, 0x1fb0, 0xcfac, 0xba0d, 0xbeea, 0xd8e3, 0xde1c, 0xf854, 0x2f24, 
+0x49ea, 0x387f, 0x14be, 0x2de7, 0x1304, 0xd01b, 0xb948, 0xbc56, 0xe0d1, 0xe484, 
+0xff93, 0x3655, 0x488a, 0x2bf5, 0x16ba, 0x3637, 0x07aa, 0xcf32, 0xc24d, 0xc063, 
+0xe449, 0xe713, 0x01e8, 0x3b25, 0x4f83, 0x26c5, 0x1640, 0x3ab8, 0xff8c, 0xc83c, 
+0xbf7c, 0xc052, 0xdf32, 0xe807, 0x09ef, 0x390f, 0x4d01, 0x25f5, 0x19b1, 0x3685, 
+0xf201, 0xbb2e, 0xb561, 0xc59a, 0xdeac, 0xe81d, 0x110d, 0x2f0d, 0x5faf, 0x5bc4, 
+0x12fe, 0xf615, 0xda50, 0xa9ae, 0x886f, 0xcd18, 0x0718, 0x09f1, 0x5bb7, 0x7af7, 
+0x3e15, 0x0a73, 0xe799, 0xa715, 0x9c71, 0xc971, 0xb0a1, 0x07a7, 0x6f82, 0x3163, 
+0x2a82, 0x5398, 0x14c9, 0xbfc2, 0xd8b3, 0xd540, 0xc5ce, 0x0fda, 0xf099, 0xf1a7, 
+0x518e, 0x1c60, 0xcd84, 0x19da, 0x35b8, 0xd346, 0x03a1, 0x377b, 0xdf14, 0xefc5, 
+0x0c59, 0xc206, 0xc448, 0x2196, 0x11ee, 0xfe70, 0x4f48, 0x1fa8, 0xeb2d, 0x1d5b, 
+0xeaf2, 0x9f51, 0xdaef, 0x10e0, 0xe2b8, 0x140e, 0x4a7c, 0x0548, 0x11c6, 0x2b5c, 
+0xd063, 0xb9e9, 0x0c49, 0xee9f, 0xcd6b, 0x32da, 0x2204, 0xe702, 0x2c36, 0x195d, 
+0xbc4d, 0xef56, 0x1ea6, 0xd1a8, 0xfb24, 0x33f8, 0xe2fa, 0xffb5, 0x3ccd, 0xe4cb, 
+0xca25, 0x2563, 0x0355, 0xd2da, 0x2bb0, 0x137a, 0xd6ec, 0x2218, 0x1b95, 0xc3b7, 
+0xf854, 0x3722, 0xe6e8, 0xf671, 0x3596, 0xec18, 0xf030, 0x2d9c, 0xe6e7, 0xc2e9, 
+0x26d5, 0x1a49, 0xd733, 0x2bbd, 0x26a1, 0xdab2, 0x1ba0, 0x23f0, 0xc355, 0xe703, 
+0x2bce, 0xdc49, 0xf190, 0x496d, 0xfc6e, 0xf386, 0x3dfc, 0xf7e9, 0xbcff, 0x1444, 
+0x0996, 0xc579, 0x1fc6, 0x2a9c, 0xe722, 0x261f, 0x2af6, 0xc74c, 0xe3b8, 0x2a8b, 
+0xe105, 0xe8c4, 0x3bef, 0xfd9f, 0xefc2, 0x313f, 0xf888, 0xbeed, 0x0f0d, 0x10ba, 
+0xcf13, 0x2814, 0x3a0d, 0xdf51, 0x0dca, 0x2f8f, 0xccfa, 0xc831, 0x1d1f, 0xe940, 
+0xe8cf, 0x4a93, 0x0d52, 0xef83, 0x3c76, 0xfaba, 0xa5dd, 0x0126, 0x112f, 0xbdc7, 
+0x1a61, 0x422a, 0xe9fb, 0x1b1a, 0x3694, 0xc9c9, 0xce2b, 0x1ef2, 0xd732, 0xdc7b, 
+0x46da, 0xff7f, 0xe9fc, 0x46e1, 0x05ac, 0xaeb6, 0x0663, 0x159d, 0xc012, 0x1316, 
+0x34ba, 0xdd94, 0x12fd, 0x31f6, 0xc596, 0xcbff, 0x2ae2, 0xe4d5, 0xd6c1, 0x4927, 
+0x0b3d, 0xdd77, 0x3926, 0x07d1, 0xa2d2, 0xfb2e, 0x211d, 0xc317, 0x1769, 0x4b14, 
+0xe280, 0x1326, 0x411c, 0xc1e2, 0xbac5, 0x2cf6, 0xe603, 0xcb4b, 0x4ed8, 0x191b, 
+0xe401, 0x458d, 0x1545, 0xac87, 0x005f, 0x1e4a, 0xba9b, 0x0cc0, 0x467e, 0xe1cf, 
+0x11da, 0x478e, 0xd350, 0xc70d, 0x31c1, 0xf201, 0xce1e, 0x434c, 0x12d6, 0xdd0b, 
+0x3986, 0x1337, 0xaf6d, 0x006c, 0x2ca7, 0xc8ff, 0x0c23, 0x4bde, 0xe11d, 0x0318, 
+0x41ef, 0xd0e5, 0xbd29, 0x3042, 0xf8a0, 0xd014, 0x4ad2, 0x1b53, 0xda3d, 0x3aa3, 
+0x14be, 0xa4bb, 0xf7a1, 0x2b27, 0xc43a, 0x0948, 0x507e, 0xe296, 0x0297, 0x45db, 
+0xd510, 0xb990, 0x273a, 0xf430, 0xc750, 0x3f4c, 0x1a85, 0xdb6a, 0x3993, 0x1ab4, 
+0xadf3, 0xf5f6, 0x280d, 0xc5fc, 0xfe8a, 0x4668, 0xe58d, 0x011c, 0x457a, 0xdfc7, 
+0xbebe, 0x255e, 0xfae1, 0xcb02, 0x3a3a, 0x1b49, 0xd635, 0x2c90, 0x1a6d, 0xb0f1, 
+0xf0b7, 0x2851, 0xcb11, 0xfd3b, 0x4815, 0xe902, 0xf73a, 0x3af3, 0xde3a, 0xb633, 
+0x1a27, 0xfae7, 0xc8e7, 0x3373, 0x1efa, 0xdab3, 0x2af8, 0x1f54, 0xb3a4, 0xe5bd, 
+0x2010, 0xc657, 0xef33, 0x4332, 0xf32a, 0xf8bc, 0x3a43, 0xe716, 0xb380, 0x1025, 
+0xf94b, 0xbff8, 0x2cbe, 0x2722, 0xd958, 0x2238, 0x24de, 0xb4e0, 0xd8e0, 0x219f, 
+0xcbf4, 0xec3e, 0x4cc4, 0xf5db, 0xee65, 0x3cb1, 0xe88f, 0xad6b, 0x15fb, 0x0312, 
+0xbe65, 0x3207, 0x3441, 0xd731, 0x1ee6, 0x2923, 0xb321, 0xd7af, 0x26e1, 0xce3a, 
+0xeb73, 0x52d6, 0xfb3a, 0xed11, 0x3fa2, 0xeb93, 0xa537, 0x0fde, 0x078b, 0xbcc7, 
+0x2dd2, 0x39bf, 0xde73, 0x2216, 0x2ba5, 0xb204, 0xd113, 0x2873, 0xd059, 0xe433, 
+0x5331, 0x00f5, 0xede6, 0x41c9, 0xf3f8, 0xaa8c, 0x0f24, 0x06be, 0xb5e6, 0x29e9, 
+0x39f4, 0xda5d, 0x25b6, 0x2b84, 0xb07f, 0xd942, 0x36fe, 0xe8ec, 0xcdd1, 0x1733, 
+0x0849, 0x1aa1, 0x4558, 0xfb48, 0xd3ef, 0x11bd, 0xef48, 0xb142, 0xf697, 0xfdea, 
+0xd64a, 0x32a6, 0x6fed, 0x25f8, 0x0b17, 0x2a5c, 0xdff3, 0xaef4, 0xd4ec, 0xbcba, 
+0xe25d, 0x44cb, 0x234b, 0x1321, 0x73ba, 0x4da9, 0xced4, 0xe817, 0x007f, 0xa908, 
+0xb5df, 0x1df6, 0x1875, 0x0e2c, 0x3ec1, 0x2fcd, 0x272d, 0x2290, 0xe25c, 0xc07e, 
+0xf134, 0xfb4d, 0xd6f2, 0x0ad3, 0x3447, 0x223c, 0x13f1, 0x2272, 0x269f, 0x025a, 
+0x0161, 0xd722, 0xd224, 0x0308, 0xde38, 0xef78, 0x3c18, 0x42ed, 0x0555, 0x290a, 
+0x5400, 0xe6be, 0xca2d, 0xdae9, 0xc68f, 0xd7d0, 0xf47c, 0x10ed, 0x3184, 0x5941, 
+0x1cf6, 0x0891, 0x3a35, 0xeb6f, 0xae39, 0xc817, 0xe6f7, 0xd6ef, 0xebb0, 0x3372, 
+0x35f1, 0x34dd, 0x1e90, 0x16f7, 0x21a1, 0xf074, 0xc287, 0xb8c4, 0xe82d, 0xe6eb, 
+0xdb90, 0x1e19, 0x40af, 0x3208, 0x1a9a, 0x320f, 0x1b9a, 0xdeff, 0xcf46, 0xb4a3, 
+0xcbd7, 0xdf68, 0xe59a, 0x22fe, 0x55b5, 0x3892, 0x0be2, 0x396b, 0x1a98, 0xc635, 
+0xc146, 0xc092, 0xd361, 0xe7eb, 0x0383, 0x2879, 0x4c6a, 0x3c0d, 0x05ca, 0x2976, 
+0x14a9, 0xc798, 0xc116, 0xd2d8, 0xdd50, 0xdcd3, 0x0b09, 0x2bce, 0x3653, 0x2ab8, 
+0x0a52, 0x2aa9, 0x14b7, 0xd401, 0xb890, 0xcc60, 0xea88, 0xd5e4, 0xfe7d, 0x383b, 
+0x3ade, 0x1b88, 0x1ad7, 0x3ed1, 0x075f, 0xcd9c, 0xbbc4, 0xcbe8, 0xeb85, 0xd822, 
+0xfbc3, 0x3e44, 0x459b, 0x10ea, 0x17ee, 0x43df, 0xf7f9, 0xc0a0, 0xc419, 0xcf1f, 
+0xdea4, 0xe05f, 0x0678, 0x330f, 0x42d4, 0x111c, 0x0fba, 0x3f57, 0xf9a8, 0xb669, 
+0xbe1b, 0xe146, 0xdd9a, 0xd4be, 0x11a3, 0x389d, 0x37d6, 0x13b2, 0x1c70, 0x3370, 
+0xf10c, 0xc063, 0xb6e6, 0xd48a, 0xdc66, 0xd809, 0x1789, 0x3f92, 0x3566, 0x0e0f, 
+0x231e, 0x2ea3, 0xde28, 0xbb31, 0xba09, 0xcf05, 0xd866, 0xdfc8, 0x18f1, 0x3ecd, 
+0x369b, 0x0a8f, 0x2386, 0x2af2, 0xda2a, 0xb79e, 0xb7d0, 0xd687, 0xde35, 0xe721, 
+0x22ba, 0x4574, 0x3572, 0x0dd3, 0x2e06, 0x263b, 0xd7ab, 0xbfc7, 0xc2f6, 0xdf1b, 
+0xe1c3, 0xf1d5, 0x2cb4, 0x4e1c, 0x37cd, 0x115d, 0x35cd, 0x1fe6, 0xd779, 0xc301, 
+0xc58e, 0xe72d, 0xe5ce, 0xf960, 0x335a, 0x4fb4, 0x357b, 0x1898, 0x426e, 0x1cc2, 
+0xd473, 0xc727, 0xc831, 0xe1fb, 0xe68f, 0x072e, 0x3da1, 0x58d4, 0x39ac, 0x1d25, 
+0x4338, 0x1401, 0xcf2b, 0xbee6, 0xca41, 0xe875, 0xe64f, 0x1316, 0x4982, 0x5236, 
+0x2f67, 0x2085, 0x38b8, 0xfd01, 0xc7c8, 0xba93, 0xc979, 0xebc7, 0xea26, 0x168d, 
+0x477d, 0x4817, 0x212b, 0x1fdd, 0x335a, 0xef3e, 0xc484, 0xb895, 0xc9b8, 0xec42, 
+0xe805, 0x136b, 0x4a61, 0x4971, 0x17b6, 0x1f6a, 0x2f97, 0xe4b1, 0xc086, 0xb999, 
+0xcac9, 0xe5fd, 0xee0c, 0x1807, 0x412f, 0x460f, 0x166d, 0x1f4c, 0x29b3, 0xdc64, 
+0xb965, 0xb861, 0xd211, 0xe147, 0xeb99, 0x2193, 0x450f, 0x3ce4, 0x113e, 0x1f63, 
+0x1c84, 0xd769, 0xb874, 0xb487, 0xd682, 0xe1c9, 0xed74, 0x24b0, 0x43a4, 0x33ba, 
+0x0e1c, 0x2413, 0x10f7, 0xcdd3, 0xb977, 0xb8d7, 0xdbc4, 0xe37c, 0xf175, 0x272e, 
+0x457d, 0x2d0a, 0x07d0, 0x297e, 0x0f41, 0xca51, 0xb9f7, 0xbc9a, 0xdaa7, 0xddfe, 
+0xf766, 0x2c64, 0x4532, 0x2d7b, 0x0dd9, 0x2cf4, 0x0c17, 0xc90f, 0xb4bc, 0xc07f, 
+0xe270, 0xdce1, 0xfc63, 0x371a, 0x4749, 0x2579, 0x1187, 0x2dc1, 0xff1f, 0xc7eb, 
+0xb7f0, 0xc150, 0xe209, 0xe0bb, 0x0562, 0x39a6, 0x419b, 0x18df, 0x11d0, 0x32b0, 
+0xf640, 0xc162, 0xbaa8, 0xc92a, 0xe355, 0xdf42, 0x07ce, 0x3de6, 0x485f, 0x1a8d, 
+0x15e0, 0x345d, 0xf2a7, 0xc2b4, 0xbc48, 0xcb43, 0xe331, 0xe771, 0x171d, 0x41c7, 
+0x46e8, 0x1e6a, 0x1d99, 0x3169, 0xea47, 0xbb34, 0xb612, 0xcfe5, 0xe372, 0xe4f4, 
+0x1dce, 0x4978, 0x4538, 0x1abb, 0x1ff9, 0x2726, 0xe2ee, 0xbf5a, 0xb642, 0xd6a7, 
+0xeb65, 0xe981, 0x26c2, 0x5246, 0x3d0f, 0x142e, 0x2f6c, 0x28fc, 0xda88, 0xc3aa, 
+0xbdbe, 0xd749, 0xeb54, 0xf1e0, 0x25cd, 0x526c, 0x41ba, 0x10bf, 0x2fe6, 0x2449, 
+0xd374, 0xbfc4, 0xbbe2, 0xd283, 0xe25c, 0xf99f, 0x2cef, 0x4ac7, 0x3ddf, 0x17d9, 
+0x3082, 0x1925, 0xce89, 0xb6a1, 0xbc50, 0xe283, 0xe474, 0xfd8d, 0x3bcc, 0x4e96, 
+0x33c3, 0x167a, 0x2e47, 0x0a43, 0xcef1, 0xbc29, 0xba3d, 0xe1a3, 0xe5f7, 0xfe7c, 
+0x39db, 0x4bea, 0x270e, 0x128b, 0x30de, 0xfb59, 0xc505, 0xbdab, 0xbd60, 0xe0c5, 
+0xe64a, 0x0171, 0x35c3, 0x47fc, 0x21b5, 0x11b5, 0x30fa, 0xf4fc, 0xc06e, 0xbaa3, 
+0xbc7a, 0xd83f, 0xe4e1, 0x0b66, 0x373d, 0x497a, 0x2421, 0x109c, 0x26f1, 0xecb6, 
+0xbadf, 0xb11f, 0xc45d, 0xdf59, 0xe4b2, 0x1641, 0x3f59, 0x42bc, 0x1c1c, 0x129c, 
+0x1bee, 0xe133, 0xbe64, 0xb1ad, 0xcc9f, 0xec32, 0xe986, 0x19ae, 0x44e5, 0x3a19, 
+0x0e88, 0x1ade, 0x1f2c, 0xdec4, 0xc3cc, 0xb2ef, 0xdaab, 0xfd08, 0xe6a7, 0x1123, 
+0x3704, 0x3898, 0x3ad4, 0x346f, 0xfe92, 0xd1d3, 0xcc04, 0x9cbd, 0xc135, 0x02eb, 
+0xf63b, 0x365b, 0x8b58, 0x58ad, 0x0415, 0x0488, 0xcf1c, 0x8e64, 0xb611, 0xc2c4, 
+0xeda1, 0x4ea8, 0x63da, 0x49bb, 0x50ec, 0x3618, 0xc859, 0xb818, 0xe010, 0xbc83, 
+0xd14a, 0x1ad8, 0x32a9, 0x4030, 0x4434, 0x0f51, 0xf80f, 0x1895, 0xeaf8, 0xc48d, 
+0x175a, 0x2702, 0xe895, 0x0fd2, 0x2756, 0xcf30, 0xdfad, 0x3a11, 0xfb80, 0xfa5f, 
+0x565f, 0x121d, 0xf290, 0x2352, 0xddf3, 0xa5f4, 0xfe06, 0x187b, 0xde96, 0x3a13, 
+0x5105, 0xf698, 0x255a, 0x212e, 0xb7a3, 0xc5a7, 0x10d7, 0xdeff, 0xe90b, 0x551a, 
+0x1708, 0xfd81, 0x42e8, 0xf9ae, 0xb328, 0xf8c8, 0x0cd4, 0xc910, 0x1398, 0x3cf8, 
+0xe89b, 0x1c9d, 0x36c1, 0xcb0b, 0xcca6, 0x2759, 0xf1e2, 0xd264, 0x3d80, 0x146d, 
+0xe372, 0x36c2, 0x0ab3, 0xb2ef, 0x0a0e, 0x2e96, 0xc7be, 0x0dcf, 0x4ba5, 0xdcd8, 
+0xff1f, 0x391f, 0xcf51, 0xc4c3, 0x314b, 0xfef3, 0xd680, 0x41c6, 0x156e, 0xdd3b, 
+0x2eeb, 0x0886, 0xa9c9, 0xf3a6, 0x247e, 0xc927, 0x069f, 0x4a37, 0xe895, 0x0061, 
+0x378e, 0xd6a1, 0xb348, 0x1688, 0xf810, 0xc498, 0x323f, 0x1fc5, 0xe066, 0x29b3, 
+0x139d, 0xadbb, 0xe71a, 0x2c44, 0xcae3, 0xe8e1, 0x3f89, 0xe822, 0xf034, 0x367a, 
+0xdf30, 0xb32c, 0x1aba, 0x0281, 0xcc1b, 0x36c4, 0x14ca, 0xc6d5, 0x2590, 0x1c08, 
+0xa351, 0xd7ce, 0x2a74, 0xd59f, 0xf3fa, 0x477e, 0xf4e0, 0xf8ff, 0x3121, 0xdc01, 
+0xb775, 0x150c, 0xfcd8, 0xcc0d, 0x38c8, 0x2ece, 0xe423, 0x2849, 0x29b5, 0xc302, 
+0xda74, 0x1f47, 0xdd2f, 0xf247, 0x3ab2, 0xf2d7, 0x006a, 0x4787, 0xf2b8, 0xbc9f, 
+0x1f1c, 0x0ac7, 0xbde9, 0x23df, 0x2b4d, 0xd869, 0x1cf2, 0x2e59, 0xc8ac, 0xe6ca, 
+0x2cef, 0xd907, 0xf197, 0x4b23, 0xf20c, 0xef15, 0x4469, 0xf156, 0xb2a9, 0x1bfd, 
+0x127b, 0xca28, 0x306d, 0x3438, 0xdf08, 0x20cf, 0x27a1, 0xb9c7, 0xd8d7, 0x2741, 
+0xd309, 0xe588, 0x5056, 0x03d5, 0xef96, 0x4207, 0xfd8d, 0xae5f, 0x03b5, 0x0589, 
+0xbd38, 0x23af, 0x3a76, 0xe095, 0x2023, 0x3839, 0xc165, 0xd4ca, 0x2de1, 0xd781, 
+0xe09b, 0x50bd, 0x0340, 0xea0c, 0x4022, 0xf840, 0xad2c, 0x1331, 0x12e3, 0xc260, 
+0x2f2a, 0x3b6c, 0xd12c, 0x18a4, 0x3197, 0xb77c, 0xd13d, 0x2bd2, 0xd972, 0xe616, 
+0x52eb, 0x041e, 0xeb26, 0x3bdc, 0xf119, 0xa2b2, 0x06d5, 0x1049, 0xbd97, 0x289f, 
+0x44ee, 0xdf14, 0x1d7f, 0x34ac, 0xb7bb, 0xc690, 0x278a, 0xda25, 0xdff9, 0x579a, 
+0x080c, 0xe6ec, 0x4374, 0xfcbd, 0xa5be, 0x078c, 0x146b, 0xbb5b, 0x2164, 0x4262, 
+0xdc47, 0x1e50, 0x39f8, 0xbce7, 0xcbb4, 0x2afe, 0xdc45, 0xdb5e, 0x5409, 0x0b3a, 
+0xe53c, 0x4358, 0x02ae, 0xa896, 0x0857, 0x1af8, 0xc23a, 0x2352, 0x496b, 0xdfb5, 
+0x197e, 0x3ce3, 0xbe54, 0xc506, 0x3012, 0xe677, 0xd704, 0x5217, 0x11ee, 0xe2e7, 
+0x3fe4, 0x06fa, 0xa5a3, 0xfdcd, 0x181f, 0xbb44, 0x1747, 0x4a1f, 0xdca9, 0x10d6, 
+0x4291, 0xc4a6, 0xbd25, 0x2a87, 0xe605, 0xcbf6, 0x4b38, 0x15fb, 0xe0ad, 0x3f35, 
+0x0d36, 0xa652, 0x0068, 0x234a, 0xbde1, 0x11e2, 0x4aeb, 0xdbe0, 0x0a9d, 0x4344, 
+0xcb41, 0xbfb5, 0x3005, 0xef5d, 0xcc1b, 0x497b, 0x1516, 0xd825, 0x3b8a, 0x1677, 
+0xabc7, 0xfeb9, 0x2dcb, 0xc484, 0x08d9, 0x4f69, 0xe275, 0x041d, 0x4846, 0xd81a, 
+0xc055, 0x3307, 0xfcca, 0xce29, 0x4a68, 0x20cb, 0xd8f3, 0x379a, 0x1b24, 0xaf02, 
+0xfaf5, 0x36a2, 0xdc0c, 0xf2c4, 0x1be5, 0xefab, 0x3121, 0x54a4, 0xf198, 0xe7b1, 
+0x2ba4, 0xe144, 0xad6e, 0x0105, 0xf0a8, 0xe331, 0x4379, 0x5911, 0x2529, 0x2cc9, 
+0x279d, 0xcce3, 0xc4aa, 0xd6d0, 0xaebe, 0xee7a, 0x3b83, 0x0e08, 0x0c23, 0x6c6b, 
+0x4249, 0xd2d0, 0xee99, 0xf0dc, 0xb1d9, 0xc315, 0x0097, 0x05b2, 0x198e, 0x3a21, 
+0x0a87, 0x19af, 0x3001, 0xda73, 0xbf3b, 0xf320, 0xf1e8, 0xce48, 0xfde9, 0x1c97, 
+0x092a, 0x1c03, 0x1996, 0x174f, 0x1e06, 0x0784, 0xc7d4, 0xc266, 0xf6c0, 0xcc3e, 
+0xdd41, 0x35c9, 0x3070, 0x0e9b, 0x2df6, 0x46cc, 0xf777, 0xdb3b, 0xd86d, 0xb2ad, 
+0xdad5, 0xea97, 0xeb13, 0x2dfd, 0x5bf5, 0x1d45, 0x0c80, 0x4c6b, 0xf9d2, 0xb332, 
+0xd3b1, 0xcca7, 0xc90a, 0xeeb9, 0x1637, 0x2142, 0x4501, 0x2b65, 0x034c, 0x35ee, 
+0x0df0, 0xbcaf, 0xb962, 0xda48, 0xd509, 0xd169, 0x125a, 0x2f7e, 0x3ce9, 0x31e9, 
+0x1f9f, 0x25c3, 0xf9ce, 0xc7fa, 0xa4bc, 0xc4e4, 0xde14, 0xd114, 0x1820, 0x4ec1, 
+0x3955, 0x1716, 0x2ffb, 0x23e1, 0xd401, 0xc118, 0xaea8, 0xc267, 0xe761, 0xe650, 
+0x166b, 0x5317, 0x4508, 0x02ef, 0x256f, 0x2a58, 0xc9bf, 0xbfb1, 0xc690, 0xc4c0, 
+0xdb5a, 0xfc3e, 0x1d56, 0x406f, 0x4672, 0x07f9, 0x258b, 0x3563, 0xd0af, 0xad4b, 
+0xc62c, 0xd7ec, 0xd118, 0xfacb, 0x32c8, 0x3cf8, 0x3893, 0x1827, 0x2a88, 0x2056, 
+0xd2e0, 0xa9a8, 0xbc95, 0xe82d, 0xd209, 0xed42, 0x4049, 0x4bca, 0x27a4, 0x17b5, 
+0x33c7, 0x048c, 0xc896, 0xbbc4, 0xb5e8, 0xde55, 0xe670, 0xf26e, 0x319d, 0x5284, 
+0x20bb, 0x0a37, 0x3f54, 0x0425, 0xb7b6, 0xbeac, 0xc4a7, 0xd10a, 0xdf90, 0x067a, 
+0x32d8, 0x4def, 0x29e9, 0x0de0, 0x33b8, 0x00f9, 0xbb53, 0xb44c, 0xca99, 0xdcb3, 
+0xdf0d, 0x140a, 0x4211, 0x47c0, 0x2741, 0x1ffe, 0x3026, 0xf2ee, 0xc44d, 0xb8c2, 
+0xcbde, 0xe86b, 0xed77, 0x1b4d, 0x47ee, 0x4766, 0x1ae9, 0x2386, 0x33e9, 0xea57, 
+0xc4ae, 0xc182, 0xd3ec, 0xeae1, 0xf2fa, 0x1c99, 0x46ce, 0x4849, 0x16e5, 0x2357, 
+0x2d0d, 0xe171, 0xc2b4, 0xc619, 0xdb43, 0xe861, 0xf96a, 0x2580, 0x41a1, 0x3fcc, 
+0x14f6, 0x245e, 0x2692, 0xe3d9, 0xc4b2, 0xc084, 0xdcfb, 0xe481, 0xf277, 0x26e8, 
+0x4453, 0x3677, 0x1401, 0x2eb5, 0x1c61, 0xda3a, 0xc536, 0xbbc2, 0xd95f, 0xe409, 
+0xf088, 0x24e3, 0x4a50, 0x36ef, 0x1343, 0x3794, 0x1bd7, 0xd0b1, 0xbf04, 0xc0c0, 
+0xd999, 0xe102, 0xfe57, 0x307b, 0x4c60, 0x3446, 0x110b, 0x34af, 0x1719, 0xd246, 
+0xbe92, 0xc661, 0xdf01, 0xde95, 0x04b9, 0x34ae, 0x44b2, 0x2c3e, 0x140f, 0x311d, 
+0x09e5, 0xcd57, 0xb673, 0xc4ea, 0xe8e6, 0xdfae, 0x02f2, 0x3c51, 0x460d, 0x2037, 
+0x160e, 0x33a4, 0xffd5, 0xd044, 0xbb77, 0xbff6, 0xe547, 0xe2d3, 0x02a5, 0x3927, 
+0x483e, 0x1e84, 0x18a8, 0x35a4, 0xf428, 0xc4b4, 0xb810, 0xbe31, 0xdf3f, 0xe3b9, 
+0x070a, 0x3a6e, 0x4a01, 0x1d3d, 0x19b7, 0x312f, 0xe9ed, 0xb9d2, 0xb185, 0xc27d, 
+0xdf74, 0xeaac, 0x163c, 0x40b2, 0x480f, 0x196b, 0x1a68, 0x2946, 0xe387, 0xbd44, 
+0xb687, 0xcdd3, 0xe1c0, 0xe73f, 0x19c6, 0x454e, 0x4471, 0x1517, 0x1f37, 0x2415, 
+0xde12, 0xbc28, 0xb193, 0xce92, 0xe199, 0xeb2a, 0x208d, 0x45c9, 0x3dfd, 0x140f, 
+0x2554, 0x1b8d, 0xd3e4, 0xb631, 0xaeee, 0xd2a0, 0xe032, 0xeefc, 0x2bad, 0x4d46, 
+0x3a27, 0x0f3b, 0x24c9, 0x111e, 0xcdbf, 0xb6b5, 0xb194, 0xd7c9, 0xe60a, 0xf93b, 
+0x2f30, 0x4968, 0x3246, 0x1306, 0x2d46, 0x06e7, 0xc785, 0xba49, 0xb9ab, 0xde3a, 
+0xe629, 0xff26, 0x3a02, 0x5456, 0x30f0, 0x10ea, 0x3149, 0x0578, 0xc92c, 0xbe07, 
+0xc00c, 0xe26f, 0xec57, 0x0aaf, 0x3ec0, 0x560f, 0x2fbd, 0x16da, 0x3543, 0xfe12, 
+0xc441, 0xbe1e, 0xce80, 0xec2a, 0xeeda, 0x1761, 0x467e, 0x531c, 0x2945, 0x16f3, 
+0x30b3, 0xfa85, 0xc82a, 0xb95b, 0xd0b9, 0xf0bf, 0xecf0, 0x1a23, 0x4acc, 0x48e2, 
+0x1c65, 0x1e4d, 0x2902, 0xe8e0, 0xc9c2, 0xbc2f, 0xd2c0, 0xf22e, 0xed1c, 0x1844, 
+0x4b01, 0x4776, 0x146e, 0x2125, 0x2832, 0xde1c, 0xc52b, 0xbd52, 0xcf76, 0xec76, 
+0xf496, 0x1c9f, 0x4726, 0x432c, 0x116f, 0x25e7, 0x2766, 0xd731, 0xbc99, 0xc162, 
+0xd7c6, 0xe12d, 0xf3c2, 0x27ac, 0x489f, 0x3fb7, 0x11f9, 0x23e3, 0x1dd1, 0xd9f9, 
+0xbc81, 0xbc41, 0xe051, 0xe6f9, 0xf6af, 0x2df2, 0x4613, 0x2fe6, 0x12b9, 0x303c, 
+0x120f, 0xd130, 0xc1da, 0xbc62, 0xdb80, 0xe279, 0xf4be, 0x2c52, 0x4660, 0x275e, 
+0x0d1c, 0x3149, 0x075f, 0xc931, 0xbf24, 0xbaf3, 0xd888, 0xe2cc, 0xfb8b, 0x2cb6, 
+0x4a52, 0x29ea, 0x0caa, 0x3097, 0xff78, 0xbdf9, 0xb45b, 0xc1cb, 0xdd4e, 0xe310, 
+0x068a, 0x24f2, 0x54ac, 0x60d2, 0x1650, 0xf4c6, 0xe059, 0xb014, 0x83b1, 0xbc91, 
+0x02f9, 0x0157, 0x4fca, 0x7cb3, 0x41bb, 0x0df7, 0xea9f, 0xace6, 0x957f, 0xc6c1, 
+0xb25c, 0xf25c, 0x6d4a, 0x3c23, 0x2274, 0x5314, 0x2754, 0xc59a, 0xd13d, 0xdf25, 
+0xc110, 0x097d, 0xfee9, 0xe7e9, 0x4a58, 0x3073, 0xd0cf, 0x0834, 0x3f47, 0xde37, 
+0xefad, 0x3de0, 0xef24, 0xe80f, 0x1519, 0xd4ff, 0xbae7, 0x160b, 0x1ed5, 0xf6f3, 
+0x4a32, 0x391f, 0xed02, 0x1a95, 0x0194, 0xa798, 0xcdb4, 0x1870, 0xed7d, 0x0805, 
+0x5609, 0x1649, 0x0c10, 0x37fb, 0xe698, 0xb602, 0x0ab1, 0x02bc, 0xc982, 0x29a0, 
+0x3592, 0xeb4c, 0x26a0, 0x2b39, 0xc51e, 0xe028, 0x25df, 0xdd3d, 0xeb89, 0x3c7d, 
+0xf25b, 0xf2a8, 0x40cd, 0xf67a, 0xbd91, 0x18e1, 0x1367, 0xcbf7, 0x1e2b, 0x2469, 
+0xd608, 0x16f8, 0x2a0b, 0xc927, 0xe2cc, 0x37b1, 0xf346, 0xe694, 0x382d, 0xf93e, 
+0xe10a, 0x2a89, 0xf6d1, 0xba9a, 0x1681, 0x2591, 0xd24e, 0x187c, 0x2fad, 0xd8f6, 
+0x0b46, 0x2ae5, 0xc8c2, 0xd38a, 0x2a7a, 0xe7b1, 0xdcb3, 0x3e95, 0x03d8, 0xe5e1, 
+0x3718, 0x0451, 0xb6fc, 0x05d7, 0x1636, 0xc589, 0x0c0d, 0x2d31, 0xe2a5, 0x145e, 
+0x2ff3, 0xd16c, 0xd748, 0x2961, 0xeee4, 0xd89a, 0x2f77, 0x0413, 0xe432, 0x2a18, 
+0x07e4, 0xbf90, 0xffac, 0x1a5c, 0xce43, 0x0eae, 0x3e2a, 0xe525, 0xfcdf, 0x3412, 
+0xe19f, 0xc0d0, 0x160c, 0xf679, 0xdaf7, 0x3d0f, 0x184f, 0xe643, 0x3314, 0x0d97, 
+0xa9d1, 0xf210, 0x1e09, 0xc374, 0x0591, 0x4995, 0xef24, 0x05bf, 0x3aa6, 0xdaf6, 
+0xc1a1, 0x198b, 0xe5e1, 0xce1f, 0x40dc, 0x134c, 0xddc5, 0x3b68, 0x1d73, 0xb2c0, 
+0xf385, 0x2228, 0xc6a9, 0xff0d, 0x4056, 0xea16, 0x071a, 0x3ca3, 0xd74b, 0xbcb1, 
+0x210f, 0xf2c1, 0xcb2c, 0x414d, 0x1f07, 0xd958, 0x2f24, 0x195a, 0xa747, 0xe84d, 
+0x2605, 0xc501, 0xff0e, 0x4e0a, 0xea48, 0x02a4, 0x46c5, 0xd723, 0xafda, 0x23af, 
+0xf6a4, 0xbc7c, 0x3c45, 0x26f8, 0xdc74, 0x367d, 0x2543, 0xb0bd, 0xed3e, 0x27e5, 
+0xc333, 0xf8e2, 0x4d51, 0xeb5f, 0xfefc, 0x4865, 0xe34b, 0xb937, 0x2748, 0x0266, 
+0xc562, 0x3a6b, 0x25b1, 0xd774, 0x2daa, 0x2313, 0xb311, 0xef4a, 0x32e8, 0xcf60, 
+0xf8b2, 0x51fb, 0xee07, 0xf368, 0x44ab, 0xe548, 0xb2da, 0x24f2, 0x07b3, 0xc446, 
+0x3bc4, 0x2db3, 0xd779, 0x2ee4, 0x281e, 0xace1, 0xe4c5, 0x335a, 0xceab, 0xf17b, 
+0x55c7, 0xf4d4, 0xf24d, 0x4603, 0xeb3d, 0xaf65, 0x1bbf, 0x08f3, 0xbf31, 0x300f, 
+0x30d1, 0xd9cf, 0x29ba, 0x2ead, 0xb5b6, 0xdd53, 0x2dff, 0xcf0d, 0xe2d2, 0x4b14, 
+0xf7cf, 0xf104, 0x48fe, 0xf5f9, 0xb102, 0x175c, 0x0bd9, 0xbcb2, 0x27b4, 0x336a, 
+0xd7be, 0x2088, 0x3408, 0xbf37, 0xdc20, 0x3264, 0xdb9f, 0xe60e, 0x5013, 0xffb1, 
+0xe856, 0x4281, 0xff01, 0xb10f, 0x1094, 0x176a, 0xc863, 0x243b, 0x390b, 0xdf6d, 
+0x1d95, 0x3900, 0xc65f, 0xd25c, 0x2c3a, 0xe187, 0xdbeb, 0x465f, 0x0986, 0xeb79, 
+0x4044, 0x0711, 0xb0da, 0x0496, 0x1513, 0xc287, 0x187b, 0x3c78, 0xe032, 0x1521, 
+0x3c5f, 0xccc3, 0xcce1, 0x2b96, 0xe4ca, 0xd2ba, 0x430a, 0x0aa2, 0xdffc, 0x3ad9, 
+0x0be5, 0xaea0, 0x03b6, 0x1ba6, 0xbbed, 0x0db5, 0x4113, 0xdc05, 0x05bb, 0x3a65, 
+0xcc55, 0xc14b, 0x25ec, 0xe783, 0xd1d2, 0x4965, 0x1616, 0xdbb4, 0x3263, 0x0a8b, 
+0xa569, 0xf7cf, 0x1f57, 0xc4d2, 0x1559, 0x517f, 0xea47, 0x0848, 0x3a1f, 0xc9f1, 
+0xbb1e, 0x266f, 0xea60, 0xcd1c, 0x4d59, 0x23a6, 0xe328, 0x3b46, 0x19d2, 0xabe2, 
+0xf47d, 0x1e1a, 0xbcd3, 0x09ed, 0x4fb3, 0xe964, 0x0dbc, 0x485b, 0xd3bb, 0xbbbe, 
+0x2722, 0xffc5, 0xce39, 0x0d09, 0xfe2c, 0x112d, 0x596c, 0x16f5, 0xd170, 0x12a7, 
+0x07ab, 0xa521, 0xd945, 0x0290, 0xcf7b, 0x0c60, 0x5af6, 0x3c64, 0x1c78, 0x2c17, 
+0xf082, 0xb62e, 0xcf0c, 0xac7d, 0xba75, 0x27ac, 0x23af, 0xf129, 0x473d, 0x6f3b, 
+0xefd4, 0xd0fc, 0xfcb5, 0xc5fa, 0xa532, 0xe2aa, 0x08ff, 0x0704, 0x304a, 0x21e6, 
+0x0f85, 0x38c1, 0x010f, 0xbcdf, 0xd894, 0xf8ab, 0xd8c7, 0xe36a, 0x1b7a, 0x178e, 
+0x1a72, 0x1741, 0x157f, 0x1dd4, 0x0dfe, 0xe47e, 0xbdd3, 0xf139, 0xe9ae, 0xc861, 
+0x198e, 0x432e, 0x1c93, 0x1246, 0x4ca3, 0x23d4, 0xd5a3, 0xdda1, 0xc097, 0xcd1a, 
+0xeddd, 0xed1a, 0x1738, 0x5658, 0x41b1, 0xfba0, 0x3319, 0x2a1d, 0xc048, 0xc0cf, 
+0xd583, 0xd4c9, 0xdb7a, 0x070a, 0x2588, 0x3798, 0x3aa9, 0x0add, 0x25af, 0x2337, 
+0xd4c2, 0xb504, 0xca8a, 0xe4dd, 0xd039, 0xf1df, 0x2bb9, 0x3c1d, 0x3426, 0x22ac, 
+0x331f, 0x0f10, 0xdc7d, 0xbbe1, 0xb47c, 0xdb63, 0xd984, 0xfcbd, 0x450f, 0x5431, 
+0x271a, 0x210b, 0x3c62, 0xf43d, 0xc565, 0xc201, 0xc114, 0xe4f6, 0xee9b, 0x085b, 
+0x3cf5, 0x5653, 0x1e82, 0x0d52, 0x38a8, 0xf608, 0xc456, 0xce8b, 0xcfd1, 0xda08, 
+0xf0f6, 0x16f4, 0x3014, 0x4610, 0x1a46, 0x0c35, 0x36d1, 0xfb60, 0xbc9c, 0xbcea, 
+0xdb0c, 0xda74, 0xdb6c, 0x17ce, 0x3715, 0x33b3, 0x13c8, 0x1e7d, 0x290c, 0xe55b, 
+0xb756, 0xb135, 0xdad6, 0xde70, 0xd336, 0x1782, 0x43a0, 0x29e5, 0x03f8, 0x2c8f, 
+0x2768, 0xd396, 0xc0e1, 0xbc23, 0xccce, 0xdf32, 0xe829, 0x16bf, 0x4610, 0x3567, 
+0x012e, 0x312c, 0x3059, 0xcf4c, 0xbc48, 0xcf7d, 0xdb0c, 0xd4f7, 0xefe3, 0x2327, 
+0x3f5e, 0x34bf, 0x11d9, 0x3885, 0x2a09, 0xd700, 0xbd59, 0xc753, 0xde26, 0xd765, 
+0xf612, 0x31cc, 0x45d3, 0x2d56, 0x17c3, 0x3e94, 0x16b7, 0xce82, 0xc389, 0xc8ab, 
+0xdd9d, 0xdd82, 0xfe36, 0x3550, 0x4d5b, 0x2a45, 0x1384, 0x3ff2, 0x0ef3, 0xc81d, 
+0xbe61, 0xcce9, 0xe4aa, 0xe0ab, 0x0699, 0x385e, 0x486b, 0x2294, 0x15f0, 0x3d85, 
+0x01db, 0xc686, 0xc116, 0xcff5, 0xe34d, 0xe14b, 0x10c9, 0x3f07, 0x466b, 0x1f0d, 
+0x1d05, 0x3ab5, 0xf8ef, 0xc8ce, 0xc05e, 0xd357, 0xe7d4, 0xe29f, 0x13df, 0x471a, 
+0x4a47, 0x1c4c, 0x297f, 0x3e3f, 0xed74, 0xc6f8, 0xbfdc, 0xccde, 0xe3d5, 0xeaa0, 
+0x19ee, 0x4b1b, 0x4d49, 0x1865, 0x2976, 0x37a0, 0xe1a2, 0xb9e8, 0xba35, 0xd299, 
+0xde2b, 0xecfc, 0x27c6, 0x4ae2, 0x4564, 0x19a4, 0x28b5, 0x2426, 0xd885, 0xbc0a, 
+0xb90e, 0xd777, 0xe284, 0xf34a, 0x2d9a, 0x4813, 0x38b9, 0x14ee, 0x2c67, 0x1894, 
+0xd324, 0xbc7e, 0xb3bc, 0xda55, 0xe3e2, 0xef0a, 0x2fd7, 0x4da0, 0x2e6a, 0x0ee2, 
+0x326e, 0x0fc1, 0xcb23, 0xbee7, 0xb82c, 0xdaac, 0xe70d, 0xf676, 0x2c96, 0x4efe, 
+0x3180, 0x0f59, 0x3430, 0x0900, 0xc464, 0xbdf3, 0xbfd4, 0xdc18, 0xe54f, 0x02ac, 
+0x346a, 0x4ca2, 0x2bdb, 0x0ba0, 0x2ca5, 0x00e4, 0xc0c2, 0xb4ae, 0xbea2, 0xdd3b, 
+0xe1b5, 0x05e5, 0x36cd, 0x455d, 0x228c, 0x0f39, 0x2721, 0xf06a, 0xbe3c, 0xb625, 
+0xc315, 0xe0db, 0xe130, 0x0824, 0x3af9, 0x4450, 0x1a04, 0x1254, 0x2a20, 0xeab7, 
+0xbec0, 0xb857, 0xc3f1, 0xdf5a, 0xe831, 0x122e, 0x3daa, 0x44fa, 0x18f6, 0x1739, 
+0x28bb, 0xe41d, 0xbbf3, 0xb89c, 0xcff6, 0xe5c1, 0xea00, 0x1c60, 0x45d5, 0x43ef, 
+0x1c06, 0x2434, 0x292a, 0xe39e, 0xc2cb, 0xbd71, 0xd5c4, 0xe95c, 0xf5d3, 0x2a36, 
+0x4b75, 0x403d, 0x1c75, 0x32bf, 0x27ef, 0xdda2, 0xcb76, 0xc7c5, 0xdb1a, 0xe84b, 
+0xf612, 0x2b74, 0x5112, 0x4137, 0x18a7, 0x3889, 0x2791, 0xd8ed, 0xc90a, 0xc6c8, 
+0xd83c, 0xe5cf, 0x01d1, 0x32e1, 0x4e08, 0x3e77, 0x1bcc, 0x39cc, 0x1bcb, 0xcf7c, 
+0xbfad, 0xc693, 0xe1af, 0xe44a, 0x0379, 0x3b80, 0x5122, 0x34da, 0x12cd, 0x2ff7, 
+0x0b3f, 0xcb7c, 0xb95e, 0xc0f4, 0xe555, 0xe1ce, 0x01a1, 0x3cc9, 0x475e, 0x2196, 
+0x156a, 0x33d5, 0xf97d, 0xc4c1, 0xb9ed, 0xbd90, 0xe1db, 0xe24b, 0x021d, 0x3cfa, 
+0x4dca, 0x1ea3, 0x12f7, 0x33e9, 0xf159, 0xbf15, 0xb984, 0xbdf4, 0xd9dc, 0xe483, 
+0x0d28, 0x3bb5, 0x4aee, 0x1fcf, 0x1792, 0x2e75, 0xe773, 0xb55d, 0xaeed, 0xc525, 
+0xdc07, 0xe07a, 0x162d, 0x403a, 0x41df, 0x18e6, 0x1816, 0x22ca, 0xe0d7, 0xba3f, 
+0xab7d, 0xc6d9, 0xe296, 0xe464, 0x1a6b, 0x45ec, 0x3cb4, 0x1203, 0x21d7, 0x1e19, 
+0xd553, 0xc042, 0xb44a, 0xca17, 0xe29f, 0xe893, 0x1a35, 0x457e, 0x3ca4, 0x0eee, 
+0x274f, 0x1dc0, 0xd010, 0xbe2a, 0xb43a, 0xca4c, 0xe2e4, 0xf448, 0x246d, 0x4965, 
+0x3fdb, 0x10f7, 0x25b8, 0x162e, 0xcca7, 0xb882, 0xb947, 0xd7a5, 0xe438, 0xfea1, 
+0x33b7, 0x4cfe, 0x3b14, 0x1175, 0x24b7, 0x0bf7, 0xcecd, 0xbc06, 0xbdfc, 0xe81e, 
+0xee24, 0x01b0, 0x3af8, 0x476e, 0x28b0, 0x20d9, 0x3412, 0xf8f1, 0xc8c9, 0xbcf1, 
+0xbe75, 0xed66, 0xf061, 0x0477, 0x2e04, 0x4a13, 0x58d9, 0x3473, 0x0a86, 0xde23, 
+0xc927, 0xa391, 0xa85a, 0xfd01, 0x01c0, 0x26a1, 0x8016, 0x6b60, 0x1f2e, 0x05f0, 
+0xdab1, 0x948b, 0xb8c2, 0xc47d, 0xcb07, 0x3e6c, 0x61b3, 0x38d1, 0x421e, 0x423b, 
+0xe147, 0xbac6, 0xe0e9, 0xbe22, 0xd9dd, 0x0b3a, 0x03de, 0x31f4, 0x40dc, 0xf8e0, 
+0xf398, 0x2cdd, 0xec3a, 0xc582, 0x25ea, 0x1c58, 0xd8cd, 0x0700, 0x13d5, 0xbffb, 
+0xdfbf, 0x2eeb, 0xf5a6, 0x0a90, 0x5506, 0x0dfc, 0xf5d4, 0x194f, 0xd0b1, 0xa469, 
+0xf944, 0x0659, 0xe225, 0x3e8d, 0x4455, 0xf804, 0x285d, 0x16e8, 0xac54, 0xcbe6, 
+0x0dc1, 0xcfa2, 0xef3a, 0x51ba, 0x0cea, 0x02d9, 0x4169, 0xec8e, 0xb42c, 0x04b3, 
+0xfdcb, 0xc5c1, 0x233b, 0x2fa0, 0xe530, 0x27ec, 0x2937, 0xc096, 0xdeaa, 0x2435, 
+0xe010, 0xe6f7, 0x3e0a, 0xfd91, 0xeb2e, 0x333b, 0xf30c, 0xb2be, 0x1250, 0x1fd9, 
+0xc7fa, 0x1877, 0x3b5d, 0xdbdb, 0x0644, 0x23bb, 0xbdc0, 0xcc54, 0x2f0c, 0xf1f3, 
+0xe57b, 0x48e5, 0x082c, 0xe598, 0x360e, 0xf80f, 0xa876, 0x0659, 0x1b42, 0xc57b, 
+0x1fb9, 0x48cb, 0xe657, 0x1591, 0x3682, 0xcb26, 0xccd4, 0x2692, 0xe8fa, 0xda38, 
+0x445f, 0x1220, 0xf0e0, 0x3d8f, 0x09d0, 0xb6bc, 0x00e1, 0x260a, 0xd188, 0x0576, 
+0x3935, 0xef31, 0x1179, 0x33e9, 0xd401, 0xcde0, 0x2d56, 0xfa21, 0xdbb0, 0x4a3c, 
+0x1c17, 0xdc92, 0x334e, 0x1ceb, 0xb17d, 0xebbf, 0x27e0, 0xd919, 0x0f7e, 0x4a4b, 
+0xf20c, 0x107b, 0x3a20, 0xcab0, 0xba0a, 0x24cb, 0xf1fa, 0xcaf2, 0x3f6a, 0x2005, 
+0xe495, 0x30ba, 0x16ef, 0xb7a7, 0xec01, 0x1401, 0xc9b7, 0x05b6, 0x393b, 0xe12d, 
+0x07bf, 0x44cb, 0xdee8, 0xbd85, 0x23f1, 0xfc20, 0xc5f2, 0x2bd6, 0x194b, 0xdfc0, 
+0x26e3, 0x160b, 0xba3e, 0xf25d, 0x2457, 0xcdc4, 0x004b, 0x4634, 0xe4dc, 0xf4a7, 
+0x3d04, 0xdcc3, 0xb397, 0x1fb0, 0x0021, 0xcbc7, 0x37a0, 0x223d, 0xdd2e, 0x2e4a, 
+0x1e22, 0xae9d, 0xea89, 0x28db, 0xc94f, 0xf4c9, 0x4a0c, 0xf565, 0xfefa, 0x4525, 
+0xee89, 0xbfb1, 0x1b8b, 0xfa5c, 0xc436, 0x2f51, 0x24ca, 0xdfcd, 0x2cf4, 0x2a31, 
+0xbd55, 0xe94e, 0x2b96, 0xd147, 0xee2f, 0x4235, 0xf2bf, 0xf601, 0x3b75, 0xe821, 
+0xb876, 0x1f6c, 0x056a, 0xc597, 0x378b, 0x2e60, 0xd377, 0x1e9d, 0x283c, 0xb892, 
+0xdee1, 0x2781, 0xd1f0, 0xf4ba, 0x554c, 0x0123, 0xf9be, 0x420b, 0xea52, 0xaa76, 
+0x121d, 0x04f0, 0xbdca, 0x333f, 0x4315, 0xe753, 0x27d8, 0x325a, 0xb873, 0xd272, 
+0x2388, 0xcf65, 0xe913, 0x57fe, 0x07f4, 0xf542, 0x4773, 0xf6c7, 0xab18, 0x11a2, 
+0x0c42, 0xb926, 0x2816, 0x3c96, 0xde7c, 0x28fb, 0x3ab1, 0xb843, 0xd1f6, 0x2e08, 
+0xd30e, 0xdd67, 0x552d, 0x04b1, 0xe6f1, 0x4408, 0xfac7, 0xa436, 0x0956, 0x1138, 
+0xb9e0, 0x267a, 0x42e3, 0xd676, 0x199d, 0x3443, 0xb086, 0xc200, 0x28e5, 0xda7a, 
+0xd827, 0x53d9, 0x0bab, 0xe3c1, 0x40a6, 0xfc98, 0xa29e, 0x018f, 0x1105, 0xb6e7, 
+0x1b43, 0x498c, 0xdd00, 0x1541, 0x4138, 0xc0de, 0xbf2e, 0x283d, 0xe09c, 0xce50, 
+0x4aa8, 0x1053, 0xdfdb, 0x3f0a, 0x0676, 0xa0c4, 0xfe21, 0x1b86, 0xb753, 0x10a7, 
+0x4958, 0xd934, 0x0821, 0x3f0a, 0xc34f, 0xba57, 0x2b9e, 0xe817, 0xc7b8, 0x46a9, 
+0x0faa, 0xd39d, 0x38e6, 0x0b67, 0x9f2e, 0xfa87, 0x2298, 0xbafd, 0x0a31, 0x466b, 
+0xd41d, 0xfd51, 0x3a2b, 0xc101, 0xb40d, 0x2b20, 0xef1f, 0xc9c0, 0x46b9, 0x10a8, 
+0xce9c, 0x3371, 0x097d, 0x9c55, 0xf5c4, 0x3090, 0xd2df, 0xecd4, 0x147e, 0xe806, 
+0x2e2d, 0x4ebd, 0xe525, 0xe179, 0x26a7, 0xd61d, 0xaa44, 0x0053, 0xe8dc, 0xe136, 
+0x46b6, 0x57fc, 0x24b5, 0x2da9, 0x235d, 0xcd31, 0xca81, 0xd1c7, 0xaf26, 0xfdb0, 
+0x3bad, 0x09ac, 0x1da0, 0x74cf, 0x3a9c, 0xd9e6, 0xf662, 0xf1b3, 0xb74e, 0xc78b, 
+0x079d, 0x1303, 0x25f7, 0x3f88, 0x14f4, 0x2459, 0x2c9b, 0xdd69, 0xc8da, 0xfb0c, 
+0xfc56, 0xd94a, 0x0b6d, 0x29c0, 0x150a, 0x22e5, 0x1d92, 0x18ef, 0x1cfc, 0x0c23, 
+0xcdc3, 0xcd7b, 0x0116, 0xd225, 0xea05, 0x3ecf, 0x321c, 0x114b, 0x3429, 0x4818, 
+0xf80f, 0xe0f6, 0xd86d, 0xb88f, 0xe34c, 0xec85, 0xf335, 0x37f0, 0x5dfb, 0x1c42, 
+0x11db, 0x4f23, 0xfc26, 0xba44, 0xd5aa, 0xd324, 0xd1fd, 0xf17c, 0x1856, 0x276a, 
+0x4692, 0x286a, 0x0ba3, 0x3d7b, 0x1150, 0xc1ac, 0xbdf0, 0xe136, 0xd542, 0xcf26, 
+0x1384, 0x2faf, 0x3870, 0x2e2c, 0x2318, 0x28d4, 0xfdee, 0xcb16, 0xa730, 0xc88d, 
+0xdb00, 0xceb6, 0x1995, 0x4d9d, 0x384a, 0x1a5c, 0x3253, 0x2473, 0xd8f1, 0xc53c, 
+0xafa7, 0xc440, 0xe9ed, 0xe807, 0x176e, 0x51f8, 0x4372, 0x074b, 0x2912, 0x2b6d, 
+0xcf1e, 0xc37a, 0xc518, 0xc3a3, 0xdc9c, 0xfa3e, 0x1a98, 0x40fa, 0x4783, 0x0983, 
+0x2539, 0x3545, 0xd15a, 0xad3e, 0xc7ca, 0xd8f8, 0xd06d, 0xf96a, 0x3340, 0x3d0f, 
+0x375f, 0x19a1, 0x2cbe, 0x2480, 0xd619, 0xaa0f, 0xbfde, 0xe9c8, 0xd157, 0xf05e, 
+0x42af, 0x4a8c, 0x2ada, 0x1e55, 0x372a, 0x09e1, 0xcd35, 0xbbbe, 0xb8fb, 0xe193, 
+0xe480, 0xf329, 0x3476, 0x51aa, 0x233d, 0x1102, 0x44ce, 0x08c4, 0xbbca, 0xc158, 
+0xc692, 0xd1e1, 0xdde2, 0x0656, 0x33cd, 0x4f74, 0x2ddc, 0x0f4d, 0x394e, 0x09e6, 
+0xbe5c, 0xb5ad, 0xcc4d, 0xdc27, 0xdab2, 0x1043, 0x3ea4, 0x479b, 0x2b41, 0x1d61, 
+0x308b, 0xf8bb, 0xc464, 0xb735, 0xcd64, 0xe75e, 0xe437, 0x161f, 0x4870, 0x48ad, 
+0x1c9b, 0x1ea2, 0x33d1, 0xf0d7, 0xc828, 0xc0cf, 0xd2aa, 0xe99c, 0xeb83, 0x1a23, 
+0x47fe, 0x4a7b, 0x1905, 0x1e38, 0x324a, 0xe958, 0xc1e9, 0xc325, 0xd7e4, 0xe635, 
+0xf2dc, 0x2267, 0x3faa, 0x415f, 0x1a59, 0x202f, 0x2852, 0xe889, 0xc4bd, 0xbe6c, 
+0xdab6, 0xe56a, 0xef10, 0x26eb, 0x4556, 0x3a6e, 0x180a, 0x2a09, 0x1fb9, 0xde8b, 
+0xc5cf, 0xb9e8, 0xd7a7, 0xe7b9, 0xedd9, 0x2300, 0x49df, 0x37d1, 0x12a8, 0x2f9a, 
+0x18aa, 0xce1b, 0xbdb0, 0xbc6b, 0xd29e, 0xdeee, 0xf71a, 0x2781, 0x45f4, 0x339d, 
+0x0ccf, 0x2b8f, 0x12d6, 0xc8e8, 0xb6b6, 0xbda1, 0xd3af, 0xd912, 0xfe42, 0x2d6d, 
+0x3ef8, 0x304b, 0x1689, 0x29cf, 0x067c, 0xcba1, 0xb57d, 0xbede, 0xdf90, 0xdc36, 
+0xfffb, 0x3465, 0x3c40, 0x2128, 0x1a44, 0x31e1, 0xfd23, 0xcc9c, 0xbac3, 0xbc48, 
+0xdd17, 0xde23, 0xfd31, 0x3137, 0x4362, 0x1eee, 0x18fc, 0x32b8, 0xf20e, 0xc5cc, 
+0xbb44, 0xbdcc, 0xd9bd, 0xe2e3, 0x076b, 0x353c, 0x4892, 0x1e7b, 0x18f6, 0x30cf, 
+0xea76, 0xbae7, 0xb387, 0xc4fa, 0xdcc0, 0xe7b8, 0x15fe, 0x3d5b, 0x45ed, 0x199f, 
+0x192d, 0x2670, 0xe39c, 0xbd23, 0xb49a, 0xce79, 0xe000, 0xe7b3, 0x1c0b, 0x42fb, 
+0x4231, 0x1500, 0x214f, 0x24b7, 0xddd0, 0xbdaf, 0xb443, 0xd1d6, 0xe488, 0xf035, 
+0x248c, 0x481a, 0x412e, 0x17e3, 0x2a09, 0x1e55, 0xd730, 0xbb6d, 0xb458, 0xd6fe, 
+0xe4f4, 0xf65d, 0x30dd, 0x50e1, 0x3ee0, 0x15ff, 0x2a77, 0x133f, 0xd208, 0xbb41, 
+0xb5d0, 0xdc9b, 0xea0f, 0xfe2e, 0x33e8, 0x4ec6, 0x3729, 0x17b0, 0x327e, 0x0ae7, 
+0xcbb1, 0xbd40, 0xbbb0, 0xe021, 0xe92f, 0x0274, 0x3a54, 0x53fa, 0x3201, 0x1417, 
+0x340a, 0x073d, 0xcaf8, 0xbd21, 0xbddc, 0xdfe9, 0xebda, 0x0cee, 0x3df0, 0x5410, 
+0x3025, 0x16c7, 0x32e0, 0xfb90, 0xc1f6, 0xbac8, 0xcb01, 0xe852, 0xeb00, 0x14bb, 
+0x4362, 0x4e09, 0x267e, 0x175e, 0x2ea6, 0xf673, 0xc679, 0xb7ca, 0xce42, 0xef38, 
+0xea88, 0x19da, 0x4c19, 0x4976, 0x1f9b, 0x2155, 0x2984, 0xe747, 0xc939, 0xbc60, 
+0xced0, 0xf05b, 0xef4a, 0x1a1b, 0x4d06, 0x49db, 0x1707, 0x21a4, 0x261f, 0xdb58, 
+0xc42f, 0xbd07, 0xcd03, 0xeb57, 0xf6f1, 0x1fe4, 0x4885, 0x45cb, 0x1391, 0x2121, 
+0x232c, 0xd7ec, 0xbd29, 0xbf59, 0xd799, 0xe575, 0xf6b7, 0x28c6, 0x4774, 0x3e39, 
+0x1137, 0x1ef7, 0x1744, 0xd610, 0xbc35, 0xb9e4, 0xdd70, 0xe860, 0xf41e, 0x2929, 
+0x4423, 0x2e1c, 0x110a, 0x2d77, 0x0e41, 0xced2, 0xc1cd, 0xbb1d, 0xd9b8, 0xe41e, 
+0xf4ed, 0x2b8f, 0x4959, 0x2b92, 0x0f36, 0x32ac, 0x0962, 0xc983, 0xc063, 0xbadd, 
+0xd65d, 0xe557, 0xfe42, 0x2c4a, 0x49b0, 0x2cc4, 0x11af, 0x335e, 0x0099, 0xbfb6, 
+0xb950, 0xc282, 0xda13, 0xe2c3, 0x0c6b, 0x2301, 0x3d0d, 0x5b32, 0x2bf1, 0xf816, 
+0xd811, 0xc694, 0x94e5, 0xa76b, 0x02b3, 0xf90f, 0x23f0, 0x863b, 0x6a8b, 0x1164, 
+0xf826, 0xd412, 0x8d7c, 0xade7, 0xbb44, 0xce06, 0x446e, 0x60cd, 0x37d3, 0x464b, 
+0x4603, 0xdb1a, 0xadc9, 0xd748, 0xbb79, 0xd2d1, 0x0130, 0x0928, 0x3b0a, 0x4390, 
+0x0002, 0xef18, 0x25c7, 0xf662, 0xbcac, 0x1201, 0x1f14, 0xda32, 0xff28, 0x1fbe, 
+0xd1ed, 0xd6db, 0x389e, 0x0dbf, 0xf3fb, 0x488e, 0x1c7e, 0xe70e, 0x1374, 0xed9e, 
+0xa6a3, 0xedff, 0x24fa, 0xe3d7, 0x2454, 0x55ff, 0xfbf6, 0x19ad, 0x27e2, 0xbe48, 
+0xc206, 0x1296, 0xe45b, 0xdd35, 0x4db6, 0x1c33, 0xef46, 0x4348, 0x0b24, 0xb5eb, 
+0xf732, 0x126a, 0xcd2b, 0x063c, 0x37c5, 0xec01, 0x18d9, 0x3cc8, 0xd616, 0xd2bc, 
+0x273a, 0xf84b, 0xd381, 0x30e7, 0x1385, 0xdff9, 0x30f4, 0x18b0, 0xc10e, 0x0696, 
+0x364d, 0xd762, 0xfbf8, 0x3d8c, 0xe397, 0xf63d, 0x3932, 0xe0e0, 0xc7fb, 0x31c6, 
+0x0e47, 0xd472, 0x33f1, 0x19cb, 0xd9b6, 0x297e, 0x174d, 0xb770, 0xf385, 0x2b80, 
+0xd844, 0x020b, 0x44ae, 0xecdc, 0xffc6, 0x3c84, 0xe59b, 0xc239, 0x1b9c, 0x03d8, 
+0xcdfc, 0x284d, 0x2050, 0xe856, 0x29ba, 0x1da6, 0xc79c, 0xf13e, 0x2a8b, 0xdb89, 
+0xe7cf, 0x315a, 0xf321, 0xf5f9, 0x332c, 0xf230, 0xc508, 0x1566, 0x093d, 0xce9a, 
+0x23e7, 0x1dac, 0xd1bc, 0x1aa1, 0x2c3b, 0xbf9a, 0xd5cb, 0x286f, 0xe374, 0xeccb, 
+0x3bb8, 0xfa4b, 0xf5e8, 0x2f2d, 0xe9fe, 0xbb23, 0x0ce2, 0xff3a, 0xc469, 0x2484, 
+0x2c01, 0xe186, 0x1b3d, 0x26db, 0xc966, 0xd43c, 0x0cf6, 0xd3cc, 0xeaf1, 0x349d, 
+0xf49e, 0xfa1b, 0x3da3, 0xf2ae, 0xb5a2, 0x09f1, 0x0303, 0xbee6, 0x1c15, 0x2f77, 
+0xe137, 0x187e, 0x2a96, 0xc3d0, 0xd414, 0x1e88, 0xd685, 0xe774, 0x4a59, 0xfa19, 
+0xe6e2, 0x3f71, 0xf365, 0xa657, 0x0aac, 0x0b27, 0xbbf9, 0x22a4, 0x3896, 0xdde2, 
+0x1ea6, 0x2ddb, 0xb6a3, 0xcf13, 0x234d, 0xd209, 0xdfcd, 0x4de4, 0x0530, 0xf235, 
+0x458e, 0xfe1c, 0xaf9c, 0x04ff, 0x0ba8, 0xc04a, 0x1dfe, 0x3a8f, 0xe44e, 0x1ebd, 
+0x3786, 0xc838, 0xd340, 0x2d49, 0xe462, 0xdc75, 0x4606, 0x05e5, 0xe8d6, 0x3e07, 
+0x0367, 0xb349, 0x0d09, 0x1be3, 0xc56a, 0x2148, 0x4004, 0xd8d7, 0x1595, 0x3a7d, 
+0xc56d, 0xd126, 0x3261, 0xe7bb, 0xe124, 0x5308, 0x0eb8, 0xeb26, 0x437a, 0x042c, 
+0xaf26, 0x0eb2, 0x218d, 0xc6ad, 0x22c2, 0x4ab9, 0xe2d2, 0x1874, 0x40cd, 0xca8d, 
+0xc838, 0x2e68, 0xedb9, 0xd7fa, 0x4c7a, 0x1526, 0xe7cb, 0x4150, 0x0c9e, 0xae99, 
+0x0430, 0x20bb, 0xc1b5, 0x1187, 0x47d4, 0xe4da, 0x1440, 0x42ec, 0xcdff, 0xc6df, 
+0x2c13, 0xec08, 0xd2d5, 0x46ed, 0x0ef1, 0xdd36, 0x3d9e, 0x0f6f, 0xadf9, 0x0331, 
+0x2434, 0xc516, 0x0f43, 0x4485, 0xde32, 0x0700, 0x3d61, 0xce91, 0xbeff, 0x2926, 
+0xf4fa, 0xd134, 0x41a9, 0x1664, 0xdc49, 0x34e2, 0x1333, 0xace3, 0xf361, 0x1f70, 
+0xc693, 0x0699, 0x47e9, 0xe934, 0x0537, 0x4024, 0xd7ae, 0xba09, 0x1da8, 0xf1cd, 
+0xcbb4, 0x3981, 0x188e, 0xddeb, 0x326b, 0x1892, 0xb095, 0xf130, 0x20bc, 0xc29d, 
+0xf9a7, 0x3f9b, 0xe3d4, 0xfb7a, 0x3e64, 0xdf3d, 0xbe59, 0x2395, 0xf6d6, 0xc4b9, 
+0x3386, 0x1936, 0xd767, 0x2b7a, 0x1dd1, 0xb547, 0xeefe, 0x2814, 0xcaa5, 0xf817, 
+0x487c, 0xeb89, 0xf26b, 0x397c, 0xdf7f, 0xb39b, 0x1c04, 0xfe68, 0xc54d, 0x349f, 
+0x2a68, 0xdbdd, 0x22d6, 0x1ddd, 0xb0a0, 0xe0fa, 0x21cc, 0xc993, 0xf898, 0x52ec, 
+0xf689, 0xf70a, 0x426a, 0xe741, 0xaf61, 0x151d, 0xf921, 0xc0cc, 0x3886, 0x3002, 
+0xdf54, 0x2dc5, 0x25fe, 0xb022, 0xe019, 0x2b01, 0xdc46, 0xdf34, 0x113b, 0xf3ef, 
+0x2b9e, 0x5380, 0xf6a9, 0xdedb, 0x2143, 0xe2d9, 0xa1ed, 0xf09b, 0xf0dc, 0xdb67, 
+0x3407, 0x5e55, 0x32ca, 0x27e1, 0x25c5, 0xd709, 0xc36a, 0xcfc9, 0xa7f8, 0xea51, 
+0x3bd7, 0x0e16, 0x0801, 0x6978, 0x4f5b, 0xdcee, 0xefc1, 0xfe47, 0xbe36, 0xbc03, 
+0xf6fb, 0x0a54, 0x1b49, 0x3bd0, 0x15ec, 0x2382, 0x3cb2, 0xeb19, 0xc5aa, 0xedb7, 
+0xf957, 0xd7a6, 0xf768, 0x22e7, 0x17a3, 0x2061, 0x1ba7, 0x1fd9, 0x23d8, 0x0c01, 
+0xd667, 0xc4b5, 0xfb1e, 0xd994, 0xd7e9, 0x3398, 0x3e92, 0x166b, 0x27af, 0x4ec2, 
+0x0515, 0xd7d3, 0xde1a, 0xb994, 0xdcbe, 0xf079, 0xeced, 0x2d31, 0x5f61, 0x253a, 
+0x040a, 0x4aa6, 0x0dcf, 0xb7f1, 0xcf3e, 0xd1b1, 0xcf61, 0xe63f, 0x105c, 0x26cc, 
+0x431a, 0x31ef, 0x089d, 0x3279, 0x1505, 0xc9c8, 0xbc77, 0xd253, 0xdbe3, 0xd185, 
+0x028c, 0x2ef7, 0x3d5b, 0x2ff3, 0x2436, 0x2ecc, 0xffae, 0xd27d, 0xae72, 0xb7bb, 
+0xda8b, 0xd2ea, 0x0b5f, 0x4d03, 0x43e6, 0x19f3, 0x2a63, 0x2e3d, 0xdc83, 0xc2d3, 
+0xb8a6, 0xbf1e, 0xe681, 0xe9fe, 0x0c02, 0x47ed, 0x4b9b, 0x0b96, 0x1c09, 0x3193, 
+0xdad3, 0xc2e7, 0xcba3, 0xc7a2, 0xd979, 0xf765, 0x1768, 0x34eb, 0x4272, 0x0e6d, 
+0x1cba, 0x35bf, 0xe2f7, 0xb4ec, 0xc2dc, 0xdbc9, 0xd4b0, 0xeaf5, 0x2a04, 0x3d45, 
+0x3135, 0x163c, 0x29bf, 0x1de9, 0xd862, 0xb512, 0xbc25, 0xe60f, 0xdb2d, 0xe4e1, 
+0x2e4c, 0x46ed, 0x2280, 0x0c95, 0x3390, 0x0dba, 0xc912, 0xc227, 0xbe99, 0xd9c1, 
+0xe290, 0xed33, 0x2239, 0x44f4, 0x1ed4, 0x0166, 0x3720, 0x122c, 0xc1e5, 0xbe0b, 
+0xcc00, 0xd5f1, 0xd17f, 0xf3b3, 0x23a2, 0x3db4, 0x2624, 0x0cc4, 0x33e1, 0x1023, 
+0xc9ae, 0xb631, 0xc8cd, 0xdd8a, 0xceea, 0xfaf7, 0x3621, 0x3ded, 0x1ca5, 0x1b0d, 
+0x3ba6, 0x0216, 0xce92, 0xc394, 0xc90e, 0xdd1a, 0xd9c7, 0x0438, 0x3a3b, 0x43f5, 
+0x193b, 0x1b93, 0x427f, 0xfe8c, 0xc66d, 0xc591, 0xd58c, 0xe393, 0xe1bc, 0x0fe2, 
+0x3df6, 0x448e, 0x1c8a, 0x21c0, 0x3e71, 0xf9bd, 0xc96f, 0xc456, 0xd5d9, 0xe4b5, 
+0xe922, 0x1ce5, 0x418b, 0x417b, 0x1d09, 0x2518, 0x341d, 0xf03a, 0xcbea, 0xc1e1, 
+0xd6e8, 0xe7f3, 0xe55f, 0x1d2e, 0x4954, 0x3f9e, 0x1b23, 0x31e7, 0x3163, 0xe580, 
+0xcb7b, 0xbe90, 0xd27b, 0xe98e, 0xede5, 0x22f3, 0x51cc, 0x440f, 0x174a, 0x3744, 
+0x308b, 0xdab4, 0xc2e8, 0xc03f, 0xd50d, 0xe3f9, 0xf766, 0x2e0e, 0x4fbc, 0x4269, 
+0x17f2, 0x2ec2, 0x1f55, 0xd524, 0xbca2, 0xbb93, 0xda21, 0xe34e, 0xfad1, 0x31b6, 
+0x47da, 0x36e7, 0x19ff, 0x2ef6, 0x0ef3, 0xd0a0, 0xb94c, 0xb54a, 0xdd97, 0xe171, 
+0xf86b, 0x35bc, 0x47ba, 0x2983, 0x1694, 0x3324, 0x023b, 0xc961, 0xbc03, 0xb2d4, 
+0xd7d9, 0xe2e7, 0xf9f7, 0x3391, 0x4b1a, 0x23f3, 0x1255, 0x2f9f, 0xf2dd, 0xbf1b, 
+0xb8c8, 0xb595, 0xd67b, 0xe49e, 0x04eb, 0x3553, 0x491e, 0x20bc, 0x101c, 0x2d09, 
+0xefb9, 0xbc9b, 0xb456, 0xbc74, 0xdcb8, 0xe7e3, 0x1085, 0x3e2d, 0x4862, 0x20a4, 
+0x178e, 0x24e7, 0xe5be, 0xbfc5, 0xb5ac, 0xc6ce, 0xe4c1, 0xe9df, 0x156b, 0x41e6, 
+0x4347, 0x169b, 0x1dcf, 0x2537, 0xdbdb, 0xbd60, 0xb4ac, 0xc74f, 0xe58f, 0xf1d1, 
+0x1bdb, 0x438d, 0x41e3, 0x1215, 0x1c5f, 0x197b, 0xd34e, 0xbb05, 0xb7f2, 0xd3b2, 
+0xe362, 0xf0f9, 0x2581, 0x46a8, 0x3c22, 0x115f, 0x2009, 0x122f, 0xd304, 0xbd34, 
+0xb54b, 0xd890, 0xe911, 0xf7d8, 0x2be6, 0x4644, 0x3124, 0x11c4, 0x2d7b, 0x0ee0, 
+0xcfc2, 0xc445, 0xbf59, 0xdf01, 0xe6a3, 0xf6fe, 0x2fa7, 0x4f24, 0x32c6, 0x10fe, 
+0x360f, 0x14d0, 0xd1fe, 0xc5f6, 0xc3cd, 0xdf16, 0xe84d, 0x00f9, 0x3302, 0x4f34, 
+0x330f, 0x190f, 0x3c38, 0x0f70, 0xcd2f, 0xc1c9, 0xccf8, 0xe5e1, 0xe528, 0x0d0a, 
+0x3fdc, 0x4c89, 0x2965, 0x1572, 0x3558, 0x0773, 0xcf30, 0xbe56, 0xcfa1, 0xeeb4, 
+0xe390, 0x0d40, 0x446b, 0x47d6, 0x22c9, 0x1f4d, 0x33f7, 0xf611, 0xcd9c, 0xbd57, 
+0xc66d, 0xec7d, 0xe7bf, 0x0df9, 0x474d, 0x4b43, 0x1b2f, 0x1f2d, 0x35f1, 0xea3c, 
+0xc455, 0xbc6b, 0xc16f, 0xe41e, 0xef9d, 0x16e5, 0x457b, 0x4d9b, 0x1df1, 0x2052, 
+0x310e, 0xe35e, 0xbd3b, 0xbe4a, 0xd17b, 0xe63a, 0xf0dd, 0x2445, 0x4bde, 0x4c1f, 
+0x20d2, 0x25a1, 0x2da1, 0xe9a8, 0xc288, 0xb909, 0xd9c6, 0xee3e, 0xf6a6, 0x2ef9, 
+0x50a3, 0x43ee, 0x1dd3, 0x2eed, 0x2309, 0xe027, 0xcabc, 0xbd16, 0xdbde, 0xee25, 
+0xf339, 0x2c27, 0x5390, 0x40a0, 0x1b96, 0x375c, 0x1d2b, 0xd734, 0xc78b, 0xb807, 
+0xd541, 0xecee, 0xfe54, 0x2fa0, 0x5361, 0x3f28, 0x1522, 0x3393, 0x1266, 0xc88d, 
+0xbc85, 0xb8d2, 0xd4a8, 0xe5ab, 0x0438, 0x3396, 0x4c0c, 0x33cd, 0x0a79, 0x2169, 
+0xfe45, 0xc2f1, 0xb2f9, 0xb954, 0xe0e9, 0xe165, 0x029e, 0x2aa5, 0x318e, 0x465f, 
+0x33d0, 0x0444, 0xd0f3, 0xc734, 0xa46c, 0x9309, 0xec1b, 0xfbdf, 0x010e, 0x6440, 
+0x7e13, 0x1ed8, 0xeedd, 0xe7dd, 0x9c36, 0x94bd, 0xaeea, 0xb4e6, 0x08d9, 0x4ccc, 
+0x44d3, 0x3995, 0x43b3, 0xfbc8, 0xa9f8, 0xbc47, 0xb7e9, 0xb05c, 0xd4b9, 0x0205, 
+0x2fad, 0x38f1, 0x145d, 0xf759, 0x0aec, 0xf6cf, 0xb93a, 0xdb0a, 0x14b9, 0xe52f, 
+0xdb64, 0x2275, 0xfc04, 0xc169, 0x1482, 0x2708, 0xda58, 0x13ad, 0x34f3, 0xe68c, 
+0xf5c6, 0x0b27, 0xbfca, 0xc11f, 0x1a39, 0xf895, 0xf15a, 0x535e, 0x1fbe, 0xfd1c, 
+0x2fab, 0xeb46, 0xb207, 0xf114, 0xfe7d, 0xd0f4, 0x2a5f, 0x4be3, 0xf98f, 0x2db3, 
+0x365b, 0xcbe5, 0xd12f, 0x160e, 0xe93e, 0xe29c, 0x4478, 0x1d6f, 0x0413, 0x49f1, 
+0x0cdb, 0xc582, 0x08ff, 0x1ce3, 0xd295, 0x10d4, 0x44fb, 0xeff9, 0x15bb, 0x4310, 
+0xddfd, 0xd8c9, 0x34f7, 0xfaaf, 0xd716, 0x4457, 0x1cff, 0xe28a, 0x3514, 0x1237, 
+0xb5a9, 0x01cc, 0x3075, 0xd90a, 0x1130, 0x4b8f, 0xf1cd, 0x0fee, 0x37f4, 0xcf77, 
+0xc32c, 0x262d, 0xfb1f, 0xde11, 0x4cfa, 0x220f, 0xe7b6, 0x379f, 0x1630, 0xb473, 
+0xeb2b, 0x1f40, 0xcdde, 0xfb49, 0x44ba, 0xf7a8, 0x0b44, 0x3ad4, 0xdf56, 0xbc11, 
+0x192e, 0xfdae, 0xc1e6, 0x2be2, 0x260a, 0xe13b, 0x285b, 0x1e09, 0xb912, 0xe471, 
+0x2223, 0xd36d, 0xfe2f, 0x46c5, 0xe36b, 0xf7a8, 0x4755, 0xdf55, 0xa7b3, 0x1a23, 
+0x0b84, 0xc893, 0x2faf, 0x2991, 0xe2bb, 0x2481, 0x13cb, 0xb383, 0xe0a3, 0x1702, 
+0xc7e4, 0xf45d, 0x4b67, 0xf6a6, 0xf97a, 0x3e6f, 0xecd9, 0xadf3, 0xfeb4, 0xfd06, 
+0xc788, 0x1f7a, 0x200a, 0xe5ba, 0x31ba, 0x2511, 0xb3da, 0xe100, 0x2776, 0xc990, 
+0xe1ba, 0x44f0, 0xef0a, 0xe6e3, 0x3c2c, 0xf024, 0xb397, 0x1376, 0x054e, 0xc2a5, 
+0x2c7f, 0x2067, 0xc5d1, 0x227f, 0x2507, 0xa6ee, 0xd8b4, 0x2da2, 0xd0d2, 0xe5d2, 
+0x4ae3, 0xf3c8, 0xec01, 0x3d1d, 0xe4c8, 0xa76d, 0x0cd7, 0x02fe, 0xc051, 0x2a3f, 
+0x2ff4, 0xd96d, 0x206e, 0x2cdb, 0xbcc2, 0xcfce, 0x1d9e, 0xd936, 0xe286, 0x3c62, 
+0xf899, 0xf161, 0x4188, 0xfacc, 0xb89c, 0x13b2, 0x0f18, 0xbfc2, 0x1908, 0x2b9b, 
+0xdd40, 0x1c58, 0x31c8, 0xcc18, 0xe1de, 0x3029, 0xe1a2, 0xeab8, 0x4814, 0xf8bb, 
+0xec3b, 0x41cd, 0xfd3d, 0xbb42, 0x1ab1, 0x1bc5, 0xd03f, 0x2b94, 0x39e6, 0xe56b, 
+0x20f6, 0x302f, 0xc7e3, 0xe07e, 0x304b, 0xe35d, 0xef37, 0x556b, 0x0a77, 0xf3f3, 
+0x471e, 0x0715, 0xb6bf, 0x0a15, 0x15a7, 0xc8f0, 0x27ce, 0x49e1, 0xef3f, 0x24d8, 
+0x3fc8, 0xcf85, 0xd3a9, 0x2981, 0xe391, 0xe1e2, 0x5568, 0x1a44, 0xf6f8, 0x47a5, 
+0x0bb1, 0xb4f6, 0x0758, 0x180f, 0xc264, 0x1c7f, 0x4997, 0xe7b6, 0x1790, 0x3eec, 
+0xcc71, 0xc989, 0x25c5, 0xe0ff, 0xd5eb, 0x4cb5, 0x1585, 0xe9fb, 0x3f4e, 0x079f, 
+0xa4e8, 0xf8b6, 0x18b7, 0xbe0e, 0x140f, 0x4dcd, 0xe6f8, 0x106e, 0x3e48, 0xc659, 
+0xb8d1, 0x1fc6, 0xe2f7, 0xcafc, 0x4b21, 0x1aac, 0xddf9, 0x38ef, 0x0d86, 0xa172, 
+0xefb8, 0x1ae3, 0xb8b9, 0x022b, 0x4952, 0xe3b7, 0x0763, 0x3fb6, 0xcaa1, 0xb546, 
+0x2034, 0xe7b3, 0xc26e, 0x4341, 0x1b44, 0xd872, 0x37f9, 0x158c, 0xa302, 0xed16, 
+0x212e, 0xbda6, 0x0112, 0x4eb5, 0xe481, 0x0180, 0x448c, 0xd2be, 0xb34a, 0x2659, 
+0xf969, 0xc3e7, 0x4253, 0x2498, 0xd3ac, 0x2f84, 0x1c93, 0xa86a, 0xeae4, 0x2be9, 
+0xc824, 0xfb1e, 0x5254, 0xeb1f, 0xf85a, 0x40c6, 0xd602, 0xacc6, 0x20d2, 0xfcc1, 
+0xbfa1, 0x3d9b, 0x2b83, 0xd669, 0x2fcc, 0x202d, 0xa65f, 0xe170, 0x2e20, 0xdd4c, 
+0xe4e8, 0x1128, 0xe9c6, 0x2b2e, 0x54f5, 0xec68, 0xd881, 0x25b3, 0xe44f, 0x9e7f, 
+0xf130, 0xeb8e, 0xd492, 0x3413, 0x5451, 0x26e6, 0x289d, 0x2623, 0xcf51, 0xbd9d, 
+0xcfb5, 0xa20d, 0xdfe7, 0x36b7, 0x0cc4, 0x056d, 0x65fe, 0x4dbe, 0xdc03, 0xeb0b, 
+0xf3c5, 0xb95e, 0xbfab, 0xf463, 0x0575, 0x1cd4, 0x3d59, 0x1332, 0x1c9e, 0x36b2, 
+0xe6ff, 0xc1d2, 0xebab, 0xf875, 0xd9ed, 0xf751, 0x1ec8, 0x177a, 0x1fdf, 0x14b0, 
+0x158a, 0x1d8b, 0x09a1, 0xd3cc, 0xc301, 0xfa03, 0xda41, 0xd913, 0x31d2, 0x3bcd, 
+0x1398, 0x2276, 0x47f0, 0x04ad, 0xdb13, 0xde05, 0xbc40, 0xe0b4, 0xf233, 0xedf8, 
+0x2b4d, 0x5c62, 0x258d, 0x04db, 0x4756, 0x0b9d, 0xbaa9, 0xd2dc, 0xd3e6, 0xd2e5, 
+0xeb10, 0x1044, 0x260b, 0x4492, 0x307c, 0x0989, 0x37e3, 0x1952, 0xc9b1, 0xbe5d, 
+0xd980, 0xdd51, 0xcfb1, 0x0665, 0x3440, 0x3f66, 0x32e5, 0x2caa, 0x3828, 0x04a2, 
+0xd6f3, 0xb98c, 0xc152, 0xdc75, 0xd7fc, 0x131d, 0x50a8, 0x4584, 0x218f, 0x39e9, 
+0x3a8c, 0xe3c0, 0xca56, 0xc147, 0xc3c0, 0xe3a0, 0xec33, 0x13df, 0x4aaa, 0x4c83, 
+0x117c, 0x2896, 0x399a, 0xdc86, 0xc6f6, 0xcd47, 0xc6ce, 0xd9cc, 0xf86e, 0x19ad, 
+0x3a91, 0x491f, 0x123e, 0x24d9, 0x3cde, 0xe11b, 0xb37c, 0xc2df, 0xd7a4, 0xd130, 
+0xef29, 0x2c49, 0x3d20, 0x37d9, 0x16ea, 0x291c, 0x26ac, 0xda1f, 0xaaed, 0xb607, 
+0xe686, 0xd568, 0xe17d, 0x337f, 0x4b43, 0x2881, 0x1389, 0x38c7, 0x12c8, 0xcd26, 
+0xbcc3, 0xb56e, 0xdd1b, 0xe483, 0xea42, 0x2a90, 0x51ed, 0x261e, 0x0805, 0x4126, 
+0x1494, 0xbddc, 0xbaf3, 0xc450, 0xd324, 0xd5cd, 0xf712, 0x2ef6, 0x4d20, 0x2af3, 
+0x0e0c, 0x3762, 0x0ac6, 0xbe79, 0xae49, 0xc076, 0xd8d1, 0xd3ec, 0x0029, 0x3a43, 
+0x4756, 0x22ca, 0x1958, 0x35d2, 0xf721, 0xbeb2, 0xb3fe, 0xbef0, 0xda1f, 0xdc92, 
+0x07d3, 0x4050, 0x4bd0, 0x19d3, 0x154a, 0x3522, 0xefeb, 0xbbc4, 0xb715, 0xc994, 
+0xdf48, 0xe0b3, 0x1046, 0x40b6, 0x462c, 0x16f6, 0x1aab, 0x3230, 0xe981, 0xbd2a, 
+0xbab3, 0xd2a2, 0xe5c9, 0xe97f, 0x1c0b, 0x466f, 0x4272, 0x167d, 0x2642, 0x3042, 
+0xe930, 0xc684, 0xbe13, 0xdccc, 0xed63, 0xea9d, 0x2413, 0x5441, 0x43f9, 0x180c, 
+0x36e2, 0x2e3f, 0xdd7b, 0xc957, 0xc358, 0xdaa2, 0xeec1, 0xf6ba, 0x27c0, 0x5560, 
+0x448c, 0x1635, 0x38ef, 0x285a, 0xd524, 0xc336, 0xc6ef, 0xdd82, 0xe86a, 0x024a, 
+0x3514, 0x5243, 0x4024, 0x1679, 0x30ad, 0x19cb, 0xd2e3, 0xbea4, 0xc57f, 0xe4e0, 
+0xe5d6, 0xfff4, 0x3873, 0x4af7, 0x2f8e, 0x188b, 0x3243, 0x0881, 0xcd5e, 0xbb93, 
+0xbf31, 0xe52f, 0xe3f9, 0xfc94, 0x39c7, 0x4714, 0x1d41, 0x169d, 0x38c9, 0xfecd, 
+0xcb1a, 0xc0fc, 0xbdbe, 0xdc75, 0xe1b5, 0xfaa7, 0x3213, 0x48a1, 0x1b68, 0x15dc, 
+0x3a99, 0xf55f, 0xc01b, 0xbf71, 0xc2a6, 0xd4e4, 0xdf4d, 0x066a, 0x3170, 0x40f1, 
+0x1a26, 0x18e0, 0x342c, 0xedf9, 0xba41, 0xb3b4, 0xc38e, 0xd795, 0xe02b, 0x10cf, 
+0x387d, 0x3bf9, 0x151b, 0x1afe, 0x254b, 0xde99, 0xbc43, 0xb3bd, 0xc921, 0xde4a, 
+0xe189, 0x1332, 0x3ec6, 0x3af6, 0x0d82, 0x1fcf, 0x23ba, 0xd6bf, 0xb847, 0xb180, 
+0xcc73, 0xe0cc, 0xeb2b, 0x1cb5, 0x417e, 0x395b, 0x0e37, 0x260e, 0x1c37, 0xceea, 
+0xb693, 0xb466, 0xd44d, 0xde55, 0xeccf, 0x28e9, 0x4c64, 0x3a26, 0x1085, 0x2a16, 
+0x12d5, 0xcc04, 0xb7f6, 0xb4e4, 0xda25, 0xe424, 0xf801, 0x3387, 0x4c82, 0x2ff0, 
+0x133d, 0x33da, 0x0a6a, 0xc653, 0xba9f, 0xb9a4, 0xdb0d, 0xe2d3, 0xfd70, 0x3932, 
+0x535b, 0x2ec6, 0x131d, 0x36f2, 0x041c, 0xc4de, 0xbc13, 0xbb88, 0xdb49, 0xe632, 
+0x0792, 0x3bf9, 0x5215, 0x2df5, 0x197b, 0x38ba, 0xfc1c, 0xc000, 0xb9c1, 0xc559, 
+0xe3b9, 0xea55, 0x13bb, 0x45e0, 0x506f, 0x2598, 0x1a8a, 0x31d4, 0xf25d, 0xc2c1, 
+0xb752, 0xc926, 0xeaa3, 0xebad, 0x18ac, 0x4b3a, 0x4b14, 0x1dc9, 0x246e, 0x2f24, 
+0xe2ff, 0xc4be, 0xbca8, 0xccb7, 0xee7a, 0xf1d7, 0x1fad, 0x5446, 0x4e8c, 0x1a55, 
+0x2bfd, 0x2de3, 0xdbcc, 0xc7c4, 0xc19e, 0xcdf0, 0xeebf, 0x0347, 0x2b46, 0x50aa, 
+0x4efc, 0x1ae7, 0x2bc2, 0x29fc, 0xd661, 0xbcdd, 0xc496, 0xddc3, 0xe917, 0xff6c, 
+0x336f, 0x4f83, 0x433f, 0x1820, 0x2877, 0x176c, 0xd63d, 0xbf37, 0xbd41, 0xe3e4, 
+0xec70, 0xfccc, 0x35e8, 0x4cad, 0x2f68, 0x12a7, 0x2fac, 0x08d7, 0xcd76, 0xc4f5, 
+0xbf59, 0xdfbb, 0xe9f3, 0xfd34, 0x3194, 0x4aa3, 0x2767, 0x0f36, 0x33c2, 0x0048, 
+0xc54f, 0xc2fd, 0xbd10, 0xd605, 0xe41c, 0xff51, 0x2a83, 0x4801, 0x28e6, 0x0aff, 
+0x2f62, 0xfdb7, 0xbd39, 0xb775, 0xc18e, 0xd7dc, 0xe021, 0x0a7d, 0x33af, 0x423a, 
+0x2081, 0x0d26, 0x28f2, 0xf6aa, 0xc604, 0xb20f, 0xca22, 0xf929, 0xe0c9, 0xfe41, 
+0x2c91, 0x285c, 0x3479, 0x40e1, 0x11dd, 0xd23c, 0xd207, 0xa861, 0xa807, 0xfe96, 
+0xf904, 0x0d6b, 0x7934, 0x78f8, 0x0f08, 0xfce1, 0xe859, 0x8e1b, 0xa714, 0xc4a3, 
+0xd05d, 0x3229, 0x6379, 0x4af3, 0x48ea, 0x4a2d, 0xe67d, 0xa875, 0xd782, 0xc120, 
+0xb7cb, 0xfb9f, 0x1f2e, 0x34e8, 0x4bf0, 0x20cd, 0xf0b2, 0x1643, 0x0563, 0xbcd0, 
+0xf27f, 0x2741, 0xe7cd, 0xef58, 0x2d5f, 0xebc6, 0xc657, 0x2de0, 0x1cb6, 0xe47e, 
+0x4360, 0x2d6e, 0xe23e, 0x16ee, 0xf98d, 0xa445, 0xddbb, 0x207f, 0xe2c0, 0x123e, 
+0x5bce, 0x016d, 0x1099, 0x3582, 0xc93d, 0xb242, 0x0573, 0xeaa3, 0xcd42, 0x3ec8, 
+0x2edf, 0xedf6, 0x39f9, 0x19b8, 0xb85b, 0xe3bc, 0x1369, 0xd1a8, 0xf1db, 0x3e71, 
+0xf679, 0x05fa, 0x4211, 0xe5a8, 0xbfbb, 0x17fb, 0x0686, 0xc767, 0x1e4b, 0x24e5, 
+0xdea8, 0x2460, 0x26bf, 0xbfbf, 0xebef, 0x3662, 0xdb5b, 0xe735, 0x478f, 0xf36f, 
+0xe6aa, 0x3a12, 0xedab, 0xb885, 0x2168, 0x1a11, 0xd137, 0x2b7c, 0x29a9, 0xd6be, 
+0x2004, 0x24d0, 0xb744, 0xddad, 0x2f52, 0xe201, 0xeeef, 0x4b3b, 0xfc02, 0xef7b, 
+0x3d92, 0xf6b9, 0xb6be, 0x0b17, 0x0d77, 0xc534, 0x191c, 0x30b3, 0xe945, 0x23b0, 
+0x2f3b, 0xc9bb, 0xd7dc, 0x269c, 0xe46c, 0xd902, 0x3766, 0x0212, 0xeb25, 0x39af, 
+0x03e0, 0xb8e7, 0x077c, 0x169d, 0xcc6f, 0x1b10, 0x2e0e, 0xd19a, 0x0fd8, 0x38f6, 
+0xca91, 0xc8f9, 0x29d6, 0xf078, 0xdd5c, 0x3b96, 0x09ef, 0xf001, 0x3507, 0xfbb1, 
+0xb660, 0x03d5, 0x0e0a, 0xc387, 0x17f0, 0x3e5b, 0xe93c, 0x15a4, 0x38a5, 0xd46a, 
+0xc5fe, 0x1360, 0xe4bc, 0xda9b, 0x39bc, 0x0c8d, 0xef2a, 0x3f9f, 0x0fdb, 0xb193, 
+0xf8d2, 0x1694, 0xb855, 0xffea, 0x4558, 0xed39, 0x083b, 0x3cd1, 0xda45, 0xc36d, 
+0x1e6e, 0xe476, 0xc765, 0x430f, 0x19a5, 0xde45, 0x3c55, 0x16d3, 0xa619, 0xf171, 
+0x1f0a, 0xbe1b, 0x04f9, 0x4d9d, 0xeec4, 0x0d1f, 0x3e78, 0xccbe, 0xb49f, 0x1d9b, 
+0xeb29, 0xc2b6, 0x448d, 0x28e1, 0xe2a4, 0x3aab, 0x21b9, 0xad2c, 0xe5d9, 0x1d14, 
+0xbe21, 0xf5ec, 0x4db1, 0xef99, 0x030b, 0x4e45, 0xe3cc, 0xb105, 0x20c5, 0xfc50, 
+0xb9ac, 0x35e2, 0x2898, 0xd9cf, 0x3397, 0x236d, 0xace6, 0xea90, 0x2c38, 0xc65d, 
+0xf7eb, 0x5313, 0xe39f, 0xf211, 0x477a, 0xdbe9, 0xad7a, 0x1ffa, 0x0017, 0xc201, 
+0x3906, 0x27ff, 0xd56a, 0x2d70, 0x20b7, 0xa843, 0xe22b, 0x2d3a, 0xc8d1, 0xeff9, 
+0x5809, 0xf171, 0xf1ca, 0x4aa1, 0xe752, 0xa7f6, 0x1531, 0x03a8, 0xbd38, 0x3515, 
+0x35e4, 0xd873, 0x2cec, 0x2fa3, 0xaedb, 0xd92e, 0x2cc6, 0xccea, 0xe531, 0x5116, 
+0xf947, 0xf6dd, 0x4ce8, 0xef45, 0xaeac, 0x190f, 0x0bfc, 0xbc68, 0x2afb, 0x3612, 
+0xd723, 0x2687, 0x3899, 0xbdfb, 0xda26, 0x3069, 0xdbaf, 0xe6bf, 0x5016, 0x0057, 
+0xf1d5, 0x480e, 0xf64b, 0xad29, 0x13a0, 0x16f4, 0xc33e, 0x2614, 0x4041, 0xe193, 
+0x201a, 0x3648, 0xc1be, 0xd35e, 0x2aee, 0xe031, 0xe3b6, 0x52de, 0x0b18, 0xedc3, 
+0x4b67, 0x084a, 0xaf95, 0x0ccc, 0x1af7, 0xc089, 0x19da, 0x4369, 0xe6d2, 0x1d97, 
+0x422d, 0xcfe2, 0xd1f7, 0x2e93, 0xe6d4, 0xd904, 0x4acc, 0x0d46, 0xe47d, 0x425b, 
+0x0eb4, 0xb1bb, 0x06af, 0x2009, 0xc469, 0x12a4, 0x3fee, 0xdd98, 0x0e0f, 0x3d40, 
+0xcdb1, 0xc9b2, 0x2f38, 0xedc8, 0xcf7d, 0x42ef, 0x1026, 0xd9af, 0x3710, 0x1033, 
+0xad12, 0xfd62, 0x2285, 0xc358, 0x0c72, 0x48be, 0xe51c, 0x0a9a, 0x2ff8, 0xbdc8, 
+0xc28d, 0x2cc9, 0xfec9, 0xc7ca, 0x13e5, 0x17e1, 0x02ca, 0x35c6, 0x0fac, 0xcd93, 
+0xf8c0, 0xfbac, 0xbba6, 0xe67f, 0x0735, 0xd6a6, 0x1bde, 0x7350, 0x2eb9, 0xfad9, 
+0x2334, 0xeee4, 0xa104, 0xc9e5, 0xcf89, 0xd376, 0x2f8b, 0x2f58, 0x13f9, 0x6199, 
+0x5172, 0xd760, 0xdae6, 0x0109, 0xaaab, 0x9f01, 0x11f6, 0x1c74, 0xff8b, 0x303b, 
+0x3d89, 0x2a49, 0x1900, 0xe5d6, 0xbb94, 0xe00a, 0xeeb6, 0xce23, 0x0253, 0x3291, 
+0x20e8, 0x0d77, 0x2650, 0x2ac1, 0xf46d, 0xf971, 0xdbe5, 0xc599, 0xf13a, 0xdd86, 
+0xebfb, 0x30a4, 0x422d, 0x0726, 0x20e1, 0x53cf, 0xe990, 0xbf8d, 0xd717, 0xc738, 
+0xcc12, 0xed69, 0x1207, 0x2679, 0x4b59, 0x2072, 0x0f6e, 0x3b3c, 0xef93, 0xaf82, 
+0xc07e, 0xdcf5, 0xccea, 0xe17b, 0x31b5, 0x3ad1, 0x3673, 0x24ae, 0x1fad, 0x2260, 
+0xf0dd, 0xc29e, 0xb494, 0xe43c, 0xe377, 0xdb2b, 0x2318, 0x45fc, 0x34e0, 0x20c4, 
+0x3ea5, 0x232d, 0xdb31, 0xcc1d, 0xb320, 0xc65a, 0xdf18, 0xea47, 0x25f0, 0x5cd4, 
+0x4386, 0x10e7, 0x3d78, 0x214b, 0xc538, 0xbca9, 0xbe8b, 0xcd16, 0xe049, 0x05f5, 
+0x2fe8, 0x5197, 0x45f2, 0x0fc2, 0x2f2f, 0x1971, 0xc5a7, 0xb7fc, 0xca80, 0xd975, 
+0xd7df, 0x0c99, 0x3a4e, 0x3fc6, 0x30e6, 0x13a0, 0x2b87, 0x0f79, 0xcd82, 0xaf27, 
+0xc107, 0xe381, 0xd5f3, 0x035c, 0x44e6, 0x44fc, 0x1db9, 0x1e95, 0x3a4e, 0xf713, 
+0xc17f, 0xb545, 0xc44b, 0xea43, 0xe0b2, 0x034f, 0x458e, 0x4e96, 0x1557, 0x1819, 
+0x3caa, 0xeb53, 0xb81f, 0xc29d, 0xcb34, 0xd827, 0xea2e, 0x153f, 0x3683, 0x4599, 
+0x17a8, 0x1025, 0x3238, 0xefae, 0xb3df, 0xb7d0, 0xd811, 0xd6f7, 0xd85a, 0x1792, 
+0x3a94, 0x35ea, 0x1657, 0x21c8, 0x243d, 0xdfb1, 0xbb30, 0xb0e9, 0xceed, 0xddbf, 
+0xdff2, 0x1be1, 0x44e0, 0x3265, 0x0879, 0x260d, 0x1f6a, 0xcd4c, 0xba1b, 0xbafd, 
+0xcb3d, 0xd899, 0xeb07, 0x19d6, 0x3c13, 0x3544, 0x08ed, 0x2407, 0x1daa, 0xcd68, 
+0xb792, 0xbf01, 0xd1c2, 0xd611, 0xf34b, 0x259b, 0x3b2f, 0x2f39, 0x1053, 0x2d78, 
+0x1a05, 0xd265, 0xba97, 0xc02a, 0xdab7, 0xd903, 0xf86d, 0x2ff9, 0x403d, 0x28d3, 
+0x14a1, 0x34af, 0x0a0e, 0xcda4, 0xc3ac, 0xc13a, 0xdd8d, 0xe2ea, 0xfd27, 0x2eb2, 
+0x45ac, 0x26be, 0x14ec, 0x3dd9, 0x06bc, 0xc81d, 0xc6e2, 0xc719, 0xd8c3, 0xe5c7, 
+0x0b66, 0x32c9, 0x4b92, 0x2cb4, 0x19ce, 0x3c10, 0x0272, 0xc5eb, 0xbb96, 0xccd7, 
+0xe07a, 0xdfbb, 0x160a, 0x4341, 0x4749, 0x2676, 0x21c7, 0x2fd3, 0xf0d0, 0xc6ee, 
+0xb624, 0xcad8, 0xe85f, 0xe7c5, 0x1d81, 0x4b84, 0x45af, 0x1eba, 0x2c0d, 0x30c1, 
+0xe4ba, 0xca8d, 0xbdbe, 0xcc89, 0xed50, 0xf3dd, 0x2203, 0x5159, 0x4cd1, 0x1b22, 
+0x2e08, 0x3255, 0xe28f, 0xc7e6, 0xc2e3, 0xd510, 0xe8de, 0xfa14, 0x2846, 0x4a33, 
+0x4c04, 0x1fed, 0x2f64, 0x2cdb, 0xe195, 0xc51d, 0xc13f, 0xdb62, 0xe696, 0xfa3e, 
+0x31bd, 0x4d3c, 0x4355, 0x2150, 0x33b3, 0x204a, 0xe0d7, 0xc877, 0xbdd9, 0xdeff, 
+0xeb46, 0x0024, 0x3a0c, 0x5485, 0x3c57, 0x1fe4, 0x3a57, 0x110e, 0xd1f0, 0xc4f8, 
+0xbfae, 0xe303, 0xf0e8, 0x0757, 0x3795, 0x525c, 0x364d, 0x163e, 0x3411, 0x078d, 
+0xc95e, 0xbed3, 0xc146, 0xdd79, 0xe8cb, 0x0fb0, 0x3b8b, 0x4b40, 0x2f52, 0x1708, 
+0x2c9b, 0xf6f7, 0xc33e, 0xb8f8, 0xc0a0, 0xe27b, 0xe6d8, 0x0c22, 0x3d9b, 0x4878, 
+0x24a6, 0x186c, 0x2467, 0xe600, 0xc014, 0xb323, 0xbc0b, 0xe0eb, 0xe8da, 0x0f11, 
+0x3cef, 0x40c5, 0x12df, 0x1430, 0x227a, 0xdb2e, 0xb8c4, 0xb5de, 0xc528, 0xdd7a, 
+0xe824, 0x13d4, 0x3e15, 0x4384, 0x124e, 0x1469, 0x1e10, 0xd6df, 0xb7fb, 0xb8e3, 
+0xcdaf, 0xdd42, 0xecbb, 0x1e7d, 0x3c6f, 0x378a, 0x1149, 0x1e8a, 0x1b08, 0xd447, 
+0xb3c7, 0xb0b3, 0xd341, 0xe16d, 0xebda, 0x22db, 0x4450, 0x345d, 0x0fcd, 0x27aa, 
+0x137c, 0xcfd2, 0xc241, 0xbb1b, 0xd538, 0xe771, 0xf62c, 0x297f, 0x4c37, 0x3271, 
+0x103e, 0x360c, 0x143c, 0xc8cb, 0xc2e2, 0xc46f, 0xd919, 0xe83f, 0x0316, 0x2e44, 
+0x49f7, 0x320d, 0x1102, 0x34eb, 0x0f20, 0xc998, 0xc1e5, 0xc68b, 0xd8b7, 0xe3aa, 
+0x0e51, 0x3839, 0x473d, 0x306d, 0x1936, 0x313b, 0x023a, 0xca3b, 0xb9cb, 0xc4e8, 
+0xe9a8, 0xe8e8, 0x0e4f, 0x4390, 0x4a72, 0x23d2, 0x1d52, 0x31ca, 0xf0b0, 0xc813, 
+0xbd25, 0xc202, 0xe6ea, 0xee18, 0x12c8, 0x4476, 0x4b2e, 0x198b, 0x19a1, 0x2fcc, 
+0xe518, 0xbf8d, 0xbe9e, 0xcb6d, 0xe622, 0xee0e, 0x167e, 0x3fbf, 0x46fb, 0x1a7d, 
+0x1f4e, 0x2d08, 0xe17f, 0xbedd, 0xbaa3, 0xcc16, 0xe196, 0xeedc, 0x21cc, 0x44ed, 
+0x4348, 0x1a18, 0x2363, 0x242e, 0xdc65, 0xbd61, 0xb300, 0xcfa0, 0xe712, 0xe5c7, 
+0x169f, 0x5f17, 0x7299, 0x2bb1, 0x0b65, 0xe2fd, 0x9b1c, 0xa3b5, 0xaeb5, 0xe147, 
+0x3787, 0x593a, 0x5290, 0x4a3c, 0x2e69, 0xcbb4, 0xa91f, 0xc5a3, 0xbd85, 0xd07b, 
+0x1055, 0x3d01, 0x2411, 0x222c, 0x2b1a, 0x0b05, 0xffdc, 0xe3f2, 0xcf8c, 0xf390, 
+0x15ad, 0xd9f5, 0xc944, 0x2d37, 0x09de, 0xc93f, 0x0d00, 0x229d, 0x0eb5, 0x31fb, 
+0x193d, 0xdefd, 0x0b6e, 0xe2b8, 0x80c1, 0xd2cb, 0x1719, 0xe9c2, 0x3008, 0x6a8a, 
+0xfee8, 0x01bc, 0x299a, 0xb39d, 0xa48f, 0x0798, 0xe5e9, 0xddfa, 0x41e1, 0x17dc, 
+0xf43b, 0x3829, 0x05c3, 0xbd89, 0xf1bc, 0x0dab, 0xcd37, 0xfad8, 0x2e14, 0xf080, 
+0x107b, 0x24ea, 0xd852, 0xd4a0, 0x17fd, 0xfd24, 0xd818, 0x2b57, 0x168d, 0xdb81, 
+0x1759, 0x0cdb, 0xc867, 0xf2e6, 0x257d, 0xe349, 0xfff1, 0x39a1, 0xe33d, 0xee45, 
+0x2b9d, 0xe388, 0xc702, 0x21a8, 0x103e, 0xda0f, 0x2f4b, 0x1b70, 0xd6c1, 0x1b55, 
+0x104d, 0xb577, 0xe811, 0x28c6, 0xe0aa, 0xfee3, 0x4403, 0xf56f, 0xf711, 0x2c32, 
+0xe60a, 0xbd96, 0x0d61, 0x048f, 0xce3d, 0x272f, 0x325d, 0xf1c7, 0x2094, 0x1ff0, 
+0xc860, 0xe30a, 0x2515, 0xdac5, 0xe92d, 0x441f, 0x0548, 0xfb76, 0x3d79, 0xfd5c, 
+0xbecb, 0x1149, 0x13f9, 0xd214, 0x2a6f, 0x3388, 0xe6f8, 0x2190, 0x2948, 0xc4a5, 
+0xdd42, 0x2f43, 0xe6af, 0xf03f, 0x54db, 0x13d9, 0xfca6, 0x3215, 0xf506, 0xc57a, 
+0x12c0, 0x0f9f, 0xd3cc, 0x322e, 0x4301, 0xf273, 0x23ab, 0x356e, 0xd3b2, 0xd051, 
+0x21b7, 0xf281, 0xecda, 0x4489, 0x12f0, 0x0242, 0x4407, 0x06d1, 0xbafe, 0x0b6c, 
+0x1d26, 0xc6ee, 0x19bc, 0x44e9, 0xe86d, 0x13b7, 0x39ca, 0xd446, 0xd119, 0x2941, 
+0xee93, 0xe7c5, 0x4bc2, 0x0643, 0xe908, 0x4535, 0x0444, 0xaaed, 0x0a10, 0x21a1, 
+0xc807, 0x1964, 0x41d6, 0xe77b, 0x16b3, 0x34e4, 0xc869, 0xc8dc, 0x2196, 0xe4ba, 
+0xdb97, 0x4973, 0x106a, 0xe7d9, 0x3cc5, 0x0a39, 0xa769, 0xf083, 0x1925, 0xc4c2, 
+0x075d, 0x3c4a, 0xe3ca, 0x0d28, 0x38d3, 0xc8d1, 0xbd34, 0x29a4, 0xea91, 0xbfc6, 
+0x3ad0, 0x0fbe, 0xd348, 0x3125, 0x0f03, 0xa6a3, 0xf4e3, 0x222b, 0xbe73, 0x00e2, 
+0x3cfa, 0xd671, 0xff6d, 0x3893, 0xc753, 0xb6c9, 0x236e, 0xec95, 0xc571, 0x3925, 
+0x1324, 0xdbd6, 0x2c09, 0x07a8, 0xaa2d, 0xf242, 0x1fa6, 0xc716, 0x042c, 0x441c, 
+0xe490, 0xffd3, 0x3dc4, 0xdc2a, 0xb9f6, 0x1f30, 0xfbb0, 0xca2e, 0x371c, 0x2003, 
+0xddf1, 0x31fa, 0x2307, 0xb4d8, 0xf004, 0x2cbc, 0xc878, 0xf7c6, 0x4caf, 0xed6b, 
+0xfe78, 0x48e2, 0xe5f3, 0xb861, 0x209c, 0xffdd, 0xc990, 0x3a8f, 0x2235, 0xd8df, 
+0x3307, 0x26fb, 0xb85c, 0xf04e, 0x2cb8, 0xd049, 0xfa7c, 0x49ae, 0xedac, 0xfa25, 
+0x3f7d, 0xe587, 0xbae6, 0x1de2, 0x03f4, 0xc964, 0x35b0, 0x2bf3, 0xdcc1, 0x287a, 
+0x2509, 0xb53e, 0xdd34, 0x21f5, 0xd014, 0xf4e6, 0x5327, 0xfbed, 0xf63d, 0x422a, 
+0xebde, 0xadff, 0x109b, 0x03c0, 0xc66e, 0x34a1, 0x371f, 0xe1e5, 0x266b, 0x298a, 
+0xb6ec, 0xdb6e, 0x2815, 0xd421, 0xf019, 0x5352, 0xff26, 0xf3f2, 0x43a2, 0xf389, 
+0xb155, 0x11bc, 0x093e, 0xc3cf, 0x2cd7, 0x37d3, 0xe04d, 0x22e3, 0x2ecd, 0xb8a8, 
+0xd4f6, 0x2b5c, 0xd879, 0xe9c1, 0x5345, 0x0074, 0xeb1b, 0x3d0d, 0xf0a8, 0xa78e, 
+0x0f83, 0x1369, 0xc523, 0x2e80, 0x3d4c, 0xdb13, 0x1e41, 0x2ecc, 0xb34d, 0xd013, 
+0x2f65, 0xd81e, 0xe458, 0x57d2, 0x0406, 0xebe0, 0x457a, 0xf7e1, 0xa66e, 0x0b6f, 
+0x0e7a, 0xb8d1, 0x251b, 0x3fe1, 0xdd7d, 0x20b9, 0x3687, 0xbb17, 0xd0b9, 0x2e06, 
+0xd6de, 0xd8c9, 0x50ce, 0x0665, 0xe605, 0x3fce, 0xfc63, 0xac6f, 0x0f4a, 0x249e, 
+0xcfcc, 0xfc68, 0x0488, 0xeb03, 0x4794, 0x43ec, 0xda83, 0xf3bd, 0x2644, 0xc019, 
+0xac19, 0xfdb7, 0xdae0, 0xebc8, 0x4a7e, 0x4842, 0x204b, 0x2f4a, 0x0bd7, 0xb466, 
+0xc7b6, 0xc25a, 0x9ff5, 0xfeaa, 0x3147, 0xf5d6, 0x1606, 0x7098, 0x2536, 0xcb1f, 
+0xef7c, 0xd8bb, 0xa610, 0xc6a6, 0xf94d, 0x01cf, 0x2326, 0x2e92, 0xfa36, 0x1b23, 
+0x1fee, 0xc9e0, 0xbf64, 0xf0f7, 0xebf9, 0xcd60, 0xfed7, 0x1727, 0x0a34, 0x1723, 
+0x0a36, 0x0e7b, 0x18aa, 0xfc64, 0xb854, 0xc985, 0xfdd8, 0xc68b, 0xea58, 0x3e80, 
+0x2a34, 0x0ba2, 0x2d28, 0x367f, 0xec1b, 0xe1de, 0xce20, 0xb654, 0xf084, 0xed7d, 
+0xf556, 0x44c2, 0x5de8, 0x118c, 0x103a, 0x43c2, 0xea97, 0xbbb3, 0xd781, 0xd5a7, 
+0xe105, 0xfd04, 0x1bc6, 0x2dbd, 0x4a4e, 0x2262, 0x090c, 0x37f3, 0x0697, 0xc337, 
+0xc445, 0xe70d, 0xe217, 0xdb53, 0x1953, 0x38c9, 0x40c1, 0x2ede, 0x22c3, 0x260c, 
+0xfc8c, 0xcfd4, 0xb0e1, 0xd39e, 0xe34c, 0xdae1, 0x253f, 0x508f, 0x342f, 0x1aa5, 
+0x3628, 0x1e6e, 0xd753, 0xc9cd, 0xb7c4, 0xd23c, 0xef41, 0xeb30, 0x1cc2, 0x523c, 
+0x3c38, 0x02b5, 0x29f9, 0x28a2, 0xd759, 0xd1f8, 0xd1bf, 0xd245, 0xe508, 0xfe91, 
+0x19fc, 0x3b30, 0x3d9b, 0x0a4c, 0x2fd0, 0x37f4, 0xdc8c, 0xbe49, 0xd7b4, 0xe591, 
+0xd3af, 0xfd0f, 0x3070, 0x36f1, 0x325e, 0x18a4, 0x3386, 0x27ca, 0xdc73, 0xb513, 
+0xcdc8, 0xf809, 0xd5d9, 0xf013, 0x4334, 0x4964, 0x2395, 0x1b7b, 0x3c5a, 0x0fe4, 
+0xd7a3, 0xc6c6, 0xc6b6, 0xf0cf, 0xeb7d, 0xf80b, 0x3914, 0x525a, 0x2445, 0x1417, 
+0x4928, 0x0ff5, 0xc35d, 0xc78a, 0xd244, 0xdff9, 0xe35e, 0x07df, 0x35ae, 0x4ba7, 
+0x2974, 0x1106, 0x3cf3, 0x0fec, 0xc4b4, 0xb9c7, 0xd562, 0xe489, 0xd970, 0x0e52, 
+0x3f61, 0x43d6, 0x27aa, 0x2131, 0x364b, 0xfd16, 0xc955, 0xb961, 0xcde0, 0xe8ce, 
+0xe024, 0x0e4f, 0x4544, 0x4582, 0x18cd, 0x22be, 0x3a77, 0xf22e, 0xc4f3, 0xbabf, 
+0xcce0, 0xe32e, 0xe352, 0x12f7, 0x43a1, 0x4666, 0x1401, 0x1c0c, 0x30e6, 0xe619, 
+0xbb56, 0xbb95, 0xd491, 0xe00b, 0xe61a, 0x17a4, 0x3b47, 0x3b00, 0x10e7, 0x1c7e, 
+0x2707, 0xe361, 0xb750, 0xb2d2, 0xd7be, 0xdb41, 0xe145, 0x2096, 0x40ed, 0x319a, 
+0x118b, 0x2924, 0x1a2e, 0xd6af, 0xba5f, 0xad6c, 0xd2c9, 0xe064, 0xe67c, 0x25df, 
+0x4ea4, 0x3357, 0x0fc7, 0x312c, 0x1020, 0xc418, 0xb5ff, 0xb68a, 0xd4f7, 0xe2ef, 
+0xfb14, 0x2e11, 0x4c3e, 0x3280, 0x08fc, 0x2966, 0x0e36, 0xc69d, 0xb3ba, 0xbf26, 
+0xde72, 0xe461, 0x0918, 0x3887, 0x4967, 0x313c, 0x1236, 0x2763, 0x0526, 0xcb44, 
+0xb35a, 0xc8b5, 0xed8f, 0xdf83, 0x05bf, 0x41b2, 0x4548, 0x20ab, 0x1a30, 0x2bd9, 
+0xf884, 0xce0f, 0xb377, 0xc10c, 0xede8, 0xe5b7, 0x0520, 0x42f2, 0x4b64, 0x19c0, 
+0x1a50, 0x2fd7, 0xee52, 0xc8d4, 0xbcea, 0xc661, 0xe5d5, 0xe9b8, 0x0e4b, 0x42da, 
+0x4c23, 0x187a, 0x1ba9, 0x2fdd, 0xe89e, 0xbcad, 0xb84a, 0xd201, 0xe619, 0xeba8, 
+0x1a61, 0x40ef, 0x41b7, 0x151a, 0x1cbf, 0x2b05, 0xea44, 0xc1f8, 0xbc6c, 0xdb3c, 
+0xe422, 0xe69f, 0x208e, 0x4881, 0x3cc7, 0x1503, 0x2aa9, 0x27ed, 0xe431, 0xc5cc, 
+0xbdfa, 0xdd9a, 0xe8e9, 0xf074, 0x2496, 0x4a59, 0x3e74, 0x1374, 0x2e8f, 0x252c, 
+0xd82c, 0xba66, 0xbeda, 0xe1cc, 0xe3a5, 0xf456, 0x3043, 0x4df4, 0x382a, 0x0d8b, 
+0x25d9, 0x1516, 0xd249, 0xb805, 0xbbdd, 0xe317, 0xe31f, 0xf717, 0x307f, 0x4438, 
+0x2ce7, 0x1089, 0x29b8, 0x060d, 0xc757, 0xb6c7, 0xb848, 0xdd4c, 0xde36, 0xf60e, 
+0x341a, 0x45f6, 0x1fc8, 0x0b03, 0x2ed5, 0xff75, 0xc14a, 0xb3bb, 0xb4dc, 0xd6d2, 
+0xdc36, 0xfbb0, 0x356c, 0x49c3, 0x2300, 0x0fe9, 0x2f18, 0xf499, 0xb802, 0xb1b2, 
+0xc06f, 0xdc85, 0xde22, 0x0805, 0x3cc1, 0x488e, 0x1f2e, 0x11d7, 0x2c64, 0xf3b1, 
+0xbd78, 0xadbb, 0xc5eb, 0xe451, 0xde57, 0x0e82, 0x4140, 0x4137, 0x1916, 0x1b84, 
+0x28d4, 0xe639, 0xc1a0, 0xb2e7, 0xc697, 0xe4be, 0xdf87, 0x10dc, 0x49b4, 0x457d, 
+0x1479, 0x2405, 0x2b0f, 0xdcbe, 0xbefc, 0xb3a9, 0xc6dd, 0xe60b, 0xed45, 0x1b13, 
+0x497b, 0x4531, 0x1324, 0x24b0, 0x243c, 0xd210, 0xb83d, 0xb984, 0xd0bc, 0xe2a6, 
+0xf3b7, 0x2766, 0x4a82, 0x4204, 0x133f, 0x22b4, 0x1b4e, 0xd4a3, 0xba37, 0xbaaf, 
+0xdf26, 0xea12, 0xf84b, 0x3177, 0x4e17, 0x39af, 0x193b, 0x308a, 0x13c1, 0xd6b0, 
+0xc5d3, 0xbffc, 0xe599, 0xeec6, 0xff4d, 0x38ac, 0x5167, 0x346a, 0x1b9d, 0x376a, 
+0x0ce4, 0xd4a8, 0xc78f, 0xc195, 0xe4f4, 0xf0f5, 0x07bb, 0x3cdc, 0x5981, 0x3510, 
+0x1b26, 0x3a31, 0x03fb, 0xca72, 0xc53e, 0xcd25, 0xecab, 0xf768, 0x193e, 0x437d, 
+0x53af, 0x2c6f, 0x15b8, 0x31bf, 0xff10, 0xcc99, 0xc147, 0xd348, 0xee05, 0xee95, 
+0x1782, 0x2f2b, 0x4b20, 0x5a80, 0x2b14, 0xfd25, 0xdd6a, 0xccb5, 0x9c77, 0xbb91, 
+0x0abb, 0xfa6d, 0x308d, 0x8b3b, 0x6386, 0x0f1b, 0x0366, 0xd9a6, 0x969a, 0xbb36, 
+0xbe42, 0xd650, 0x4a43, 0x5e11, 0x39f6, 0x4e5f, 0x3f3f, 0xd1f7, 0xbac7, 0xda01, 
+0xb75e, 0xdb85, 0x0689, 0x0f50, 0x402d, 0x3a48, 0xf492, 0xf3ba, 0x232e, 0xe3c2, 
+0xc221, 0x1c7e, 0x103b, 0xda32, 0x0d99, 0x12a9, 0xc374, 0xe4a9, 0x2fee, 0xef59, 
+0xf571, 0x4551, 0x09ce, 0xee4d, 0x190c, 0xdd87, 0xa5eb, 0xf5c9, 0x0d02, 0xd8dd, 
+0x32e0, 0x4556, 0xf27b, 0x272d, 0x1a0f, 0xac2d, 0xc929, 0x0d48, 0xd065, 0xe73f, 
+0x4fb6, 0x0a4b, 0xfcc1, 0x4512, 0xed54, 0xb2b9, 0x0350, 0xfc0b, 0xbed7, 0x1926, 
+0x2f0c, 0xe1a6, 0x2871, 0x338a, 0xc365, 0xd8fc, 0x2261, 0xe12a, 0xda5e, 0x3836, 
+0x02a6, 0xeb2d, 0x3c29, 0xfc95, 0xb47f, 0x126c, 0x2240, 0xc4df, 0x1301, 0x42d9, 
+0xddbd, 0x05c8, 0x2ff4, 0xc609, 0xc9ef, 0x2ebd, 0xf193, 0xda07, 0x46da, 0x0cd3, 
+0xe052, 0x39eb, 0x0085, 0xa3df, 0xfdbd, 0x1d67, 0xc36d, 0x1321, 0x461a, 0xe3db, 
+0x121d, 0x3bc5, 0xce7e, 0xc611, 0x1e92, 0xe869, 0xd146, 0x3d6e, 0x12f6, 0xe781, 
+0x3a2e, 0x100e, 0xb4c0, 0xf87f, 0x2451, 0xce12, 0xfd54, 0x3b61, 0xe9af, 0x0485, 
+0x363a, 0xd7a5, 0xc531, 0x26b6, 0xfb26, 0xd3af, 0x4024, 0x13d3, 0xcf38, 0x31ca, 
+0x1fe6, 0xacba, 0xe830, 0x28d0, 0xd67b, 0x03f4, 0x4390, 0xeff5, 0x0d9b, 0x3cdc, 
+0xd2ef, 0xbce5, 0x1df5, 0xf194, 0xcc0a, 0x3c7b, 0x22be, 0xe9d0, 0x37e4, 0x1f21, 
+0xbf6a, 0xed14, 0x13f9, 0xccad, 0xfeed, 0x36f2, 0xe931, 0x0bd9, 0x4870, 0xe9a7, 
+0xc649, 0x2406, 0x009e, 0xc7de, 0x28c6, 0x1d14, 0xe19d, 0x2d2e, 0x24eb, 0xc1ae, 
+0xf293, 0x2948, 0xd034, 0xfc36, 0x4c80, 0xed33, 0xf76a, 0x4574, 0xe546, 0xb51f, 
+0x205e, 0x01e4, 0xc8f6, 0x3c9b, 0x2dfd, 0xe000, 0x3231, 0x23e4, 0xac3f, 0xe1e2, 
+0x2470, 0xc806, 0xf279, 0x51f9, 0xfc93, 0xfd3d, 0x471f, 0xf14b, 0xb564, 0x0d8d, 
+0xf7a1, 0xbaf7, 0x2ae2, 0x3330, 0xe3cf, 0x2876, 0x2f9d, 0xbe99, 0xd8ed, 0x2066, 
+0xcc5b, 0xe037, 0x444b, 0xfc55, 0xf1ae, 0x3dee, 0xedb1, 0xa9f3, 0x0f58, 0x052a, 
+0xb88b, 0x286b, 0x32e9, 0xd191, 0x1a2d, 0x2b19, 0xb1ba, 0xd055, 0x2574, 0xcd9d, 
+0xe17a, 0x4f5d, 0xf991, 0xe9c8, 0x4424, 0xee22, 0xa03f, 0x0b3e, 0x0833, 0xb2f6, 
+0x25d7, 0x3fb5, 0xd971, 0x1eca, 0x3552, 0xb55f, 0xc5ed, 0x2341, 0xd2b5, 0xd7c1, 
+0x523e, 0x069d, 0xe63d, 0x453d, 0xfaec, 0xa137, 0x0414, 0x12c4, 0xb981, 0x1bb8, 
+0x4054, 0xdb21, 0x1feb, 0x3f6a, 0xbc6b, 0xcb19, 0x2eaa, 0xdddc, 0xd782, 0x53f0, 
+0x0db9, 0xe5f5, 0x4ae5, 0x09f1, 0xaaaa, 0x08ea, 0x1b96, 0xc280, 0x22c4, 0x4ce0, 
+0xe24f, 0x1cfe, 0x4491, 0xc23a, 0xc424, 0x2faf, 0xe9a8, 0xd606, 0x50b8, 0x16c3, 
+0xe5a3, 0x41e4, 0x0b1a, 0xa940, 0xfef6, 0x1bdf, 0xbfb1, 0x1607, 0x4e4e, 0xe252, 
+0x116e, 0x44af, 0xc71f, 0xbeed, 0x2c56, 0xed57, 0xd13f, 0x46da, 0x1220, 0xdf44, 
+0x3fcf, 0x0e72, 0xa687, 0xfe99, 0x22c2, 0xc0f4, 0x10f5, 0x4ab0, 0xdcc9, 0x0862, 
+0x42d3, 0xcce8, 0xbf2b, 0x2c4a, 0xf130, 0xcf23, 0x47a0, 0x1557, 0xd894, 0x3b17, 
+0x15eb, 0xac91, 0xfc3e, 0x2839, 0xc889, 0x0a6b, 0x4a0a, 0xe524, 0x0571, 0x40a3, 
+0xd642, 0xc2d3, 0x2b1c, 0xfa19, 0xd4f9, 0x465b, 0x1ef6, 0xe106, 0x371e, 0x15ec, 
+0xb185, 0xfc2f, 0x2898, 0xcc97, 0x0b55, 0x4c1f, 0xebc4, 0x08bc, 0x3f08, 0xd705, 
+0xc599, 0x2bb5, 0x081d, 0xcd96, 0x0d3b, 0x0ffa, 0x0823, 0x3f09, 0x1a45, 0xdad9, 
+0x0662, 0x07b7, 0xbb6a, 0xde9a, 0x0740, 0xda46, 0x0e1e, 0x6549, 0x38b1, 0x04bd, 
+0x2510, 0xf943, 0xad98, 0xc9a0, 0xca5c, 0xcaba, 0x22c9, 0x2b10, 0x01f0, 0x511a, 
+0x637c, 0xe409, 0xcfea, 0xff1b, 0xbae4, 0x9b34, 0xfafc, 0x154f, 0xfdb5, 0x2da1, 
+0x2e82, 0x1b20, 0x2472, 0xf46c, 0xbc6b, 0xd8c3, 0xf895, 0xcd65, 0xe4ee, 0x20c1, 
+0x1821, 0x08d6, 0x178c, 0x2a03, 0x07e8, 0xfe05, 0xe136, 0xbccf, 0xeb99, 0xdae7, 
+0xd3aa, 0x1d70, 0x3e94, 0x094b, 0x0900, 0x5434, 0x0901, 0xc4b1, 0xdc6e, 0xc832, 
+0xca7f, 0xe370, 0xfc55, 0x19fb, 0x5037, 0x3174, 0xfe1c, 0x3bdc, 0x1079, 0xb5a5, 
+0xbd97, 0xde91, 0xd7dc, 0xd8e9, 0x1ed3, 0x2fd7, 0x3373, 0x2e1c, 0x130d, 0x2861, 
+0x0ada, 0xcec0, 0xaf81, 0xd3f1, 0xe991, 0xcbf7, 0x0636, 0x408c, 0x3d14, 0x22da, 
+0x2e7f, 0x334f, 0xf091, 0xd23f, 0xb6f6, 0xbe39, 0xe0ea, 0xdac6, 0x0ab7, 0x52de, 
+0x5241, 0x1a28, 0x36a7, 0x3ee4, 0xdc10, 0xbfb1, 0xc06c, 0xc69f, 0xdf82, 0xf62e, 
+0x1f54, 0x4e25, 0x578d, 0x17a6, 0x26c4, 0x37fc, 0xe05d, 0xc099, 0xcd8c, 0xd886, 
+0xd8c3, 0xfcba, 0x2d83, 0x3fa6, 0x48bb, 0x1e77, 0x2a31, 0x31eb, 0xe98e, 0xbcf5, 
+0xc196, 0xe4e4, 0xdb34, 0xf4b5, 0x398d, 0x47e8, 0x3526, 0x2168, 0x3d9a, 0x20eb, 
+0xddcb, 0xbe09, 0xb85c, 0xe775, 0xe3f6, 0xedd1, 0x3731, 0x576a, 0x2d99, 0x1229, 
+0x4011, 0x0fb4, 0xc58a, 0xc2e0, 0xc163, 0xd8b3, 0xe485, 0xfbc4, 0x28a2, 0x4aba, 
+0x2b57, 0x06a4, 0x385f, 0x150e, 0xc2cd, 0xb65c, 0xcd33, 0xde60, 0xd4fe, 0x0096, 
+0x3507, 0x45bc, 0x2781, 0x142c, 0x33ba, 0x049c, 0xc775, 0xb39c, 0xc6ec, 0xe39b, 
+0xd75b, 0x0203, 0x3c34, 0x4589, 0x1c2f, 0x171d, 0x336b, 0xeff6, 0xbf31, 0xb8c6, 
+0xc21c, 0xde19, 0xe412, 0x0b3a, 0x399a, 0x4631, 0x1799, 0x116c, 0x3085, 0xeefe, 
+0xbcec, 0xb922, 0xcdc6, 0xe051, 0xe2d7, 0x10d0, 0x38e1, 0x3dfb, 0x1356, 0x1516, 
+0x2876, 0xe6f8, 0xbb6a, 0xb636, 0xd128, 0xdda0, 0xdf16, 0x11df, 0x387e, 0x338c, 
+0x0c5c, 0x211c, 0x2422, 0xdca8, 0xbf10, 0xb435, 0xcd32, 0xde18, 0xe25f, 0x144e, 
+0x3fe0, 0x3472, 0x0753, 0x2b41, 0x27e8, 0xd555, 0xc117, 0xbddb, 0xcb8c, 0xdaa8, 
+0xee16, 0x185e, 0x406a, 0x394d, 0x0e4c, 0x3224, 0x2283, 0xcee6, 0xb78f, 0xbe46, 
+0xd600, 0xd73a, 0xf882, 0x2db5, 0x4253, 0x3500, 0x1558, 0x2eee, 0x13ba, 0xd1b3, 
+0xb80a, 0xbd32, 0xe28d, 0xdf23, 0xfd44, 0x3980, 0x4ace, 0x2d3f, 0x18f4, 0x34ae, 
+0x039f, 0xcc97, 0xbb5e, 0xbe2a, 0xe6fa, 0xe555, 0x023b, 0x3de8, 0x4db4, 0x2192, 
+0x1578, 0x3a68, 0xfe29, 0xc84a, 0xbd0b, 0xc1ef, 0xe3a9, 0xe936, 0x0a3b, 0x3ab4, 
+0x505a, 0x260d, 0x1903, 0x39c0, 0xf9ac, 0xc53b, 0xbc41, 0xcc45, 0xe5fc, 0xe843, 
+0x15b8, 0x436d, 0x4dae, 0x24c5, 0x212b, 0x33f2, 0xf1b2, 0xc3a3, 0xb509, 0xcd57, 
+0xe8db, 0xeb7c, 0x1d1e, 0x4aef, 0x4a01, 0x1af5, 0x24c7, 0x2df1, 0xe4a5, 0xc1ae, 
+0xb8ad, 0xd2c8, 0xe887, 0xee7b, 0x21d0, 0x4d5f, 0x4806, 0x171f, 0x2854, 0x27e5, 
+0xdd26, 0xc075, 0xb9c1, 0xd6dc, 0xe94e, 0xf760, 0x2a99, 0x4d0c, 0x4405, 0x1751, 
+0x2a63, 0x1e7d, 0xd670, 0xba60, 0xb674, 0xde00, 0xe8fc, 0xf57e, 0x3121, 0x51b2, 
+0x3a66, 0x11d4, 0x29d9, 0x107f, 0xd01f, 0xbbd1, 0xb864, 0xe08f, 0xea2a, 0xfafd, 
+0x34de, 0x5038, 0x3061, 0x1294, 0x3316, 0x07d3, 0xc6ab, 0xbd82, 0xc0f2, 0xe421, 
+0xebe4, 0x0398, 0x39c6, 0x54a2, 0x2e8b, 0x0e55, 0x3308, 0x0648, 0xc5ad, 0xbd8e, 
+0xc53c, 0xdfb2, 0xe8b4, 0x0f4a, 0x3d14, 0x4caa, 0x2bf1, 0x15bf, 0x2e89, 0xf945, 
+0xc136, 0xb890, 0xcaeb, 0xe950, 0xe7bf, 0x115d, 0x451b, 0x4aa1, 0x20cd, 0x1684, 
+0x2a91, 0xf0a3, 0xc5b7, 0xb815, 0xc9bf, 0xee16, 0xea12, 0x117d, 0x470b, 0x42c7, 
+0x113f, 0x1b7c, 0x2b91, 0xe191, 0xc212, 0xbd24, 0xc84b, 0xe419, 0xe8c1, 0x104f, 
+0x440c, 0x4662, 0x1122, 0x20a6, 0x2d8e, 0xda8b, 0xbcf3, 0xc089, 0xcbf5, 0xde1c, 
+0xf3c0, 0x2135, 0x414e, 0x3fd9, 0x15e1, 0x26f5, 0x292e, 0xdc7e, 0xb937, 0xb924, 
+0xd769, 0xe06d, 0xee92, 0x2aa0, 0x48ae, 0x379d, 0x15e3, 0x2afa, 0x167d, 0xd370, 
+0xbfeb, 0xb8aa, 0xd8da, 0xe695, 0xf331, 0x2abe, 0x4918, 0x2e1c, 0x0f19, 0x32cf, 
+0x0f46, 0xc822, 0xbf6b, 0xbca2, 0xdadc, 0xe628, 0xf835, 0x2cf1, 0x4b03, 0x2c10, 
+0x0df9, 0x358e, 0x0a2c, 0xc678, 0xc06b, 0xc05f, 0xd849, 0xe170, 0x02e1, 0x3324, 
+0x4bd0, 0x2fc8, 0x13c8, 0x3314, 0x0029, 0xbf2e, 0xb455, 0xc1d3, 0xe027, 0xe480, 
+0x0a7f, 0x2c7a, 0x5506, 0x634d, 0x2129, 0xfadf, 0xe1b5, 0xb620, 0x8bd2, 0xbfae, 
+0x0a2a, 0x0d5d, 0x5240, 0x8109, 0x4e83, 0x15cf, 0xf367, 0xba2c, 0x9d5f, 0xcd2e, 
+0xbdc8, 0xf85d, 0x6f35, 0x4484, 0x29e8, 0x54f0, 0x2a04, 0xcc06, 0xd6d5, 0xe253, 
+0xc387, 0x09da, 0xff4a, 0xebc6, 0x4eb3, 0x2edb, 0xcfcc, 0x0b9a, 0x3d1b, 0xdc1f, 
+0xf4a1, 0x3fae, 0xeb9b, 0xe915, 0x13be, 0xcb86, 0xb940, 0x1643, 0x18ee, 0xf7d9, 
+0x4acf, 0x30df, 0xe6dc, 0x16fe, 0xf4d5, 0x9c55, 0xcc79, 0x10aa, 0xe384, 0x0496, 
+0x4c2c, 0x0504, 0xff4c, 0x2d7e, 0xd93d, 0xacb4, 0x00e4, 0xf5af, 0xc18e, 0x2289, 
+0x2a64, 0xe0a9, 0x2089, 0x21b8, 0xbaf3, 0xdd89, 0x1ea4, 0xd2e4, 0xe648, 0x37ea, 
+0xec35, 0xe993, 0x35d6, 0xed2e, 0xbadd, 0x15b4, 0x0a9d, 0xc841, 0x1a7c, 0x191c, 
+0xcaef, 0x0f4e, 0x1fff, 0xbfae, 0xe155, 0x3460, 0xeb55, 0xe0b6, 0x3048, 0xf2f2, 
+0xddca, 0x235a, 0xee7f, 0xb7cc, 0x15dd, 0x2097, 0xce52, 0x180f, 0x2dcf, 0xd499, 
+0x0857, 0x29b8, 0xc4c2, 0xd000, 0x28ff, 0xe652, 0xde94, 0x43c5, 0x05e6, 0xe425, 
+0x356a, 0xfee7, 0xb2c1, 0x0914, 0x1584, 0xbe7b, 0x0e5a, 0x368a, 0xe276, 0x1274, 
+0x3391, 0xd008, 0xd357, 0x26c2, 0xec06, 0xdd61, 0x39e2, 0x0868, 0xe6f9, 0x3207, 
+0x091c, 0xbc0e, 0x0582, 0x1f6d, 0xd133, 0x1cab, 0x4d57, 0xeb81, 0x02e3, 0x3712, 
+0xde41, 0xc71f, 0x212b, 0xfb67, 0xe7a1, 0x504a, 0x23ac, 0xedd8, 0x3eb6, 0x157e, 
+0xad36, 0xfc30, 0x2995, 0xcb86, 0x10c5, 0x529b, 0xf7a7, 0x15fe, 0x4546, 0xdc21, 
+0xcaba, 0x26eb, 0xe984, 0xd493, 0x4c8e, 0x16e6, 0xe56c, 0x463b, 0x1cf9, 0xb4a9, 
+0xfd71, 0x24ab, 0xc8a4, 0x09c8, 0x41c1, 0xe4ff, 0x0a9c, 0x3d28, 0xd226, 0xc16f, 
+0x2d0a, 0xf732, 0xcb2f, 0x42b2, 0x1d8f, 0xd5f3, 0x2c26, 0x1649, 0xa7c7, 0xed21, 
+0x286f, 0xc688, 0x04e2, 0x51dd, 0xe73b, 0x0013, 0x46f0, 0xd1e8, 0xab29, 0x260f, 
+0xf7aa, 0xbdee, 0x402d, 0x25c0, 0xda8b, 0x3989, 0x21df, 0xa95c, 0xf0ed, 0x290b, 
+0xbd3d, 0xfb44, 0x4eba, 0xe63a, 0xfecd, 0x4a1d, 0xe177, 0xbc6f, 0x2af3, 0xfdf2, 
+0xc4cf, 0x3b3d, 0x1ebb, 0xd4a0, 0x319d, 0x221e, 0xaf94, 0xf1b0, 0x3313, 0xcaf9, 
+0xf7f2, 0x4fd1, 0xeb5b, 0xf54e, 0x3faa, 0xd925, 0xb016, 0x2624, 0x012e, 0xc2f3, 
+0x3e16, 0x255d, 0xce61, 0x2b67, 0x1e8d, 0xa020, 0xe075, 0x2e2f, 0xc930, 0xf3f3, 
+0x4f96, 0xe6da, 0xef8a, 0x43fb, 0xdd85, 0xab7b, 0x2022, 0xfe5f, 0xba39, 0x346d, 
+0x27b4, 0xd20a, 0x2bfd, 0x2882, 0xae6f, 0xe3d3, 0x2b38, 0xc9c6, 0xef8e, 0x49d8, 
+0xeade, 0xf2c2, 0x46de, 0xe8ca, 0xb2fe, 0x208e, 0x0855, 0xc5c4, 0x338e, 0x29eb, 
+0xd645, 0x257e, 0x260c, 0xb7e2, 0xebef, 0x3365, 0xd6d8, 0xf811, 0x518d, 0xf457, 
+0xf134, 0x4558, 0xf41a, 0xb66e, 0x1a28, 0x0bd1, 0xcaa3, 0x31f9, 0x3045, 0xe17a, 
+0x2ad4, 0x2f2d, 0xbd2b, 0xe13e, 0x2cfe, 0xd3bd, 0xea52, 0x4fb4, 0x020e, 0xf40a, 
+0x4278, 0xf8f7, 0xb45e, 0x127c, 0x0af1, 0xc2d1, 0x2b03, 0x36f1, 0xdd10, 0x20d2, 
+0x35ec, 0xc074, 0xd7bd, 0x2eef, 0xd9db, 0xe543, 0x52c9, 0x05cf, 0xec53, 0x41bb, 
+0xfa65, 0xaf2a, 0x15c6, 0x1274, 0xbe0e, 0x2c97, 0x448e, 0xdd59, 0x1c74, 0x3817, 
+0xbb2b, 0xcf5b, 0x2f9a, 0xdc0c, 0xe4f0, 0x586d, 0x096c, 0xe913, 0x42c2, 0xf921, 
+0xa4d2, 0x0f94, 0x157d, 0xbee7, 0x2a97, 0x46c2, 0xe0bf, 0x1d38, 0x3786, 0xb9af, 
+0xcb2a, 0x2dd9, 0xd952, 0xdcbe, 0x5596, 0x0bab, 0xea4b, 0x4531, 0xffe2, 0xa78b, 
+0x0c61, 0x136f, 0xb532, 0x2148, 0x44ae, 0xd96e, 0x195c, 0x392c, 0xb898, 0xc8e9, 
+0x3388, 0xef92, 0xcd85, 0x0ef6, 0xf796, 0x13e1, 0x506a, 0x028d, 0xcd42, 0x14f5, 
+0xf58e, 0x9d81, 0xe29f, 0xfb3c, 0xcd66, 0x1bbf, 0x6302, 0x30d7, 0x14e4, 0x29bc, 
+0xdf14, 0xae5e, 0xce80, 0xabdc, 0xca7e, 0x3503, 0x1ee4, 0xf688, 0x5aac, 0x62a7, 
+0xd87d, 0xd4d5, 0xfc76, 0xb6dd, 0xa5b5, 0xf6e7, 0x0b99, 0x0665, 0x381b, 0x1f19, 
+0x1206, 0x2ed5, 0xebdd, 0xb56d, 0xde2e, 0xf87e, 0xce4d, 0xed47, 0x2439, 0x121c, 
+0x1266, 0x1483, 0x16c8, 0x10fd, 0x0650, 0xd754, 0xbaff, 0xf7e2, 0xda39, 0xcd45, 
+0x2986, 0x40dc, 0x0e53, 0x182a, 0x50a1, 0x01de, 0xcb6e, 0xdc62, 0xb781, 0xcfc4, 
+0xee54, 0xf542, 0x2240, 0x5981, 0x2c5e, 0xf8e5, 0x3e3b, 0x0d29, 0xaf98, 0xc3b7, 
+0xd787, 0xd3b1, 0xe2e2, 0x19c0, 0x28df, 0x3943, 0x2fe3, 0x081e, 0x2922, 0x0f78, 
+0xc962, 0xb6cc, 0xd979, 0xe6a6, 0xd121, 0x07cf, 0x3500, 0x3ad0, 0x2c2a, 0x2624, 
+0x2c95, 0xfb6f, 0xd7be, 0xb61f, 0xc05e, 0xe300, 0xd931, 0x0c0c, 0x4eae, 0x4878, 
+0x15a7, 0x2a43, 0x31b1, 0xdd24, 0xc4ea, 0xbda7, 0xc680, 0xe6be, 0xf0c6, 0x13f8, 
+0x45f0, 0x4cdc, 0x09ee, 0x185b, 0x3039, 0xdd40, 0xc562, 0xd19d, 0xd51e, 0xdcc7, 
+0xfbf1, 0x1f9a, 0x3311, 0x4108, 0x10a0, 0x1d6d, 0x368a, 0xebc0, 0xbacd, 0xc61c, 
+0xe6be, 0xd8c6, 0xecc7, 0x2b4f, 0x3ad6, 0x3234, 0x16aa, 0x312b, 0x2c20, 0xe5cf, 
+0xbf0c, 0xc2d3, 0xef02, 0xde96, 0xe42b, 0x3264, 0x4f6e, 0x2b87, 0x1502, 0x434e, 
+0x2169, 0xd824, 0xcd4a, 0xcbe5, 0xe67d, 0xe8bc, 0xf5fe, 0x2bd2, 0x4fbf, 0x2b2a, 
+0x05aa, 0x4482, 0x2857, 0xcb20, 0xc28b, 0xdaa2, 0xe5a8, 0xd616, 0xfaa0, 0x2fc3, 
+0x4640, 0x2ce5, 0x0f5a, 0x3ab7, 0x1944, 0xcda3, 0xbbcb, 0xcda1, 0xe22a, 0xd491, 
+0x0143, 0x3873, 0x3fbe, 0x22bb, 0x1736, 0x3ae6, 0x0407, 0xc3a8, 0xb9c4, 0xc437, 
+0xdc67, 0xd7ba, 0x00f1, 0x3801, 0x41a0, 0x1951, 0x11c6, 0x35de, 0xf7fb, 0xbeac, 
+0xb811, 0xc658, 0xdc21, 0xd8e4, 0x060e, 0x39e5, 0x4146, 0x14d2, 0x16dd, 0x36f4, 
+0xed6d, 0xba86, 0xb9b4, 0xcb20, 0xdd7e, 0xdfe1, 0x0f15, 0x3b82, 0x3e9b, 0x1158, 
+0x1b8a, 0x323f, 0xe8e2, 0xbdfb, 0xb835, 0xd09f, 0xddf2, 0xdd36, 0x148a, 0x40d3, 
+0x3e5f, 0x13a7, 0x2794, 0x2f4a, 0xde17, 0xbd25, 0xb6e3, 0xcb99, 0xdc56, 0xe6b9, 
+0x1ce9, 0x4836, 0x40a4, 0x1189, 0x2c70, 0x2966, 0xd436, 0xb74c, 0xb722, 0xd074, 
+0xdc0f, 0xf37b, 0x2f67, 0x4c6c, 0x3aa1, 0x13df, 0x2e82, 0x1863, 0xcd4e, 0xbc3f, 
+0xbce0, 0xd9c4, 0xe1be, 0xfb8d, 0x359d, 0x4c01, 0x3625, 0x17b8, 0x32ce, 0x1032, 
+0xcc89, 0xbc30, 0xbdba, 0xe2ec, 0xe81c, 0x005e, 0x3db9, 0x512c, 0x2c97, 0x17fc, 
+0x380c, 0x06f5, 0xcdb1, 0xc0d4, 0xbe6b, 0xe241, 0xead9, 0x05a4, 0x3a27, 0x518a, 
+0x2c10, 0x187d, 0x3809, 0xfd0c, 0xc4ac, 0xbff0, 0xc939, 0xe3de, 0xe907, 0x0ded, 
+0x3e36, 0x4e75, 0x2456, 0x1759, 0x31b3, 0xf547, 0xc449, 0xba76, 0xcb7c, 0xe629, 
+0xeb17, 0x17cc, 0x43ae, 0x4970, 0x1dfb, 0x1c5c, 0x2c1b, 0xe97c, 0xc40d, 0xbedd, 
+0xd492, 0xe90c, 0xea14, 0x18aa, 0x44ec, 0x43bf, 0x15aa, 0x2421, 0x2f68, 0xe453, 
+0xc2c4, 0xbef4, 0xd4c2, 0xe5c8, 0xf22d, 0x2430, 0x475e, 0x4461, 0x187f, 0x2916, 
+0x2d8a, 0xe382, 0xc1ee, 0xc2fa, 0xe144, 0xe6ea, 0xf400, 0x30a7, 0x50eb, 0x4265, 
+0x1b39, 0x2f67, 0x2260, 0xde78, 0xc61b, 0xc3e2, 0xe4c5, 0xea6e, 0xf9b7, 0x32e4, 
+0x4b24, 0x330a, 0x1529, 0x377b, 0x1ad4, 0xd298, 0xc471, 0xc39e, 0xdfcf, 0xe493, 
+0xf83e, 0x339f, 0x5169, 0x3178, 0x0fe4, 0x3634, 0x10e7, 0xcad8, 0xc188, 0xc0cb, 
+0xd97a, 0xe36b, 0x01cf, 0x3255, 0x49ca, 0x2dc9, 0x1019, 0x33a3, 0x059a, 0xbd42, 
+0xb33f, 0xbe30, 0xd9b3, 0xdc31, 0x0338, 0x37ee, 0x44ae, 0x224f, 0x0cf2, 0x27ab, 
+0xf5dc, 0xbd67, 0xaf02, 0xbe02, 0xde1c, 0xd738, 0x02b2, 0x3eba, 0x4074, 0x174f, 
+0x1829, 0x2c82, 0xe72a, 0xbf61, 0xb6b3, 0xbe85, 0xe2b1, 0xe25f, 0x05c1, 0x4181, 
+0x4a2b, 0x1512, 0x1a96, 0x326a, 0xe3c7, 0xbc8c, 0xb7af, 0xbd6f, 0xd849, 0xe90a, 
+0x150e, 0x3ed0, 0x469e, 0x176f, 0x1b23, 0x2908, 0xdb26, 0xb2f3, 0xb1f8, 0xca6a, 
+0xdb06, 0xe6a5, 0x1fb9, 0x4383, 0x3e5d, 0x1596, 0x1e94, 0x1cb0, 0xd8cf, 0xba95, 
+0xaec4, 0xcef4, 0xe43f, 0xeaf7, 0x2443, 0x4766, 0x336a, 0x0e32, 0x27a3, 0x1356, 
+0xcd5d, 0xc150, 0xb6ba, 0xd1d8, 0xe528, 0xee84, 0x2426, 0x4adf, 0x3667, 0x10cd, 
+0x310e, 0x1388, 0xcbbb, 0xc47e, 0xbd1f, 0xd491, 0xe98e, 0x0244, 0x3289, 0x53b3, 
+0x3eb9, 0x1566, 0x3290, 0x11e3, 0xcc07, 0xc004, 0xc4fd, 0xe223, 0xed0a, 0x10ae, 
+0x3ff0, 0x5037, 0x36e6, 0x164f, 0x29a1, 0x0284, 0xcdb8, 0xbdcd, 0xc637, 0xed96, 
+0xeeb1, 0x0cd0, 0x4050, 0x49bb, 0x239a, 0x1780, 0x2eab, 0xf6b6, 0xce3d, 0xbc38, 
+0xc8a0, 0x00e6, 0xefad, 0x0021, 0x33f9, 0x3ae3, 0x3cd3, 0x3fb1, 0x1838, 0xd924, 
+0xd541, 0xaecf, 0xa5de, 0xf7be, 0xfc4c, 0x140b, 0x790a, 0x7937, 0x1616, 0xfecc, 
+0xe9f4, 0x93de, 0xa330, 0xc0f0, 0xcf7e, 0x2cbc, 0x6286, 0x4ccf, 0x462d, 0x450f, 
+0xe74f, 0xa99c, 0xd6b1, 0xc669, 0xba55, 0xfefe, 0x25a9, 0x3149, 0x43ec, 0x1f26, 
+0xede2, 0x0adf, 0xff6f, 0xbdad, 0xf121, 0x2c23, 0xf18d, 0xf0cc, 0x2718, 0xe6c1, 
+0xbbba, 0x1d92, 0x14c7, 0xde85, 0x3e57, 0x31f4, 0xe295, 0x0f8d, 0xf992, 0xa267, 
+0xd117, 0x1bec, 0xe179, 0x07c9, 0x5af9, 0x03a7, 0x02e9, 0x3014, 0xd04d, 0xa794, 
+0xfb7e, 0xf282, 0xc715, 0x36b9, 0x3764, 0xea25, 0x307a, 0x1cb0, 0xb2ec, 0xd406, 
+0x117c, 0xd2a9, 0xea54, 0x43e9, 0xfc21, 0xfaa3, 0x3fc1, 0xeafd, 0xb060, 0x0b4c, 
+0x0ff9, 0xc461, 0x1954, 0x3040, 0xd984, 0x1601, 0x2825, 0xbc3f, 0xdbce, 0x3875, 
+0xe248, 0xdd2e, 0x4e02, 0xfd2c, 0xd91c, 0x3749, 0xf658, 0xaa69, 0x13e1, 0x2498, 
+0xcc14, 0x21ba, 0x3a26, 0xdb15, 0x1623, 0x2c3d, 0xba40, 0xcd2e, 0x2cf5, 0xe4ae, 
+0xe186, 0x52e0, 0x0d31, 0xe5cf, 0x3778, 0xffc1, 0xac3d, 0xfddf, 0x1bac, 0xc8ec, 
+0x14d4, 0x4029, 0xe79d, 0x15d6, 0x3792, 0xcc34, 0xca86, 0x3225, 0xf50a, 0xcf32, 
+0x3e28, 0x12b9, 0xe181, 0x364b, 0x1002, 0xb4c9, 0x031c, 0x26d6, 0xd0a9, 0x1e6a, 
+0x443a, 0xd350, 0x08d3, 0x41ed, 0xc7a2, 0xb99c, 0x2fe3, 0xff21, 0xdc75, 0x4839, 
+0x19bb, 0xe84c, 0x32f7, 0x01b7, 0xaddf, 0xfef1, 0x1e1c, 0xcae8, 0x16e4, 0x4bda, 
+0xecbb, 0x0caf, 0x3f24, 0xe0dc, 0xc4bc, 0x18da, 0xf67e, 0xdd77, 0x3908, 0x10f4, 
+0xed5b, 0x4369, 0x1b8d, 0xb980, 0x0190, 0x297a, 0xc6e3, 0x009e, 0x4462, 0xea33, 
+0x0155, 0x3cba, 0xe27f, 0xcbef, 0x2bda, 0xf9a0, 0xd4bc, 0x439f, 0x150b, 0xd559, 
+0x344d, 0x1a5b, 0xaf57, 0xf935, 0x2de0, 0xcf9a, 0x0979, 0x49a9, 0xea95, 0x051a, 
+0x3cdb, 0xd6df, 0xbc25, 0x2174, 0xf28b, 0xc89b, 0x4222, 0x2645, 0xdfc1, 0x315e, 
+0x201e, 0xb2fc, 0xe3d4, 0x181b, 0xc442, 0xfd80, 0x4a43, 0xed31, 0xff1f, 0x4381, 
+0xdf06, 0xb4dc, 0x1fd7, 0xf6dc, 0xbffe, 0x3a30, 0x24f3, 0xd6d6, 0x297b, 0x1c5d, 
+0xaf37, 0xedb8, 0x286b, 0xc61d, 0xfe95, 0x515b, 0xe559, 0xf3c9, 0x4090, 0xd830, 
+0xae85, 0x1db8, 0xf7ec, 0xc607, 0x3f9f, 0x264d, 0xd94a, 0x2a8a, 0x1485, 0xa002, 
+0xdeaf, 0x235b, 0xc381, 0xfa49, 0x5796, 0xefa6, 0xf6b9, 0x4056, 0xd904, 0xa813, 
+0x17bf, 0xf931, 0xbf26, 0x3e31, 0x2c1d, 0xd50a, 0x2d55, 0x22b9, 0xa846, 0xdf9f, 
+0x28c5, 0xc598, 0xef6b, 0x51e5, 0xf17d, 0xfa6e, 0x46ce, 0xddcb, 0xac63, 0x1bcf, 
+0xff42, 0xc08e, 0x3b8a, 0x30ab, 0xd540, 0x2b2a, 0x2b14, 0xb01e, 0xe003, 0x2eb4, 
+0xd207, 0xf705, 0x5a04, 0xf5f1, 0xf4f2, 0x49c1, 0xe735, 0xac7d, 0x1ff2, 0x0bc1, 
+0xc150, 0x3a15, 0x3cd0, 0xdc44, 0x29ee, 0x3079, 0xb504, 0xdcbb, 0x2cd7, 0xcfca, 
+0xeed8, 0x5c84, 0xfe19, 0xf346, 0x4ec0, 0xf24e, 0xa9a2, 0x1b01, 0x120e, 0xbf61, 
+0x31bd, 0x3ed0, 0xdca8, 0x27d7, 0x3553, 0xb79f, 0xddc0, 0x376a, 0xd743, 0xea45, 
+0x592a, 0xf9f4, 0xe94c, 0x4a1d, 0xf552, 0xa9a1, 0x19d2, 0x14c6, 0xbc9b, 0x2b11, 
+0x3913, 0xd2dc, 0x1f02, 0x340a, 0xb6b6, 0xd426, 0x33f8, 0xd9a8, 0xdc7f, 0x5123, 
+0xfd3a, 0xde46, 0x40ce, 0xfa10, 0xa997, 0x14a8, 0x1bb4, 0xc08d, 0x2376, 0x3d24, 
+0xd503, 0x166b, 0x35f1, 0xbc86, 0xd0fa, 0x36e8, 0xf1a1, 0xd628, 0x16ed, 0xf145, 
+0x0d1a, 0x55e9, 0x09b3, 0xd0ea, 0x189e, 0xfae5, 0xa1d9, 0xe581, 0xfd1f, 0xd241, 
+0x1ffa, 0x5b9f, 0x2d05, 0x1f94, 0x316b, 0xe330, 0xba22, 0xd9ab, 0xb354, 0xcfaa, 
+0x3059, 0x1e34, 0xfcfc, 0x565e, 0x623a, 0xe738, 0xe027, 0xfe57, 0xc099, 0xb327, 
+0xf470, 0x0c3c, 0x0e38, 0x38fd, 0x1a11, 0x0892, 0x3339, 0xf5c3, 0xbab1, 0xe297, 
+0xf843, 0xce95, 0xe620, 0x1c2a, 0x09ee, 0x1283, 0x1b02, 0x1187, 0x188b, 0x0e86, 
+0xd87e, 0xb652, 0xeca9, 0xdb2d, 0xc7dd, 0x1fe5, 0x379e, 0x0fd2, 0x1c45, 0x4c2e, 
+0x1316, 0xd85d, 0xdfc8, 0xb6df, 0xc87f, 0xeb35, 0xe54a, 0x1628, 0x57e4, 0x3419, 
+0xff6c, 0x4156, 0x1c74, 0xb5b4, 0xca06, 0xd49b, 0xc6db, 0xdff3, 0x0f42, 0x1c9b, 
+0x38c2, 0x3cc3, 0x059b, 0x2a27, 0x2699, 0xce85, 0xb4f9, 0xd393, 0xdea9, 0xcdb3, 
+0x03e7, 0x3281, 0x3d54, 0x3c61, 0x2583, 0x2ce2, 0x0c86, 0xdb4d, 0xb3bf, 0xbb9c, 
+0xe353, 0xd3fa, 0x034f, 0x4cdb, 0x4ab4, 0x21fa, 0x2b59, 0x391f, 0xeb27, 0xc6cb, 
+0xb8e4, 0xba9a, 0xe811, 0xec0e, 0x0c31, 0x4bdb, 0x5772, 0x163d, 0x1a19, 0x3f4d, 
+0xe9e8, 0xc3a2, 0xce2a, 0xc788, 0xd9f4, 0xf83e, 0x1bc6, 0x3ce8, 0x5548, 0x1db0, 
+0x1a55, 0x4521, 0xf1e2, 0xb3ab, 0xc2fd, 0xdbe1, 0xd800, 0xed52, 0x2c30, 0x402d, 
+0x430b, 0x23ff, 0x260b, 0x2f76, 0xea68, 0xb3d7, 0xb28e, 0xe14a, 0xdd06, 0xe066, 
+0x33b3, 0x51ec, 0x33b4, 0x1667, 0x3052, 0x1b77, 0xd41e, 0xc1bd, 0xb6c4, 0xd7a4, 
+0xeae0, 0xe9c9, 0x2119, 0x50ee, 0x3348, 0x0504, 0x35a7, 0x2224, 0xc555, 0xbad4, 
+0xc362, 0xd0c4, 0xdade, 0xf6c3, 0x247a, 0x463c, 0x3726, 0x098e, 0x2ae9, 0x1a2f, 
+0xc9d7, 0xb0fe, 0xc012, 0xdaac, 0xd5e1, 0xf9b0, 0x351f, 0x47da, 0x2cc6, 0x10fb, 
+0x2d9f, 0x068e, 0xc5e3, 0xb7fe, 0xc297, 0xe2b0, 0xe422, 0x01db, 0x36ef, 0x48cb, 
+0x23b7, 0x10de, 0x3507, 0x0307, 0xc7bf, 0xbff3, 0xc77c, 0xe128, 0xe56e, 0x0857, 
+0x3924, 0x4aaf, 0x2249, 0x103e, 0x31eb, 0xfa7b, 0xc42a, 0xbff2, 0xca69, 0xdf50, 
+0xe715, 0x1070, 0x37d6, 0x4303, 0x1eac, 0x16ba, 0x3184, 0xf739, 0xc4f5, 0xba46, 
+0xcd7e, 0xe4d0, 0xe592, 0x10ee, 0x3d09, 0x4044, 0x17ce, 0x2016, 0x2f3f, 0xe9e5, 
+0xc633, 0xbad5, 0xc6f9, 0xdeac, 0xe624, 0x121c, 0x413b, 0x4301, 0x1783, 0x29fd, 
+0x2ba5, 0xdaa4, 0xbe2e, 0xbb8e, 0xcbc8, 0xdde4, 0xf1e9, 0x21db, 0x439b, 0x4190, 
+0x172e, 0x27a0, 0x21f8, 0xd636, 0xbad8, 0xb8bf, 0xd096, 0xdf64, 0xf8a8, 0x2b93, 
+0x443b, 0x3b96, 0x185e, 0x26da, 0x10a6, 0xd167, 0xbdb5, 0xb977, 0xdb3a, 0xe708, 
+0xfa86, 0x2f52, 0x4806, 0x3265, 0x17a3, 0x31bc, 0x0e05, 0xd510, 0xc461, 0xbd66, 
+0xe192, 0xed77, 0x0119, 0x32ba, 0x50ed, 0x31ea, 0x16d3, 0x36ec, 0x0732, 0xcfc7, 
+0xc460, 0xc184, 0xdf83, 0xea58, 0x0626, 0x3550, 0x5246, 0x2def, 0x16cd, 0x3427, 
+0xfd3a, 0xc953, 0xbd3c, 0xc544, 0xe4ec, 0xf153, 0x166b, 0x3e10, 0x4e6d, 0x26d4, 
+0x1968, 0x2f16, 0xf428, 0xcae0, 0xbedd, 0xccf8, 0xe956, 0xefa2, 0x1950, 0x4297, 
+0x4a75, 0x1de5, 0x1955, 0x29ba, 0xeb91, 0xc61c, 0xbb12, 0xce33, 0xe7ce, 0xefe6, 
+0x18c6, 0x3e32, 0x43c5, 0x1922, 0x1cc3, 0x20fd, 0xde2b, 0xbf55, 0xb70b, 0xd16f, 
+0xe788, 0xef8e, 0x20c4, 0x4654, 0x3d93, 0x11d7, 0x1d2e, 0x15c5, 0xd810, 0xc122, 
+0xb7df, 0xd5bd, 0xe934, 0xf5a0, 0x24cd, 0x4321, 0x356b, 0x10be, 0x2522, 0x0e25, 
+0xcdbf, 0xc120, 0xbd1c, 0xd9ef, 0xe950, 0xf8ec, 0x2940, 0x4a04, 0x31e9, 0x09bb, 
+0x2935, 0x0de2, 0xcd32, 0xc3e0, 0xc0ad, 0xd96f, 0xebee, 0x0617, 0x2f65, 0x4a9d, 
+0x32b8, 0x104d, 0x2b20, 0x042c, 0xc6fe, 0xc0fc, 0xccb1, 0xe4c6, 0xe7e5, 0x0a2f, 
+0x3646, 0x44a9, 0x27ed, 0x0f84, 0x2482, 0xf9ba, 0xc9c9, 0xbc46, 0xc6f1, 0xe7c9, 
+0xe7b4, 0x0935, 0x38ab, 0x3dfb, 0x17f4, 0x1202, 0x2366, 0xe8cf, 0xc894, 0xc02b, 
+0xc4e7, 0xe682, 0xe9b4, 0x07dc, 0x39bc, 0x4323, 0x1255, 0x11a3, 0x2383, 0xde38, 
+0xc201, 0xc28c, 0xc797, 0xe30e, 0xf319, 0x11aa, 0x3329, 0x3e07, 0x11d9, 0x1242, 
+0x2173, 0xdd6c, 0xbc12, 0xbfc4, 0xd3cc, 0xe301, 0xf14f, 0x1ed7, 0x3c0b, 0x3bbe, 
+0x150a, 0x16d9, 0x1504, 0xded6, 0xc844, 0xc0c3, 0xdedd, 0xf0d7, 0xf666, 0x25d8, 
+0x4424, 0x33d0, 0x130e, 0x2876, 0x1370, 0xd7a6, 0xcf17, 0xc604, 0xdfb9, 0xf3d2, 
+0xfde9, 0x29bc, 0x4a3a, 0x328f, 0x0b59, 0x293f, 0x0f84, 0xd398, 0xd04b, 0xc938, 
+0xdc96, 0xf077, 0x05ff, 0x2a1d, 0x46e9, 0x33e3, 0x0e06, 0x27af, 0x084b, 0xcbee, 
+0xc5ed, 0xce50, 0xe4ec, 0xee95, 0x0fc4, 0x3481, 0x4291, 0x2ab8, 0x0ee7, 0x217a, 
+0xfbca, 0xd072, 0xc584, 0xcdc2, 0xeeae, 0xf284, 0x0beb, 0x2a91, 0x499c, 0x4ab9, 
+0x1751, 0xfb4e, 0xdff4, 0xc548, 0xaa11, 0xcb25, 0x079b, 0x0c5f, 0x3e98, 0x6247, 
+0x3e07, 0x0f43, 0xf0e4, 0xca5f, 0xb34f, 0xd401, 0xc893, 0xf3d1, 0x4c26, 0x308b, 
+0x22b3, 0x41c0, 0x2279, 0xdc8b, 0xdff8, 0xe310, 0xcceb, 0x027f, 0xf615, 0xee06, 
+0x3db0, 0x2392, 0xe01d, 0x1366, 0x3415, 0xe34c, 0xf6fc, 0x29c3, 0xe8c4, 0xee7a, 
+0x0fa2, 0xddee, 0xd84b, 0x1d1b, 0x1722, 0xff58, 0x3ac2, 0x1f74, 0xf03f, 0x1870, 
+0xfcd6, 0xbff1, 0xe68f, 0x1180, 0xed1f, 0x0a12, 0x3895, 0x07ec, 0x0a31, 0x24b3, 
+0xe648, 0xc9fc, 0x0734, 0xf757, 0xd412, 0x1f4f, 0x1e8b, 0xee37, 0x1f0e, 0x1be3, 
+0xd43a, 0xefa3, 0x194b, 0xddce, 0xf237, 0x287d, 0xeedf, 0xf88e, 0x2f7f, 0xf704, 
+0xd874, 0x1c88, 0x0972, 0xd8d5, 0x1702, 0x0f28, 0xe05e, 0x15f4, 0x1a7c, 0xd9ff, 
+0xf6eb, 0x29b0, 0xf002, 0xf068, 0x23d5, 0xf4b8, 0xf046, 0x1d23, 0xf157, 0xd110, 
+0x1519, 0x14cc, 0xdede, 0x142d, 0x1a12, 0xe515, 0x0b1c, 0x1636, 0xd4d5, 0xe629, 
+0x1cf8, 0xe7c6, 0xea58, 0x2b1f, 0xfc3e, 0xeeea, 0x236a, 0xfb53, 0xcfca, 0x089d, 
+0x0488, 0xd160, 0x0a55, 0x141d, 0xe5cd, 0x107d, 0x186d, 0xd8c8, 0xeaf7, 0x1870, 
+0xe826, 0xe955, 0x18d7, 0xf4b0, 0xf2f4, 0x198f, 0xf637, 0xd898, 0x0a60, 0x099d, 
+0xe121, 0x112c, 0x19f0, 0xe9f0, 0x0257, 0x16f3, 0xea68, 0xe825, 0x11db, 0xf73d, 
+0xf784, 0x22c2, 0x01a7, 0xfa94, 0x2329, 0xff98, 0xd3ac, 0x066b, 0x0f20, 0xe092, 
+0x0cc3, 0x1ddc, 0xf6f5, 0x1320, 0x1de5, 0xe877, 0xf111, 0x167b, 0xeabe, 0xf59b, 
+0x2682, 0xf99e, 0xf763, 0x2689, 0x0359, 0xdfbd, 0x0e98, 0x0da2, 0xe78d, 0x0e20, 
+0x0ddb, 0xeff0, 0x11e2, 0x1312, 0xe459, 0xf4b0, 0x1704, 0xee92, 0xf4ab, 0x1ec2, 
+0xfc20, 0xf450, 0x169f, 0xfcad, 0xdbac, 0x0468, 0x089e, 0xe794, 0x0e53, 0x118e, 
+0xefe9, 0x0e4a, 0x169a, 0xe1da, 0xebc0, 0x15eb, 0xefcb, 0xf2ee, 0x1beb, 0xfce8, 
+0xfa9c, 0x1c17, 0xffdb, 0xe6b1, 0x0fc5, 0x065c, 0xe6be, 0x10a6, 0x0c31, 0xefee, 
+0x1306, 0x13f9, 0xe94c, 0xfe45, 0x19f0, 0xf32a, 0xfe85, 0x1905, 0xf62a, 0xfd6b, 
+0x1747, 0xf729, 0xeaea, 0x11d1, 0x0593, 0xf301, 0x1786, 0x0b5f, 0xf124, 0x0940, 
+0x0668, 0xe6ec, 0xfe96, 0x1506, 0xf474, 0x04f3, 0x1923, 0xf708, 0xfe00, 0x1197, 
+0xf0a5, 0xe784, 0x0dcb, 0xff73, 0xf084, 0x1476, 0x091e, 0xf640, 0x0af0, 0x0286, 
+0xe773, 0xfd6b, 0x0efa, 0xf175, 0xf89a, 0x07af, 0xf9a6, 0x0516, 0x128d, 0x00ff, 
+0xfb4e, 0x0ed0, 0xfc70, 0xe60e, 0xf53d, 0xf46c, 0xf494, 0x0bff, 0x1551, 0x06e1, 
+0x0c9f, 0x0f55, 0xefab, 0xed70, 0xf731, 0xf0fe, 0xfd13, 0x0d56, 0x068f, 0x0174, 
+0x0fee, 0xffe4, 0xea15, 0xfb9a, 0xffd4, 0xf166, 0xfe33, 0x0e6f, 0xfeb8, 0x0068, 
+0x0cad, 0xf543, 0xef47, 0x0118, 0xf5be, 0xeb4f, 0x04dc, 0x09b3, 0xf586, 0x0081, 
+0x05bb, 0xf123, 0xf60d, 0x03d9, 0xf8d9, 0xfe28, 0x0dac, 0xfb79, 0xf27c, 0xfe7f, 
+0xf2c5, 0xeeb0, 0x04d2, 0x030d, 0xfb07, 0x0e9e, 0x0d11, 0xf686, 0xfc94, 0xffbf, 
+0xed59, 0xf589, 0x05ab, 0xfa48, 0xffa7, 0x10c1, 0x014b, 0xfa25, 0x09af, 0xfdfc, 
+0xf0ef, 0x03b9, 0x0400, 0xf635, 0x063f, 0x0b0b, 0xf9ca, 0x03dd, 0x0d8d, 0xfce6, 
+0x00df, 0x0f4b, 0x024e, 0xff59, 0x0dc5, 0x0159, 0xf654, 0x067a, 0x0580, 0xfe5c, 
+0x0e74, 0x0f97, 0x0220, 0x099e, 0x09f1, 0xf6cc, 0xfa19, 0x04a0, 0xfb69, 0x0199, 
+0x10a2, 0x0726, 0x02f2, 0x0c0d, 0x00c5, 0xf7e4, 0x056d, 0x020c, 0xf921, 0x0880, 
+0x0a05, 0xfc9b, 0x05b1, 0x0ba8, 0xfd73, 0x0126, 0x0afa, 0xfedb, 0xfe8e, 0x0754, 
+0xff08, 0x010e, 0x0a12, 0xff2a, 0xfc7a, 0x0965, 0x0306, 0xfbf9, 0x0735, 0x05c2, 
+0xfdbe, 0x020b, 0x01d4, 0xfd23, 0x035d, 0x0690, 0x0006, 0x0536, 0x0b42, 0x02fd, 
+0x0048, 0x04d9, 0xffac, 0xfb96, 0x0522, 0x06ea, 0x01a3, 0x0640, 0x0721, 0x02e7, 
+0x04ad, 0x0494, 0xfe70, 0x009e, 0x0380, 0xfafb, 0xfecf, 0x0890, 0x0224, 0xffd6, 
+0x0613, 0x005f, 0xfada, 0x0129, 0xfdf3, 0xf949, 0x014d, 0x006d, 0xfa91, 0x0029, 
+0x002c, 0xf7d8, 0xff02, 0x0615, 0xfbc4, 0xfc2b, 0x035b, 0xfb89, 0xf601, 0xfa4f, 
+0xfabf, 0xfbd9, 0x00a3, 0xfe0a, 0xfbd4, 0x0009, 0xfe8b, 0xf866, 0xf96c, 0xfcbd, 
+0xf750, 0xf6d5, 0xfee5, 0xfea6, 0xfc47, 0x00a5, 0x013f, 0xfaa4, 0xf910, 0xf98a, 
+0xf6f0, 0xfa55, 0xfc01, 0xfac1, 0xff53, 0x001d, 0xfac1, 0xfb9d, 0xfef2, 0xf9c9, 
+0xf9ce, 0xff10, 0xfabf, 0xfab8, 0xfe59, 0xfa05, 0xfa90, 0x00a1, 0xff54, 0xfdbe, 
+0x0243, 0xff6b, 0xfac6, 0xfde2, 0xfc78, 0xf927, 0xfc12, 0xfe2f, 0xfc8a, 0xfe15, 
+0x00a9, 0xff55, 0x0011, 0x0049, 0xfbfb, 0xfa18, 0xfd23, 0xfbc7, 0xf7ac, 0xfd25, 
+0x019e, 0x0030, 0x02a9, 0x0344, 0x0053, 0x0036, 0x003f, 0xfc42, 0xfd77, 0x047f, 
+0x022f, 0xffd5, 0x0747, 0x065b, 0xffcd, 0x058c, 0x0801, 0x00b8, 0x029f, 0x057c, 
+0x0228, 0x02a9, 0x03ae, 0x0336, 0x052e, 0x06d3, 0x0355, 0x0367, 0x097b, 0x0767, 
+0x040b, 0x0708, 0x062b, 0x00f3, 0x010e, 0x0624, 0x0661, 0x0641, 0x0870, 0x08cf, 
+0x095c, 0x0672, 0x0114, 0x0064, 0x0450, 0x0372, 0x00f0, 0x074e, 0x0927, 0x0375, 
+0x04d0, 0x06fa, 0x0278, 0x00e0, 0x023e, 0x0105, 0x0392, 0x0478, 0x01dc, 0x0633, 
+0x06ad, 0x0137, 0x035b, 0x071e, 0x039a, 0x00b9, 0x0238, 0x0257, 0x03b3, 0x032c, 
+0x00b5, 0x062b, 0x0920, 0x0425, 0x05d7, 0x09b0, 0x0457, 0x011e, 0x02cb, 0x0112, 
+0x01e7, 0x03e0, 0x04a0, 0x09f0, 0x0993, 0x025d, 0x03ab, 0x06f0, 0x01ce, 0xffa9, 
+0x0343, 0x03bf, 0x02bc, 0x0192, 0x0175, 0x03f8, 0x025f, 0xfe13, 0xffaf, 0x037b, 
+0x017f, 0xff0d, 0x010c, 0x01cc, 0xff47, 0xfda7, 0xff79, 0xffc8, 0xfd08, 0xfdcd, 
+0x01e5, 0x03c0, 0x00fa, 0xfdf8, 0xfdb9, 0xff87, 0xff9b, 0xfbe2, 0xfeae, 0x0380, 
+0x0014, 0xfe6f, 0x0115, 0x0048, 0xfe1d, 0xff3b, 0xff7b, 0xff0a, 0x0012, 0xfed0, 
+0xfed6, 0xffe0, 0xfcbf, 0xfbdb, 0x005d, 0xffb1, 0xf9ae, 0xfb2b, 0x0004, 0xff44, 
+0xfc6c, 0xfb62, 0xfdf8, 0xff0d, 0xfbbb, 0xfae7, 0xfd8a, 0xfd70, 0xfaee, 0xfbe3, 
+0xfdf3, 0xfc89, 0xfa9a, 0xfb6e, 0xfd82, 0xfcb8, 0xfaa3, 0xfc2a, 0xfeb9, 0xfc5c, 
+0xf8a1, 0xfb85, 0x000c, 0xfee7, 0xfbc5, 0xfc1f, 0xfee8, 0xfdac, 0xfae0, 0xfc8b, 
+0xfef5, 0xfebd, 0xfdf5, 0xfec1, 0x0023, 0xff0f, 0xfc4a, 0xfdd7, 0x00f5, 0xfea6, 
+0xfd0c, 0x002f, 0x0087, 0xfc77, 0xfc93, 0x0024, 0x013b, 0x00dc, 0xfdb0, 0xfcbd, 
+0x0060, 0xfed8, 0xfc65, 0xfff5, 0x0160, 0xfef8, 0x0045, 0x0243, 0x0065, 0xfff6, 
+0x0124, 0x00f9, 0x00f5, 0x00ae, 0xff8e, 0x00df, 0x02e1, 0xffa3, 0xfea2, 0x0390, 
+0x035d, 0xff35, 0xff1f, 0x009b, 0x0048, 0xffed, 0x0005, 0xfff7, 0x0019, 0xff23, 
+0xfe36, 0xff91, 0x0112, 0x0088, 0xfff6, 0x00fa, 0x00a3, 0xfe18, 0xfe82, 0x01b6, 
+0x00ae, 0xfead, 0x018f, 0x02ef, 0x0126, 0x002b, 0xffb6, 0x01e3, 0x0382, 0x00b0, 
+0x00bd, 0x0402, 0x024e, 0x0002, 0x02e3, 0x0327, 0x00b6, 0x01cf, 0x02ca, 0x0250, 
+0x0280, 0x01bd, 0x021d, 0x04f6, 0x0340, 0xfee9, 0x0095, 0x0305, 0x00bc, 0x012c, 
+0x04fc, 0x0469, 0x0257, 0x027e, 0x0242, 0x01ad, 0x014b, 0x00c3, 0x0147, 0x037a, 
+0x036a, 0x00b5, 0x0068, 0x0121, 0xff9a, 0xfec8, 0x0143, 0x0151, 0xfd18, 0xfced, 
+0xffbd, 0x0066, 0x007d, 0xff3b, 0xfdd4, 0xfe9a, 0xff0d, 0xfdc1, 0xfe33, 0xffd7, 
+0xfd45, 0xfbe9, 0xffc6, 0xff2d, 0xfb3e, 0xfd69, 0x0057, 0xff59, 0xffc4, 0x00ad, 
+0x0017, 0xffc4, 0xfde4, 0xfc22, 0xfe08, 0x004b, 0xffd4, 0x0028, 0x0265, 0x00fa, 
+0xfdc5, 0xfe0b, 0xff0e, 0xfe78, 0xfdca, 0xfe74, 0xff9b, 0x005c, 0x0106, 0x00eb, 
+0x015c, 0x01a8, 0xff52, 0xfee2, 0x00ee, 0xffbe, 0xfec8, 0x010d, 0x01ab, 0x00d9, 
+0x0106, 0x010d, 0x00e8, 0x0118, 0x00e8, 0x012b, 0x02b4, 0x0211, 0xff7a, 0xff8e, 
+0x0115, 0x0100, 0x00de, 0x02dd, 0x0379, 0x00f9, 0xffd1, 0x0018, 0xfff6, 0xfffa, 
+0x000c, 0xfff1, 0x0004, 0x0012, 0xffc4, 0x009c, 0x010c, 0xfffb, 0xffe4, 0x001a, 
+0xfff2, 0xfffc, 0x0012, 0xffe2, 0x0015, 0x015a, 0x0257, 0x01c9, 0x004d, 0xfff9, 
+0xffdd, 0x0059, 0x019b, 0x004f, 0x0095, 0x030f, 0x0191, 0xff96, 0x015d, 0x0296, 
+0x01ee, 0x0205, 0x01f5, 0x0220, 0x0303, 0x0276, 0x01b6, 0x02a2, 0x02f4, 0x01f9, 
+0x0209, 0x01e3, 0x0073, 0x00ad, 0x0219, 0x0205, 0x00f2, 0x000a, 0xffc0, 0x00c9, 
+0x0105, 0xffac, 0x007c, 0x0198, 0x0051, 0xffcf, 0x001b, 0xfff4, 0x0001, 0x0002, 
+0xfffe, 0xfffb, 0x0005, 0xfffd, 0xfff3, 0x0025, 0xff14, 0xfe3b, 0xffa5, 0xfffc, 
+0xfee0, 0xff17, 0xffe8, 0x0010, 0xffec, 0x0017, 0xffe5, 0xff21, 0xfef3, 0xfef8, 
+0xff4b, 0x002c, 0xffc0, 0xfee9, 0xffc3, 0x001f, 0xff65, 0xffbc, 0x001d, 0xfff2, 
+000000, 0x0003, 0xfffc, 0xfffc, 0x000a, 0xffec, 0x0015, 0x0095, 0x002c, 0xffc9, 
+0x006a, 0x0078, 0xfff2, 0xfffb, 0x0006, 0xfffa, 0x0002, 0xfffd, 0x0004, 0xfff4, 
+0x0010, 0xfff2, 0xfff7, 0x003a, 0xfeb1, 0xfe3a, 0xfff4, 0x0020, 0xffde, 0x0015, 
+0xfff6, 000000, 0x0002, 0xfffc, 0x0001, 0xfffe, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 
+000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000 };
diff --git a/libs/iax/src/ringtone.h b/libs/iax/src/ringtone.h
new file mode 100644 (file)
index 0000000..637021d
--- /dev/null
@@ -0,0 +1,30 @@
+/* ringtone.h: Generated from frequencies 440 and 480 
+   by gensound.  200 samples  */
+static short ringtone[200] = {
+           0, 11581, 21659, 28927, 32445, 31764, 26981, 18727, 
+        8084, -3559, -14693, -23875, -29927, -32083, -30088, -24228, 
+       -15290, -4453,  6864, 17195, 25212, 29902, 30693, 27526, 
+       20856, 11585,   944, -9673, -18899, -25560, -28837, -28357, 
+       -24244, -17089, -7868,  2192, 11780, 19667, 24872, 26779, 
+       25212, 20450, 13179,  4396, -4731, -13019, -19421, -23164, 
+       -23839, -21446, -16384, -9384, -1408,  6484, 13281, 18145, 
+       20517, 20182, 17286, 12301,  5951,  -887, -7314, -12519, 
+       -15886, -17068, -16017, -12983, -8458, -3109,  2327,  7142, 
+       10750, 12757, 13007, 11585,  8793,  5095,  1044, -2800, 
+       -5951, -8053, -8921, -8560, -7141, -4967, -2421,   104, 
+        2260,  3791,  4567,  4589,  3977,  2941,  1733,   600, 
+        -257,  -722,  -772,  -481,     0,   481,   772,   722, 
+         257,  -600, -1733, -2941, -3977, -4589, -4567, -3791, 
+       -2260,  -104,  2421,  4967,  7141,  8560,  8921,  8053, 
+        5951,  2800, -1044, -5095, -8793, -11585, -13007, -12757, 
+       -10750, -7142, -2327,  3109,  8458, 12983, 16017, 17068, 
+       15886, 12519,  7314,   887, -5951, -12301, -17286, -20182, 
+       -20517, -18145, -13281, -6484,  1408,  9384, 16384, 21446, 
+       23839, 23164, 19421, 13019,  4731, -4396, -13179, -20450, 
+       -25212, -26779, -24872, -19667, -11780, -2192,  7868, 17089, 
+       24244, 28357, 28837, 25560, 18899,  9673,  -944, -11585, 
+       -20856, -27526, -30693, -29902, -25212, -17195, -6864,  4453, 
+       15290, 24228, 30088, 32083, 29927, 23875, 14693,  3559, 
+       -8084, -18727, -26981, -31764, -32445, -28927, -21659, -11581, 
+       
+};
diff --git a/libs/iax/src/winiphone.c b/libs/iax/src/winiphone.c
new file mode 100644 (file)
index 0000000..0bc3147
--- /dev/null
@@ -0,0 +1,761 @@
+/*
+ * Miniphone: A simple, command line telephone
+ *
+ * IAX Support for talking to Asterisk and other Gnophone clients
+ *
+ * Copyright (C) 1999, Linux Support Services, Inc.
+ *
+ * Mark Spencer <markster@linux-support.net>
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License
+ */
+
+/* #define     PRINTCHUCK /* enable this to indicate chucked incomming packets */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <fcntl.h>
+#include <io.h>
+#include <conio.h>
+#include <stdio.h>
+#include <errno.h>
+#include <time.h>
+#include <process.h>
+#include <windows.h>
+#include <winsock.h>
+#include <mmsystem.h>
+#include <malloc.h>
+#include "gsm.h"
+#include "iax-client.h"
+#include "frame.h"
+#include "miniphone.h"
+
+
+struct peer {
+       int time;
+       gsm gsmin;
+       gsm gsmout;
+
+       struct iax_session *session;
+       struct peer *next;
+};
+
+static struct peer *peers;
+static int answered_call = 0;
+
+/* stuff for wave audio device */
+HWAVEOUT wout;
+HWAVEIN win;
+
+typedef struct whout {
+       WAVEHDR w;
+       short   data[160];
+       struct whout *next;
+} WHOUT;
+
+WHOUT *outqueue = NULL;
+
+/* parameters for audio in */
+#define        NWHIN 8                         /* number of input buffer entries */
+/* NOTE the OUT_INTERVAL parameter *SHOULD* be more around 18 to 20 or so, since the packets should
+be spaced by 20 milliseconds. However, in practice, especially in Windoze-95, setting it that high
+caused underruns. 10 is just ever so slightly agressive, and the receiver has to chuck a packet
+every now and then. Thats about the way it should be to be happy. */
+#define        OUT_INTERVAL 10         /* number of ms to wait before sending more data to peer */
+/* parameters for audio out */
+#define        OUT_DEPTH 12            /* number of outbut buffer entries */
+#define        OUT_PAUSE_THRESHOLD 2 /* number of active entries needed to start output (for smoothing) */
+
+/* audio input buffer headers */
+WAVEHDR whin[NWHIN];
+/* audio input buffers */
+char bufin[NWHIN][320];
+
+/* initialize the sequence variables for the audio in stuff */
+unsigned int whinserial = 1,nextwhin = 1;
+
+static struct peer *find_peer(struct iax_session *);
+static void parse_args(FILE *, unsigned char *);
+void do_iax_event(FILE *);
+void call(FILE *, char *);
+void answer_call(void);
+void reject_call(void);
+static void handle_event(FILE *, struct iax_event *e, struct peer *p);
+void parse_cmd(FILE *, int, char **);
+void issue_prompt(FILE *);
+void dump_array(FILE *, char **);
+
+static char *help[] = {
+"Welcome to the miniphone telephony client, the commands are as follows:\n",
+"Help\t\t-\tDisplays this screen.",
+"Call <Number>\t-\tDials the number supplied.",
+"Answer\t\t-\tAnswers an Inbound call.",
+"Reject\t\t-\tRejects an Inbound call.",
+"Dump\t\t-\tDumps (disconnects) the current call.",
+"Dtmf <Digit>\t-\tSends specified DTMF digit.",
+"Status\t\t-\tLists the current sessions and their current status.",
+"Quit\t\t-\tShuts down the client.",
+"",
+0
+};
+
+static struct peer *most_recent_answer;
+static struct iax_session *newcall = 0;
+
+/* holder of the time, relative to startup in system ticks. See our
+gettimeofday() implementation */
+time_t startuptime;
+
+/* routine called at exit to shutdown audio I/O and close nicely.
+NOTE: If all this isnt done, the system doesnt not handle this
+cleanly and has to be rebooted. What a pile of doo doo!! */
+void killem(void)
+{
+       waveInStop(win);
+       waveInReset(win);
+       waveInClose(win); 
+       waveOutReset(wout);
+       waveOutClose(wout);
+       WSACleanup(); /* dont forget socket stuff too */
+       return;
+}
+
+/* Win-doze doenst have gettimeofday(). This sux. So, what we did is
+provide some gettimeofday-like functionality that works for our purposes.
+In the main(), we take a sample of the system tick counter (into startuptime).
+This function returns the relative time since program startup, more or less,
+which is certainly good enough for our purposes. */
+void gettimeofday(struct timeval *tv, struct timezone *tz)
+{
+       long l = startuptime + GetTickCount();
+
+       tv->tv_sec = l / 1000;
+       tv->tv_usec = (l % 1000) * 1000;
+       return;
+}
+
+
+static struct peer *find_peer(struct iax_session *session)
+{
+       struct peer *cur = peers;
+       while(cur) {
+               if (cur->session == session)
+                       return cur;
+               cur = cur->next;
+       }
+       return NULL;
+}
+
+void
+parse_args(FILE *f, unsigned char *cmd)
+{
+       static char *argv[MAXARGS];
+       unsigned char *parse = cmd;
+       int argc = 0, t = 0;
+
+       // Don't mess with anything that doesn't exist...
+       if(!*parse)
+               return;
+
+       memset(argv, 0, sizeof(argv));
+       while(*parse) {
+               if(*parse < 33 || *parse > 128) {
+                       *parse = 0, t++;
+                       if(t > MAXARG) {
+                               fprintf(f, "Warning: Argument exceeds maximum argument size, command ignored!\n");
+                               return;
+                       }
+               } else if(t || !argc) {
+                       if(argc == MAXARGS) {
+                               fprintf(f, "Warning: Command ignored, too many arguments\n");
+                               return;
+                       }
+                       argv[argc++] = parse;
+                       t = 0;
+               }
+
+               parse++;
+       }
+
+       if(argc)
+               parse_cmd(f, argc, argv);
+}
+
+/* handle all network requests, and a pending scheduled event, if any */
+void service_network(int netfd, FILE *f)
+{
+       fd_set readfd;
+       struct timeval dumbtimer;
+
+       /* set up a timer that falls-through */
+       dumbtimer.tv_sec = 0;
+       dumbtimer.tv_usec = 0;
+
+
+               for(;;) /* suck everything outa network stuff */
+               {
+                       FD_ZERO(&readfd);
+                       FD_SET(netfd, &readfd);
+                       if (select(netfd + 1, &readfd, 0, 0, &dumbtimer) > 0)
+                       {
+                               if (FD_ISSET(netfd,&readfd))
+                               {
+                                       do_iax_event(f);
+                                       (void) iax_time_to_next_event();
+                               } else break;
+                       } else break;
+               }
+               do_iax_event(f); /* do pending event if any */
+}
+
+
+int
+main(int argc, char *argv[])
+{
+       int port;
+       int netfd;
+       int c, i;
+       FILE *f;
+       char rcmd[RBUFSIZE];
+       gsm_frame fo;
+       WSADATA foop;
+       time_t  t;
+       WAVEFORMATEX wf;
+       WHOUT *wh,*wh1,*wh2;
+       unsigned long lastouttick = 0;
+
+
+
+       /* get time of day in milliseconds, offset by tick count (see our
+          gettimeofday() implementation) */
+       time(&t);
+       startuptime = ((t % 86400) * 1000) - GetTickCount();
+
+       f = stdout;
+       _dup2(fileno(stdout),fileno(stderr));
+
+       /* start up the windoze-socket layer stuff */
+       if (WSAStartup(0x0101,&foop)) {
+               fprintf(stderr,"Fatal error: Falied to startup windows sockets\n");
+               return -1;
+       }
+
+
+       /* setup the format for opening audio channels */
+       wf.wFormatTag = WAVE_FORMAT_PCM;
+       wf.nChannels = 1;
+       wf.nSamplesPerSec = 8000;
+       wf.nAvgBytesPerSec = 16000;
+       wf.nBlockAlign = 2;
+       wf.wBitsPerSample = 16;
+       wf.cbSize = 0;
+       /* open the audio out channel */
+       if (waveOutOpen(&wout,0,&wf,0,0,CALLBACK_NULL) != MMSYSERR_NOERROR)
+               {
+                       fprintf(stderr,"Fatal Error: Failed to open wave output device\n");
+                       return -1;
+               }
+       /* open the audio in channel */
+       if (waveInOpen(&win,0,&wf,0,0,CALLBACK_NULL) != MMSYSERR_NOERROR)
+               {
+                       fprintf(stderr,"Fatal Error: Failed to open wave input device\n");
+                       waveOutReset(wout);
+                       waveOutClose(wout);
+                       return -1;
+               }
+       /* activate the exit handler */
+       atexit(killem);
+       /* initialize the audio in buffer structures */
+       memset(&whin,0,sizeof(whin));
+
+       if ( (port = iax_init(0) < 0)) {
+               fprintf(stderr, "Fatal error: failed to initialize iax with port %d\n", port);
+               return -1;
+       }
+
+
+       iax_set_formats(AST_FORMAT_GSM);
+       netfd = iax_get_fd();
+
+       fprintf(f, "Text Based Telephony Client.\n\n");
+       issue_prompt(f);
+
+       /* main tight loop */
+       while(1) {
+               /* service the network stuff */
+               service_network(netfd,f);
+               if (outqueue) /* if stuff in audio output queue, free it up if its available */
+               {
+                       /* go through audio output queue */
+                       for(wh = outqueue,wh1 = wh2 = NULL,i = 0; wh != NULL; wh = wh->next)
+                       {
+                               service_network(netfd,f); /* service network here for better performance */
+                               /* if last one was removed from queue, zot it here */
+                               if (i && wh1)
+                               { 
+                                       free(wh1);
+                                       wh1 = wh2;
+                               }
+                               i = 0; /* reset "last one removed" flag */
+                               if (wh->w.dwFlags & WHDR_DONE) /* if this one is done */
+                               {
+                                       /* prepare audio header */
+                                       if ((c = waveOutUnprepareHeader(wout,&wh->w,sizeof(WAVEHDR))) != MMSYSERR_NOERROR)
+                                       { 
+                                               fprintf(stderr,"Cannot unprepare audio out header, error %d\n",c);
+                                               exit(255);
+                                       }
+                                       if (wh1 != NULL) /* if there was a last one */
+                                       {
+                                               wh1->next = wh->next;
+                                       } 
+                                       if (outqueue == wh) /* is first one, so set outqueue to next one */
+                                       {
+                                               outqueue = wh->next;
+                                       }
+                                       i = 1; /* set 'to free' flag */
+                               }
+                               wh2 = wh1;      /* save old,old wh pointer */
+                               wh1 = wh; /* save the old wh pointer */
+                       }
+               }
+               /* go through all audio in buffers, and prepare and queue ones that are currently idle */
+               for(i = 0; i < NWHIN; i++)
+               {
+                       service_network(netfd,f); /* service network stuff here for better performance */
+                       if (!(whin[i].dwFlags & WHDR_PREPARED)) /* if not prepared, do so */
+                       {
+                               /* setup this input buffer header */
+                               memset(&whin[i],0,sizeof(WAVEHDR));
+                               whin[i].lpData = bufin[i];
+                               whin[i].dwBufferLength = 320;
+                               whin[i].dwUser = whinserial++; /* set 'user data' to current serial number */
+                               /* prepare the buffer */
+                               if (waveInPrepareHeader(win,&whin[i],sizeof(WAVEHDR)))
+                               {
+                                       fprintf(stderr,"Unable to prepare header for input\n");
+                                       return -1;
+                               }
+                               /* add it to device (queue) */
+                               if (waveInAddBuffer(win,&whin[i],sizeof(WAVEHDR)))
+                               {
+                                       fprintf(stderr,"Unable to prepare header for input\n");
+                                       return -1;
+                               }
+                       }
+                       waveInStart(win); /* start it (if not already started) */
+               }
+               
+               /* if key pressed, do command stuff */
+               if(_kbhit())
+               {
+                               if ( ( fgets(&*rcmd, 256, stdin))) {
+                                       rcmd[strlen(rcmd)-1] = 0;
+                                       parse_args(f, &*rcmd);
+                               } else fprintf(f, "Fatal error: failed to read data!\n");
+
+                               issue_prompt(f);
+               }
+               /* do audio input stuff for buffers that have received data from audio in device already. Must
+                       do them in serial number order (the order in which they were originally queued). */
+               if(answered_call) /* send audio only if call answered */
+               {
+                       for(;;) /* loop until all are found */
+                       {
+                               for(i = 0; i < NWHIN; i++) /* find an available one that's the one we are looking for */
+                               {
+                                       service_network(netfd,f); /* service network here for better performance */
+                                       /* if not time to send any more, dont */
+                                       if (GetTickCount() < (lastouttick + OUT_INTERVAL))
+                                       {
+                                               i = NWHIN; /* set to value that WILL exit loop */
+                                               break;
+                                       }
+                                       if ((whin[i].dwUser == nextwhin) && (whin[i].dwFlags & WHDR_DONE)) { /* if audio is ready */
+
+                                               /* must have read exactly 320 bytes */
+                                               if (whin[i].dwBytesRecorded != whin[i].dwBufferLength)
+                                               {
+                                                       fprintf(stderr,"Short audio read, got %d bytes, expected %d bytes\n", whin[i].dwBytesRecorded,
+                                                               whin[i].dwBufferLength);
+                                                       return -1;
+                                               }
+                                               if(!most_recent_answer->gsmout)
+                                                               most_recent_answer->gsmout = gsm_create();
+
+                                               service_network(netfd,f); /* service network here for better performance */
+                                               /* encode the audio from the buffer into GSM format */
+                                               gsm_encode(most_recent_answer->gsmout, (short *) ((char *) whin[i].lpData), fo);
+                                               if(iax_send_voice(most_recent_answer->session,
+                                                       AST_FORMAT_GSM, (char *)fo, sizeof(gsm_frame)) == -1)
+                                                                       puts("Failed to send voice!"); 
+                                               lastouttick = GetTickCount(); /* save time of last output */
+
+                                               /* unprepare (free) the header */
+                                               waveInUnprepareHeader(win,&whin[i],sizeof(WAVEHDR));
+                                               /* initialize the buffer */
+                                               memset(&whin[i],0,sizeof(WAVEHDR));
+                                               /* bump the serial number to look for the next time */
+                                               nextwhin++;
+                                               /* exit the loop so that we can start at lowest buffer again */
+                                               break;
+                                       }
+                               } 
+                               if (i >= NWHIN) break; /* if all found, get out of loop */
+                       }
+               }
+
+       }
+       return 0;
+}
+
+void
+do_iax_event(FILE *f) {
+       int sessions = 0;
+       struct iax_event *e = 0;
+       struct peer *peer;
+
+       while ( (e = iax_get_event(0))) {
+               peer = find_peer(e->session);
+               if(peer) {
+                       handle_event(f, e, peer);
+               } else {
+                       if(e->etype != IAX_EVENT_CONNECT) {
+                               fprintf(stderr, "Huh? This is an event for a non-existant session?\n");
+                       }
+                       sessions++;
+
+                       if(sessions >= MAX_SESSIONS) {
+                               fprintf(f, "Missed a call... too many sessions open.\n");
+                       }
+
+
+                       if(e->event.connect.callerid && e->event.connect.dnid)
+                               fprintf(f, "Call from '%s' for '%s'", e->event.connect.callerid, 
+                               e->event.connect.dnid);
+                       else if(e->event.connect.dnid) {
+                               fprintf(f, "Call from '%s'", e->event.connect.dnid);
+                       } else if(e->event.connect.callerid) {
+                               fprintf(f, "Call from '%s'", e->event.connect.callerid);
+                       } else printf("Call from");
+                       fprintf(f, " (%s)\n", inet_ntoa(iax_get_peer_addr(e->session).sin_addr));
+
+                       if(most_recent_answer) {
+                               fprintf(f, "Incoming call ignored, there's already a call waiting for answer... \
+please accept or reject first\n");
+                               iax_reject(e->session, "Too many calls, we're busy!");
+                       } else {
+                               if ( !(peer = malloc(sizeof(struct peer)))) {
+                                       fprintf(f, "Warning: Unable to allocate memory!\n");
+                                       return;
+                               }
+
+                               peer->time = time(0);
+                               peer->session = e->session;
+                               peer->gsmin = 0;
+                               peer->gsmout = 0;
+
+                               peer->next = peers;
+                               peers = peer;
+
+                               iax_accept(peer->session);
+                               iax_ring_announce(peer->session);
+                               most_recent_answer = peer;
+                               fprintf(f, "Incoming call!\n");
+                       }
+                       iax_event_free(e);
+                       issue_prompt(f);
+               }
+       }
+}
+
+void
+call(FILE *f, char *num)
+{
+       struct peer *peer;
+
+       if(!newcall)
+               newcall = iax_session_new();
+       else {
+               fprintf(f, "Already attempting to call somewhere, please cancel first!\n");
+               return;
+       }
+
+       if ( !(peer = malloc(sizeof(struct peer)))) {
+               fprintf(f, "Warning: Unable to allocate memory!\n");
+               return;
+       }
+
+       peer->time = time(0);
+       peer->session = newcall;
+       peer->gsmin = 0;
+       peer->gsmout = 0;
+
+       peer->next = peers;
+       peers = peer;
+
+       most_recent_answer = peer;
+
+       iax_call(peer->session, num, 10);
+}
+
+void
+answer_call(void)
+{
+       if(most_recent_answer)
+               iax_answer(most_recent_answer->session);
+       printf("Answering call!\n");
+       answered_call = 1;
+}
+
+void
+dump_call(void)
+{
+       if(most_recent_answer)
+       {
+               iax_hangup(most_recent_answer->session,"");
+               free(most_recent_answer);
+       }
+       printf("Dumping call!\n");
+       answered_call = 0;
+       most_recent_answer = 0;
+       answered_call = 0;
+       peers = 0;
+       newcall = 0;
+}
+
+void
+reject_call(void)
+{
+       iax_reject(most_recent_answer->session, "Call rejected manually.");
+       most_recent_answer = 0;
+}
+
+void
+handle_event(FILE *f, struct iax_event *e, struct peer *p)
+{
+       int len,n;
+       WHOUT *wh,*wh1;
+       short fr[160];
+       static paused_xmit = 0;
+
+
+       switch(e->etype) {
+               case IAX_EVENT_HANGUP:
+                       iax_hangup(most_recent_answer->session, "Byeee!");
+                       fprintf(f, "Call disconnected by peer\n");
+                       free(most_recent_answer);
+                       most_recent_answer = 0;
+                       answered_call = 0;
+                       peers = 0;
+                       newcall = 0;
+                       
+                       break;
+
+               case IAX_EVENT_REJECT:
+                       fprintf(f, "Authentication was rejected\n");
+                       break;
+               case IAX_EVENT_ACCEPT:
+                       fprintf(f, "Waiting for answer... RING RING\n");
+                       issue_prompt(f);
+                       break;
+               case IAX_EVENT_ANSWER:
+                       answer_call();
+                       break;
+               case IAX_EVENT_VOICE:
+                       switch(e->event.voice.format) {
+                               case AST_FORMAT_GSM:
+                                       if(e->event.voice.datalen % 33) {
+                                               fprintf(stderr, "Weird gsm frame, not a multiple of 33.\n");
+                                               break;
+                                       }
+
+                                       if (!p->gsmin)
+                                               p->gsmin = gsm_create();
+
+                                       len = 0;
+                                       while(len < e->event.voice.datalen) {
+                                               if(gsm_decode(p->gsmin, (char *) e->event.voice.data + len, fr)) {
+                                                       fprintf(stderr, "Bad GSM data\n");
+                                                       break;
+                                               } else {  /* its an audio packet to be output to user */
+
+                                                       /* get count of pending items in audio output queue */
+                                                       n = 0; 
+                                                       if (outqueue) 
+                                                       {       /* determine number of pending out queue items */
+                                                               for(wh = outqueue; wh != NULL; wh = wh->next)
+                                                               {
+                                                                       if (!(wh->w.dwFlags & WHDR_DONE)) n++;
+                                                               }
+                                                       }
+                                                       /* if not too many, send to user, otherwise chuck packet */
+                                                       if (n <= OUT_DEPTH) /* if not to chuck packet */
+                                                       {
+                                                               /* malloc the memory for the queue item */
+                                                               wh = (WHOUT *) malloc(sizeof(WHOUT));
+                                                               if (wh == (WHOUT *) NULL) /* if error, bail */
+                                                               {
+                                                                       fprintf(stderr,"Outa memory!!!!\n");
+                                                                       exit(255);
+                                                               }
+                                                               /* initialize the queue entry */
+                                                               memset(wh,0,sizeof(WHOUT));
+                                                               /* copy the PCM data from the gsm conversion buffer */
+                                                               memcpy((char *)wh->data,(char *)fr,sizeof(fr));
+                                                               /* set parameters for data */
+                                                               wh->w.lpData = (char *) wh->data;
+                                                               wh->w.dwBufferLength = 320;
+                                                               
+                                                               /* prepare buffer for output */
+                                                               if (waveOutPrepareHeader(wout,&wh->w,sizeof(WAVEHDR)))
+                                                               {
+                                                                       fprintf(stderr,"Cannot prepare header for audio out\n");
+                                                                       exit(255);
+                                                               }
+                                                               /* if not currently transmitting, hold off a couple of packets for 
+                                                                       smooth sounding output */
+                                                               if ((!n) && (!paused_xmit))
+                                                               {
+                                                                       /* pause output (before starting) */
+                                                                       waveOutPause(wout);
+                                                                       /* indicate as such */
+                                                                       paused_xmit = 1;
+                                                               }
+                                                               /* queue packet for output on audio device */
+                                                               if (waveOutWrite(wout,&wh->w,sizeof(WAVEHDR)))
+                                                               {
+                                                                       fprintf(stderr,"Cannot output to wave output device\n");
+                                                                       exit(255);
+                                                               }
+                                                               /* if we are paused, and we have enough packets, start audio */
+                                                               if ((n > OUT_PAUSE_THRESHOLD) && paused_xmit)
+                                                               {
+                                                                       /* start the output */
+                                                                       waveOutRestart(wout);
+                                                                       /* indicate as such */
+                                                                       paused_xmit = 0;
+                                                               }
+                                                               /* insert it onto tail of outqueue */
+                                                               if (outqueue == NULL) /* if empty queue */
+                                                                       outqueue = wh; /* point queue to new entry */
+                                                               else /* otherwise is non-empty queue */
+                                                               {
+                                                                       wh1 = outqueue;
+                                                                       while(wh1->next) wh1 = wh1->next; /* find last entry in queue */
+                                                                       wh1->next = wh; /* point it to new entry */
+                                                               }
+                                                       } 
+#ifdef PRINTCHUCK
+                                                       else printf("Chucking packet!!\n");
+#endif
+                                               }
+                                               len += 33;
+                                       }
+                                       break;
+                               default :
+                                       fprintf(f, "Don't know how to handle that format %d\n", e->event.voice.format);
+                       }
+                       break;
+               case IAX_EVENT_RINGA:
+                       break;
+               default:
+                       fprintf(f, "Unknown event: %d\n", e->etype);
+                       break;
+       }
+}
+
+void
+parse_cmd(FILE *f, int argc, char **argv)
+{
+       _strupr(argv[0]);
+       if(!strcmp(argv[0], "HELP")) {
+               if(argc == 1)
+                       dump_array(f, help);
+               else if(argc == 2) {
+                       if(!strcmp(argv[1], "HELP"))
+                               fprintf(f, "Help <Command>\t-\tDisplays general help or specific help on command if supplied an arguement\n");
+                       else if(!strcmp(argv[1], "QUIT"))
+                               fprintf(f, "Quit\t\t-\tShuts down the miniphone\n");
+                       else fprintf(f, "No help available on %s\n", argv[1]);
+               } else {
+                       fprintf(f, "Too many arguements for command help.\n");
+               }
+       } else if(!strcmp(argv[0], "STATUS")) {
+               if(argc == 1) {
+                       int c = 0;
+                       struct peer *peerptr = peers;
+
+                       if(!peerptr)
+                               fprintf(f, "No session matches found.\n");
+                       else while(peerptr) {
+                               fprintf(f, "Listing sessions:\n\n");
+                               fprintf(f, "Session %d\n", ++c);
+                               fprintf(f, "Session existed for %d seconds\n", (int)time(0)-peerptr->time);
+                               if(answered_call)
+                                       fprintf(f, "Call answered.\n");
+                               else fprintf(f, "Call ringing.\n");
+
+                               peerptr = peerptr->next;
+                       }
+               } else fprintf(f, "Too many arguments for command status.\n");
+       } else if(!strcmp(argv[0], "ANSWER")) {
+               if(argc > 1)
+                       fprintf(f, "Too many arguements for command answer\n");
+               else answer_call();
+       } else if(!strcmp(argv[0], "REJECT")) {
+               if(argc > 1)
+                       fprintf(f, "Too many arguements for command reject\n");
+               else {
+                       fprintf(f, "Rejecting current phone call.\n");
+                       reject_call();
+               }
+       } else if(!strcmp(argv[0], "CALL")) {
+               if(argc > 2)
+                       fprintf(f, "Too many arguements for command call\n");
+               else {
+                       call(f, argv[1]);
+               }
+       } else if(!strcmp(argv[0], "DUMP")) {
+               if(argc > 1)
+                       fprintf(f, "Too many arguements for command dump\n");
+               else {
+                       dump_call();
+               }
+       } else if(!strcmp(argv[0], "DTMF")) {
+               if(argc > 2)
+               {
+                       fprintf(f, "Too many arguements for command dtmf\n");
+                       return;
+               }
+               if (argc < 1)
+               {
+                       fprintf(f, "Too many arguements for command dtmf\n");
+                       return;
+               }
+               if(most_recent_answer)
+                               iax_send_dtmf(most_recent_answer->session,*argv[1]);
+       } else if(!strcmp(argv[0], "QUIT")) {
+               if(argc > 1)
+                       fprintf(f, "Too many arguements for command quit\n");
+               else {
+                       fprintf(f, "Good bye!\n");
+                       exit(1);
+               }
+       } else fprintf(f, "Unknown command of %s\n", argv[0]);
+}
+
+void
+issue_prompt(FILE *f)
+{
+       fprintf(f, "TeleClient> ");
+       fflush(f);
+}
+
+void
+dump_array(FILE *f, char **array) {
+       while(*array)
+               fprintf(f, "%s\n", *array++);
+}
diff --git a/libs/iax/src/winpoop.h b/libs/iax/src/winpoop.h
new file mode 100644 (file)
index 0000000..ac8c055
--- /dev/null
@@ -0,0 +1,41 @@
+/* 
+ * Functions Windows doesn't have... but should
+ * Copyright(C) 2001, Linux Support Services, Inc.
+ *
+ * Distributed under GNU LGPL.
+ *
+ * These are NOT fully compliant with BSD 4.3 and are not
+ * threadsafe.
+ *
+ */
+
+#ifndef _winpoop_h
+#define _winpoop_h
+
+#if defined(_MSC_VER)
+#define INLINE __inline
+#else
+#define INLINE inline
+#endif
+
+#include <winsock.h>
+
+void gettimeofday(struct timeval *tv, void /*struct timezone*/ *tz);
+
+static INLINE int inet_aton(char *cp, struct in_addr *inp)
+{
+       int res;
+       int a1, a2, a3, a4;
+       unsigned int saddr;
+       if (sscanf(cp, "%d.%d.%d.%d", &a1, &a2, &a3, &a4) != 4)
+               return 0;
+       a1 &= 0xff;
+       a2 &= 0xff;
+       a3 &= 0xff;
+       a4 &= 0xff; 
+       saddr = (a1 << 24) | (a2 << 16) | (a3 << 8) | a4;
+       inp->s_addr = htonl(saddr);
+       return 1;
+}
+
+#endif