[pjsip] Python PJSIP on Windows Mobile
danbrwn at gmail.com
Wed May 28 11:11:58 EDT 2008
Ive had a couple of people ask me about a working python on CE
binding. It appears because of some attachments that I put with some
of my responses, the full details of what I did, and the status of
what I did is not completely on the list. So I am posting this as a
complete record I hope so that others may find it usefull.
First let me say that it does indeed work! I am using it on a mobile
2003 device and it seems to work very well.
So here is what I did. I took the py_pjsua from the main (win32)
project and created a project within the workspace for the
wince port and built it using Embedded visual studio 4.0. I had to do
some things with the paths as you might expect. Change some libs
directives since some of the standard API's are in different libs for
the PPC versus WIN32. A couple of other things that I don't recall
right now but are certainly the standard kind of things you go through
when going from one platform to another. It built exactly like you
would expect. I ended up with a version of py_pjsua.pyd that runs on
this CE python engine , http://pythonce.sourceforge.net .
So, my next goal was to get a client app running. Of course I
immediately thought of the win32 py_pjsua_app. I tried to get it
running on the CE device. It did not work, mainly because CE has no
console mode, ie no sys.stdin.readline() as used in the mainloop of
the py_pjsua_app. So, I attempted to use TKinter and redirect stdin
and stdout to Tkinter widgets. It actually appeared to work, until I
registered with my sip server. It appeared to just hang. I suspect it
has to do with some threading issues which someone more familiar with
Python could figure out.
For me, I realized I did not really need console input in the first
place since all my client actions are originated from my sip server
(my client is truly a client and must originate calls through a custom
interface back at the server). Never the less I used the TKinter to
get access to the windows message loop to do some key bindings. So one
can see that my app is truly such a hodge podge of different things
that in and of itself it won't help many people. Certainly, following
the examples on the pjsip site, one could make there own client app
that utilizes py_pjsua.pyd built for CE; but out of the box, the
pjsua_app.py will not work.
Bottom line is , someone should be able to get a TKinter version of
py_pjsua_app working. It is very easy to redirect stdin, and stdout to
a TKinter text input and output widget. I would be happy to provide
the Embedded visual studio 4 project that I used to build my
py_pjsua.pyd, It is not clean and probably not the best example of
proper project management so someone might need to clean it up a
little to include it in the official project. I am an R&D guy and just
figure out what is necessary to get me the results I need .So some of
the things I do, I do out of a need to move forward.
Here is a link that explains how to get Tkinter working on CE.
Fabio, If you would like me to email you my py_pjsua.pyd, let me know
and I will send it to you.
More information about the pjsip