Giter VIP home page Giter VIP logo

rtmplite's Introduction

More details at
http://code.google.com/p/rtmplite and http://code.google.com/p/siprtmp
--
Copyright (c) 2007-2009, Mamta Singh.
Copyright (c) 2010-2011, Kundan Singh. All rights reserved.
Copyright (c) 2011-2012, Intencity Cloud Technologies. All rights reserved.
Copyright (c) 2011, Cumulus Python. No rights reserved.

--

The main program is rtmp.py. Please see the embedded documentation in that file.
Some parts of the documentation are copied here. Other modules such as amf, util
and multitask are used from elsewhere and contain their respective copyright 
notices.
--
The siprtmp module implements a SIP-RTMP gateway.  Please see the google 
code project for details on demo instructions and support information.
The project description is contained in siprtmp.py file itself. The command
line of siprtmp is same as rtmp, hence just replce rtmp by siprtmp in the 
following example to start the gateway.
--
The rtmpclient module implements a simple RTMP client. Please see the documentation
in rtmpclient.py source file on how it works and how it can be used.
--
The rtmfp module implements a simple and imcomplete RTMFP rendezvous server. Please
see the documentation in rtmfp.py source file on how it works.

-- 
Dependencies: Python 2.6 and Python 2.5
--
Typically an application can launch this server as follows:
$ python rtmp.py -d
The -d option enables debug trace so you know what is happening in the server.

To know the command line options use the -h option:
$ python rtmp.py -h

A test client is available in testClient directory, and can be compiled 
using Flex Builder. Alternatively, you can use the SWF file to launch
from testClient/bin-debug after starting the server. Once you have 
launched the client in the browser, you can connect to
local host by clicking on 'connect' button. Then click on publish 
button to publish a stream. Open another browser with
same URL and first connect then play the same stream name. If 
everything works fine you should be able to see the video
from first browser to the second browser. Similar, in the first 
browser, if you check the record box before publishing,
it will create a new FLV file for the recorded stream. You can 
close the publishing stream and play the recorded stream to
see your recording. Note that due to initial delay in timestamp 
(in case publish was clicked much later than connect),
your played video will start appearing after some initial delay.


---------------------- LICENSING -----------------------------------

This SOFTWARE consists of all the source code and documentation in the
"rtmplite" project.

The SOFTWARE is released under dual license, open source (GPL) or
alternative license.

The SOFTWARE may be used according to Free Software GNU General Public
License (GPL) version 3, or (at your option) any later version.

The GPL allows you to compile, modify, link, or combine the SOFTWARE
with other software, commercial or non-commercial, as long as the
resulting program complies with GPL. Copy of GNU General Public
License is available on the http://www.gnu.org.  More information
about GPL can be found in GPL FAQ.

If you cannot comply with GPL, an alternative licensing scheme may be
arranged.  Please contact me "Mamta Singh" at this address
<[email protected]> for further details.

A copy of GNU GENERAL PUBLIC LICENSE is presented below:

--------------------------------------------------------------------

                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  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
them 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 prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  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.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

  Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey 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;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If 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 convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Use with the GNU Affero General Public License.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU 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 that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  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.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
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.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            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
state 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) <year>  <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 3 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, see <http://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

  If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

    <program>  Copyright (C) <year>  <name of author>
    This program 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, your program's commands
might be different; for a GUI interface, you would use an "about box".

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.

  The GNU 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 Lesser General
Public License instead of this License.  But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

rtmplite's People

Watchers

 avatar

rtmplite's Issues

List of sockets for RTP/RTCP keeps growing with every call.

Reported by Franck <[email protected]> on Jan 28, 2011
Fixed in p2p-sip's svn r26 (version 1.10)

Hi Kundan,

didn't have any news from you.
hope you're well.

after experiment with rfc3550
I noticed that with p2p and siprtmp
udp socket session still stays open undiefinetly
and the list of socket is growing after every call.
so despite of my bad knowledge in python
i got the trick below:

    def close(self):
        if _debug: print 'cleaning up sockets'
        if self.rtp: self.rtp.close(); self.rtp = None
        if self.rtcp: self.rtcp.close(); self.rtcp = None
        if self.app: self.app = None
        self = None
once the call hangup siprtmp clean completely the ocket
and avoid that all udp port raange to be reached.


Take care

---
Hi Franck,

I think I found the problem.
It was a terrible oversight on my part in rfc3550.py.
I have fixed it in svn r26 as shown in
http://code.google.com/p/p2p-sip/source/list

I have also attached rfc3550.py which you can use to replace yours in
p2p-sip/src/std/rfc3550.py

Thanks a lot for helping with this bug!

Original issue reported on code.google.com by [email protected] on 7 Feb 2011 at 4:43

Handle multiple IP interfaces correctly

First reported by Joshua Shaffner <[email protected]> on Mar 5, 2011.
In summary, if the machine has multiple IP addresses, the siprtmp listens on 
one IP address for RTMP but another for SIP. Fix this, so that if IP address is 
supplied from command line, always use that.

--
I was able to register VideoIO with Freeswitch via siprtmp gateway but
there was no audio when I make a call. How do you suggest to
troubleshoot the issue?

Thank you,
Joshua

---
Hi,

Can you start siprtmp with -d option, and send me the program trace as
a text file. That can give some idea about what might be going wrong
in SIP/SDP negotiation. Problem could be in SDP codec negotiation or
in media port behind NAT/firewall.

Also, for next step, can you check if you can make call to your
freeswitch using X-lite (or some other SIP client) with only speex
enabled?
--
Any idea why sometimes it it will show 10.0.1.10 which is correct but
sometimes it show 10.211.55.2 (no idea where that came from)?

I had to register, unregister, restart servers, etc until it shows
10.0.1.10 for the contact before I could make a call

j

User:           [email protected]
Contact:        "1001 videoio" <sip:[email protected]:52948>

--
from rtmplite

rtmp-register scheme= sip aor= [email protected] login= 1001 passwd= ****
display= 1001 videoio
User created on ('10.211.55.2', 50486)
 registering addr= "1001 videoio" <sip:[email protected]> port= 50486
createClient <UserAgent [email protected]>
sending[356] to ('10.0.1.10', 5060)
REGISTER sip:10.0.1.10 SIP/2.0
Content-Length: 0
Via: SIP/2.0/UDP 10.211.55.2:50486;rport;branch=z9hG4bK-RdvxJKS0AmOqI8HIv90aQ..
From: "1001 videoio" <sip:[email protected]>;tag=190882210157
Expires: 180
To: "1001 videoio" <sip:[email protected]>
Contact: <sip:[email protected]:50486>
CSeq: 1 REGISTER
Max-Forwards: 70
Call-ID: [email protected]
--
ah, interesting, check this out, it looks like self.sockaddr in
voip.py picks up ip from vnic0 even tho i dont use it. I use en1
(10.0.1.10). What do you suggest?

ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
       inet6 ::1 prefixlen 128
       inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
       inet 127.0.0.1 netmask 0xff000000
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
       ether c4:2c:03:16:b2:c1
       media: autoselect
       status: inactive
fw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 4078
       lladdr 78:ca:39:ff:fe:32:16:12
       media: autoselect <full-duplex>
       status: inactive
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
       ether c8:bc:c8:b8:fd:3d
       inet 10.0.1.10 netmask 0xffffff00 broadcast 10.0.1.255
       media: autoselect
       status: active
vnic0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
       ether 00:1c:42:00:00:08
       inet 10.211.55.2 netmask 0xffffff00 broadcast 10.211.55.255
       inet6 fe80::21c:42ff:fe00:8%vnic0 prefixlen 64 scopeid 0x7
       inet6 fec0:0:0:fea9::1 prefixlen 64
       media: autoselect
       status: active
vnic1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
       ether 00:1c:42:00:00:09
       inet 10.37.129.2 netmask 0xffffff00 broadcast 10.37.129.255
       inet6 fe80::21c:42ff:fe00:9%vnic1 prefixlen 64 scopeid 0x8
       inet6 fec0:0:0:feaa::1 prefixlen 64
       media: autoselect
       status: active

---
okay, I am not sure what makes it work this time..maybe after I make
"ip6" thingy auto instead of off in my network setting (OSX)

I did test using xlite with just speex and could hear playback (MOH)
but not with flash/speex. here is the trace

register and answering the call from FS which will then park the call
and play back music (for off hook agent)

---
got it working this time..did not publish/play when accepting call, my bad :)

Original issue reported on code.google.com by kundan10 on 10 Mar 2011 at 10:21

Create server startup script for Linux

Reported by Madovsky <[email protected]> on Jul 23, 2010.

hope you're well...
I made a lsb script to start your rtmplite app as
a linux daemon (joined)  hope you'll like it
don't know yet very well python. I think I need
holidays for my eyes after 15 years of computer ;)

Take care

Franck

Original issue reported on code.google.com by [email protected] on 5 Feb 2011 at 2:13

Attachments:

StreamID switches randomly and breaks existing streaming

First reported by Gabor Janak <[email protected]> on Jun 25, 2010.

> Hello,
>
> I'm experimenting with your rtmplite component. And notice a little
> Problem. Is this known ?
>
> I connect to a svn  rtmlite server from a Flash Applet
> 1 netconnection.
> 2 NetStreams - server assigns streamId 1 and streamdid2
>
> now i start rtmpclient  file.flv  rtmp://url/app?id=test
>
> it call createstream, and server assigns streamId=1
>
> after some seconds a weired happen.
>
> the server thinks, it get an Message from the rtmpclient
> with streamId=2 .... Ough ?
> now an assert throws.. because server don't know this streamId in this
> Client Instance.
>
> I'm currently debugging the rtmp.py and try to add debug code
> but i could not find where the streamId changes...
>
> If the server is started, without connected the doublestream Applet ...
> the error doesn't happen.
>
> If the double-stream client is disconnected... the error doesn't happen.
>
>
> Can you give me a Hint where to search ?
>
>
> Thanks in advantage...
>
> Bye
> Gabor

---

Hello again,

i found my Failure. I used a flv file which i recorded with the rtmpClient.
I don't know why,but at the beginning of the file a TextData Message is
written.

hexdump a.flv -C -n 100
00000000  46 4c 56 01 05 00 00 00  09 00 00 00 00 09 00 00
|FLV.............|
00000010  1d 00 09 cd 00 00 00 00  02 00 0d 73 74 61 74 75
|...........statu|
00000020  73 4d 65 73 73 61 67 65  02 00 0a 57 65 6c 63 6f
|sMessage...Welco|
00000030  6d 65 2e 2e 2e 00 00 00  28 09 00 07 ca 00 13 9a
|me......(.......|
00000040  00 00 00 00 12 00 00 84  02 82 a6 20 20 20 21 ff  |...........
 !.|
00000050  ff 31 01 01 01 0f ff f9  88 08 08 08 7f ff cc 40
|.1.............@|
00000060  40 40 43 ff                                       |@@C.|
00000064

sended by NetStream.send("statusMessage","Welcome...");
it seems the rtmpclient wrote this Message into the FLV,
and now the old streamID 0x02 is inserted into the new Stream...


I will patch the rtmpClient, that this type of messages arn't written
into the flv :) or is this behavior planned ?


Bye

Gabor

---
> Hello,
>
> sorry, but this is the Last Email.
>
> I send you a small fix.
>
> the Problem is, that you cache the header in lastReadHeader
> by reference. and this Reference is in the message,too.
> if this Message is send over a stream, the stream send function
> calls msg.streamId=self.id (streamId)
> this changes the streamId of the cached Header ...
> and if the next message is not type0 it use the wrong streamId
>
> solution:
> @@ -523,7 +530,13 @@
>         '''Method to send a Message or Command on this stream.'''
>         if isinstance(msg, Command):
>             msg = msg.toMessage()
> -        msg.streamId = self.id
> +        if msg.streamId != self.id:
> +               #make a copy of the message, changing the orginal       +
>           #messages is BAD, because it can hold
> +               #a reference to a cached header
> +               old_msg=msg
> +               msg=copy.deepcopy(old_msg)
> +               msg.streamId = self.id
>         # if _debug: print self,'send'
>         if self.client is not None: self.client.writeMessage(msg)
>
> Attached a patch...
>
> I hope this helps.
>
> Thanks.
>

---
Hey,

Thanks a lot for identifying the problem. We will add your suggestion
to the SVN code soon.

Original issue reported on code.google.com by [email protected] on 4 Feb 2011 at 11:35

Integrate G.711 and H.264 available with Flash Player 11

Flash Player 11 (in beta) has new audio and video codecs support from 
microphone and camera captured data. Integrated this with siprtmp/VideoPhone 
and Flash-VideoIO.

Original issue reported on code.google.com by kundan10 on 27 Jul 2011 at 4:53

Exception in rtmpclient when connection is closed by remote

Reported by Jonas Borjesson on Apr 6, 2011.

 File "rtmp.py",
line 283, in parseMessages
   count = min(header.size - (len(data)), self.readChunkSize) # how much more
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'

Original issue reported on code.google.com by kundan10 on 16 Apr 2011 at 1:49

RTP sockets/ports are not closed in siprtmp

Reported by Hakan Kocaman <[email protected]> on May 12, 2010

Hi,

we are using your sip<>rtmp-gateway in a prototype together with freeswitch.
We are very pleased with it, but now we are seeing that there are a
lot of open ports :
Netstat -punta
[..]
udp        0      0 0.0.0.0:43595           0.0.0.0:*
         10076/python
udp        0      0 0.0.0.0:25675           0.0.0.0:*
         10076/python
udp        0      0 0.0.0.0:57803           0.0.0.0:*
         10076/python
udp        0      0 0.0.0.0:19275           0.0.0.0:*
         10076/python
udp        0      0 0.0.0.0:51148           0.0.0.0:*
         10076/python
udp        0      0 0.0.0.0:51149           0.0.0.0:*
         10076/python
udp        0      0 0.0.0.0:12494           0.0.0.0:*
         10076/python
udp        0      0 0.0.0.0:38606           0.0.0.0:*
         10076/python
udp        0      0 0.0.0.0:12495           0.0.0.0:*
         10076/python
udp        0      0 0.0.0.0:38607           0.0.0.0:*
         10076/python
udp        0      0 0.0.0.0:56016           0.0.0.0:*
         10076/python
udp        0      0 0.0.0.0:62416           0.0.0.0:*
         10076/python
udp        0      0 0.0.0.0:56017           0.0.0.0:*
         10076/python
udp        0      0 0.0.0.0:62417           0.0.0.0:*
         10076/python
[..]

There are at the moment 166 open ports, although there is no activity
from our flash-client.
Is this expected behavior ? Is their something like a garbagecollector
involved ?
I must admit, that there is no python-specialist in our team for this project,
so we don't know is this is OK.
We would appreciate any help we can get from your site.

Best regards from germany

Freundliche GrรผรŸe

Hakan Kocaman
Software-Development

---


Hi Hakan,

Thanks for trying out siprtmp.

These port numbers are related to RTP/RTCP socket that are opened for
media stream.
I have a close() method in the voip.py::MediaSession and
rfc3550::RTPNetwork classes. The close
method of RTPNetwork gets called from MediaSession.close(), but I
guess the siprtmp is not calling the close() method.

I will try to look at the siprtmp.py's cleanup code to make sure that
it correctly closes the SIP and RTP sessions.

---

Thank you for your swift reply!

Thanks a lot for having a look at it.
Indeed, I believe that we suffer from unclean session aborts here.
The software we're using siprtmp against is freeswitch which uses
nokia's sofia sip implementation. If you feel that the aborted sessions
are owed to a bug in freeswitch or sofia sip, let me know and I'll hook
you up with the right person for the problem over at the freeswitch
project.


Original issue reported on code.google.com by [email protected] on 3 Feb 2011 at 10:51

ffmpeg encoder connection: KeyError: 'objectEncoding'

On Ubuntu 10.10 I download rtmplite-6.0. I start the application...

python rtmp.py -d

On the same machine, I attempt to connect to it with a live rtmp stream from 
ffmpeg....

ffmpeg -i "/somevideo.vob" -re -vcodec libx264 -vpre default -b 500000 -s 
320x180 -strict experimental -g 25 -me_method zero -acodec aac -ab 96000 -ar 
48000 -ac 2 -b 500K -f flv  rtmp://127.0.0.1/live/livestream

I get the following output from rtmp.py...

connection received from ('127.0.0.1', 34624)
socket.read[23] calling recv()
socket.read[1537] 
"\x03\x00\x19\x160\x00\x00\x00\x00gE\x8bk\xc6#{2i\x98<dsH3fQ\xdc\xb0t\xff\\I\x19
J\x94\xe8*\xecXUb)\x1f\x8e#\xcd|\xe8F\xbaX\x1b=\xab\xd7~P\xf2A\xb1.\xfb\x1e\xb7A
\xe3\xa9\xe2yF\xe1Eu|\x00_Q\xc2b\xd0[T\x08 
\x12\xf8'\xb1M\x1b#\x16\x02\xe8\xe9\x16\x1f\xe7\xcd\x90...(1537)"
socket.write[1537] 
"\x03\x00\x19\x160\x00\x00\x00\x00gE\x8bk\xc6#{2i\x98<dsH3fQ\xdc\xb0t\xff\\I\x19
J\x94\xe8*\xecXUb)\x1f\x8e#\xcd|\xe8F\xbaX\x1b=\xab\xd7~P\xf2A\xb1.\xfb\x1e\xb7A
\xe3\xa9\xe2yF\xe1Eu|\x00_Q\xc2b\xd0[T\x08 
\x12\xf8'\xb1M\x1b#\x16\x02\xe8\xe9\x16\x1f\xe7\xcd\x90...(1537)"
socket.read[1536] calling recv()
socket.read[1536] 
"\x00\x19\x160\x00\x00\x00\x00gE\x8bk\xc6#{2i\x98<dsH3fQ\xdc\xb0t\xff\\I\x19J\x9
4\xe8*\xecXUb)\x1f\x8e#\xcd|\xe8F\xbaX\x1b=\xab\xd7~P\xf2A\xb1.\xfb\x1e\xb7A\xe3
\xa9\xe2yF\xe1Eu|\x00_Q\xc2b\xd0[T\x08 
\x12\xf8'\xb1M\x1b#\x16\x02\xe8\xe9\x16\x1f\xe7\xcd\x90\x11...(1536)"
socket.write[1536] 
"\x00\x19\x160\x00\x00\x00\x00gE\x8bk\xc6#{2i\x98<dsH3fQ\xdc\xb0t\xff\\I\x19J\x9
4\xe8*\xecXUb)\x1f\x8e#\xcd|\xe8F\xbaX\x1b=\xab\xd7~P\xf2A\xb1.\xfb\x1e\xb7A\xe3
\xa9\xe2yF\xe1Eu|\x00_Q\xc2b\xd0[T\x08 
\x12\xf8'\xb1M\x1b#\x16\x02\xe8\xe9\x16\x1f\xe7\xcd\x90\x11...(1536)"
socket.read[1] calling recv()
socket.read[97] 
'\x03\x00\x00\x00\x00\x00U\x14\x00\x00\x00\x00\x02\x00\x07connect\x00?\xf0\x00\x
00\x00\x00\x00\x00\x03\x00\x03app\x02\x00\x04live\x00\x04type\x02\x00\nnonprivat
e\x00\x05tcUrl\x02\x00\x15rtmp://127.0.0.1/live\x00\x00\t'
Protocol.parseMessage msg= <Message header=<Header channel=3 time=0 size=85 
type=20 streamId=0> 
data='\x02\x00\x07connect\x00?\xf0\x00\x00\x00\x00\x00\x00\x03\x00\x03app\x02\x0
0\x04live\x00\x04type\x02\x00\nnonprivate\x00\x05tcUrl\x02\x00\x15rtmp://127.0.0
.1/live\x00\x00\t'>
Traceback (most recent call last):
  File "rtmp.py", line 295, in parseMessages
    yield self.messageReceived(msg)
  File "/home/simonb/Documents/Source/rtmplite/multitask.py", line 963, in run_next
    output = task.send(input)
  File "/home/simonb/Documents/Source/rtmplite/multitask.py", line 182, in send
    return self.task.send(value)
  File "rtmp.py", line 611, in messageReceived
    self.objectEncoding = self.agent['objectEncoding']
KeyError: 'objectEncoding'
Protocol.parseMessages exception None
socket.read[1] calling recv()

Original issue reported on code.google.com by [email protected] on 4 Feb 2011 at 6:39

CPU charge question

- siprtmp takes without calls about 2% of CPU and with one call about 10% with 
a nocona 2 x Xeon
This is a little weird since there is no audio/video encoding. 
is this the effect of RTMP to RTP loop ?

Original issue reported on code.google.com by [email protected] on 8 Feb 2011 at 11:08

Recorded FLV cannot be played by flowplayer or JW player

Reported by John K <[email protected]> on May 1, 2010


Hello! First, thanks for providing this. A lightweight RTMP server is
what I'm looking for. I'm trying to stream FLV videos. With the
supplied testclient, I can watch an FLV, but when I try to view it
using a commercial player like JW player or flowplayer, it just
displays animation that indicates it's loading but the video never
plays. For instance,
http://www.push-a-button.com/products/youglevista/rtmp.php is a site
that lets you play an rtmp stream you specify with flowplayer. About
the only reason I can think of at this point is that with my web host,
I'm using a non-standard port for my server, i.e. it's not 1935. If
you have any suggestions on how to make this work, I would greatly
appreciate it. If you don't have time to do support, I understand, but
if I can get this to work, I will definitely spread the word about
rtmplite at my web host support forum & also in JW player forum.

thanks,
John K

Original issue reported on code.google.com by [email protected] on 3 Feb 2011 at 10:17

Memory leak in siprtmp and rfc3261.py

Reported by ลukasz Paszke <[email protected]> May 6, 2010

Hi,

Thank you for p2p-sip.

I am debugging memory leaks in siprtmp.py from rtmplite, and sipd.py from 
p2p-sip. siprtmp.py and sipd.py are based on p2p-sip. I know that in sip.py 
memory usage increases after every register request generated by asterisk 
1.4.22 on reregistration. This is because ServerTransaction and Proxy objects 
are not closed (removed from memory) after each successful register 
transaction. Therefore there is a buildup in the number of this object over 
time (40 MB over 4 days).

Can you advise what can be wrong and where to look for the solution in the code?

Best Regards / Pozdrawiam

ลukasz

---

I can try looking at the memory problem in rfc3261.py file.
There is a circular reference among transaction and Dialog/Proxy
object I feel. I think I had implemented a close() method in both the
classes. But may be the close() method is not getting invoked for
cleanup on the Proxy object.

Which tool are you using to detect the memory leak?

We can probably chat further on gtalk ([email protected]) and nail
this down....

---

I use pdb and objgraph from 
http://www.lshift.net/blog/2008/11/14/tracing-python-memory-leaks

I am new to python (I have experience in ruby, a little bit like python).

I think the problem occurs because of typo in rfc3261.py. Please see 
rfc3261.py.patch for more details. After this correction objects are correctly 
destroyed during registers/reregisters with asterisk.

I found some other leak occurring every time siprtmp.py registers/reregisters 
to sipd.py (increase in application memory consumption), but unfortunately I 
cant find any application objects in memory space after application termination.

siprtmp.py also have a number of more complicated memory leaks.

---

Index: rfc3261.py
===================================================================
--- rfc3261.py  (revision 917)
+++ rfc3261.py  (revision 918)
@@ -560,7 +560,7 @@
    def state():
        def fset(self, value):
            self._state = value
-            if self._state == 'terminating': self.close() # automatically 
close when state goes terminating
+            if self._state == 'terminated': self.close() # automatically close 
when state goes terminating
        def fget(self): return self._state
        return locals()
    state = property(**state())

---

Hi Lukasz,

Thanks for the patch. That was a tricky typo and thanks for detecting.

We will add the memory leak detection as our things to do. I agree
that siprtmp.py is pretty primitive -- it was a student project and
haven't been regressed for robustness.

Regards

Original issue reported on code.google.com by [email protected] on 3 Feb 2011 at 11:21

AttributeError ClientTransaction object has no receivedRequest in siprtmp

Reported by bernard roubaud <[email protected]>on Sep 14, 2010.

Hi,
I am playing with siprtmp (6.0) and X-Lite (3.0 build 56125) as described i=
n the =93Testing=94 paragraph and I got the following error  :  AttributeErro=
r: 'ClientTransaction' object has no attribute 'receivedRequest'
Does I miss something in the configuration ?
Thanks
Bernard


C:\p2p-sip\src\app>python.exe sipd.py -d

starting agent on ('0.0.0.0', 5060) with transports ('udp',)

('10.184.83.33', 5062)=3D>('0.0.0.0', 5060) on type=3D2

REGISTER sip:10.184.83.33 SIP/2.0

Via: SIP/2.0/UDP 127.0.0.1:5062
;branch=3Dz9hG4bK-d8754z-49044a660b56871e-1---d875

z-;rport

Max-Forwards: 70

Contact: <sip:[email protected]:5062;rinstance=3D6d89135e21df93da>

To: "bernard"<sip:[email protected]>

From: "bernard"<sip:[email protected] <sip%[email protected]>
>;tag=3D57755873

Call-ID: MTE4ZTk3Mzc3YTIxMWI1OTIzNjRkZTk0ODdhYzk1ZTc.

CSeq: 1 REGISTER

Expires: 0

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE=
,
IN

O

User-Agent: X-Lite release 1104o stamp 56125

Content-Length: 0





received request from stack REGISTER

save {}

locate sip:[email protected] {}

('0.0.0.0', 5060)=3D>('10.184.83.33', 5062) on type=3D2

SIP/2.0 200 OK

Content-Length: 0

Via: SIP/2.0/UDP 127.0.0.1:5062
;received=3D10.184.83.33;branch=3Dz9hG4bK-d8754z-490

4a660b56871e-1---d8754z-;rport=3D5062

From: "bernard" <sip:[email protected] <sip%[email protected]>
>;tag=3D57755873

Expires: 0

To: "bernard" <sip:[email protected] <sip%[email protected]>
>;tag=3D28744989463

CSeq: 1 REGISTER

Call-ID: MTE4ZTk3Mzc3YTIxMWI1OTIzNjRkZTk0ODdhYzk1ZTc.





('10.184.83.33', 5062)=3D>('0.0.0.0', 5060) on type=3D2

SUBSCRIBE sip:[email protected] SIP/2.0

Via: SIP/2.0/UDP 127.0.0.1:5062
;branch=3Dz9hG4bK-d8754z-a67c6e0157793427-1---d875

z-;rport

Max-Forwards: 70

Contact: <sip:[email protected]:5062>

To: "bernard"<sip:[email protected]>

From: "bernard"<sip:[email protected] <sip%[email protected]>
>;tag=3D2607fb33

Call-ID: ZTJjZDUyNjBhYjM2Njc3MjI4YTk0NjQyMjgwZGUzYTk.

CSeq: 1 SUBSCRIBE

Expires: 300

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE=
,
IN

O

User-Agent: X-Lite release 1104o stamp 56125

Event: message-summary

Content-Length: 0





received request from stack SUBSCRIBE

proxying non-invite non-local request

sending request on stack SUBSCRIBE

('0.0.0.0', 5060)=3D>('10.184.83.33', 5060) on type=3D2

SUBSCRIBE sip:[email protected] SIP/2.0

Event: message-summary

Content-Length: 0

Via: SIP/2.0/UDP 10.184.83.33:5060
;rport;branch=3Dz9hG4bKlPGUl9DxKlheAqvOZPNE5A..

Via: SIP/2.0/UDP 127.0.0.1:5062
;received=3D10.184.83.33;rport=3D5062;branch=3Dz9hG4bK

d8754z-a67c6e0157793427-1---d8754z-

From: "bernard" <sip:[email protected] <sip%[email protected]>
>;tag=3D2607fb33

Expires: 300

To: "bernard" <sip:[email protected] <sip%[email protected]>>

Contact: <sip:[email protected]:5062>

CSeq: 1 SUBSCRIBE

Max-Forwards: 69

Allow: INVITE

Allow: ACK

Allow: CANCEL

Allow: OPTIONS

Allow: BYE

Allow: REFER

Allow: NOTIFY

Allow: MESSAGE

Allow: SUBSCRIBE

Allow: INFO

Call-ID: ZTJjZDUyNjBhYjM2Njc3MjI4YTk0NjQyMjgwZGUzYTk.

User-Agent: X-Lite release 1104o stamp 56125





('10.184.83.33', 5060)=3D>('0.0.0.0', 5060) on type=3D2

SUBSCRIBE sip:[email protected] SIP/2.0

Event: message-summary

Content-Length: 0

Via: SIP/2.0/UDP 10.184.83.33:5060
;rport;branch=3Dz9hG4bKlPGUl9DxKlheAqvOZPNE5A..

Via: SIP/2.0/UDP 127.0.0.1:5062
;received=3D10.184.83.33;rport=3D5062;branch=3Dz9hG4bK

d8754z-a67c6e0157793427-1---d8754z-

From: "bernard" <sip:[email protected] <sip%[email protected]>
>;tag=3D2607fb33

Expires: 300

To: "bernard" <sip:[email protected] <sip%[email protected]>>

Contact: <sip:[email protected]:5062>

CSeq: 1 SUBSCRIBE

Max-Forwards: 69

Allow: INVITE

Allow: ACK

Allow: CANCEL

Allow: OPTIONS

Allow: BYE

Allow: REFER

Allow: NOTIFY

Allow: MESSAGE

Allow: SUBSCRIBE

Allow: INFO

Call-ID: ZTJjZDUyNjBhYjM2Njc3MjI4YTk0NjQyMjgwZGUzYTk.

User-Agent: X-Lite release 1104o stamp 56125





Traceback (most recent call last):

  File "sipd.py", line 110, in <module>

    sipapi.run()  # the loop to process the SIP listening point

  File "c:\p2p-sip\src\app\sipapi.py", line 246, in run

    try: multitask.run()

  File "c:\p2p-sip\src\external\multitask.py", line 1196, in run

    get_default_task_manager().run()

  File "c:\p2p-sip\src\external\multitask.py", line 897, in run

    self.run_next()

  File "c:\p2p-sip\src\external\multitask.py", line 963, in run_next

    output =3D task.send(input)

  File "c:\p2p-sip\src\app\sipapi.py", line 151, in _sipreceiver

    if data: stack.received(data, remote)

  File "c:\p2p-sip\src\std\rfc3261.py", line 425, in received

    self._receivedRequest(m, uri)

  File "c:\p2p-sip\src\std\rfc3261.py", line 494, in _receivedRequest

    t.receivedRequest(r)

AttributeError: 'ClientTransaction' object has no attribute
'receivedRequest'



C:\p2p-sip\src\app>

Original issue reported on code.google.com by [email protected] on 5 Feb 2011 at 3:35

siprtmp_gevent.py fail on video transmit

Transmitting video fail (client closes connection) when running server by 
siprtmp_gevent.py.
Problem in function FlashCliend.send(), there is no check for all data sent.
Solution: replace self.sock.send(data) to self.sock.sendall(data), or process 
sending in loop with counting sent bytes.

Original issue reported on code.google.com by [email protected] on 28 May 2011 at 5:25

rtmpclient_gevent

Please help to build a rtmpclient_gevent.
Mean replace multitask by gevent in rtmpclient, so we can use with 
siprtmp_gevent.py

Original issue reported on code.google.com by [email protected] on 27 Apr 2011 at 6:52

Display name in UTF8

- UTF8 in display name is not supported, also the "*" in fromt of a number. 
maybe it should be encoded in base64 also ?)

Original issue reported on code.google.com by [email protected] on 8 Feb 2011 at 11:07

exeception error in incoming calls with gevent version

Hi,

below the error trace when the ua receives a call.
it's not fatal but sometimes no audio


receive RTP exception (<class 'socket.error'>, error(9, 'Bad f                  

            ile descriptor'), <traceback object at 0x2374878>)
Traceback (most recent call last):
  File "/home/adobe/rtmplite/siprtmp.py", line 642, in receiveRTP
    fd = sock.fileno()
  File "<string>", line 1, in fileno
  File "/usr/lib64/python2.5/site-packages/gevent-0.14.0dev-py2.5-linux-x86_64.e                                                                                                              gg/gevent/socket.py", line 266, in _dummy
    raise error(EBADF, 'Bad file descriptor')
error: (9, 'Bad file descriptor')
receive RTCP exception (<class 'socket.error'>, error(9, 'Bad file 
descriptor'),                                                                   
                                            <traceback object at 0x23747e8>)
Exception greenlet.GreenletExit: GreenletExit() in <bound method 
Network.__del__                                                                 
                                              of <__main__.Network object at 
0x2375110>> ignored
receive RTP exception (<class 'socket.error'>, error(9, 'Bad file descriptor'), 

                              <traceback object at 0x24253f8>)
Traceback (most recent call last):
  File "/home/adobe/rtmplite/siprtmp.py", line 642, in receiveRTP
    fd = sock.fileno()
  File "<string>", line 1, in fileno
  File "/usr/lib64/python2.5/site-packages/gevent-0.14.0dev-py2.5-linux-x86_64.e                                                                                                              gg/gevent/socket.py", line 266, in _dummy
    raise error(EBADF, 'Bad file descriptor')
error: (9, 'Bad file descriptor')
receive RTCP exception (<class 'socket.error'>, error(9, 'Bad file 
descriptor'),                                                                   
                                            <traceback object at 0x24253f8>)
Exception greenlet.GreenletExit: GreenletExit() in <bound method 
Network.__del__                                                                 
                                              of <__main__.Network object at 
0x2422290>> ignored


I tried to figure it out without success.
seems that maybe the sock.fileno() is not ready at the time to send packet?

thanks

Original issue reported on code.google.com by [email protected] on 28 May 2011 at 7:52

Interoperate with Asterisk for Audio/Video

Reported by Borja SIXTO <[email protected]> on May 14, 2010

Hi,

I am Borja SIXTO from i6net.

We made working your Application (SipRTMP) with an Asterisk (audio and
video : using a transcoder in the Asterisk).
Are you interested by the changes done ?

Regards,

Borja

---
> Hi Borja,
>
> Thanks for the offer to send the changes.
> It will help a lot to the project if you can send your changes and any
> other lessons learned.
>
> Thanks.

---
Nice to get your response.

I do two modifications :

1/ enable Speex to be able to pass full audio calls with the Asterisk
(with Asterisk 1.6 it works fine, with a warning but the audio is ok).

2/ I had developp a video transcoder for the video h263sorenon
(integrated in the Asterisk 1.6), now I can call sip phone (h263, h263
and h264) and 3G video phones. For the video, the GW need to use 2
different netstreams to get a smooth audio/video.

It will be great to get the DTMF, but I don't know how to add the in
the SIP/sdp and how to send them from the P2P-sip API.

This is a prototype to make our native RTMP channel in the Asterisk.

Regards,


Borja

Original issue reported on code.google.com by [email protected] on 3 Feb 2011 at 11:55

Attachments:

Python list to AMF in rtmplite

Reported by alfonz77 <[email protected]> on Nov 29, 2010.

Hello,

First of all congrats for the project I really like it simplicity. I
am trying to build a multi-player game with Flex and Python - I am a
beginner with Python. I noticed that Python lists are nor sent
correctly to Flash - actually when I try to send a list I get corrupt
data on the Flash side. Currently I make a workaround by converting
lists to dictionaries before sending. Am I missing something?

Original issue reported on code.google.com by [email protected] on 5 Feb 2011 at 5:25

No video in siprtmp using videophone.swf.

Reported by Rus <[email protected]> on May 9, 2010

Hello,

 First thanks for this interesting project. Tried to make it work with
latest rtmplite and p2p-sip svn. The clients can connect to servers,
can view the initial camera video, can do the call, but just when the
call are
answered all cameras led became inactive and no video (only vertical rainbow
color bars) is shown. Logs are attached. I have the simple setup of
two boxes - first (10.1.0.100 is running siprtmp and sipd and
videophone.swf client named Dao, second (10.1.0.7) is running
videophone.swf client named acer. This is internal home network - no
firewalls and gateways - only hub connection. I see that contact field
in sipd logs are wrong for second client (it needs to be 10.1.0.7 but
seems like it is the same as for first client). Settings for
10.1.0.100 swf client are :

rtmp url - rtmp://localhost/sip
sip url - [email protected]
auth name - dao
auth pass - 1234 (do not care)
name - Dao

Settings for 10.1.0.7 swf client are :

rtmp url - rtmp://10.1.0.100/sip
sip url - [email protected]
auth name - acer
auth pass - 1234 (do not care)
name - Acer

 What can be the issue ? Sipd.py and siprtmp.py logs are attached. Can
supply any additional info.

Thanks in advance.

Original issue reported on code.google.com by [email protected] on 3 Feb 2011 at 10:25

Attachments:

siprtmp hanging on Python 2.7

First reported by James [email protected] on Mar 9, 2011.

--
Hi,

I've downloaded and setup siprtmp on a centos server. The default python 
installation is 2.4 so i've done an alternate installation of 2.7. When i try 
to run the server using python2.7 siprtmp.py -d it shows 'Flash Server Starts - 
0.0.0.0:1935' and nothing happens after that. When i check on the ports using 
netstat there's no service running on port 1935. Is there something am doing 
wrong? How do i know when siprtmp is running?

james
--

Original issue reported on code.google.com by kundan10 on 10 Mar 2011 at 9:33

Working with Flash Media Encoder

Reported by Tomas Asmenybe <[email protected]> on Sep 2, 2010

Hello,

I tried to use flash media encoder 2.5 with your rtmp server, but it
throws error "keyerror: objectencoding"... Is it possible to use fme
with your server or should I look for something else? Any help would
be apreciated.

Original issue reported on code.google.com by [email protected] on 5 Feb 2011 at 2:20

AsyncError was unable to invoke onMetaData

Reported by Erald (gmx) <[email protected]> on Jun 3, 2010.

Hello,

This looks like the server I am looking for. Red5 and others are
complex and since I am really a noob on flash very difficult to
understand.

I understand it supports live streaming to which you can connect. This
I might want to use in the future. However I am interested in using
the server as a .flv streaming server using the jw player.

However I tried you example application to stream some files but get
always the error: streamErrorHandler() asyncError Error #2095:
flash.net.NetStream was unable to invoke callback onMetaData.

How should I avoid this and can I use this server as a rtmp .flv
streaming server.

Some guidance would be very nice on how to configure this.

Thank you for your help

Erald

Original issue reported on code.google.com by [email protected] on 4 Feb 2011 at 11:16

Easy Application override

Hi,

I tried rtmplite with openlaszlo, it works like a charm ! Only one thing. It's 
not nice to have to recreate FlashServer to override application methods.

So, I did a patch to allow user to override Application class and to pass 
"dict" to FlashServer constructor.

So you can do;
 class MyApp(Application):
    pass

 class MyOtherApp(Application):
    pass

And send it to constructor, for example:
 app = FlashServer(dict({'url1': MyApp, 'url2'; MyOtherApp}))


Original issue reported on code.google.com by Metal3d on 19 Feb 2011 at 1:42

Attachments:

481 response

sometimes on SIP trace I can see 481 response. but everything works fine. What 
does it mean ? how to resolve it ?

thanks

Original issue reported on code.google.com by [email protected] on 9 Feb 2011 at 3:50

re-INVITE handling

Currently siprtmp does not support re-INVITE handling (send '501 re-INVITE not 
implemented'). Require this feature to modify SDP (for change in remote media 
destination or hold/unhold).

Original issue reported on code.google.com by [email protected] on 29 Mar 2011 at 12:24

Add redirectConnection in rtmplite's Client

Reported by Wai Keen Woon <[email protected]>on Sep 15, 2010


 Hello, I would like to contribute a patch for RTMP redirection as
described in 
http://www.adobe.com/livedocs/flashmediaserver/3.0/hpdocs/help.html?content=0000
0251.html

Index: rtmp.py
===================================================================
--- rtmp.py    (revision 4753)
+++ rtmp.py    (working copy)
@@ -657,6 +657,15 @@
                        description=reason, details=None))
        self.writeMessage(response.toMessage())

+    def redirectConnection(self, url, reason=''):
+        '''Method to redirect an incoming client to the given url.'''
+        response = Command()
+        response.id, response.name, response.type = 1, '_error', Message.RPC
+        extra = dict(code=302, redirect=url)
+        response.setArg(dict(level='status',
code='NetConnection.Connect.Rejected',
+                        description=reason, details=None, ex=extra))
+        self.writeMessage(response.toMessage())
+
    def call(self, method, *args):
        '''Call a (callback) method on the client.'''
        cmd = Command()

Original issue reported on code.google.com by [email protected] on 5 Feb 2011 at 3:52

timestamps get reset to 0

What steps will reproduce the problem?
1. play an FLV file where two frames have the same absolute timestamp
2. it will send a packet with absolute timestamp=0
3.

What is the expected output? What do you see instead?

The send routine only gets a relative timestamp passed to it. It should
only send an absolute timestamp for the first packet in a stream.


What version of the product are you using? On what operating system?
4.0 Linux

Please provide any additional information below.

The bug is caused by this "or header.time==0" condition at rtmp.py:316
>>>
            # now figure out the header data bytes
            if header.streamId != message.streamId or header.time == 0:
                header.streamId, header.type, header.size, header.time =
message.streamId, message.type, message.size, message.time
                control = Header.FULL
<<<

The attached patch seems to fix it for me, by insuring that header.time
will never be 0 after the first packet in the stream.


Original issue reported on code.google.com by [email protected] on 17 Dec 2009 at 8:54

Attachments:

Bad file descriptor error in siprtmp when receiving call

Reported by Nico <[email protected]> on Aug 30, 2010

Hi, I'm trying to use rtmplite for a project and whenever I make a call to the 
flash client, I get an error like the one below, I was wondering if you know 
how to fix it, although it looks like it is a problem with p2p-sip. Thanks!

rtmp-accept
create answer failed to create an answer
receive RTP exception (<class 'socket.error'>, error(9, 'Bad file descriptor'), 
<traceback object at 0xb7bcb4dc>)
Traceback (most recent call last):
  File "/root/downloads/p2p-sip/src/std/rfc3550.py", line 689, in receiveRTP
    data, remote = yield multitask.recvfrom(sock, self.maxsize)
  File "/root/downloads/rtmplite/multitask.py", line 544, in recvfrom
    return FDAction(sock, sock.recvfrom, args, kwargs, read=True)
  File "/root/downloads/rtmplite/multitask.py", line 409, in __init__
    super(FDAction, self).__init__(fd, read, write, exc, timeout)
  File "/root/downloads/rtmplite/multitask.py", line 299, in __init__
    self.fd = (fd if _is_file_descriptor(fd) else fd.fileno())
  File "<string>", line 1, in fileno
  File "/opt/python-2.6.6/lib/python2.6/socket.py", line 167, in _dummy
    raise error(EBADF, 'Bad file descriptor')
error: [Errno 9] Bad file descriptor
receive RTCP exception (<class 'socket.error'>, error(9, 'Bad file 
descriptor'), <traceback object at 0xb7bcb464>)
receive RTP exception (<class 'socket.error'>, error(9, 'Bad file descriptor'), 
<traceback object at 0xb7bcb4dc>)
Traceback (most recent call last):
  File "/root/downloads/p2p-sip/src/std/rfc3550.py", line 689, in receiveRTP
    data, remote = yield multitask.recvfrom(sock, self.maxsize)
  File "/root/downloads/rtmplite/multitask.py", line 544, in recvfrom
    return FDAction(sock, sock.recvfrom, args, kwargs, read=True)
  File "/root/downloads/rtmplite/multitask.py", line 409, in __init__
    super(FDAction, self).__init__(fd, read, write, exc, timeout)
  File "/root/downloads/rtmplite/multitask.py", line 299, in __init__
    self.fd = (fd if _is_file_descriptor(fd) else fd.fileno())
  File "<string>", line 1, in fileno
  File "/opt/python-2.6.6/lib/python2.6/socket.py", line 167, in _dummy
    raise error(EBADF, 'Bad file descriptor')
error: [Errno 9] Bad file descriptor
receive RTCP exception (<class 'socket.error'>, error(9, 'Bad file 
descriptor'), <traceback object at 0xb7bcb464>)
sending[307] to ('74.55.36.250', 5060)
SIP/2.0 488 Incompatible SDP

---

Hi Nico,

This might be a bug in the code that both sides are not using the same
SDP session. I see the following error: "SIP/2.0 488 Incompatible SDP"

Can you enable trace log using "-d" option or setting "_debug = True"
in appropriate .py files, so that it prints the full SIP messages.
Then send me the sender and receiver's INVITE and 200 OK message
traces. That will give good deal of information about why SDP m= lines
are incompatible.

Keep in touch and good luck!

---

Thank you very much for your reply, here's the whole trace, from when I start 
the server to when the call is terminated with the error. The flow is as 
follows:
* Start siprtmp
* Connect with flash
* Originate a call to the extension registered by flash through siprtmp
* When the called is answered in flash, siprtmp throughs an error and send an 
SDP saying incompatible destination

This happens only when calling flash. If I make the call from flash, there's no 
problem.

received[1139] from ('myserver_ip', 5060)
INVITE sip:[email protected]:60640 SIP/2.0
Via: SIP/2.0/UDP myserver_ip;rport;branch=z9hG4bKrg9D9XB2BXpvg
Max-Forwards: 70
From: "FreeSWITCH" <sip:0000000000@myserver_ip>;tag=r3474y38cjBcj
To: <sip:[email protected]:60640>
Call-ID: cf7b348c-332c-122e-688d-001d09ef4a24
CSeq: 1488363 INVITE
Contact: <sip:mod_sofia@myserver_ip:5060>
User-Agent: FreeSWITCH-mod_sofia/1.0.trunk-15979
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO, REGISTER, 
REFER, NOTIFY, PUBLISH, SUBSCRIBE
Supported: timer, precondition, path, replaces
Allow-Events: talk, presence, dialog, line-seize, call-info, sla, 
include-session-description, presence.winfo, message-summary, refer
Content-Type: application/sdp
Content-Disposition: session
Content-Length: 247
X-FS-Support: update_display
Remote-Party-ID: "FreeSWITCH" 
<sip:0000000000@myserver_ip>;party=calling;screen=yes;privacy=off

v=0

o=FreeSWITCH 1283617883 1283617884 IN IP4 myserver_ip
s=FreeSWITCH
c=IN IP4 myserver_ip
t=0 0
m=audio 30972 RTP/AVP 98 101 13
a=rtpmap:98 SPEEX/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=rtpmap:13 CN/8000
a=ptime:20

createServer <UserAgent call-id=cf7b348c-332c-122e-688d-001d09ef4a24>
sending[280] to ('myserver_ip', 5060)
SIP/2.0 100 Trying
Content-Length: 0
Via: SIP/2.0/UDP myserver_ip;rport=5060;branch=z9hG4bKrg9D9XB2BXpvg
From: "FreeSWITCH" <sip:0000000000@myserver_ip>;tag=r3474y38cjBcj
To: <sip:[email protected]:60640>
CSeq: 1488363 INVITE
Call-ID: cf7b348c-332c-122e-688d-001d09ef4a24


receivedRequest method= INVITE ua= <UserAgent 
call-id=cf7b348c-332c-122e-688d-001d09ef4a24>  for ua without queue
incominghandler connect
Gateway[0] onResult None
Gateway[0] onPublish sip/[email protected] local
Gateway[0] onPlay sip/[email protected] remote
rtmp-accept
create answer failed to create an answer
receive RTP exception (<class 'socket.error'>, error(9, 'Bad file descriptor'), 
<traceback object at 0xb7b47414>)
Traceback (most recent call last):
  File "/root/downloads/p2p-sip/src/std/rfc3550.py", line 689, in receiveRTP
    data, remote = yield multitask.recvfrom(sock, self.maxsize)
  File "/root/downloads/rtmplite/multitask.py", line 544, in recvfrom
    return FDAction(sock, sock.recvfrom, args, kwargs, read=True)
  File "/root/downloads/rtmplite/multitask.py", line 409, in __init__
    super(FDAction, self).__init__(fd, read, write, exc, timeout)

  File "/root/downloads/rtmplite/multitask.py", line 299, in __init__
    self.fd = (fd if _is_file_descriptor(fd) else fd.fileno())
  File "<string>", line 1, in fileno
  File "/opt/python-2.6.6/lib/python2.6/socket.py", line 167, in _dummy
    raise error(EBADF, 'Bad file descriptor')
error: [Errno 9] Bad file descriptor
receive RTCP exception (<class 'socket.error'>, error(9, 'Bad file 
descriptor'), <traceback object at 0xb7b4716c>)
receive RTP exception (<class 'socket.error'>, error(9, 'Bad file descriptor'), 
<traceback object at 0xb7b473ec>)
Traceback (most recent call last):
  File "/root/downloads/p2p-sip/src/std/rfc3550.py", line 689, in receiveRTP
    data, remote = yield multitask.recvfrom(sock, self.maxsize)
  File "/root/downloads/rtmplite/multitask.py", line 544, in recvfrom
    return FDAction(sock, sock.recvfrom, args, kwargs, read=True)
  File "/root/downloads/rtmplite/multitask.py", line 409, in __init__
    super(FDAction, self).__init__(fd, read, write, exc, timeout)
  File "/root/downloads/rtmplite/multitask.py", line 299, in __init__
    self.fd = (fd if _is_file_descriptor(fd) else fd.fileno())
  File "<string>", line 1, in fileno
  File "/opt/python-2.6.6/lib/python2.6/socket.py", line 167, in _dummy
    raise error(EBADF, 'Bad file descriptor')
error: [Errno 9] Bad file descriptor
receive RTCP exception (<class 'socket.error'>, error(9, 'Bad file 
descriptor'), <traceback object at 0xb7b4743c>)
sending[307] to ('myserver_ip', 5060)
SIP/2.0 488 Incompatible SDP
Content-Length: 0
Via: SIP/2.0/UDP myserver_ip;rport=5060;branch=z9hG4bKrg9D9XB2BXpvg
From: "FreeSWITCH" <sip:0000000000@myserver_ip>;tag=r3474y38cjBcj
To: <sip:[email protected]:60640>;tag=109646747812
CSeq: 1488363 INVITE
Call-ID: cf7b348c-332c-122e-688d-001d09ef4a24


received[325] from ('myserver_ip', 5060)
ACK sip:[email protected]:60640 SIP/2.0
Via: SIP/2.0/UDP myserver_ip;rport;branch=z9hG4bKrg9D9XB2BXpvg
Max-Forwards: 70
From: "FreeSWITCH" <sip:0000000000@myserver_ip>;tag=r3474y38cjBcj
To: <sip:[email protected]:60640>;tag=109646747812
Call-ID: cf7b348c-332c-122e-688d-001d09ef4a24
CSeq: 1488363 ACK
Content-Length: 0


Gateway[0] onClose sip/[email protected] local
Gateway[0] onStop sip/[email protected] remote
Gateway[0] onResult None

Original issue reported on code.google.com by [email protected] on 5 Feb 2011 at 2:24

Call transfer in siprtmp

Reported by ravindimantha <[email protected]>on Nov 24, 2010.

Hi great project!

Just wanted to know if in the rtmplite project if you have implemented
the Call Transfer function. I ask this question here because the
rtmplite is said to be using the p2p-sip stack from here.

Thanks in advance.

Ravin

Original issue reported on code.google.com by [email protected] on 5 Feb 2011 at 5:18

playback problem version 7.2

Please describe the issue and also put debug trace. Additionally, please
describe your network configuration (NAT, IP addresses, etc).

Hi, 
I've updated my rtmplite versione to the latest 7.2 one, but webcam recorded 
clips won't playback correctly - buggy sound and slow video output.

After switching back to 7.0 the playback worked fine.

Original issue reported on code.google.com by [email protected] on 7 Mar 2011 at 12:31

Cannot dial sip address with * in front

Reported by Franck <[email protected]> on Aug 3, 2010

there is this message error when I try to call a sip address with an asterisk 
in front :

rtmp-invite  *[email protected]
exception in invite (<type 'exceptions.AttributeError'>, 
AttributeError("'NoneType' object has no attribute 'dup'",), <traceback object 
at 0x1f92b00>)
Gateway[0] onResult None

tried to correct it but my python level is not yet skillfull


Thanks

Franck

Original issue reported on code.google.com by [email protected] on 5 Feb 2011 at 12:18

Asterisk / SIP with rtmplite problems

I am trying to interconnect SIP and flash using Asterisk as the SIP server, on 
my LAN. Here is one of the tests I have done, and its log. 
I am using Ekiga, it connects to Asterisk fine and can make calls from and to 
other SIP clients.
- First I connect the flash VideoPhone application to rtmplite
- Then I make Ekiga call the VideoPhone
- Then I pick up on the VideoPhone. It instantly connects and disconnects. 
Ekiga believes it is still connected, using speex. After 7 seconds, Ekiga hangs 
up automatically.
- At this time the VideoPhone starts ringing again (as if it is receiving a 
call), but picking up doesn't do anything of course, except reset the 
VideoPhone to standby mode, waiting for new calls.

Notice the same symptoms seem to happen when doing flash to flash calls using 
asterisk (but not p2psip, there it works fine), flash to phone and phone to 
flash (p2psip and asterisk), but asterisk with VideoPhone and Android native 
Gingerbread SIP client works fine, and so does Ekiga with the Android SIP 
client.

The log of the above described situation (Ekiga calls VideoPhone) is in the 
attached file (inlined), as well as the log of a flash to flash call over 
asterisk (both are using videophones) with the following scenario:

- First I register the first compouter (1001)
- Next I register the second computer (1004)
- Then 1001 calls 1004
- 1004 picks up and instantly connection is cut

Thanks for any help anyone may provide,
Yannack

Original issue reported on code.google.com by [email protected] on 7 Jul 2011 at 9:33

Attachments:

Audio quality problem with speex8 and Asterisk

Reported by Taras S <[email protected]> on Aug 5, 2010

see 
http://groups.google.com/group/myprojectguide/browse_thread/thread/4449bb7c9b48f
bae/cb25671d2e0acd39?pli=1

hi
I used siprtmp and I have a question about it
If I'm calling(using speex8) from flash to asterisk, on music on hold
extensions, sound quality is awful.(in trafshow seen that rtp flow is
unstable. From time to time the flow stops and then resumes again,
this leads to failures in the sound). But if i calling(using speex8)
from flash to freeswitch, on music on hold extensions, sound quality
are normal(steady stream of rtp). I'm confused. 

--

There were some timestamp related bug fixes done in version 6.0 of
rtmplite/siprtmp. Can you please give it a try.

If you are already trying version 6.0 or later, could you please
enable RTP trace (set _debug=True in siprtmp.py, rtmplite.py and in
p2p-sip's rfc3550.py) and send the trace as reply. Basically I want to
see the RTP timestamp and actual RTMP time when packets are sent by
asterisk to Flash application.

Thanks. 

---
hi
This is tarce log siprtmp ver6.0 

Original issue reported on code.google.com by [email protected] on 5 Feb 2011 at 2:18

about new params --int-ip and --ext-ip

I tried to configure siprtmp with
--int-ip as 127.0.0.1 and --ext-ip as a public ip 12.34.56.78
all SIP messages are going and received well, but no sound.
is it a NAT issue ? if yes, how should I set it ?

Thanks

Franck

Original issue reported on code.google.com by [email protected] on 14 Apr 2011 at 5:37

Performance measurement

Measure the performance of rtmplite for simple (1) video recording, (2) 
playback streaming, (3) audio only, (4) siprtmp translation for audio call, (5) 
real-time two-party call.

Original issue reported on code.google.com by [email protected] on 3 Feb 2011 at 7:07

Stream switcher using rtmplite

First reported by Fabio Di Bernardini [email protected] on Tue, Jul 26, 2011

---
I need a simple streaming system where only one client at a time can
stream (due to bandwitdh issues) and a director can choose which
client.

Look at this sketch: http://goo.gl/8vauk

At the end of this system there is a converter and a streaming service
(like ustream, icecast or similar) needed to broadcast the choosed
client.

What do you think? Is it feasible with rtmplite?

---

Hi Fabio,

Yes, this should be feasible with rtmplite.

Assuming that it is your web client, and the simplest option would to
be to send RPC commands from rtmplite to your Flash application to
enable/disable publish of the stream. The Flash client application
connects to the server rtmp://server/myapp/scope123. But the Flash
client will not publish until it receives "start_stream" command from
the server. The server built using rtmp.py and rtmpclient.py creates a
new FlashServer instance to listen to incoming Flash client
connections. The server already keeps track of list of connected
clients, and can decide which client it wants to start streaming from.
Then it sends a "stop_stream" command to any previously active client,
and "start_stream" command to new active client, using the "call"
method (look for how self.client.call is called in siprtmp.py to
indicate an event from server to client). The client application
invokes publish/close based on when it receives "start_stream" or
"stop_stream" commands. If you are using a third party Flash client
application, then you will need to handle this signaling out of band,
e.g., using separate signaling channel.

On the other side of the system, you will need to use the
NetConnection/NetStream objects of rtmpclient.py module to connect to
your existing streaming server, or have the existing streaming server
connect to rtmpclient. The rtmpclient module is capable of connecting
to existing RTMP server to publish or play a stream. You can use the
onPublishData callback (see rtmp.py) to receive the audio data from
the client, and NetStream's send to send it to the other streaming
service.

Original issue reported on code.google.com by kundan10 on 27 Jul 2011 at 4:55

Uplink with ffmpeg: playback with ffplay, vlc and rtmpdump fails

I uplink using ffmpeg...
ffmpeg -i somevideo.mp4 -re -vcodec copy -acodec copy -f flv 
rtmp://localhost/live/livestream

In this case the video is H264/MP3 and known to work with other live rtmp 
streaming software e.g. Wowza and rtmpd.

If I try to connect to the stream using VLC using...
vlc -vvv rtmp://localhost/live/livestream

I get the following error report...

[0x1b6df00] main input debug: `rtmp://localhost/live/livestream' gives access 
`rtmp' demux `' path `localhost/live/livestream'
[0x1b6df00] main input debug: creating demux: access='rtmp' demux='' 
path='localhost/live/livestream'
[0x1f3a810] main demux debug: looking for access_demux module: 0 candidates
[0x1f3a810] main demux debug: no access_demux module matched "rtmp"
[0x1f3a810] main demux debug: TIMER module_need() : 0.165 ms - Total 0.165 ms / 
1 intvls (Avg 0.165 ms)
[0x1b6df00] main input debug: creating access 'rtmp' 
path='localhost/live/livestream'
[0x1f3a9c0] main access debug: looking for access module: 1 candidate
[0x1f3a9c0] access_avio access debug: Opening 'rtmp://localhost/live/livestream'
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Warning: call to rand()
Closing connection: NetStream.Play.StreamNotFound
[0x1f3a9c0] access_avio access error: Failed to open url using libavformat
[0x1f3a9c0] main access debug: no access module matching "rtmp" could be loaded
[0x1f3a9c0] main access debug: TIMER module_need() : 81.128 ms - Total 81.128 
ms / 1 intvls (Avg 81.128 ms)
[0x1b6df00] main input error: open of `rtmp://localhost/live/livestream' 
failed: (null)


If I open with ffplay...
ffplay rtmp://localhost/live/livestream

I get the following error report...

Closing connection: NetStream.Play.StreamNotFound
rtmp://localhost/live/livestream: Operation not permitted


If I connect using rtmpdump piped into ffplay...
rtmpdump -r rtmp://localhost/live/livestream -q -o - -v | ffplay -

I get only sound, no picture, and the following error report...

[h264 @ 0x22ccc80]no frame!
[flv @ 0x22a86b0]invalid stream
[h264 @ 0x22ccc80]no frame!
    Last message repeated 4 times
[h264 @ 0x22ccc80]slice type too large (0) at 0 0
[h264 @ 0x22ccc80]decode_slice_header error
[h264 @ 0x22ccc80]no frame!
(repeated)

Original issue reported on code.google.com by [email protected] on 22 Feb 2011 at 3:19

While label phone for siprtmp

Reported by <[email protected]>on Oct 7, 2010

Hello, and Congratulations for your nice little software SIP
videophone.

I would like to do some experiments with it and I need your help
for that as soon as possible.

1- I would like a plain version of the flash-to-Sip videophone page
without: (the text input form, without the buttons, without the
tool-tips, without the confirmation yellow bars in the bottom, just
a white background, no border, in other words, no visual elements
at all, but only a white plain square SWF object that I can fix the
size and the loggin infos in the html source myself). I ask you
because I don't want to break anything in the asc code if I edit it
myself for my experiments. send it in my email Please, I'm willing
to give you a donation for your help, and for future experiments
help also :-)

Best Regards

Marco

---
Hi Marco,

Not sure if we replied to you earlier or not. So am replying again.

Were you able to do this yourself?

You can edit View.mxml to remove various UI elements.
Then you can add code in VideoPhone.mxml::installJavaScriptAPI() to
add more API to control from JavaScript.

If you haven't done it already and if you find it difficult, I will
try to send you the new SWF. Let me know.

---
Hi Kundan,

I cannot do it, I was still waiting for your help, my experiment
need is that I will make it call a SIP number, that's it. so I
don't want
no graphics at all, and also I want it to be able to call just a SIP
number, without password or name remembering.

Can you do it for me please?

Best Regards

Marco

Original issue reported on code.google.com by [email protected] on 5 Feb 2011 at 4:10

Changing Message to Message(object) breaks

Reported by Valery <[email protected]> on Nov 30, 2009.

> Hi,
>
> Most probably there is a bug in your code.
> If I change Message to class Message(object), playing stop working. Second
> connection hangs and response is not sent back to flash.
>
> The issue somewhere in property, fget, fset. Without 'object', message.type
> does not set message.header.type and everything works.
>
> So this is strange for me.
>
> It will be great if you explain that and provide a fix.
>
> Thanks,
> Valery.
>

Original issue reported on code.google.com by [email protected] on 3 Feb 2011 at 7:13

In about 2-5 minutes, video freezes

Reported by Valery <[email protected]> on Dec 9, 2009.

I got the latest source code and I found another issue, that seems is more 
critical.
In about 2-5 minutes of playing, the picture freezes. I dig a little and found 
out that the recv on publisher's socket stoped getting data.

To reproduce it faster I do minor changes to inclease bitrate.
- I changed width and height for video to 320x240
- added the code to 'private function publish'
        ns.publish(name, record ? 'record' : null);

        var camera:Camera = Camera.getCamera();
        camera.setMode(wVideo, hVideo, 30);
        camera.setQuality(0, 100);

        local.attachCamera(camera);
        ns.attachCamera(camera);

In about 30 seconds, it stops working.

Thanks,
Valery.

Original issue reported on code.google.com by [email protected] on 3 Feb 2011 at 7:23

Cannot play using FLVPlayback component

Reported by Alexey Eremin <[email protected]> on Feb 17, 2010.

Hello.

Thank you for this project. I try to use it, but i have some question.
I try to record some video by call publish("some", "record"), server
create a file some.flv.
In next step i want to try play it, i write little player, which use
NetStream and Video components - it's works.
But i want to use FLVPlayback to watch recorded video, but it
components can't play video from server.
I try set a source property of component and try use play method, but
it not work.
In server debug mode i see, that server resive connection request and
answer on it, but next component command(s) not sent.
How to use FLVPlayback component?
Thank you. Aleksey.
P.S. Sorry for my english.

Original issue reported on code.google.com by [email protected] on 3 Feb 2011 at 7:37

Attachments:

Audio dropping off with VideoIO.swf and rtmplite

Reported by Diarmuid Wrenne <[email protected]> on Nov 2, 2010.

Hi

Sorry for emailing you directly but I am not sure if the support is
working on Google Groups.

The audio seems to be dropping off when I record a file. The file
attached is an example.

Could the be something to do with the built in mic or some setting I
need to change

Great work on the apps and your write ups.

Cheers

Diarmuid

---
Hi Diarmuid,

Do you have some other audio tool which you can record and playback to
verify that your mic is working fine?

I suspect it is something else. Few questions if you can answer:

1. Is rtmplite running on same host as your browser in your test?

2. If (1) is no, then how is the bandwidth between your browser's host
and the host running rtmplite?

3. Do you have information about CPU usage (either window's task
manager or Mac's activity monitor can give this information) on the
machine that runs rtmplite? and that runs your browser? Is it showing
high (close to 100%) CPU usage?

4. Did you change any default parameter in VideoIO?

5. Which version of rtmplite are you using? or are you using the
latest SVN code?

6. What is your flash player version? Right click in VideoIO and then
left click on 'Adobe Flash Player...' to know the exact version
number.

---
Also I am attaching another VideoIO.swf if you can replace yours with this one.

The difference is that this one disables silence-suppression in
Microphone object of Flash Player, in case this was an issue.

Also in your experiment, if you can set the mic's volume to be max,
that will help.

---
Hi Kundan,

Thanks for the great reply.

Activity Monitor shows rtmplite running at 6 % when recording 1 stream.

Audio works fine with Photobooth.

I set the max volume in the flash recorder and that had the biggest
effect on the audio recorder. I think the echo check box may have had
some affect as well.

I also tested the Flash recorder (not rtmplite)  in Facebook that
works the same way with the volume control needing to be very high for
any audio to be recorded consistently. It could be something to do
with the 24" i-mac's build in mic. I also played around with the mac's
built in audio prefs and the default settings work well. Ambient noise
reduction makes a big difference but seems to have little impact on
the recorder

The recorder volume in flash seems to be quite crude as it need to be
very high before it picks up the sound. I wonder is this scriptable on
javascript.

Do you know of a RTMFP server to help with making peer to peer calls.
I see you use the Adobe stratus server , but maybe there is an open
source server out there??

I tried the recoder with two inpute streams and it worked fine. Any
idea how many could be recorded at once or is it based on server
capacity ?

Thanks for your help. I was telling a friend today how brilliant your
code and write-ups are. They are very impressive.

Cheers

---
Hey Diarmuid,

The recorder volume is also scriptable from Javascript using the
"gain" property as described in
http://myprojectguide.org/p/flash-videoio/10.html.

I don't know of any open source rtmfp server. There was some effort
that started out, but I haven't followed it recently.

One of the pending task I need to do is capacity/performance
measurement of rtmplite.

Hopefully I should be able to do that soon.

Thanks!

Original issue reported on code.google.com by [email protected] on 5 Feb 2011 at 4:07

Attachments:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.