Skip to content

Commit

Permalink
Convert PJSUA2 Hello World sample to Python3
Browse files Browse the repository at this point in the history
  • Loading branch information
bennylp committed Feb 14, 2023
1 parent 50cabd5 commit 8c269f1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docs/source/pjsua2/hello_world.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,18 @@ The C++ sample app above is built along with standard build, you can run the exe
from ``pjsip-apps/bin/samples/..`` directory.


Python
Python3
===========================
The equivalence of the C++ sample code above in Python is as follows:
The equivalence of the C++ sample code above in Python3 is as follows:

.. code-block:: python
import pjsua2 as pj
# Subclass to extend the Account and get notifications etc.
class Account(pj.Account):
def onRegState(self, prm):
print "***OnRegState: " + prm.reason
print("***OnRegState: " + prm.reason)
# pjsua2 test function
def pjsua2_test():
Expand Down

0 comments on commit 8c269f1

Please sign in to comment.