Python SIP User Agent (Softphone)

Actually pjsip now supports Python abstraction for PJSUA-API, although there don’t seem to be a lot of interests for this (people seem to be more interested with ActiveX abstraction rather than Python abstraction πŸ˜€ ).

But why Python?

Well first and foremost, it’s for building a nice GUI!

If you’re looking for tools to build a portable GUI, actually Python fits the bill very well since it’s available on almost every platform (Win32, WinCE, MacOS X, Linux, Unices, and even Symbian, you name it), and many GUI toolkits are available for it (with my favorite being wxPython, although PythonCard also looks very interesting (too bad it doesn’t support sizer though)). And not to mention that the language itself is very powerful for creating this kind of application (read: to create something very quickly).

With the power of Python and the high level SIP and media API provided by PJSUA-API to do SIP calls, multiple accounts, presence, IM/instant messaging, buddy list management, conferencing, etc., this could potentially create a potent combination!

So watch this space, there could be a GUI coming out of pjsip.org soon! (or maybe not, just don’t hold your breath yet πŸ˜€ ).

Other reasons for creating Python abstraction for PJSUA-API:

  • it sounds ideal for creating scripting like programs, such as for testing purposes,
  • .. and I always want to learn Python. πŸ™‚

So Python it is!

19 Responses to “Python SIP User Agent (Softphone)”


  1. 1 Daniel Ellison 29 January 2007 at 15:16

    This looks fantastic! I was just about to build a VoIP phone for WM5 using Python and I came across your site. I already have Python running on my i-mate JASJAM. Do you have any examples or more information about the Python bindings for pjsip that might point me in the right direction?

    Thanks for the excellent software!

  2. 2 Daniel Ellison 29 January 2007 at 20:00

    OK, so I found the py_pjsua directory in the source. πŸ™‚ Now I just have to figure out why eVC4 keeps freezing when I choose “POCKET PC 2003” from the SDK dropdown.

    I guess I also have to figure out how to get py_pjsua running on my JASJAM. After I get pjsip on there, of course.

  3. 3 GrumpyOldCoder 29 January 2007 at 20:06

    Cool, I wasn’t sure that Python can run in WM (I haven’t tried it myself), so thanks for letting me know.

    Yup, that’s the directory indeed for the Python stuff (the py_pjsua directory). A simple application to register and make call is there (the pjsua_app.py file).

    Documentation wise, well it’s still left to be desired. πŸ˜€ Mostly I also have to look at the Python module implementation (py_pjsua.c) to look for stuffs!

    But mind you, things are still being cooked here, so be patient if few stuffs still don’t work as expected. πŸ™‚

  4. 4 Daniel Ellison 29 January 2007 at 20:32

    The PythonCE page is here:

    http://pythonce.sourceforge.net/Wikka/HomePage

    It’s actually up to version 2.5! Not bad. ctypes is in there too, so I can get at the hardware for the most part. So first I need to get pjsip running on my JASJAM and then somehow get py_pjsua compiled for WM5 (or 2003, if necessary). LOTS to learn, especially since I’m not a Windows developer.

    Any help from anyone at all would be very much appreciated. πŸ™‚ I’d love to see all of this running on WM5. It seems a natural place for it!

  5. 5 Daniel Ellison 30 January 2007 at 17:41

    Me again. πŸ™‚

    Since I can’t get eVC4 SP3 to run without crashing (on TWO different machines!), I was wondering if it’s possible to cross compile for WM5 (or 2003) from a Linux or Cygwin environment. Are there any problems I should know of?

    The cross compilation docs say to specify the host, but doesn’t really say HOW to specify the target architecture. The example uses “arm-elf-linux”. What would I specify for my JASJAM? It uses a Samsung 2442 processor (ARM).

    Thanks!

  6. 6 GrumpyOldCoder 30 January 2007 at 17:52

    I know you’re not a Windows developer (well you said this) so I understand that on a first hint of problem your first reaction is to switch to Cygwin/Linux and gcc (which we love most, of course). πŸ˜€

    Frankly I’m not sure how things would work with Cygwin/gcc combination for making CE peograms. I have no experience on using this, and somehow it doesn’t sound like you’ll have a full access to CE API.

  7. 7 Daniel Ellison 30 January 2007 at 18:50

    Yeah, you guessed it! πŸ™‚ I kind of like Linux. And Python. But you’re probably right: I wouldn’t have access to the CE API fron the gcc cross-compiler.

    Ah well. I’ll continue trying to get it going under Windoze, then. It is irksome that I’ll probably have to pay for VS 2005 just to get this compiled. Stupid eVC4!

  8. 8 ismangil 30 January 2007 at 20:06

    @Daniel:

    Can you not try using VS2005 C++ Express edition first?

  9. 9 Daniel Ellison 30 January 2007 at 20:46

    As far as I know, the VS2005 set of apps don’t allow creating Windows Mobile applications. They’re desktop only.

    Right now I’m trying out the Pelles C IDE. It’s a free system for developing Windows, Pocket PC and Smartphone apps. It’s very impressive! And it has an “Import eMbedded VC Project” option. No luck yet, but at least it doesn’t crash.

    Hey, maybe GrumpyOldCoder could convert the wince-evc4 projects to Pelles C! πŸ™‚

  10. 10 Daniel Ellison 30 January 2007 at 21:01

    Sorry, I meant the VS2005 Express set of apps. Of COURSE the full VS2005 would allow the creation of WinMo apps.

  11. 11 GrumpyOldCoder 1 February 2007 at 3:49

    Just updated PJSUA-API documentation to cover Python as well:
    http://www.pjsip.org/pjsip/docs/html/group__PJSUA__LIB.htm

    πŸ™‚

  12. 12 Greg 7 February 2007 at 8:59

    Soooooooo great !! Thanks !

  13. 13 Frank Miller 6 March 2007 at 21:33

    For those that might be interested, I’m putting the final touches on a softphone for WM5 that is written in C#. I’m looking for (pre)alpha testers if anyone is interested.

    Thanks,
    FM

    fwmiller@cornfed.com

  14. 14 plateau 17 April 2007 at 9:33

    Hello,

    The pjsua_app.py is wonderful for doing quick modifications (for example add default accounts and add default players for use).

    By the way, just a small suggestion: maybe you can change the following usage:
    string.replace(“\n”,””)
    to
    straing[:-1]

    It’s more pythonic. : ) and cleaner

  15. 15 saltydog 17 April 2007 at 21:00

    Frank – happy to test the C# version on an iMate SP5(Tornado) running WM5. I have a modified version of SJPhone running already, but diesn’t look very nice. I tried another proprietary C# version but it is locked to a single service provider. Cheers

  16. 16 _gm 8 April 2010 at 6:05

    Hi, i want to know how can i define a custom conf slot for buffered RTP data, i.e. i get sound input and output in a buffered RTP stream instead of sound card device.

  17. 17 mauro_fix 20 May 2010 at 20:47

    when i compile the python_pjsua proyect it launch this error:

    LINK : fatal error LNK1181: no se puede abrir el archivo de entrada β€˜..\..\lib\libpjproject-i386-win32-vc8-release.lib’

    i have no idea what’s wrong

    thank for your attention..


  1. 1 VOIP IP Telephony Trackback on 30 January 2007 at 11:35
  2. 2 Python SIP Take Two (Part 1) « pjsip blog Trackback on 24 July 2008 at 23:15
Comments are currently closed.




%d bloggers like this: