Changes between Version 5 and Version 6 of Python_SIP/Basic_Concept
- Timestamp:
- Jul 24, 2008 2:45:03 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Python_SIP/Basic_Concept
v5 v6 1 = P JSUA Python Module=1 = Python PJSUA Concepts = 2 2 3 3 [[TracNav(Python_SIP/TOC)]] 4 4 5 == Developing Python SIP Application == #develop6 5 7 === Concepts === #concepts 8 9 ==== Asynchronous Operations ==== 6 == Asynchronous Operations == 10 7 11 8 If you have developed applications with PJSIP, you'll know about this already. In PJSIP, all operations that involve sending and receiving SIP messages are asynchronous, meaning that the function that invokes the operation will complete immediately, and you will be given the completion status as callbacks. … … 14 11 15 12 16 == == The Main Classes ====13 == The Main Classes == 17 14 18 15 The [http://www.pjsip.org/python/pjsua.htm PJSUA Python Module Reference Manual] shows quite many classes there, and it is probably not very easy to spot which are the important classes. But actually the concept is quite simple. Here are the main classes of the library. … … 34 31 35 32 36 == == Basic Usage Pattern ====33 == Basic Usage Pattern == 37 34 38 35 With the methods of the main classes above, you will be able to invoke various operations to the object quite easily. But how can we get events/notifications from these classes? … … 44 41 More will be explained in later chapters. 45 42 46 == == Error Handling ====43 == Error Handling == 47 44 48 45 By convention, we use exceptions as means to report error, as this would make the program flows more naturally. Operations which yield error will raise [http://www.pjsip.org/python/pjsua.htm#Error pjsua.Error] exception. Here is a sample: … … 63 60 64 61 65 == == Threading and Concurrency ====62 == Threading and Concurrency == 66 63 67 64 For platforms that require polling, the pjsua module provides it's own worker thread to poll pjsip, so it is not necessary to instantiate own your polling thread. Having said that the application should be prepared to have the callbacks called by different thread than the main thread.