Changeset 1430


Ignore:
Timestamp:
Sep 10, 2007 4:54:22 PM (17 years ago)
Author:
bennylp
Message:

Updated Python module to pjsip-0.7 (inc. custom presence test)

Location:
pjproject/trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/build/py_pjsua.dsp

    r1128 r1430  
    7171# PROP Target_Dir "" 
    7272# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PY_PJSUA_EXPORTS" /YX /FD /GZ /c 
    73 # ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\pjlib\include" /I "..\..\pjlib-util\include" /I "..\..\pjmedia\include" /I "..\..\pjsip\include" /I "../../pjnath/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PY_PJSUA_EXPORTS" /FR /YX /FD /GZ /c 
     73# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "..\..\pjlib\include" /I "..\..\pjlib-util\include" /I "..\..\pjmedia\include" /I "..\..\pjsip\include" /I "../../pjnath/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PY_PJSUA_EXPORTS" /FR /YX /FD /GZ /c 
    7474# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 
    7575# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 
     
    114114 
    115115# PROP Default_Filter "h;hpp;hxx;hm;inl" 
     116# Begin Source File 
     117 
     118SOURCE=..\src\py_pjsua\py_pjsua.h 
     119# End Source File 
    116120# End Group 
    117121# Begin Group "Resource Files" 
  • pjproject/trunk/pjsip-apps/src/py_pjsua/pjsua_app.py

    r1128 r1430  
    1818 
    1919# STUN config. 
    20 # Set C_STUN_SRV to the address of the STUN server to enable STUN 
    21 # 
    22 C_STUN_SRV = "" 
     20# Set C_STUN_HOST to the address:port of the STUN server to enable STUN 
     21# 
     22#C_STUN_HOST = "" 
     23C_STUN_HOST = "192.168.0.2" 
     24#C_STUN_HOST = "stun.iptel.org:3478" 
     25 
     26# SIP port 
    2327C_SIP_PORT = 5060 
    24 C_STUN_PORT = 3478 
    2528 
    2629 
     
    4144def err_exit(title, rc): 
    4245    py_pjsua.perror(THIS_FILE, title, rc) 
     46    py_pjsua.destroy() 
    4347    exit(1) 
    4448 
     
    197201        ua_cfg.cb.on_call_transfer_request = on_call_transfer_request 
    198202 
     203        # Configure STUN setting 
     204        if C_STUN_HOST != "": 
     205            ua_cfg.stun_host = C_STUN_HOST; 
     206 
    199207        # Create and initialize media config 
    200208        med_cfg = py_pjsua.media_config_default() 
     
    208216                err_exit("pjsua init() error", status) 
    209217 
    210         # Configure STUN config 
    211         #stun_cfg = py_pjsua.stun_config_default() 
    212         #stun_cfg.stun_srv1 = C_STUN_SRV 
    213         #stun_cfg.stun_srv2 = C_STUN_SRV 
    214         #stun_cfg.stun_port1 = C_STUN_PORT 
    215         #stun_cfg.stun_port2 = C_STUN_PORT 
    216  
    217218        # Configure UDP transport config 
    218219        transport_cfg = py_pjsua.transport_config_default() 
    219220        transport_cfg.port = C_SIP_PORT 
    220         #transport_cfg.stun_config = stun_cfg 
    221         if C_STUN_SRV != "": 
    222                 transport_cfg.use_stun = 1 
    223221 
    224222        # Create UDP transport 
     
    226224            py_pjsua.transport_create(py_pjsua.PJSIP_TRANSPORT_UDP, transport_cfg) 
    227225        if status != 0: 
    228                 py_pjsua.destroy() 
    229226                err_exit("Error creating UDP transport", status) 
     227                 
    230228 
    231229        # Create initial default account 
    232230        status, acc_id = py_pjsua.acc_add_local(transport_id, 1) 
    233231        if status != 0: 
    234                 py_pjsua.destroy() 
    235232                err_exit("Error creating account", status) 
    236233 
     
    497494        status = py_pjsua.start() 
    498495        if status != 0: 
    499                 py_pjsua.destroy() 
    500496                err_exit("Error starting pjsua!", status) 
    501497 
  • pjproject/trunk/pjsip-apps/src/py_pjsua/py_pjsua.c

    r1128 r1430  
    1717 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  
    1818 */ 
    19 #include <Python.h> 
    20 #include "structmember.h" 
    21 #include <pjsua-lib/pjsua.h> 
     19#include "py_pjsua.h" 
    2220 
    2321#define THIS_FILE    "main.c" 
     
    6159 
    6260 
    63 /* 
    64  * pjsip_event_Object 
    65  * C/python typewrapper for event struct 
    66  */ 
    67 typedef struct 
    68 { 
    69     PyObject_HEAD 
    70     /* Type-specific fields go here. */ 
    71     pjsip_event * event; 
    72 } pjsip_event_Object; 
    73  
    74  
    75 /* 
    76  * pjsip_event_Type 
    77  * event struct signatures 
    78  */ 
    79 static PyTypeObject pjsip_event_Type = 
    80 { 
    81     PyObject_HEAD_INIT(NULL) 
    82     0,                          /*ob_size*/ 
    83     "py_pjsua.PJSIP_Event",     /*tp_name*/ 
    84     sizeof(pjsip_event_Object), /*tp_basicsize*/ 
    85     0,                          /*tp_itemsize*/ 
    86     0,                          /*tp_dealloc*/ 
    87     0,                          /*tp_print*/ 
    88     0,                          /*tp_getattr*/ 
    89     0,                          /*tp_setattr*/ 
    90     0,                          /*tp_compare*/ 
    91     0,                          /*tp_repr*/ 
    92     0,                          /*tp_as_number*/ 
    93     0,                          /*tp_as_sequence*/ 
    94     0,                          /*tp_as_mapping*/ 
    95     0,                          /*tp_hash */ 
    96     0,                          /*tp_call*/ 
    97     0,                          /*tp_str*/ 
    98     0,                          /*tp_getattro*/ 
    99     0,                          /*tp_setattro*/ 
    100     0,                          /*tp_as_buffer*/ 
    101     Py_TPFLAGS_DEFAULT,         /*tp_flags*/ 
    102     "pjsip_event objects",      /*tp_doc */ 
    103 }; 
    104  
    105  
    106 /* 
    107  * pjsip_rx_data_Object 
    108  * C/python typewrapper for RX data struct 
    109  */ 
    110 typedef struct 
    111 { 
    112     PyObject_HEAD 
    113     /* Type-specific fields go here. */ 
    114     pjsip_rx_data * rdata; 
    115 } pjsip_rx_data_Object; 
    116  
    117  
    118 /* 
    119  * pjsip_rx_data_Type 
    120  */ 
    121 static PyTypeObject pjsip_rx_data_Type = 
    122 { 
    123     PyObject_HEAD_INIT(NULL) 
    124     0,                              /*ob_size*/ 
    125     "py_pjsua.PJSIP_RX_Data",       /*tp_name*/ 
    126     sizeof(pjsip_rx_data_Object),   /*tp_basicsize*/ 
    127     0,                              /*tp_itemsize*/ 
    128     0,                              /*tp_dealloc*/ 
    129     0,                              /*tp_print*/ 
    130     0,                              /*tp_getattr*/ 
    131     0,                              /*tp_setattr*/ 
    132     0,                              /*tp_compare*/ 
    133     0,                              /*tp_repr*/ 
    134     0,                              /*tp_as_number*/ 
    135     0,                              /*tp_as_sequence*/ 
    136     0,                              /*tp_as_mapping*/ 
    137     0,                              /*tp_hash */ 
    138     0,                              /*tp_call*/ 
    139     0,                              /*tp_str*/ 
    140     0,                              /*tp_getattro*/ 
    141     0,                              /*tp_setattro*/ 
    142     0,                              /*tp_as_buffer*/ 
    143     Py_TPFLAGS_DEFAULT,             /*tp_flags*/ 
    144     "pjsip_rx_data objects",        /*tp_doc*/ 
    145 }; 
    146  
    147  
    148 /* 
    149  * callback_Object 
    150  * C/python typewrapper for callback struct 
    151  */ 
    152 typedef struct 
    153 { 
    154     PyObject_HEAD 
    155     /* Type-specific fields go here. */ 
    156     PyObject * on_call_state; 
    157     PyObject * on_incoming_call; 
    158     PyObject * on_call_media_state; 
    159     PyObject * on_call_transfer_request; 
    160     PyObject * on_call_transfer_status; 
    161     PyObject * on_call_replace_request; 
    162     PyObject * on_call_replaced; 
    163     PyObject * on_reg_state; 
    164     PyObject * on_buddy_state; 
    165     PyObject * on_pager; 
    166     PyObject * on_pager_status; 
    167     PyObject * on_typing; 
    168  
    169 } callback_Object; 
    170  
    17161 
    17262/* 
    17363 * The global callback object. 
    17464 */ 
    175 static callback_Object * g_obj_callback; 
     65static PyObj_pjsua_callback * g_obj_callback; 
    17666 
    17767 
     
    18474    if (PyCallable_Check(g_obj_callback->on_call_state)) 
    18575    {    
    186         pjsip_event_Object * obj; 
     76        PyObj_pjsip_event * obj; 
    18777 
    18878        ENTER_PYTHON(); 
    18979 
    190         obj = (pjsip_event_Object *)PyType_GenericNew(&pjsip_event_Type, 
     80        obj = (PyObj_pjsip_event *)PyType_GenericNew(&PyTyp_pjsip_event, 
    19181                                                      NULL, NULL); 
    19282                 
     
    19484                 
    19585        PyObject_CallFunctionObjArgs( 
    196             g_obj_callback->on_call_state,Py_BuildValue("i",call_id),obj,NULL 
     86            g_obj_callback->on_call_state, 
     87            Py_BuildValue("i",call_id), 
     88            obj, 
     89            NULL 
    19790        ); 
    19891 
     
    211104    if (PyCallable_Check(g_obj_callback->on_incoming_call)) 
    212105    { 
    213         pjsip_rx_data_Object * obj; 
     106        PyObj_pjsip_rx_data * obj; 
    214107 
    215108        ENTER_PYTHON(); 
    216109 
    217         obj = (pjsip_rx_data_Object *)PyType_GenericNew(&pjsip_rx_data_Type,  
     110        obj = (PyObj_pjsip_rx_data *)PyType_GenericNew(&PyTyp_pjsip_rx_data,  
    218111                                                        NULL, NULL); 
    219112        obj->rdata = rdata; 
     
    242135        ENTER_PYTHON(); 
    243136 
    244         PyObject_CallFunction(g_obj_callback->on_call_media_state,"i",call_id); 
     137        PyObject_CallFunction( 
     138            g_obj_callback->on_call_media_state, 
     139            "i", 
     140            call_id, 
     141            NULL 
     142        ); 
     143 
     144        LEAVE_PYTHON(); 
     145    } 
     146} 
     147 
     148 
     149/* 
     150 * cb_on_dtmf_digit() 
     151 * Callback from PJSUA-LIB on receiving DTMF digit 
     152 */ 
     153static void cb_on_dtmf_digit(pjsua_call_id call_id, int digit) 
     154{ 
     155    if (PyCallable_Check(g_obj_callback->on_call_media_state)) 
     156    { 
     157        char digit_str[10]; 
     158 
     159        ENTER_PYTHON(); 
     160 
     161        pj_ansi_snprintf(digit_str, sizeof(digit_str), "%c", digit); 
     162 
     163        PyObject_CallFunctionObjArgs( 
     164            g_obj_callback->on_call_media_state, 
     165            Py_BuildValue("i",call_id), 
     166            PyString_FromString(digit_str), 
     167            NULL 
     168        ); 
    245169 
    246170        LEAVE_PYTHON(); 
     
    341265        PyObject * txt; 
    342266        int cd; 
    343         pjsip_rx_data_Object * obj; 
     267        PyObj_pjsip_rx_data * obj; 
    344268 
    345269        ENTER_PYTHON(); 
    346270 
    347         obj = (pjsip_rx_data_Object *)PyType_GenericNew(&pjsip_rx_data_Type, 
     271        obj = (PyObj_pjsip_rx_data *)PyType_GenericNew(&PyTyp_pjsip_rx_data, 
    348272                                                        NULL, NULL); 
    349273        obj->rdata = rdata; 
     
    387311            g_obj_callback->on_call_replaced, 
    388312            Py_BuildValue("i",old_call_id), 
    389             Py_BuildValue("i",old_call_id), 
     313            Py_BuildValue("i",new_call_id), 
    390314            NULL 
    391315        ); 
     
    406330        ENTER_PYTHON(); 
    407331 
    408         PyObject_CallFunction(g_obj_callback->on_reg_state,"i",acc_id); 
     332        PyObject_CallFunction( 
     333            g_obj_callback->on_reg_state, 
     334            "i", 
     335            acc_id, 
     336            NULL 
     337        ); 
    409338 
    410339        LEAVE_PYTHON(); 
     
    423352        ENTER_PYTHON(); 
    424353 
    425         PyObject_CallFunction(g_obj_callback->on_buddy_state,"i",buddy_id); 
     354        PyObject_CallFunction( 
     355            g_obj_callback->on_buddy_state, 
     356            "i", 
     357            buddy_id, 
     358            NULL 
     359        ); 
    426360 
    427361        LEAVE_PYTHON(); 
     
    447381            PyString_FromStringAndSize(contact->ptr, contact->slen), 
    448382            PyString_FromStringAndSize(mime_type->ptr, mime_type->slen), 
    449             PyString_FromStringAndSize(body->ptr, body->slen), NULL 
     383            PyString_FromStringAndSize(body->ptr, body->slen),  
     384            NULL 
    450385        ); 
    451386 
     
    505440            PyString_FromStringAndSize(to->ptr, to->slen), 
    506441            PyString_FromStringAndSize(contact->ptr, contact->slen), 
    507             Py_BuildValue("i",is_typing),NULL 
     442            Py_BuildValue("i",is_typing), 
     443            NULL 
    508444        ); 
    509445 
     
    513449 
    514450 
    515 /* 
    516  * callback_dealloc 
    517  * destructor function for callback struct 
    518  */ 
    519 static void callback_dealloc(callback_Object* self) 
    520 { 
    521     Py_XDECREF(self->on_call_state); 
    522     Py_XDECREF(self->on_incoming_call); 
    523     Py_XDECREF(self->on_call_media_state); 
    524     Py_XDECREF(self->on_call_transfer_request); 
    525     Py_XDECREF(self->on_call_transfer_status); 
    526     Py_XDECREF(self->on_call_replace_request); 
    527     Py_XDECREF(self->on_call_replaced); 
    528     Py_XDECREF(self->on_reg_state); 
    529     Py_XDECREF(self->on_buddy_state); 
    530     Py_XDECREF(self->on_pager); 
    531     Py_XDECREF(self->on_pager_status); 
    532     Py_XDECREF(self->on_typing); 
    533     self->ob_type->tp_free((PyObject*)self); 
    534 } 
    535  
    536  
    537 /* 
    538  * callback_new 
    539  * * declares constructor for callback struct 
    540  */ 
    541 static PyObject * callback_new(PyTypeObject *type, PyObject *args, 
    542                                PyObject *kwds) 
    543 { 
    544     callback_Object *self; 
    545  
    546     self = (callback_Object *)type->tp_alloc(type, 0); 
    547     if (self != NULL) 
    548     { 
    549         Py_INCREF(Py_None); 
    550         self->on_call_state = Py_None; 
    551         if (self->on_call_state == NULL) 
    552         { 
    553             Py_DECREF(Py_None); 
    554             return NULL; 
    555         } 
    556         Py_INCREF(Py_None); 
    557         self->on_incoming_call = Py_None; 
    558         if (self->on_incoming_call == NULL) 
    559         { 
    560             Py_DECREF(Py_None); 
    561             return NULL; 
    562         } 
    563         Py_INCREF(Py_None); 
    564         self->on_call_media_state = Py_None; 
    565         if (self->on_call_media_state == NULL) 
    566         { 
    567             Py_DECREF(Py_None); 
    568             return NULL; 
    569         } 
    570         Py_INCREF(Py_None); 
    571         self->on_call_transfer_request = Py_None; 
    572         if (self->on_call_transfer_request == NULL) 
    573         { 
    574             Py_DECREF(Py_None); 
    575             return NULL; 
    576         } 
    577         Py_INCREF(Py_None); 
    578         self->on_call_transfer_status = Py_None; 
    579         if (self->on_call_transfer_status == NULL) 
    580         { 
    581             Py_DECREF(Py_None); 
    582             return NULL; 
    583         } 
    584         Py_INCREF(Py_None); 
    585         self->on_call_replace_request = Py_None; 
    586         if (self->on_call_replace_request == NULL) 
    587         { 
    588             Py_DECREF(Py_None); 
    589             return NULL; 
    590         } 
    591         Py_INCREF(Py_None); 
    592         self->on_call_replaced = Py_None; 
    593         if (self->on_call_replaced == NULL) 
    594         { 
    595             Py_DECREF(Py_None); 
    596             return NULL; 
    597         } 
    598         Py_INCREF(Py_None); 
    599         self->on_reg_state = Py_None; 
    600         if (self->on_reg_state == NULL) 
    601         { 
    602             Py_DECREF(Py_None); 
    603             return NULL; 
    604         } 
    605         Py_INCREF(Py_None); 
    606         self->on_buddy_state = Py_None; 
    607         if (self->on_buddy_state == NULL) 
    608         { 
    609             Py_DECREF(Py_None); 
    610             return NULL; 
    611         } 
    612         Py_INCREF(Py_None); 
    613         self->on_pager = Py_None; 
    614         if (self->on_pager == NULL) 
    615         { 
    616             Py_DECREF(Py_None); 
    617             return NULL; 
    618         } 
    619         Py_INCREF(Py_None); 
    620         self->on_pager_status = Py_None; 
    621         if (self->on_pager_status == NULL) 
    622         { 
    623             Py_DECREF(Py_None); 
    624             return NULL; 
    625         } 
    626         Py_INCREF(Py_None); 
    627         self->on_typing = Py_None; 
    628         if (self->on_typing == NULL) 
    629         { 
    630             Py_DECREF(Py_None); 
    631             return NULL; 
    632         } 
    633     } 
    634  
    635     return (PyObject *)self; 
    636 } 
    637  
    638  
    639 /* 
    640  * callback_members 
    641  * declares available functions for callback object 
    642  */ 
    643 static PyMemberDef callback_members[] = 
    644 { 
    645     { 
    646         "on_call_state", T_OBJECT_EX, offsetof(callback_Object, on_call_state), 
    647         0, "Notify application when invite state has changed. Application may " 
    648         "then query the call info to get the detail call states." 
    649     }, 
    650     { 
    651         "on_incoming_call", T_OBJECT_EX, 
    652         offsetof(callback_Object, on_incoming_call), 0, 
    653         "Notify application on incoming call." 
    654     }, 
    655     { 
    656         "on_call_media_state", T_OBJECT_EX, 
    657         offsetof(callback_Object, on_call_media_state), 0, 
    658         "Notify application when media state in the call has changed. Normal " 
    659         "application would need to implement this callback, e.g. to connect " 
    660         "the call's media to sound device." 
    661     }, 
    662     { 
    663         "on_call_transfer_request", T_OBJECT_EX, 
    664         offsetof(callback_Object, on_call_transfer_request), 0, 
    665         "Notify application on call being transfered. " 
    666         "Application can decide to accept/reject transfer request " 
    667         "by setting the code (default is 200). When this callback " 
    668         "is not defined, the default behavior is to accept the " 
    669         "transfer." 
    670     }, 
    671     { 
    672         "on_call_transfer_status", T_OBJECT_EX, 
    673         offsetof(callback_Object, on_call_transfer_status), 0, 
    674         "Notify application of the status of previously sent call " 
    675         "transfer request. Application can monitor the status of the " 
    676         "call transfer request, for example to decide whether to " 
    677         "terminate existing call." 
    678     }, 
    679     { 
    680         "on_call_replace_request", T_OBJECT_EX, 
    681         offsetof(callback_Object, on_call_replace_request), 0, 
    682         "Notify application about incoming INVITE with Replaces header. " 
    683         "Application may reject the request by setting non-2xx code." 
    684     }, 
    685     { 
    686         "on_call_replaced", T_OBJECT_EX, 
    687         offsetof(callback_Object, on_call_replaced), 0, 
    688         "Notify application that an existing call has been replaced with " 
    689         "a new call. This happens when PJSUA-API receives incoming INVITE " 
    690         "request with Replaces header." 
    691         " " 
    692         "After this callback is called, normally PJSUA-API will disconnect " 
    693         "old_call_id and establish new_call_id." 
    694     }, 
    695     { 
    696         "on_reg_state", T_OBJECT_EX, 
    697         offsetof(callback_Object, on_reg_state), 0, 
    698         "Notify application when registration status has changed. Application " 
    699         "may then query the account info to get the registration details." 
    700     }, 
    701     { 
    702         "on_buddy_state", T_OBJECT_EX, 
    703         offsetof(callback_Object, on_buddy_state), 0, 
    704         "Notify application when the buddy state has changed. Application may " 
    705         "then query the buddy into to get the details." 
    706     }, 
    707     { 
    708         "on_pager", T_OBJECT_EX, offsetof(callback_Object, on_pager), 0, 
    709         "Notify application on incoming pager (i.e. MESSAGE request). " 
    710         "Argument call_id will be -1 if MESSAGE request is not related to an " 
    711         "existing call." 
    712     }, 
    713     { 
    714         "on_pager_status", T_OBJECT_EX, 
    715         offsetof(callback_Object, on_pager_status), 0, 
    716         "Notify application about the delivery status of outgoing pager " 
    717         "request." 
    718     }, 
    719     { 
    720         "on_typing", T_OBJECT_EX, offsetof(callback_Object, on_typing), 0, 
    721         "Notify application about typing indication." 
    722     }, 
    723     {NULL}  /* Sentinel */ 
    724 }; 
    725  
    726  
    727 /* 
    728  * callback_Type 
    729  * callback class definition 
    730  */ 
    731 static PyTypeObject callback_Type = 
    732 { 
    733     PyObject_HEAD_INIT(NULL) 
    734     0,                              /*ob_size*/ 
    735     "py_pjsua.Callback",            /*tp_name*/ 
    736     sizeof(callback_Object),        /*tp_basicsize*/ 
    737     0,                              /*tp_itemsize*/ 
    738     (destructor)callback_dealloc,   /*tp_dealloc*/ 
    739     0,                                  /*tp_print*/ 
    740     0,                                  /*tp_getattr*/ 
    741     0,                                  /*tp_setattr*/ 
    742     0,                                  /*tp_compare*/ 
    743     0,                                  /*tp_repr*/ 
    744     0,                                  /*tp_as_number*/ 
    745     0,                                  /*tp_as_sequence*/ 
    746     0,                                  /*tp_as_mapping*/ 
    747     0,                                  /*tp_hash */ 
    748     0,                                  /*tp_call*/ 
    749     0,                                  /*tp_str*/ 
    750     0,                                  /*tp_getattro*/ 
    751     0,                                  /*tp_setattro*/ 
    752     0,                                  /*tp_as_buffer*/ 
    753     Py_TPFLAGS_DEFAULT,                 /*tp_flags*/ 
    754     "Callback objects",             /* tp_doc */ 
    755     0,                                  /* tp_traverse */ 
    756     0,                                  /* tp_clear */ 
    757     0,                                  /* tp_richcompare */ 
    758     0,                                  /* tp_weaklistoffset */ 
    759     0,                                  /* tp_iter */ 
    760     0,                                  /* tp_iternext */ 
    761     0,                                          /* tp_methods */ 
    762     callback_members,               /* tp_members */ 
    763     0,                                  /* tp_getset */ 
    764     0,                                  /* tp_base */ 
    765     0,                                  /* tp_dict */ 
    766     0,                                  /* tp_descr_get */ 
    767     0,                                  /* tp_descr_set */ 
    768     0,                                  /* tp_dictoffset */ 
    769     0,                                                  /* tp_init */ 
    770     0,                                  /* tp_alloc */ 
    771     callback_new,                   /* tp_new */ 
    772  
    773 }; 
    774  
    775  
    776 /* 
    777  * media_config_Object 
    778  * C/Python wrapper for media_config object 
    779  */ 
    780 typedef struct 
    781 { 
    782     PyObject_HEAD 
    783     /* Type-specific fields go here. */ 
    784     unsigned clock_rate; 
    785     unsigned max_media_ports; 
    786     int has_ioqueue; 
    787     unsigned thread_cnt; 
    788     unsigned quality; 
    789     unsigned ptime; 
    790     int no_vad; 
    791     unsigned ilbc_mode; 
    792     unsigned tx_drop_pct; 
    793     unsigned rx_drop_pct; 
    794     unsigned ec_options; 
    795     unsigned ec_tail_len; 
    796 } media_config_Object; 
    797  
    798  
    799 /* 
    800  * media_config_members 
    801  * declares attributes accessible from both C and Python for media_config file 
    802  */ 
    803 static PyMemberDef media_config_members[] = 
    804 { 
    805     { 
    806         "clock_rate", T_INT, offsetof(media_config_Object, clock_rate), 0, 
    807         "Clock rate to be applied to the conference bridge. If value is zero, " 
    808         "default clock rate will be used (16KHz)." 
    809     }, 
    810     { 
    811         "max_media_ports", T_INT, 
    812         offsetof(media_config_Object, max_media_ports), 0, 
    813         "Specify maximum number of media ports to be created in the " 
    814         "conference bridge. Since all media terminate in the bridge (calls, " 
    815         "file player, file recorder, etc), the value must be large enough to " 
    816         "support all of them. However, the larger the value, the more " 
    817         "computations are performed." 
    818     }, 
    819     { 
    820         "has_ioqueue", T_INT, offsetof(media_config_Object, has_ioqueue), 0, 
    821         "Specify whether the media manager should manage its own ioqueue for " 
    822         "the RTP/RTCP sockets. If yes, ioqueue will be created and at least " 
    823         "one worker thread will be created too. If no, the RTP/RTCP sockets " 
    824         "will share the same ioqueue as SIP sockets, and no worker thread is " 
    825         "needed." 
    826     }, 
    827     { 
    828         "thread_cnt", T_INT, offsetof(media_config_Object, thread_cnt), 0, 
    829         "Specify the number of worker threads to handle incoming RTP packets. " 
    830         "A value of one is recommended for most applications." 
    831     }, 
    832     { 
    833         "quality", T_INT, offsetof(media_config_Object, quality), 0, 
    834         "The media quality also sets speex codec quality/complexity to the " 
    835         "number." 
    836     }, 
    837     { 
    838         "ptime", T_INT, offsetof(media_config_Object, ptime), 0, 
    839         "Specify default ptime." 
    840     }, 
    841     { 
    842         "no_vad", T_INT, offsetof(media_config_Object, no_vad), 0, 
    843         "Disable VAD?" 
    844     }, 
    845     { 
    846         "ilbc_mode", T_INT, offsetof(media_config_Object, ilbc_mode), 0, 
    847         "iLBC mode (20 or 30)." 
    848     }, 
    849     { 
    850         "tx_drop_pct", T_INT, offsetof(media_config_Object, tx_drop_pct), 0, 
    851         "Percentage of RTP packet to drop in TX direction (to simulate packet " 
    852         "lost)." 
    853     }, 
    854     { 
    855         "rx_drop_pct", T_INT, offsetof(media_config_Object, rx_drop_pct), 0, 
    856         "Percentage of RTP packet to drop in RX direction (to simulate packet " 
    857         "lost)."}, 
    858     { 
    859         "ec_options", T_INT, offsetof(media_config_Object, ec_options), 0, 
    860         "Echo canceller options (see #pjmedia_echo_create())" 
    861     }, 
    862     { 
    863         "ec_tail_len", T_INT, offsetof(media_config_Object, ec_tail_len), 0, 
    864         "Echo canceller tail length, in miliseconds." 
    865     }, 
    866     {NULL}  /* Sentinel */ 
    867 }; 
    868  
    869  
    870 /* 
    871  * media_config_Type 
    872  */ 
    873 static PyTypeObject media_config_Type = 
    874 { 
    875     PyObject_HEAD_INIT(NULL) 
    876     0,                              /*ob_size*/ 
    877     "py_pjsua.Media_Config",        /*tp_name*/ 
    878     sizeof(media_config_Object),    /*tp_basicsize*/ 
    879     0,                              /*tp_itemsize*/ 
    880     0,                              /*tp_dealloc*/ 
    881     0,                              /*tp_print*/ 
    882     0,                              /*tp_getattr*/ 
    883     0,                              /*tp_setattr*/ 
    884     0,                              /*tp_compare*/ 
    885     0,                              /*tp_repr*/ 
    886     0,                              /*tp_as_number*/ 
    887     0,                              /*tp_as_sequence*/ 
    888     0,                              /*tp_as_mapping*/ 
    889     0,                              /*tp_hash */ 
    890     0,                              /*tp_call*/ 
    891     0,                              /*tp_str*/ 
    892     0,                              /*tp_getattro*/ 
    893     0,                              /*tp_setattro*/ 
    894     0,                              /*tp_as_buffer*/ 
    895     Py_TPFLAGS_DEFAULT,             /*tp_flags*/ 
    896     "Media Config objects",         /*tp_doc*/ 
    897     0,                              /*tp_traverse*/ 
    898     0,                              /*tp_clear*/ 
    899     0,                              /*tp_richcompare*/ 
    900     0,                              /* tp_weaklistoffset */ 
    901     0,                              /* tp_iter */ 
    902     0,                              /* tp_iternext */ 
    903     0,                              /* tp_methods */ 
    904     media_config_members,           /* tp_members */ 
    905  
    906 }; 
    907  
    908  
    909 /* 
    910  * config_Object 
    911  * attribute list for config object 
    912  */ 
    913 typedef struct 
    914 { 
    915     PyObject_HEAD 
    916     /* Type-specific fields go here. */ 
    917     unsigned max_calls; 
    918     unsigned thread_cnt; 
    919     unsigned outbound_proxy_cnt; 
    920     pj_str_t outbound_proxy[4]; 
    921     PyObject *stun_domain; 
    922     PyObject *stun_host; 
    923     PyObject *stun_relay_host; 
    924     unsigned cred_count; 
    925     pjsip_cred_info cred_info[PJSUA_ACC_MAX_PROXIES]; 
    926     callback_Object * cb; 
    927     PyObject * user_agent; 
    928 } config_Object; 
    929  
    930  
    931 /* 
    932  * config_dealloc 
    933  * deallocates a config object 
    934  */ 
    935 static void config_dealloc(config_Object* self) 
    936 { 
    937     Py_XDECREF(self->cb); 
    938     Py_XDECREF(self->user_agent); 
    939     self->ob_type->tp_free((PyObject*)self); 
    940 } 
    941  
    942 /* 
    943  * config_new  
    944  * config object constructor 
    945  */ 
    946 static PyObject *config_new(PyTypeObject *type, PyObject *args, PyObject *kwds) 
    947 { 
    948     config_Object *self; 
    949  
    950     self = (config_Object *)type->tp_alloc(type, 0); 
    951     if (self != NULL) 
    952     { 
    953         self->user_agent = PyString_FromString(""); 
    954         if (self->user_agent == NULL) 
    955         { 
    956             Py_DECREF(self); 
    957             return NULL; 
    958         } 
    959         self->cb = (callback_Object *)PyType_GenericNew( 
    960             &callback_Type, NULL, NULL 
    961         ); 
    962         if (self->cb == NULL) 
    963         { 
    964             Py_DECREF(Py_None); 
    965             return NULL; 
    966         } 
    967     } 
    968     return (PyObject *)self; 
    969 } 
    970  
    971  
    972 /* 
    973  * config_members 
    974  * attribute list accessible from Python/C 
    975  */ 
    976 static PyMemberDef config_members[] = 
    977 { 
    978     { 
    979         "max_calls", T_INT, offsetof(config_Object, max_calls), 0, 
    980         "Maximum calls to support (default: 4) " 
    981     }, 
    982     { 
    983         "thread_cnt", T_INT, offsetof(config_Object, thread_cnt), 0, 
    984         "Number of worker threads. Normally application will want to have at " 
    985         "least one worker thread, unless when it wants to poll the library " 
    986         "periodically, which in this case the worker thread can be set to " 
    987         "zero." 
    988     }, 
    989     { 
    990         "outbound_proxy_cnt", T_INT, 
    991         offsetof(config_Object, outbound_proxy_cnt), 0, 
    992         "Number of outbound proxies in the array." 
    993     }, 
    994     { 
    995         "cred_count", T_INT, offsetof(config_Object, cred_count), 0, 
    996         "Number of credentials in the credential array." 
    997     }, 
    998     { 
    999         "user_agent", T_OBJECT_EX, offsetof(config_Object, user_agent), 0, 
    1000         "User agent string (default empty)" 
    1001     }, 
    1002     { 
    1003         "cb", T_OBJECT_EX, offsetof(config_Object, cb), 0, 
    1004         "Application callback." 
    1005     }, 
    1006     {NULL}  /* Sentinel */ 
    1007 }; 
    1008  
    1009  
    1010 /* 
    1011  * config_Type 
    1012  * type wrapper for config class 
    1013  */ 
    1014 static PyTypeObject config_Type = 
    1015 { 
    1016     PyObject_HEAD_INIT(NULL) 
    1017     0,                         /*ob_size*/ 
    1018     "py_pjsua.Config",         /*tp_name*/ 
    1019     sizeof(config_Object),     /*tp_basicsize*/ 
    1020     0,                         /*tp_itemsize*/ 
    1021     (destructor)config_dealloc,/*tp_dealloc*/ 
    1022     0,                         /*tp_print*/ 
    1023     0,                         /*tp_getattr*/ 
    1024     0,                         /*tp_setattr*/ 
    1025     0,                         /*tp_compare*/ 
    1026     0,                         /*tp_repr*/ 
    1027     0,                         /*tp_as_number*/ 
    1028     0,                         /*tp_as_sequence*/ 
    1029     0,                         /*tp_as_mapping*/ 
    1030     0,                         /*tp_hash */ 
    1031     0,                         /*tp_call*/ 
    1032     0,                         /*tp_str*/ 
    1033     0,                         /*tp_getattro*/ 
    1034     0,                         /*tp_setattro*/ 
    1035     0,                         /*tp_as_buffer*/ 
    1036     Py_TPFLAGS_DEFAULT,        /*tp_flags*/ 
    1037     "Config objects",          /* tp_doc */ 
    1038     0,                         /* tp_traverse */ 
    1039     0,                         /* tp_clear */ 
    1040     0,                         /* tp_richcompare */ 
    1041     0,                         /* tp_weaklistoffset */ 
    1042     0,                         /* tp_iter */ 
    1043     0,                         /* tp_iternext */ 
    1044     0,                         /* tp_methods */ 
    1045     config_members,            /* tp_members */ 
    1046     0,                         /* tp_getset */ 
    1047     0,                         /* tp_base */ 
    1048     0,                         /* tp_dict */ 
    1049     0,                         /* tp_descr_get */ 
    1050     0,                         /* tp_descr_set */ 
    1051     0,                         /* tp_dictoffset */ 
    1052     0,                         /* tp_init */ 
    1053     0,                         /* tp_alloc */ 
    1054     config_new,                 /* tp_new */ 
    1055  
    1056 }; 
    1057  
    1058  
    1059 /* 
    1060  * logging_config_Object 
    1061  * configuration class for logging_config object 
    1062  */ 
    1063 typedef struct 
    1064 { 
    1065     PyObject_HEAD 
    1066     /* Type-specific fields go here. */ 
    1067     int msg_logging; 
    1068     unsigned level; 
    1069     unsigned console_level; 
    1070     unsigned decor; 
    1071     PyObject * log_filename; 
    1072     PyObject * cb; 
    1073 } logging_config_Object; 
    1074  
    1075  
    1076 /* 
    1077  * logging_config_dealloc 
    1078  * deletes a logging config from memory 
    1079  */ 
    1080 static void logging_config_dealloc(logging_config_Object* self) 
    1081 { 
    1082     Py_XDECREF(self->log_filename); 
    1083     Py_XDECREF(self->cb); 
    1084     self->ob_type->tp_free((PyObject*)self); 
    1085 } 
    1086  
    1087  
    1088 /* 
    1089  * logging_config_new 
    1090  * constructor for logging_config object 
    1091  */ 
    1092 static PyObject * logging_config_new(PyTypeObject *type, PyObject *args, 
    1093                                     PyObject *kwds) 
    1094 { 
    1095     logging_config_Object *self; 
    1096  
    1097     self = (logging_config_Object *)type->tp_alloc(type, 0); 
    1098     if (self != NULL) 
    1099     { 
    1100         self->log_filename = PyString_FromString(""); 
    1101         if (self->log_filename == NULL) 
    1102         { 
    1103             Py_DECREF(self); 
    1104             return NULL; 
    1105         } 
    1106         Py_INCREF(Py_None); 
    1107         self->cb = Py_None; 
    1108         if (self->cb == NULL) 
    1109         { 
    1110             Py_DECREF(Py_None); 
    1111             return NULL; 
    1112         } 
    1113     } 
    1114  
    1115     return (PyObject *)self; 
    1116 } 
    1117  
    1118  
    1119 /* 
    1120  * logging_config_members 
    1121  */ 
    1122 static PyMemberDef logging_config_members[] = 
    1123 { 
    1124     { 
    1125         "msg_logging", T_INT, offsetof(logging_config_Object, msg_logging), 0, 
    1126         "Log incoming and outgoing SIP message? Yes!" 
    1127     }, 
    1128     { 
    1129         "level", T_INT, offsetof(logging_config_Object, level), 0, 
    1130         "Input verbosity level. Value 5 is reasonable." 
    1131     }, 
    1132     { 
    1133         "console_level", T_INT, offsetof(logging_config_Object, console_level), 
    1134         0, "Verbosity level for console. Value 4 is reasonable." 
    1135     }, 
    1136     { 
    1137         "decor", T_INT, offsetof(logging_config_Object, decor), 0, 
    1138         "Log decoration" 
    1139     }, 
    1140     { 
    1141         "log_filename", T_OBJECT_EX, 
    1142         offsetof(logging_config_Object, log_filename), 0, 
    1143         "Optional log filename" 
    1144     }, 
    1145     { 
    1146         "cb", T_OBJECT_EX, offsetof(logging_config_Object, cb), 0, 
    1147         "Optional callback function to be called to write log to application " 
    1148         "specific device. This function will be called forlog messages on " 
    1149         "input verbosity level." 
    1150     }, 
    1151     {NULL}  /* Sentinel */ 
    1152 }; 
    1153  
    1154  
    1155  
    1156  
    1157 /* 
    1158  * logging_config_Type 
    1159  */ 
    1160 static PyTypeObject logging_config_Type = 
    1161 { 
    1162     PyObject_HEAD_INIT(NULL) 
    1163     0,                              /*ob_size*/ 
    1164     "py_pjsua.Logging_Config",      /*tp_name*/ 
    1165     sizeof(logging_config_Object),  /*tp_basicsize*/ 
    1166     0,                              /*tp_itemsize*/ 
    1167     (destructor)logging_config_dealloc,/*tp_dealloc*/ 
    1168     0,                              /*tp_print*/ 
    1169     0,                              /*tp_getattr*/ 
    1170     0,                              /*tp_setattr*/ 
    1171     0,                              /*tp_compare*/ 
    1172     0,                              /*tp_repr*/ 
    1173     0,                              /*tp_as_number*/ 
    1174     0,                              /*tp_as_sequence*/ 
    1175     0,                              /*tp_as_mapping*/ 
    1176     0,                              /*tp_hash */ 
    1177     0,                              /*tp_call*/ 
    1178     0,                              /*tp_str*/ 
    1179     0,                              /*tp_getattro*/ 
    1180     0,                              /*tp_setattro*/ 
    1181     0,                              /*tp_as_buffer*/ 
    1182     Py_TPFLAGS_DEFAULT,             /*tp_flags*/ 
    1183     "Logging Config objects",       /* tp_doc */ 
    1184     0,                              /* tp_traverse */ 
    1185     0,                              /* tp_clear */ 
    1186     0,                              /* tp_richcompare */ 
    1187     0,                              /* tp_weaklistoffset */ 
    1188     0,                              /* tp_iter */ 
    1189     0,                              /* tp_iternext */ 
    1190     0,                              /* tp_methods */ 
    1191     logging_config_members,         /* tp_members */ 
    1192     0,                              /* tp_getset */ 
    1193     0,                              /* tp_base */ 
    1194     0,                              /* tp_dict */ 
    1195     0,                              /* tp_descr_get */ 
    1196     0,                              /* tp_descr_set */ 
    1197     0,                              /* tp_dictoffset */ 
    1198     0,                              /* tp_init */ 
    1199     0,                              /* tp_alloc */ 
    1200     logging_config_new,             /* tp_new */ 
    1201  
    1202 }; 
    1203  
    1204  
    1205 /* 
    1206  * msg_data_Object 
    1207  * typewrapper for MessageData class 
    1208  * !modified @ 061206 
    1209  */ 
    1210 typedef struct 
    1211 { 
    1212     PyObject_HEAD 
    1213     /* Type-specific fields go here. */ 
    1214     /*pjsip_hdr hdr_list;*/ 
    1215     PyObject * hdr_list; 
    1216     PyObject * content_type; 
    1217     PyObject * msg_body; 
    1218 } msg_data_Object; 
    1219  
    1220  
    1221 /* 
    1222  * msg_data_dealloc 
    1223  * deletes a msg_data 
    1224  * !modified @ 061206 
    1225  */ 
    1226 static void msg_data_dealloc(msg_data_Object* self) 
    1227 { 
    1228     Py_XDECREF(self->hdr_list); 
    1229     Py_XDECREF(self->content_type); 
    1230     Py_XDECREF(self->msg_body); 
    1231     self->ob_type->tp_free((PyObject*)self); 
    1232 } 
    1233  
    1234  
    1235 /* 
    1236  * msg_data_new 
    1237  * constructor for msg_data object 
    1238  * !modified @ 061206 
    1239  */ 
    1240 static PyObject * msg_data_new(PyTypeObject *type, PyObject *args, 
    1241                                 PyObject *kwds) 
    1242 { 
    1243     msg_data_Object *self; 
    1244  
    1245     self = (msg_data_Object *)type->tp_alloc(type, 0); 
    1246     if (self != NULL) 
    1247     { 
    1248         Py_INCREF(Py_None); 
    1249         self->hdr_list = Py_None; 
    1250         if (self->hdr_list == NULL) 
    1251         { 
    1252             Py_DECREF(self); 
    1253             return NULL; 
    1254         } 
    1255         self->content_type = PyString_FromString(""); 
    1256         if (self->content_type == NULL) 
    1257         { 
    1258             Py_DECREF(self); 
    1259             return NULL; 
    1260         } 
    1261         self->msg_body = PyString_FromString(""); 
    1262         if (self->msg_body == NULL) 
    1263         { 
    1264             Py_DECREF(self); 
    1265             return NULL; 
    1266         } 
    1267     } 
    1268  
    1269     return (PyObject *)self; 
    1270 } 
    1271  
    1272  
    1273 /* 
    1274  * msg_data_members 
    1275  * !modified @ 061206 
    1276  */ 
    1277 static PyMemberDef msg_data_members[] = 
    1278 { 
    1279     { 
    1280         "hdr_list", T_OBJECT_EX, offsetof(msg_data_Object, hdr_list), 
    1281         0, "Additional message headers as linked list." 
    1282     },  
    1283     { 
    1284         "content_type", T_OBJECT_EX, offsetof(msg_data_Object, content_type), 
    1285         0, "MIME type of optional message body." 
    1286     }, 
    1287     { 
    1288         "msg_body", T_OBJECT_EX, offsetof(msg_data_Object, msg_body), 0, 
    1289         "Optional message body." 
    1290     }, 
    1291     {NULL}  /* Sentinel */ 
    1292 }; 
    1293  
    1294  
    1295 /* 
    1296  * msg_data_Type 
    1297  */ 
    1298 static PyTypeObject msg_data_Type = 
    1299 { 
    1300     PyObject_HEAD_INIT(NULL) 
    1301     0,                         /*ob_size*/ 
    1302     "py_pjsua.Msg_Data",       /*tp_name*/ 
    1303     sizeof(msg_data_Object),   /*tp_basicsize*/ 
    1304     0,                         /*tp_itemsize*/ 
    1305     (destructor)msg_data_dealloc,/*tp_dealloc*/ 
    1306     0,                         /*tp_print*/ 
    1307     0,                         /*tp_getattr*/ 
    1308     0,                         /*tp_setattr*/ 
    1309     0,                         /*tp_compare*/ 
    1310     0,                         /*tp_repr*/ 
    1311     0,                         /*tp_as_number*/ 
    1312     0,                         /*tp_as_sequence*/ 
    1313     0,                         /*tp_as_mapping*/ 
    1314     0,                         /*tp_hash */ 
    1315     0,                         /*tp_call*/ 
    1316     0,                         /*tp_str*/ 
    1317     0,                         /*tp_getattro*/ 
    1318     0,                         /*tp_setattro*/ 
    1319     0,                         /*tp_as_buffer*/ 
    1320     Py_TPFLAGS_DEFAULT,        /*tp_flags*/ 
    1321     "msg_data objects",        /* tp_doc */ 
    1322     0,                         /* tp_traverse */ 
    1323     0,                         /* tp_clear */ 
    1324     0,                         /* tp_richcompare */ 
    1325     0,                         /* tp_weaklistoffset */ 
    1326     0,                         /* tp_iter */ 
    1327     0,                         /* tp_iternext */ 
    1328     0,                         /* tp_methods */ 
    1329     msg_data_members,          /* tp_members */ 
    1330     0,                         /* tp_getset */ 
    1331     0,                         /* tp_base */ 
    1332     0,                         /* tp_dict */ 
    1333     0,                         /* tp_descr_get */ 
    1334     0,                         /* tp_descr_set */ 
    1335     0,                         /* tp_dictoffset */ 
    1336     0,                         /* tp_init */ 
    1337     0,                         /* tp_alloc */ 
    1338     msg_data_new,                 /* tp_new */ 
    1339  
    1340 }; 
    1341451 
    1342452/*  
     
    1419529 
    1420530/* 
    1421  * pj_pool_Object 
    1422  */ 
    1423 typedef struct 
    1424 { 
    1425     PyObject_HEAD 
    1426     /* Type-specific fields go here. */ 
    1427     pj_pool_t * pool; 
    1428 } pj_pool_Object; 
    1429  
    1430  
    1431 /* 
    1432  * pj_pool_Type 
    1433  */ 
    1434 static PyTypeObject pj_pool_Type = 
    1435 { 
    1436     PyObject_HEAD_INIT(NULL) 
    1437     0,                         /*ob_size*/ 
    1438     "py_pjsua.PJ_Pool",        /*tp_name*/ 
    1439     sizeof(pj_pool_Object),    /*tp_basicsize*/ 
    1440     0,                         /*tp_itemsize*/ 
    1441     0,                         /*tp_dealloc*/ 
    1442     0,                         /*tp_print*/ 
    1443     0,                         /*tp_getattr*/ 
    1444     0,                         /*tp_setattr*/ 
    1445     0,                         /*tp_compare*/ 
    1446     0,                         /*tp_repr*/ 
    1447     0,                         /*tp_as_number*/ 
    1448     0,                         /*tp_as_sequence*/ 
    1449     0,                         /*tp_as_mapping*/ 
    1450     0,                         /*tp_hash */ 
    1451     0,                         /*tp_call*/ 
    1452     0,                         /*tp_str*/ 
    1453     0,                         /*tp_getattro*/ 
    1454     0,                         /*tp_setattro*/ 
    1455     0,                         /*tp_as_buffer*/ 
    1456     Py_TPFLAGS_DEFAULT,        /*tp_flags*/ 
    1457     "pj_pool_t objects",       /* tp_doc */ 
    1458  
    1459 }; 
    1460  
    1461  
    1462 /* 
    1463  * pjsip_endpoint_Object 
    1464  */ 
    1465 typedef struct 
    1466 { 
    1467     PyObject_HEAD 
    1468     /* Type-specific fields go here. */ 
    1469     pjsip_endpoint * endpt; 
    1470 } pjsip_endpoint_Object; 
    1471  
    1472  
    1473 /* 
    1474  * pjsip_endpoint_Type 
    1475  */ 
    1476 static PyTypeObject pjsip_endpoint_Type = 
    1477 { 
    1478     PyObject_HEAD_INIT(NULL) 
    1479     0,                         /*ob_size*/ 
    1480     "py_pjsua.PJSIP_Endpoint", /*tp_name*/ 
    1481     sizeof(pjsip_endpoint_Object),/*tp_basicsize*/ 
    1482     0,                         /*tp_itemsize*/ 
    1483     0,                         /*tp_dealloc*/ 
    1484     0,                         /*tp_print*/ 
    1485     0,                         /*tp_getattr*/ 
    1486     0,                         /*tp_setattr*/ 
    1487     0,                         /*tp_compare*/ 
    1488     0,                         /*tp_repr*/ 
    1489     0,                         /*tp_as_number*/ 
    1490     0,                         /*tp_as_sequence*/ 
    1491     0,                         /*tp_as_mapping*/ 
    1492     0,                         /*tp_hash */ 
    1493     0,                         /*tp_call*/ 
    1494     0,                         /*tp_str*/ 
    1495     0,                         /*tp_getattro*/ 
    1496     0,                         /*tp_setattro*/ 
    1497     0,                         /*tp_as_buffer*/ 
    1498     Py_TPFLAGS_DEFAULT,        /*tp_flags*/ 
    1499     "pjsip_endpoint objects",  /* tp_doc */ 
    1500 }; 
    1501  
    1502  
    1503 /* 
    1504  * pjmedia_endpt_Object 
    1505  */ 
    1506 typedef struct 
    1507 { 
    1508     PyObject_HEAD 
    1509     /* Type-specific fields go here. */ 
    1510     pjmedia_endpt * endpt; 
    1511 } pjmedia_endpt_Object; 
    1512  
    1513  
    1514 /* 
    1515  * pjmedia_endpt_Type 
    1516  */ 
    1517 static PyTypeObject pjmedia_endpt_Type = 
    1518 { 
    1519     PyObject_HEAD_INIT(NULL) 
    1520     0,                         /*ob_size*/ 
    1521     "py_pjsua.PJMedia_Endpt",  /*tp_name*/ 
    1522     sizeof(pjmedia_endpt_Object), /*tp_basicsize*/ 
    1523     0,                         /*tp_itemsize*/ 
    1524     0,                         /*tp_dealloc*/ 
    1525     0,                         /*tp_print*/ 
    1526     0,                         /*tp_getattr*/ 
    1527     0,                         /*tp_setattr*/ 
    1528     0,                         /*tp_compare*/ 
    1529     0,                         /*tp_repr*/ 
    1530     0,                         /*tp_as_number*/ 
    1531     0,                         /*tp_as_sequence*/ 
    1532     0,                         /*tp_as_mapping*/ 
    1533     0,                         /*tp_hash */ 
    1534     0,                         /*tp_call*/ 
    1535     0,                         /*tp_str*/ 
    1536     0,                         /*tp_getattro*/ 
    1537     0,                         /*tp_setattro*/ 
    1538     0,                         /*tp_as_buffer*/ 
    1539     Py_TPFLAGS_DEFAULT,        /*tp_flags*/ 
    1540     "pjmedia_endpt objects",   /* tp_doc */ 
    1541  
    1542 }; 
    1543  
    1544  
    1545 /* 
    1546  * pj_pool_factory_Object 
    1547  */ 
    1548 typedef struct 
    1549 { 
    1550     PyObject_HEAD 
    1551     /* Type-specific fields go here. */ 
    1552     pj_pool_factory * pool_fact; 
    1553 } pj_pool_factory_Object; 
    1554  
    1555  
    1556  
    1557 /* 
    1558  * pj_pool_factory_Type 
    1559  */ 
    1560 static PyTypeObject pj_pool_factory_Type = 
    1561 { 
    1562     PyObject_HEAD_INIT(NULL) 
    1563     0,                         /*ob_size*/ 
    1564     "py_pjsua.PJ_Pool_Factory",/*tp_name*/ 
    1565     sizeof(pj_pool_factory_Object), /*tp_basicsize*/ 
    1566     0,                         /*tp_itemsize*/ 
    1567     0,                         /*tp_dealloc*/ 
    1568     0,                         /*tp_print*/ 
    1569     0,                         /*tp_getattr*/ 
    1570     0,                         /*tp_setattr*/ 
    1571     0,                         /*tp_compare*/ 
    1572     0,                         /*tp_repr*/ 
    1573     0,                         /*tp_as_number*/ 
    1574     0,                         /*tp_as_sequence*/ 
    1575     0,                         /*tp_as_mapping*/ 
    1576     0,                         /*tp_hash */ 
    1577     0,                         /*tp_call*/ 
    1578     0,                         /*tp_str*/ 
    1579     0,                         /*tp_getattro*/ 
    1580     0,                         /*tp_setattro*/ 
    1581     0,                         /*tp_as_buffer*/ 
    1582     Py_TPFLAGS_DEFAULT,        /*tp_flags*/ 
    1583     "pj_pool_factory objects", /* tp_doc */ 
    1584  
    1585 }; 
    1586  
    1587  
    1588 /* 
    1589  * pjsip_cred_info_Object 
    1590  */ 
    1591 typedef struct 
    1592 { 
    1593     PyObject_HEAD 
    1594     /* Type-specific fields go here. */ 
    1595         PyObject * realm;                
    1596     PyObject * scheme;           
    1597     PyObject * username;         
    1598     int data_type;       
    1599     PyObject * data;     
    1600      
    1601 } pjsip_cred_info_Object; 
    1602  
    1603 /* 
    1604  * cred_info_dealloc 
    1605  * deletes a cred info from memory 
    1606  */ 
    1607 static void pjsip_cred_info_dealloc(pjsip_cred_info_Object* self) 
    1608 { 
    1609     Py_XDECREF(self->realm); 
    1610     Py_XDECREF(self->scheme); 
    1611     Py_XDECREF(self->username); 
    1612     Py_XDECREF(self->data); 
    1613     self->ob_type->tp_free((PyObject*)self); 
    1614 } 
    1615  
    1616  
    1617 /* 
    1618  * cred_info_new 
    1619  * constructor for cred_info object 
    1620  */ 
    1621 static PyObject * pjsip_cred_info_new(PyTypeObject *type, PyObject *args, 
    1622                                     PyObject *kwds) 
    1623 { 
    1624     pjsip_cred_info_Object *self; 
    1625  
    1626     self = (pjsip_cred_info_Object *)type->tp_alloc(type, 0); 
    1627     if (self != NULL) 
    1628     { 
    1629         self->realm = PyString_FromString(""); 
    1630         if (self->realm == NULL) 
    1631         { 
    1632             Py_DECREF(self); 
    1633             return NULL; 
    1634         } 
    1635         self->scheme = PyString_FromString(""); 
    1636         if (self->scheme == NULL) 
    1637         { 
    1638             Py_DECREF(self); 
    1639             return NULL; 
    1640         } 
    1641         self->username = PyString_FromString(""); 
    1642         if (self->username == NULL) 
    1643         { 
    1644             Py_DECREF(self); 
    1645             return NULL; 
    1646         } 
    1647         self->data = PyString_FromString(""); 
    1648         if (self->data == NULL) 
    1649         { 
    1650             Py_DECREF(self); 
    1651             return NULL; 
    1652         } 
    1653     } 
    1654  
    1655     return (PyObject *)self; 
    1656 } 
    1657  
    1658  
    1659 /* 
    1660  * pjsip_cred_info_members 
    1661  */ 
    1662 static PyMemberDef pjsip_cred_info_members[] = 
    1663 { 
    1664     { 
    1665         "realm", T_OBJECT_EX, 
    1666         offsetof(pjsip_cred_info_Object, realm), 0, 
    1667         "Realm" 
    1668     }, 
    1669     { 
    1670         "scheme", T_OBJECT_EX, 
    1671         offsetof(pjsip_cred_info_Object, scheme), 0, 
    1672         "Scheme" 
    1673     }, 
    1674     { 
    1675         "username", T_OBJECT_EX, 
    1676         offsetof(pjsip_cred_info_Object, username), 0, 
    1677         "User name" 
    1678     }, 
    1679     { 
    1680         "data", T_OBJECT_EX, 
    1681         offsetof(pjsip_cred_info_Object, data), 0, 
    1682         "The data, which can be a plaintext password or a hashed digest. " 
    1683     }, 
    1684     { 
    1685         "data_type", T_INT, offsetof(pjsip_cred_info_Object, data_type), 0, 
    1686         "Type of data" 
    1687     }, 
    1688      
    1689     {NULL}  /* Sentinel */ 
    1690 }; 
    1691  
    1692 /* 
    1693  * pjsip_cred_info_Type 
    1694  */ 
    1695 static PyTypeObject pjsip_cred_info_Type = 
    1696 { 
    1697     PyObject_HEAD_INIT(NULL) 
    1698     0,                              /*ob_size*/ 
    1699     "py_pjsua.PJSIP_Cred_Info",      /*tp_name*/ 
    1700     sizeof(pjsip_cred_info_Object),  /*tp_basicsize*/ 
    1701     0,                              /*tp_itemsize*/ 
    1702     (destructor)pjsip_cred_info_dealloc,/*tp_dealloc*/ 
    1703     0,                              /*tp_print*/ 
    1704     0,                              /*tp_getattr*/ 
    1705     0,                              /*tp_setattr*/ 
    1706     0,                              /*tp_compare*/ 
    1707     0,                              /*tp_repr*/ 
    1708     0,                              /*tp_as_number*/ 
    1709     0,                              /*tp_as_sequence*/ 
    1710     0,                              /*tp_as_mapping*/ 
    1711     0,                              /*tp_hash */ 
    1712     0,                              /*tp_call*/ 
    1713     0,                              /*tp_str*/ 
    1714     0,                              /*tp_getattro*/ 
    1715     0,                              /*tp_setattro*/ 
    1716     0,                              /*tp_as_buffer*/ 
    1717     Py_TPFLAGS_DEFAULT,             /*tp_flags*/ 
    1718     "PJSIP Cred Info objects",       /* tp_doc */ 
    1719     0,                              /* tp_traverse */ 
    1720     0,                              /* tp_clear */ 
    1721     0,                              /* tp_richcompare */ 
    1722     0,                              /* tp_weaklistoffset */ 
    1723     0,                              /* tp_iter */ 
    1724     0,                              /* tp_iternext */ 
    1725     0,                              /* tp_methods */ 
    1726     pjsip_cred_info_members,         /* tp_members */ 
    1727     0,                              /* tp_getset */ 
    1728     0,                              /* tp_base */ 
    1729     0,                              /* tp_dict */ 
    1730     0,                              /* tp_descr_get */ 
    1731     0,                              /* tp_descr_set */ 
    1732     0,                              /* tp_dictoffset */ 
    1733     0,                              /* tp_init */ 
    1734     0,                              /* tp_alloc */ 
    1735     pjsip_cred_info_new,             /* tp_new */ 
    1736  
    1737 }; 
    1738  
    1739 /* 
    1740531 * py_pjsua_thread_register 
    1741532 * !added @ 061206 
    1742533 */ 
    1743 static PyObject *py_pjsua_thread_register(PyObject *pSelf, PyObject  
    1744 *pArgs) 
     534static PyObject *py_pjsua_thread_register(PyObject *pSelf, PyObject *pArgs) 
    1745535{ 
    1746536         
     
    1756546#endif 
    1757547 
     548    PJ_UNUSED_ARG(pSelf); 
     549 
    1758550    if (!PyArg_ParseTuple(pArgs, "sO", &name, &py_desc)) 
    1759551    { 
     
    1788580                                                    PyObject *pArgs) 
    1789581{ 
    1790     logging_config_Object *obj;  
     582    PyObj_pjsua_logging_config *obj;     
    1791583    pjsua_logging_config cfg; 
    1792584 
     585    PJ_UNUSED_ARG(pSelf); 
     586 
    1793587    if (!PyArg_ParseTuple(pArgs, "")) 
    1794588    { 
     
    1797591     
    1798592    pjsua_logging_config_default(&cfg); 
    1799     obj = (logging_config_Object *) logging_config_new 
    1800                 (&logging_config_Type,NULL,NULL); 
    1801     obj->msg_logging = cfg.msg_logging; 
    1802     obj->level = cfg.level; 
    1803     obj->console_level = cfg.console_level; 
    1804     obj->decor = cfg.decor; 
     593    obj = (PyObj_pjsua_logging_config *) PyObj_pjsua_logging_config_new 
     594                (&PyTyp_pjsua_logging_config,NULL,NULL); 
     595    PyObj_pjsua_logging_config_import(obj, &cfg); 
    1805596     
    1806597    return (PyObject *)obj; 
     
    1814605static PyObject *py_pjsua_config_default(PyObject *pSelf, PyObject *pArgs) 
    1815606{ 
    1816     config_Object *obj; 
     607    PyObj_pjsua_config *obj; 
    1817608    pjsua_config cfg; 
    1818609 
     610    PJ_UNUSED_ARG(pSelf); 
     611 
    1819612    if (!PyArg_ParseTuple(pArgs, "")) 
    1820613    { 
     
    1822615    } 
    1823616    pjsua_config_default(&cfg); 
    1824     obj = (config_Object *) config_new(&config_Type, NULL, NULL); 
    1825     obj->max_calls = cfg.max_calls; 
    1826     obj->thread_cnt = cfg.thread_cnt; 
     617    obj = (PyObj_pjsua_config *) PyObj_pjsua_config_new(&PyTyp_pjsua_config, NULL, NULL); 
     618    PyObj_pjsua_config_import(obj, &cfg); 
     619 
    1827620    return (PyObject *)obj; 
    1828621} 
     
    1836629                                                PyObject *pArgs) 
    1837630{ 
    1838     media_config_Object *obj; 
     631    PyObj_pjsua_media_config *obj; 
    1839632    pjsua_media_config cfg; 
     633 
     634    PJ_UNUSED_ARG(pSelf); 
     635 
    1840636    if (!PyArg_ParseTuple(pArgs, "")) 
    1841637    { 
     
    1843639    } 
    1844640    pjsua_media_config_default(&cfg); 
    1845     obj = (media_config_Object *)PyType_GenericNew 
    1846                 (&media_config_Type, NULL, NULL); 
    1847     obj->clock_rate = cfg.clock_rate; 
    1848     obj->ec_options = cfg.ec_options; 
    1849     obj->ec_tail_len = cfg.ec_tail_len; 
    1850     obj->has_ioqueue = cfg.has_ioqueue; 
    1851     obj->ilbc_mode = cfg.ilbc_mode; 
    1852     obj->max_media_ports = cfg.max_media_ports; 
    1853     obj->no_vad = cfg.no_vad; 
    1854     obj->ptime = cfg.ptime; 
    1855     obj->quality = cfg.quality; 
    1856     obj->rx_drop_pct = cfg.rx_drop_pct; 
    1857     obj->thread_cnt = cfg.thread_cnt; 
    1858     obj->tx_drop_pct = cfg.tx_drop_pct; 
     641    obj = (PyObj_pjsua_media_config *) 
     642          PyType_GenericNew(&PyTyp_pjsua_media_config, NULL, NULL); 
     643    PyObj_pjsua_media_config_import(obj, &cfg); 
    1859644    return (PyObject *)obj; 
    1860645} 
     
    1867652static PyObject *py_pjsua_msg_data_init(PyObject *pSelf, PyObject *pArgs) 
    1868653{ 
    1869     msg_data_Object *obj; 
     654    PyObj_pjsua_msg_data *obj; 
    1870655    pjsua_msg_data msg; 
    1871656     
     657    PJ_UNUSED_ARG(pSelf); 
     658 
    1872659    if (!PyArg_ParseTuple(pArgs, "")) 
    1873660    { 
     
    1875662    } 
    1876663    pjsua_msg_data_init(&msg); 
    1877     obj = (msg_data_Object *)msg_data_new(&msg_data_Type, NULL, NULL); 
     664    obj = (PyObj_pjsua_msg_data *)PyObj_pjsua_msg_data_new(&PyTyp_pjsua_msg_data, NULL, NULL); 
    1878665    Py_XDECREF(obj->content_type); 
    1879666    obj->content_type = PyString_FromStringAndSize( 
     
    1897684{ 
    1898685    PyObject * logObj; 
    1899     logging_config_Object *log; 
     686    PyObj_pjsua_logging_config *log; 
    1900687    pjsua_logging_config cfg; 
    1901688    pj_status_t status; 
    1902689 
     690    PJ_UNUSED_ARG(pSelf); 
     691 
    1903692    if (!PyArg_ParseTuple(pArgs, "O", &logObj)) 
    1904693    { 
     
    1907696    if (logObj != Py_None)  
    1908697    { 
    1909         log = (logging_config_Object *)logObj; 
     698        log = (PyObj_pjsua_logging_config *)logObj; 
    1910699        cfg.msg_logging = log->msg_logging; 
    1911700        cfg.level = log->level; 
     
    1935724    const char * name; 
    1936725    pj_pool_t *p; 
    1937     pj_pool_Object *pool; 
     726    PyObj_pj_pool *pool; 
     727 
     728    PJ_UNUSED_ARG(pSelf); 
    1938729 
    1939730    if (!PyArg_ParseTuple(pArgs, "sII", &name, &init_size, &increment)) 
     
    1943734     
    1944735    p = pjsua_pool_create(name, init_size, increment); 
    1945     pool = (pj_pool_Object *)PyType_GenericNew(&pj_pool_Type, NULL, NULL); 
     736    pool = (PyObj_pj_pool *)PyType_GenericNew(&PyTyp_pj_pool_t, NULL, NULL); 
    1946737    pool->pool = p; 
    1947738    return (PyObject *)pool; 
     
    1955746static PyObject *py_pjsua_get_pjsip_endpt(PyObject *pSelf, PyObject *pArgs) 
    1956747{ 
    1957     pjsip_endpoint_Object *endpt; 
     748    PyObj_pjsip_endpoint *endpt; 
    1958749    pjsip_endpoint *e; 
    1959750 
     751    PJ_UNUSED_ARG(pSelf); 
     752 
    1960753    if (!PyArg_ParseTuple(pArgs, "")) 
    1961754    { 
     
    1963756    } 
    1964757    e = pjsua_get_pjsip_endpt(); 
    1965     endpt = (pjsip_endpoint_Object *)PyType_GenericNew( 
    1966         &pjsip_endpoint_Type, NULL, NULL 
     758    endpt = (PyObj_pjsip_endpoint *)PyType_GenericNew( 
     759        &PyTyp_pjsip_endpoint, NULL, NULL 
    1967760    ); 
    1968761    endpt->endpt = e; 
     
    1976769static PyObject *py_pjsua_get_pjmedia_endpt(PyObject *pSelf, PyObject *pArgs) 
    1977770{ 
    1978     pjmedia_endpt_Object *endpt; 
     771    PyObj_pjmedia_endpt *endpt; 
    1979772    pjmedia_endpt *e; 
    1980773 
     774    PJ_UNUSED_ARG(pSelf); 
     775 
    1981776    if (!PyArg_ParseTuple(pArgs, "")) 
    1982777    { 
     
    1984779    } 
    1985780    e = pjsua_get_pjmedia_endpt(); 
    1986     endpt = (pjmedia_endpt_Object *)PyType_GenericNew( 
    1987         &pjmedia_endpt_Type, NULL, NULL 
     781    endpt = (PyObj_pjmedia_endpt *)PyType_GenericNew( 
     782        &PyTyp_pjmedia_endpt, NULL, NULL 
    1988783    ); 
    1989784    endpt->endpt = e; 
     
    1997792static PyObject *py_pjsua_get_pool_factory(PyObject *pSelf, PyObject *pArgs) 
    1998793{ 
    1999     pj_pool_factory_Object *pool; 
     794    PyObj_pj_pool_factory *pool; 
    2000795    pj_pool_factory *p; 
    2001796 
     797    PJ_UNUSED_ARG(pSelf); 
     798 
    2002799    if (!PyArg_ParseTuple(pArgs, "")) 
    2003800    { 
     
    2005802    } 
    2006803    p = pjsua_get_pool_factory(); 
    2007     pool = (pj_pool_factory_Object *)PyType_GenericNew( 
    2008         &pj_pool_factory_Type, NULL, NULL 
     804    pool = (PyObj_pj_pool_factory *)PyType_GenericNew( 
     805        &PyTyp_pj_pool_factory, NULL, NULL 
    2009806    ); 
    2010807    pool->pool_fact = p; 
     
    2021818    const char *title; 
    2022819    pj_status_t status; 
     820 
     821    PJ_UNUSED_ARG(pSelf); 
     822 
    2023823    if (!PyArg_ParseTuple(pArgs, "ssi", &sender, &title, &status)) 
    2024824    { 
     
    2038838{ 
    2039839    pj_status_t status; 
     840 
     841    PJ_UNUSED_ARG(pSelf); 
     842 
    2040843    if (!PyArg_ParseTuple(pArgs, "")) 
    2041844    { 
     
    2061864{ 
    2062865    pj_status_t status; 
    2063     PyObject * ua_cfgObj; 
    2064     config_Object * ua_cfg; 
    2065     PyObject * log_cfgObj; 
    2066     logging_config_Object * log_cfg; 
    2067     PyObject * media_cfgObj; 
    2068     media_config_Object * media_cfg; 
    2069     pjsua_config cfg_ua; 
    2070     pjsua_config * p_cfg_ua; 
    2071     pjsua_logging_config cfg_log; 
    2072     pjsua_logging_config * p_cfg_log; 
    2073     pjsua_media_config cfg_media; 
    2074     pjsua_media_config * p_cfg_media; 
    2075     unsigned i; 
    2076  
    2077     if (!PyArg_ParseTuple(pArgs, "OOO", &ua_cfgObj, &log_cfgObj,&media_cfgObj)) 
    2078     { 
    2079         return NULL; 
    2080     } 
    2081  
     866    PyObject *o_ua_cfg, *o_log_cfg, *o_media_cfg; 
     867    pjsua_config cfg_ua, *p_cfg_ua; 
     868    pjsua_logging_config cfg_log, *p_cfg_log; 
     869    pjsua_media_config cfg_media, *p_cfg_media; 
     870 
     871    PJ_UNUSED_ARG(pSelf); 
     872 
     873    if (!PyArg_ParseTuple(pArgs, "OOO", &o_ua_cfg, &o_log_cfg, &o_media_cfg)) 
     874    { 
     875        return NULL; 
     876    } 
    2082877     
    2083878    pjsua_config_default(&cfg_ua); 
     
    2085880    pjsua_media_config_default(&cfg_media); 
    2086881 
    2087     if (ua_cfgObj != Py_None)  
    2088     { 
    2089         ua_cfg = (config_Object *)ua_cfgObj; 
    2090         cfg_ua.cred_count = ua_cfg->cred_count; 
    2091         for (i = 0; i < 4; i++) 
    2092         { 
    2093             cfg_ua.cred_info[i] = ua_cfg->cred_info[i]; 
    2094         } 
    2095         cfg_ua.max_calls = ua_cfg->max_calls; 
    2096         for (i = 0; i < PJSUA_ACC_MAX_PROXIES; i++) 
    2097         { 
    2098             cfg_ua.outbound_proxy[i] = ua_cfg->outbound_proxy[i]; 
    2099         } 
    2100  
    2101         g_obj_callback = ua_cfg->cb; 
     882    if (o_ua_cfg != Py_None)  
     883    { 
     884        PyObj_pjsua_config *obj_ua_cfg = (PyObj_pjsua_config*)o_ua_cfg; 
     885 
     886        PyObj_pjsua_config_export(&cfg_ua, obj_ua_cfg); 
     887 
     888        g_obj_callback = obj_ua_cfg->cb; 
    2102889        Py_INCREF(g_obj_callback); 
    2103890 
     
    2105892        cfg_ua.cb.on_incoming_call = &cb_on_incoming_call; 
    2106893        cfg_ua.cb.on_call_media_state = &cb_on_call_media_state; 
     894        cfg_ua.cb.on_dtmf_digit = &cb_on_dtmf_digit; 
    2107895        cfg_ua.cb.on_call_transfer_request = &cb_on_call_transfer_request; 
    2108896        cfg_ua.cb.on_call_transfer_status = &cb_on_call_transfer_status; 
     
    2115903        cfg_ua.cb.on_typing = &cb_on_typing; 
    2116904 
    2117         cfg_ua.outbound_proxy_cnt = ua_cfg->outbound_proxy_cnt; 
    2118         cfg_ua.thread_cnt = ua_cfg->thread_cnt; 
    2119         cfg_ua.user_agent.ptr = PyString_AsString(ua_cfg->user_agent); 
    2120         cfg_ua.user_agent.slen = strlen(cfg_ua.user_agent.ptr); 
    2121  
    2122905        p_cfg_ua = &cfg_ua; 
     906 
    2123907    } else { 
    2124908        p_cfg_ua = NULL; 
    2125909    } 
    2126910 
    2127     if (log_cfgObj != Py_None)  
    2128     { 
    2129         log_cfg = (logging_config_Object *)log_cfgObj; 
    2130         cfg_log.msg_logging = log_cfg->msg_logging; 
    2131         cfg_log.level = log_cfg->level; 
    2132         cfg_log.console_level = log_cfg->console_level; 
    2133         cfg_log.decor = log_cfg->decor; 
    2134         cfg_log.log_filename.ptr = PyString_AsString(log_cfg->log_filename); 
    2135         cfg_log.log_filename.slen = strlen(cfg_log.log_filename.ptr); 
     911    if (o_log_cfg != Py_None)  
     912    { 
     913        PyObj_pjsua_logging_config * obj_log; 
     914 
     915        obj_log = (PyObj_pjsua_logging_config *)o_log_cfg; 
     916         
     917        PyObj_pjsua_logging_config_export(&cfg_log, obj_log); 
     918 
    2136919        Py_XDECREF(obj_log_cb); 
    2137         obj_log_cb = log_cfg->cb; 
     920        obj_log_cb = obj_log->cb; 
    2138921        Py_INCREF(obj_log_cb); 
     922 
    2139923        cfg_log.cb = &cb_log_cb; 
    2140924        p_cfg_log = &cfg_log; 
     925 
    2141926    } else { 
    2142927        p_cfg_log = NULL; 
    2143928    } 
    2144929 
    2145     if (media_cfgObj != Py_None)  
    2146     { 
    2147         media_cfg = (media_config_Object *)media_cfgObj; 
    2148         cfg_media.clock_rate = media_cfg->clock_rate; 
    2149         cfg_media.ec_options = media_cfg->ec_options; 
    2150         cfg_media.ec_tail_len = media_cfg->ec_tail_len; 
    2151         cfg_media.has_ioqueue = media_cfg->has_ioqueue; 
    2152         cfg_media.ilbc_mode = media_cfg->ilbc_mode; 
    2153         cfg_media.max_media_ports = media_cfg->max_media_ports; 
    2154         cfg_media.no_vad = media_cfg->no_vad; 
    2155         cfg_media.ptime = media_cfg->ptime; 
    2156         cfg_media.quality = media_cfg->quality; 
    2157         cfg_media.rx_drop_pct = media_cfg->rx_drop_pct; 
    2158         cfg_media.thread_cnt = media_cfg->thread_cnt; 
    2159         cfg_media.tx_drop_pct = media_cfg->tx_drop_pct; 
    2160             p_cfg_media = &cfg_media; 
     930    if (o_media_cfg != Py_None)  
     931    { 
     932        PyObj_pjsua_media_config_export(&cfg_media,  
     933                                        (PyObj_pjsua_media_config*)o_media_cfg); 
     934        p_cfg_media = &cfg_media; 
     935 
    2161936    } else { 
    2162937        p_cfg_media = NULL; 
     
    2174949{ 
    2175950    pj_status_t status; 
     951 
     952    PJ_UNUSED_ARG(pSelf); 
     953 
    2176954    if (!PyArg_ParseTuple(pArgs, "")) 
    2177955    { 
     
    2190968{ 
    2191969    pj_status_t status; 
     970 
     971    PJ_UNUSED_ARG(pSelf); 
     972 
    2192973    if (!PyArg_ParseTuple(pArgs, "")) 
    2193974    { 
     
    2207988    int ret; 
    2208989    unsigned msec; 
     990 
     991    PJ_UNUSED_ARG(pSelf); 
     992 
    2209993    if (!PyArg_ParseTuple(pArgs, "i", &msec)) 
    2210994    { 
     
    22321016    pj_status_t status; 
    22331017    const char *url; 
     1018 
     1019    PJ_UNUSED_ARG(pSelf); 
     1020 
    22341021    if (!PyArg_ParseTuple(pArgs, "s", &url)) 
    22351022    { 
     
    22641051 
    22651052static char pjsua_init_doc[] = 
    2266     "int py_pjsua.init (py_pjsua.Config ua_cfg, " 
     1053    "int py_pjsua.init (py_pjsua.Config obj_ua_cfg, " 
    22671054        "py_pjsua.Logging_Config log_cfg, py_pjsua.Media_Config media_cfg) " 
    22681055    "Initialize pjsua with the specified settings. All the settings are " 
    22691056    "optional, and the default values will be used when the config is not " 
    22701057    "specified. Parameters: " 
    2271     "ua_cfg : User agent configuration;  " 
     1058    "obj_ua_cfg : User agent configuration;  " 
    22721059    "log_cfg : Optional logging configuration; " 
    22731060    "media_cfg : Optional media configuration."; 
     
    23001087 
    23011088static char pjsua_pool_create_doc[] = 
    2302     "py_pjsua.PJ_Pool py_pjsua.pool_create (string name, int init_size, " 
     1089    "py_pjsua.Pj_Pool py_pjsua.pool_create (string name, int init_size, " 
    23031090                                            "int increment) " 
    23041091    "Create memory pool Parameters: " 
     
    23081095 
    23091096static char pjsua_get_pjsip_endpt_doc[] = 
    2310     "py_pjsua.PJSIP_Endpoint py_pjsua.get_pjsip_endpt (void) " 
     1097    "py_pjsua.Pjsip_Endpoint py_pjsua.get_pjsip_endpt (void) " 
    23111098    "Internal function to get SIP endpoint instance of pjsua, which is needed " 
    23121099    "for example to register module, create transports, etc. Probably is only " 
     
    23141101 
    23151102static char pjsua_get_pjmedia_endpt_doc[] = 
    2316     "py_pjsua.PJMedia_Endpt py_pjsua.get_pjmedia_endpt (void) " 
     1103    "py_pjsua.Pjmedia_Endpt py_pjsua.get_pjmedia_endpt (void) " 
    23171104    "Internal function to get media endpoint instance. Only valid after " 
    23181105    "pjsua_init() is called."; 
    23191106 
    23201107static char pjsua_get_pool_factory_doc[] = 
    2321     "py_pjsua.PJ_Pool_Factory py_pjsua.get_pool_factory (void) " 
     1108    "py_pjsua.Pj_Pool_Factory py_pjsua.get_pool_factory (void) " 
    23221109    "Internal function to get PJSUA pool factory. Only valid after " 
    23231110    "pjsua_init() is called."; 
     
    23511138 
    23521139/* 
    2353  * transport_config_Object 
    2354  * Transport configuration for creating UDP transports for both SIP 
    2355  * and media. 
    2356  */ 
    2357 typedef struct 
    2358 { 
    2359     PyObject_HEAD 
    2360     /* Type-specific fields go here. */ 
    2361     unsigned port; 
    2362     PyObject * public_addr; 
    2363     PyObject * bound_addr; 
    2364 } transport_config_Object; 
    2365  
    2366  
    2367 /* 
    2368  * transport_config_dealloc 
    2369  * deletes a transport config from memory 
    2370  */ 
    2371 static void transport_config_dealloc(transport_config_Object* self) 
    2372 { 
    2373     Py_XDECREF(self->public_addr);     
    2374     Py_XDECREF(self->bound_addr);     
    2375     self->ob_type->tp_free((PyObject*)self); 
    2376 } 
    2377  
    2378  
    2379 /* 
    2380  * transport_config_new 
    2381  * constructor for transport_config object 
    2382  */ 
    2383 static PyObject * transport_config_new(PyTypeObject *type, PyObject *args, 
    2384                                     PyObject *kwds) 
    2385 { 
    2386     transport_config_Object *self; 
    2387  
    2388     self = (transport_config_Object *)type->tp_alloc(type, 0); 
    2389     if (self != NULL) 
    2390     { 
    2391         self->public_addr = PyString_FromString(""); 
    2392         if (self->public_addr == NULL) 
    2393         { 
    2394             Py_DECREF(self); 
    2395             return NULL; 
    2396         } 
    2397                 self->bound_addr = PyString_FromString(""); 
    2398         if (self->bound_addr == NULL) 
    2399         { 
    2400             Py_DECREF(self); 
    2401             return NULL; 
    2402         } 
    2403     } 
    2404  
    2405     return (PyObject *)self; 
    2406 } 
    2407  
    2408  
    2409 /* 
    2410  * transport_config_members 
    2411  */ 
    2412 static PyMemberDef transport_config_members[] = 
    2413 { 
    2414     { 
    2415         "port", T_INT, offsetof(transport_config_Object, port), 0, 
    2416         "UDP port number to bind locally. This setting MUST be specified " 
    2417         "even when default port is desired. If the value is zero, the " 
    2418         "transport will be bound to any available port, and application " 
    2419         "can query the port by querying the transport info." 
    2420     }, 
    2421     { 
    2422         "public_addr", T_OBJECT_EX,  
    2423         offsetof(transport_config_Object, public_addr), 0, 
    2424         "Optional address to advertise as the address of this transport. " 
    2425         "Application can specify any address or hostname for this field, " 
    2426         "for example it can point to one of the interface address in the " 
    2427         "system, or it can point to the public address of a NAT router " 
    2428         "where port mappings have been configured for the application."          
    2429     },     
    2430     { 
    2431         "bound_addr", T_OBJECT_EX,  
    2432         offsetof(transport_config_Object, bound_addr), 0, 
    2433         "Optional address where the socket should be bound to. This option " 
    2434         "SHOULD only be used to selectively bind the socket to particular " 
    2435         "interface (instead of 0.0.0.0), and SHOULD NOT be used to set the " 
    2436         "published address of a transport (the public_addr field should be " 
    2437         "used for that purpose)."                
    2438     },     
    2439     {NULL}  /* Sentinel */ 
    2440 }; 
    2441  
    2442  
    2443  
    2444  
    2445 /* 
    2446  * transport_config_Type 
    2447  */ 
    2448 static PyTypeObject transport_config_Type = 
    2449 { 
    2450     PyObject_HEAD_INIT(NULL) 
    2451     0,                              /*ob_size*/ 
    2452     "py_pjsua.Transport_Config",      /*tp_name*/ 
    2453     sizeof(transport_config_Object),  /*tp_basicsize*/ 
    2454     0,                              /*tp_itemsize*/ 
    2455     (destructor)transport_config_dealloc,/*tp_dealloc*/ 
    2456     0,                              /*tp_print*/ 
    2457     0,                              /*tp_getattr*/ 
    2458     0,                              /*tp_setattr*/ 
    2459     0,                              /*tp_compare*/ 
    2460     0,                              /*tp_repr*/ 
    2461     0,                              /*tp_as_number*/ 
    2462     0,                              /*tp_as_sequence*/ 
    2463     0,                              /*tp_as_mapping*/ 
    2464     0,                              /*tp_hash */ 
    2465     0,                              /*tp_call*/ 
    2466     0,                              /*tp_str*/ 
    2467     0,                              /*tp_getattro*/ 
    2468     0,                              /*tp_setattro*/ 
    2469     0,                              /*tp_as_buffer*/ 
    2470     Py_TPFLAGS_DEFAULT,             /*tp_flags*/ 
    2471     "Transport Config objects",       /* tp_doc */ 
    2472     0,                              /* tp_traverse */ 
    2473     0,                              /* tp_clear */ 
    2474     0,                              /* tp_richcompare */ 
    2475     0,                              /* tp_weaklistoffset */ 
    2476     0,                              /* tp_iter */ 
    2477     0,                              /* tp_iternext */ 
    2478     0,                              /* tp_methods */ 
    2479     transport_config_members,         /* tp_members */ 
    2480     0,                              /* tp_getset */ 
    2481     0,                              /* tp_base */ 
    2482     0,                              /* tp_dict */ 
    2483     0,                              /* tp_descr_get */ 
    2484     0,                              /* tp_descr_set */ 
    2485     0,                              /* tp_dictoffset */ 
    2486     0,                              /* tp_init */ 
    2487     0,                              /* tp_alloc */ 
    2488     transport_config_new,             /* tp_new */ 
    2489  
    2490 }; 
    2491  
    2492 /* 
    2493  * host_port_Object 
    2494  * C/Python wrapper for host_port object 
    2495  */ 
    2496 typedef struct 
    2497 { 
    2498     PyObject_HEAD 
    2499     /* Type-specific fields go here. */ 
    2500     PyObject * host; 
    2501     int port; 
    2502 } host_port_Object; 
    2503  
    2504 /* 
    2505  * host_port_dealloc 
    2506  * deletes a host_port from memory 
    2507  */ 
    2508 static void host_port_dealloc(host_port_Object* self) 
    2509 { 
    2510     Py_XDECREF(self->host);     
    2511     self->ob_type->tp_free((PyObject*)self); 
    2512 } 
    2513  
    2514  
    2515 /* 
    2516  * host_port_new 
    2517  * constructor for host_port object 
    2518  */ 
    2519 static PyObject * host_port_new(PyTypeObject *type, PyObject *args, 
    2520                                     PyObject *kwds) 
    2521 { 
    2522     host_port_Object *self; 
    2523  
    2524     self = (host_port_Object *)type->tp_alloc(type, 0); 
    2525     if (self != NULL) 
    2526     { 
    2527         self->host = PyString_FromString(""); 
    2528         if (self->host == NULL) 
    2529         { 
    2530             Py_DECREF(self); 
    2531             return NULL; 
    2532         } 
    2533          
    2534     } 
    2535  
    2536     return (PyObject *)self; 
    2537 } 
    2538  
    2539  
    2540 /* 
    2541  * host_port_members 
    2542  * declares attributes accessible from both C and Python for host_port object 
    2543  */ 
    2544 static PyMemberDef host_port_members[] = 
    2545 {     
    2546     { 
    2547         "port", T_INT, 
    2548         offsetof(host_port_Object, port), 0, 
    2549         "Port number." 
    2550     }, 
    2551     { 
    2552         "host", T_OBJECT_EX, 
    2553         offsetof(host_port_Object, host), 0, 
    2554         "Host part or IP address." 
    2555     }, 
    2556     {NULL}  /* Sentinel */ 
    2557 }; 
    2558  
    2559  
    2560 /* 
    2561  * host_port_Type 
    2562  */ 
    2563 static PyTypeObject host_port_Type = 
    2564 { 
    2565     PyObject_HEAD_INIT(NULL) 
    2566     0,                              /*ob_size*/ 
    2567     "py_pjsua.Host_Port",        /*tp_name*/ 
    2568     sizeof(host_port_Object),    /*tp_basicsize*/ 
    2569     0,                              /*tp_itemsize*/ 
    2570     (destructor)host_port_dealloc,/*tp_dealloc*/ 
    2571     0,                              /*tp_print*/ 
    2572     0,                              /*tp_getattr*/ 
    2573     0,                              /*tp_setattr*/ 
    2574     0,                              /*tp_compare*/ 
    2575     0,                              /*tp_repr*/ 
    2576     0,                              /*tp_as_number*/ 
    2577     0,                              /*tp_as_sequence*/ 
    2578     0,                              /*tp_as_mapping*/ 
    2579     0,                              /*tp_hash */ 
    2580     0,                              /*tp_call*/ 
    2581     0,                              /*tp_str*/ 
    2582     0,                              /*tp_getattro*/ 
    2583     0,                              /*tp_setattro*/ 
    2584     0,                              /*tp_as_buffer*/ 
    2585     Py_TPFLAGS_DEFAULT,             /*tp_flags*/ 
    2586     "Host_port objects",         /*tp_doc*/ 
    2587     0,                              /*tp_traverse*/ 
    2588     0,                              /*tp_clear*/ 
    2589     0,                              /*tp_richcompare*/ 
    2590     0,                              /* tp_weaklistoffset */ 
    2591     0,                              /* tp_iter */ 
    2592     0,                              /* tp_iternext */ 
    2593     0,                              /* tp_methods */ 
    2594     host_port_members,           /* tp_members */ 
    2595         0,                              /* tp_getset */ 
    2596     0,                              /* tp_base */ 
    2597     0,                              /* tp_dict */ 
    2598     0,                              /* tp_descr_get */ 
    2599     0,                              /* tp_descr_set */ 
    2600     0,                              /* tp_dictoffset */ 
    2601     0,                              /* tp_init */ 
    2602     0,                              /* tp_alloc */ 
    2603     host_port_new,             /* tp_new */ 
    2604 }; 
    2605  
    2606  
    2607  
    2608  
    2609 /* 
    2610  * transport_info_Object 
    2611  * Transport info 
    2612  */ 
    2613 typedef struct 
    2614 { 
    2615     PyObject_HEAD 
    2616     /* Type-specific fields go here. */ 
    2617     int id; 
    2618     int type; 
    2619     PyObject * type_name; 
    2620     PyObject * info; 
    2621     unsigned flag; 
    2622     unsigned addr_len; 
    2623     host_port_Object * local_name; 
    2624     unsigned usage_count; 
    2625 } transport_info_Object; 
    2626  
    2627  
    2628 /* 
    2629  * transport_info_dealloc 
    2630  * deletes a transport info from memory 
    2631  */ 
    2632 static void transport_info_dealloc(transport_info_Object* self) 
    2633 { 
    2634     Py_XDECREF(self->type_name);  
    2635     Py_XDECREF(self->info); 
    2636     Py_XDECREF(self->local_name); 
    2637     self->ob_type->tp_free((PyObject*)self); 
    2638 } 
    2639  
    2640  
    2641 /* 
    2642  * transport_info_new 
    2643  * constructor for transport_info object 
    2644  */ 
    2645 static PyObject * transport_info_new(PyTypeObject *type, PyObject *args, 
    2646                                     PyObject *kwds) 
    2647 { 
    2648     transport_info_Object *self; 
    2649  
    2650     self = (transport_info_Object *)type->tp_alloc(type, 0); 
    2651     if (self != NULL) 
    2652     { 
    2653         self->type_name = PyString_FromString(""); 
    2654         if (self->type_name == NULL) 
    2655         { 
    2656             Py_DECREF(self); 
    2657             return NULL; 
    2658         } 
    2659         self->info = PyString_FromString(""); 
    2660         if (self->info == NULL) 
    2661         { 
    2662             Py_DECREF(self); 
    2663             return NULL; 
    2664         } 
    2665         self->local_name =  
    2666             (host_port_Object *)host_port_new(&host_port_Type,NULL,NULL); 
    2667         if (self->local_name == NULL) 
    2668         { 
    2669             Py_DECREF(self); 
    2670             return NULL; 
    2671         } 
    2672     } 
    2673  
    2674     return (PyObject *)self; 
    2675 } 
    2676  
    2677  
    2678 /* 
    2679  * transport_info_members 
    2680  */ 
    2681 static PyMemberDef transport_info_members[] = 
    2682 { 
    2683     { 
    2684         "id", T_INT, offsetof(transport_info_Object, id), 0, 
    2685         "PJSUA transport identification." 
    2686     }, 
    2687     { 
    2688         "type", T_INT, offsetof(transport_info_Object, id), 0, 
    2689         "Transport type." 
    2690     }, 
    2691     { 
    2692         "type_name", T_OBJECT_EX, 
    2693         offsetof(transport_info_Object, type_name), 0, 
    2694         "Transport type name." 
    2695     }, 
    2696     { 
    2697         "info", T_OBJECT_EX, 
    2698         offsetof(transport_info_Object, info), 0, 
    2699         "Transport string info/description." 
    2700     }, 
    2701     { 
    2702         "flag", T_INT, offsetof(transport_info_Object, flag), 0, 
    2703         "Transport flag (see ##pjsip_transport_flags_e)." 
    2704     }, 
    2705     { 
    2706         "addr_len", T_INT, offsetof(transport_info_Object, addr_len), 0, 
    2707         "Local address length." 
    2708     }, 
    2709     { 
    2710         "local_name", T_OBJECT_EX, 
    2711         offsetof(transport_info_Object, local_name), 0, 
    2712         "Published address (or transport address name)." 
    2713     }, 
    2714     { 
    2715         "usage_count", T_INT, offsetof(transport_info_Object, usage_count), 0, 
    2716         "Current number of objects currently referencing this transport." 
    2717     },     
    2718     {NULL}  /* Sentinel */ 
    2719 }; 
    2720  
    2721  
    2722  
    2723  
    2724 /* 
    2725  * transport_info_Type 
    2726  */ 
    2727 static PyTypeObject transport_info_Type = 
    2728 { 
    2729     PyObject_HEAD_INIT(NULL) 
    2730     0,                              /*ob_size*/ 
    2731     "py_pjsua.Transport_Info",      /*tp_name*/ 
    2732     sizeof(transport_info_Object),  /*tp_basicsize*/ 
    2733     0,                              /*tp_itemsize*/ 
    2734     (destructor)transport_info_dealloc,/*tp_dealloc*/ 
    2735     0,                              /*tp_print*/ 
    2736     0,                              /*tp_getattr*/ 
    2737     0,                              /*tp_setattr*/ 
    2738     0,                              /*tp_compare*/ 
    2739     0,                              /*tp_repr*/ 
    2740     0,                              /*tp_as_number*/ 
    2741     0,                              /*tp_as_sequence*/ 
    2742     0,                              /*tp_as_mapping*/ 
    2743     0,                              /*tp_hash */ 
    2744     0,                              /*tp_call*/ 
    2745     0,                              /*tp_str*/ 
    2746     0,                              /*tp_getattro*/ 
    2747     0,                              /*tp_setattro*/ 
    2748     0,                              /*tp_as_buffer*/ 
    2749     Py_TPFLAGS_DEFAULT,             /*tp_flags*/ 
    2750     "Transport Info objects",       /* tp_doc */ 
    2751     0,                              /* tp_traverse */ 
    2752     0,                              /* tp_clear */ 
    2753     0,                              /* tp_richcompare */ 
    2754     0,                              /* tp_weaklistoffset */ 
    2755     0,                              /* tp_iter */ 
    2756     0,                              /* tp_iternext */ 
    2757     0,                              /* tp_methods */ 
    2758     transport_info_members,         /* tp_members */ 
    2759     0,                              /* tp_getset */ 
    2760     0,                              /* tp_base */ 
    2761     0,                              /* tp_dict */ 
    2762     0,                              /* tp_descr_get */ 
    2763     0,                              /* tp_descr_set */ 
    2764     0,                              /* tp_dictoffset */ 
    2765     0,                              /* tp_init */ 
    2766     0,                              /* tp_alloc */ 
    2767     transport_info_new,             /* tp_new */ 
    2768  
    2769 }; 
    2770  
    2771 /* 
    2772  * pjsip_transport_Object 
    2773  * C/python typewrapper for pjsip_transport 
    2774  */ 
    2775 typedef struct 
    2776 { 
    2777     PyObject_HEAD 
    2778     /* Type-specific fields go here. */ 
    2779     pjsip_transport *tp; 
    2780 } pjsip_transport_Object; 
    2781  
    2782  
    2783 /* 
    2784  * pjsip_transport_Type 
    2785  */ 
    2786 static PyTypeObject pjsip_transport_Type = 
    2787 { 
    2788     PyObject_HEAD_INIT(NULL) 
    2789     0,                              /*ob_size*/ 
    2790     "py_pjsua.PJSIP_Transport",       /*tp_name*/ 
    2791     sizeof(pjsip_transport_Object),   /*tp_basicsize*/ 
    2792     0,                              /*tp_itemsize*/ 
    2793     0,                              /*tp_dealloc*/ 
    2794     0,                              /*tp_print*/ 
    2795     0,                              /*tp_getattr*/ 
    2796     0,                              /*tp_setattr*/ 
    2797     0,                              /*tp_compare*/ 
    2798     0,                              /*tp_repr*/ 
    2799     0,                              /*tp_as_number*/ 
    2800     0,                              /*tp_as_sequence*/ 
    2801     0,                              /*tp_as_mapping*/ 
    2802     0,                              /*tp_hash */ 
    2803     0,                              /*tp_call*/ 
    2804     0,                              /*tp_str*/ 
    2805     0,                              /*tp_getattro*/ 
    2806     0,                              /*tp_setattro*/ 
    2807     0,                              /*tp_as_buffer*/ 
    2808     Py_TPFLAGS_DEFAULT,             /*tp_flags*/ 
    2809     "pjsip_transport objects",        /*tp_doc*/ 
    2810 }; 
    2811  
    2812  
    2813 /* 
    28141140 * py_pjsua_transport_config_default 
    28151141 * !modified @ 051206 
    28161142 */ 
    2817 static PyObject *py_pjsua_transport_config_default 
    2818 (PyObject *pSelf, PyObject *pArgs) 
    2819 { 
    2820     transport_config_Object *obj; 
     1143static PyObject *py_pjsua_transport_config_default(PyObject *pSelf,  
     1144                                                  PyObject *pArgs) 
     1145{ 
     1146    PyObj_pjsua_transport_config *obj; 
    28211147    pjsua_transport_config cfg; 
    28221148 
    2823     if (!PyArg_ParseTuple(pArgs, "")) 
    2824     { 
    2825         return NULL; 
    2826     } 
     1149    PJ_UNUSED_ARG(pSelf); 
     1150 
     1151    if (!PyArg_ParseTuple(pArgs, "")) { 
     1152        return NULL; 
     1153    } 
     1154 
    28271155    pjsua_transport_config_default(&cfg); 
    2828     obj = (transport_config_Object *)transport_config_new 
    2829                 (&transport_config_Type,NULL,NULL); 
    2830     obj->public_addr =  
    2831         PyString_FromStringAndSize(cfg.public_addr.ptr, cfg.public_addr.slen); 
    2832     obj->bound_addr =  
    2833         PyString_FromStringAndSize(cfg.bound_addr.ptr, cfg.bound_addr.slen); 
    2834     obj->port = cfg.port; 
     1156    obj = (PyObj_pjsua_transport_config*) 
     1157          PyObj_pjsua_transport_config_new(&PyTyp_pjsua_transport_config, 
     1158                                           NULL, NULL); 
     1159    PyObj_pjsua_transport_config_import(obj, &cfg); 
     1160 
    28351161    return (PyObject *)obj; 
    28361162} 
     
    28441170    pj_status_t status; 
    28451171    int type; 
    2846      
    28471172    PyObject * tmpObj; 
    2848     transport_config_Object *obj; 
    28491173    pjsua_transport_config cfg; 
    28501174    pjsua_transport_id id; 
    2851     if (!PyArg_ParseTuple(pArgs, "iO", &type, &tmpObj)) 
    2852     { 
    2853         return NULL; 
    2854     } 
    2855     if (tmpObj != Py_None) 
    2856     { 
    2857         obj = (transport_config_Object *)tmpObj; 
    2858         cfg.public_addr.ptr = PyString_AsString(obj->public_addr); 
    2859         cfg.public_addr.slen = strlen(PyString_AsString(obj->public_addr)); 
    2860         cfg.bound_addr.ptr = PyString_AsString(obj->bound_addr); 
    2861         cfg.bound_addr.slen = strlen(PyString_AsString(obj->bound_addr)); 
    2862         cfg.port = obj->port; 
     1175 
     1176    PJ_UNUSED_ARG(pSelf); 
     1177 
     1178    if (!PyArg_ParseTuple(pArgs, "iO", &type, &tmpObj)) { 
     1179        return NULL; 
     1180    } 
     1181 
     1182    if (tmpObj != Py_None) { 
     1183        PyObj_pjsua_transport_config *obj; 
     1184        obj = (PyObj_pjsua_transport_config*)tmpObj; 
     1185        PyObj_pjsua_transport_config_export(&cfg, obj); 
    28631186        status = pjsua_transport_create(type, &cfg, &id); 
    28641187    } else { 
     
    28671190     
    28681191     
    2869     return Py_BuildValue("ii",status,id); 
    2870 } 
    2871  
    2872 /* 
    2873  * py_pjsua_transport_register 
    2874  * !modified @ 051206 
    2875  */ 
    2876 static PyObject *py_pjsua_transport_register(PyObject *pSelf, PyObject *pArgs) 
    2877 { 
    2878     pj_status_t status;      
    2879     PyObject * tmpObj; 
    2880     pjsip_transport_Object *obj;         
    2881     pjsua_transport_id id; 
    2882     if (!PyArg_ParseTuple(pArgs, "O", &tmpObj)) 
    2883     { 
    2884         return NULL; 
    2885     } 
    2886     if (tmpObj != Py_None) 
    2887     { 
    2888         obj = (pjsip_transport_Object *)tmpObj; 
    2889         status = pjsua_transport_register(obj->tp, &id); 
    2890     } else { 
    2891         status = pjsua_transport_register(NULL, &id); 
    2892     } 
    2893      
    2894     return Py_BuildValue("ii",status, id); 
     1192    return Py_BuildValue("ii", status, id); 
    28951193} 
    28961194 
     
    29061204    pjsua_transport_id id[PJSIP_MAX_TRANSPORTS]; 
    29071205    unsigned c, i; 
     1206 
     1207    PJ_UNUSED_ARG(pSelf); 
     1208 
    29081209    if (!PyArg_ParseTuple(pArgs, "")) 
    29091210    { 
     
    29351236    pj_status_t status; 
    29361237    int id; 
    2937     transport_info_Object *obj; 
    29381238    pjsua_transport_info info; 
    29391239     
    2940  
    2941     if (!PyArg_ParseTuple(pArgs, "i", &id)) 
    2942     { 
     1240    PJ_UNUSED_ARG(pSelf); 
     1241 
     1242    if (!PyArg_ParseTuple(pArgs, "i", &id)) { 
    29431243        return NULL; 
    29441244    }    
     
    29461246    status = pjsua_transport_get_info(id, &info);        
    29471247    if (status == PJ_SUCCESS) { 
    2948         obj = (transport_info_Object *) transport_info_new 
    2949                         (&transport_info_Type,NULL,NULL); 
    2950         obj->addr_len = info.addr_len; 
    2951         obj->flag = info.flag; 
    2952         obj->id = info.id; 
    2953         obj->info = PyString_FromStringAndSize(info.info.ptr, info.info.slen); 
     1248        PyObj_pjsua_transport_info *obj; 
     1249        obj = (PyObj_pjsua_transport_info *)  
     1250              PyObj_pjsua_transport_info_new(&PyTyp_pjsua_transport_info,  
     1251                                             NULL, NULL); 
     1252        PyObj_pjsua_transport_info_import(obj, &info); 
    29541253        return Py_BuildValue("O", obj); 
    29551254    } else { 
     
    29681267    int id; 
    29691268    int enabled; 
     1269 
     1270    PJ_UNUSED_ARG(pSelf); 
     1271 
    29701272    if (!PyArg_ParseTuple(pArgs, "ii", &id, &enabled)) 
    29711273    { 
     
    29851287    int id; 
    29861288    int force; 
     1289 
     1290    PJ_UNUSED_ARG(pSelf); 
     1291 
    29871292    if (!PyArg_ParseTuple(pArgs, "ii", &id, &force)) 
    29881293    { 
     
    30011306    "py_pjsua.Transport_Config cfg) " 
    30021307    "Create SIP transport."; 
    3003 static char pjsua_transport_register_doc[] = 
    3004     "int, int py_pjsua.transport_register " 
    3005     "(py_pjsua.PJSIP_Transport tp) " 
    3006     "Register transport that has been created by application."; 
    30071308static char pjsua_enum_transports_doc[] = 
    30081309    "int[] py_pjsua.enum_transports () " 
     
    30331334/* LIB ACCOUNT */ 
    30341335 
    3035 /* 
    3036  * acc_config_Object 
    3037  * Acc Config 
    3038  */ 
    3039 typedef struct 
    3040 { 
    3041     PyObject_HEAD 
    3042     /* Type-specific fields go here. */ 
    3043     int priority;        
    3044     PyObject * id; 
    3045     PyObject * reg_uri; 
    3046     int publish_enabled; 
    3047     PyObject * force_contact; 
    3048     unsigned proxy_cnt; 
    3049     /*pj_str_t proxy[8];*/ 
    3050     PyListObject * proxy; 
    3051     unsigned reg_timeout; 
    3052     unsigned cred_count; 
    3053     /*pjsip_cred_info cred_info[8];*/ 
    3054     PyListObject * cred_info; 
    3055 } acc_config_Object; 
    3056  
    3057  
    3058 /* 
    3059  * acc_config_dealloc 
    3060  * deletes a acc_config from memory 
    3061  */ 
    3062 static void acc_config_dealloc(acc_config_Object* self) 
    3063 { 
    3064     Py_XDECREF(self->id);  
    3065     Py_XDECREF(self->reg_uri); 
    3066     Py_XDECREF(self->force_contact);     
    3067     Py_XDECREF(self->proxy); 
    3068     Py_XDECREF(self->cred_info); 
    3069     self->ob_type->tp_free((PyObject*)self); 
    3070 } 
    3071  
    3072  
    3073 /* 
    3074  * acc_config_new 
    3075  * constructor for acc_config object 
    3076  */ 
    3077 static PyObject * acc_config_new(PyTypeObject *type, PyObject *args, 
    3078                                     PyObject *kwds) 
    3079 { 
    3080     acc_config_Object *self; 
    3081  
    3082     self = (acc_config_Object *)type->tp_alloc(type, 0); 
    3083     if (self != NULL) 
    3084     { 
    3085         self->id = PyString_FromString(""); 
    3086         if (self->id == NULL) 
    3087         { 
    3088             Py_DECREF(self); 
    3089             return NULL; 
    3090         } 
    3091         self->reg_uri = PyString_FromString(""); 
    3092         if (self->reg_uri == NULL) 
    3093         { 
    3094             Py_DECREF(self); 
    3095             return NULL; 
    3096         } 
    3097         self->force_contact = PyString_FromString(""); 
    3098         if (self->force_contact == NULL) 
    3099         { 
    3100             Py_DECREF(self); 
    3101             return NULL; 
    3102         } 
    3103         self->proxy = (PyListObject *)PyList_New(8); 
    3104         if (self->proxy == NULL) 
    3105         { 
    3106             Py_DECREF(self); 
    3107             return NULL; 
    3108         } 
    3109         self->cred_info = (PyListObject *)PyList_New(8); 
    3110         if (self->cred_info == NULL) 
    3111         { 
    3112             Py_DECREF(self); 
    3113             return NULL; 
    3114         } 
    3115     } 
    3116  
    3117     return (PyObject *)self; 
    3118 } 
    3119  
    3120  
    3121  
    3122 /* 
    3123  * acc_config_members 
    3124  */ 
    3125 static PyMemberDef acc_config_members[] = 
    3126 { 
    3127     { 
    3128         "priority", T_INT, offsetof(acc_config_Object, priority), 0, 
    3129         "Account priority, which is used to control the order of matching " 
    3130         "incoming/outgoing requests. The higher the number means the higher " 
    3131         "the priority is, and the account will be matched first. " 
    3132     }, 
    3133     { 
    3134         "id", T_OBJECT_EX, 
    3135         offsetof(acc_config_Object, id), 0, 
    3136         "The full SIP URL for the account. " 
    3137         "The value can take name address or URL format, " 
    3138         "and will look something like 'sip:account@serviceprovider'. " 
    3139         "This field is mandatory." 
    3140     }, 
    3141     { 
    3142         "reg_uri", T_OBJECT_EX, 
    3143         offsetof(acc_config_Object, reg_uri), 0, 
    3144         "This is the URL to be put in the request URI for the registration, " 
    3145         "and will look something like 'sip:serviceprovider'. " 
    3146         "This field should be specified if registration is desired. " 
    3147         "If the value is empty, no account registration will be performed. " 
    3148     }, 
    3149     { 
    3150         "publish_enabled", T_INT,  
    3151         offsetof(acc_config_Object, publish_enabled), 0, 
    3152         "Publish presence? " 
    3153     }, 
    3154     { 
    3155         "force_contact", T_OBJECT_EX, 
    3156         offsetof(acc_config_Object, force_contact), 0, 
    3157         "Optional URI to be put as Contact for this account. " 
    3158         "It is recommended that this field is left empty, " 
    3159         "so that the value will be calculated automatically " 
    3160         "based on the transport address. " 
    3161     }, 
    3162     { 
    3163         "proxy_cnt", T_INT, offsetof(acc_config_Object, proxy_cnt), 0, 
    3164         "Number of proxies in the proxy array below. " 
    3165     }, 
    3166     { 
    3167         "proxy", T_OBJECT_EX, 
    3168         offsetof(acc_config_Object, proxy), 0, 
    3169         "Optional URI of the proxies to be visited for all outgoing requests " 
    3170         "that are using this account (REGISTER, INVITE, etc). Application need " 
    3171         "to specify these proxies if the service provider requires " 
    3172         "that requests destined towards its network should go through certain " 
    3173         "proxies first (for example, border controllers)." 
    3174     }, 
    3175     { 
    3176         "reg_timeout", T_INT, offsetof(acc_config_Object, reg_timeout), 0, 
    3177         "Optional interval for registration, in seconds. " 
    3178         "If the value is zero, default interval will be used " 
    3179         "(PJSUA_REG_INTERVAL, 55 seconds). " 
    3180     }, 
    3181     { 
    3182         "cred_count", T_INT, offsetof(acc_config_Object, cred_count), 0, 
    3183         "Number of credentials in the credential array. " 
    3184     }, 
    3185     { 
    3186         "cred_info", T_OBJECT_EX, 
    3187         offsetof(acc_config_Object, cred_info), 0, 
    3188         "Array of credentials. If registration is desired, normally there " 
    3189         "should be at least one credential specified, to successfully " 
    3190         "authenticate against the service provider. More credentials can " 
    3191         "be specified, for example when the requests are expected to be " 
    3192         "challenged by the proxies in the route set." 
    3193     }, 
    3194     {NULL}  /* Sentinel */ 
    3195 }; 
    3196  
    3197  
    3198  
    3199  
    3200 /* 
    3201  * acc_config_Type 
    3202  */ 
    3203 static PyTypeObject acc_config_Type = 
    3204 { 
    3205     PyObject_HEAD_INIT(NULL) 
    3206     0,                              /*ob_size*/ 
    3207     "py_pjsua.Acc_Config",      /*tp_name*/ 
    3208     sizeof(acc_config_Object),  /*tp_basicsize*/ 
    3209     0,                              /*tp_itemsize*/ 
    3210     (destructor)acc_config_dealloc,/*tp_dealloc*/ 
    3211     0,                              /*tp_print*/ 
    3212     0,                              /*tp_getattr*/ 
    3213     0,                              /*tp_setattr*/ 
    3214     0,                              /*tp_compare*/ 
    3215     0,                              /*tp_repr*/ 
    3216     0,                              /*tp_as_number*/ 
    3217     0,                              /*tp_as_sequence*/ 
    3218     0,                              /*tp_as_mapping*/ 
    3219     0,                              /*tp_hash */ 
    3220     0,                              /*tp_call*/ 
    3221     0,                              /*tp_str*/ 
    3222     0,                              /*tp_getattro*/ 
    3223     0,                              /*tp_setattro*/ 
    3224     0,                              /*tp_as_buffer*/ 
    3225     Py_TPFLAGS_DEFAULT,             /*tp_flags*/ 
    3226     "Acc Config objects",       /* tp_doc */ 
    3227     0,                              /* tp_traverse */ 
    3228     0,                              /* tp_clear */ 
    3229     0,                              /* tp_richcompare */ 
    3230     0,                              /* tp_weaklistoffset */ 
    3231     0,                              /* tp_iter */ 
    3232     0,                              /* tp_iternext */ 
    3233     0/*acc_config_methods*/,                              /* tp_methods */ 
    3234     acc_config_members,         /* tp_members */ 
    3235     0,                              /* tp_getset */ 
    3236     0,                              /* tp_base */ 
    3237     0,                              /* tp_dict */ 
    3238     0,                              /* tp_descr_get */ 
    3239     0,                              /* tp_descr_set */ 
    3240     0,                              /* tp_dictoffset */ 
    3241     0,                              /* tp_init */ 
    3242     0,                              /* tp_alloc */ 
    3243     acc_config_new,             /* tp_new */ 
    3244  
    3245 }; 
    3246  
    3247 /* 
    3248  * acc_info_Object 
    3249  * Acc Info 
    3250  */ 
    3251 typedef struct 
    3252 { 
    3253     PyObject_HEAD 
    3254     /* Type-specific fields go here. */ 
    3255     int id;      
    3256     int is_default; 
    3257     PyObject * acc_uri; 
    3258     int has_registration; 
    3259     int expires; 
    3260     int status; 
    3261     PyObject * status_text; 
    3262     int online_status;   
    3263     char buf_[PJ_ERR_MSG_SIZE]; 
    3264 } acc_info_Object; 
    3265  
    3266  
    3267 /* 
    3268  * acc_info_dealloc 
    3269  * deletes a acc_info from memory 
    3270  */ 
    3271 static void acc_info_dealloc(acc_info_Object* self) 
    3272 { 
    3273     Py_XDECREF(self->acc_uri);  
    3274     Py_XDECREF(self->status_text);       
    3275     self->ob_type->tp_free((PyObject*)self); 
    3276 } 
    3277  
    3278  
    3279 /* 
    3280  * acc_info_new 
    3281  * constructor for acc_info object 
    3282  */ 
    3283 static PyObject * acc_info_new(PyTypeObject *type, PyObject *args, 
    3284                                     PyObject *kwds) 
    3285 { 
    3286     acc_info_Object *self; 
    3287  
    3288     self = (acc_info_Object *)type->tp_alloc(type, 0); 
    3289     if (self != NULL) 
    3290     { 
    3291         self->acc_uri = PyString_FromString(""); 
    3292         if (self->acc_uri == NULL) 
    3293         { 
    3294             Py_DECREF(self); 
    3295             return NULL; 
    3296         } 
    3297                 self->status_text = PyString_FromString(""); 
    3298         if (self->status_text == NULL) 
    3299         { 
    3300             Py_DECREF(self); 
    3301             return NULL; 
    3302         } 
    3303          
    3304     } 
    3305  
    3306     return (PyObject *)self; 
    3307 } 
    3308  
    3309 static PyObject * acc_info_get_buf 
    3310 (acc_info_Object *self, PyObject * args) 
    3311 { 
    3312     int idx; 
    3313     char elmt; 
    3314     if (!PyArg_ParseTuple(args,"i",&idx))  
    3315     { 
    3316         return NULL; 
    3317     } 
    3318     if ((idx >= 0) && (idx < PJ_ERR_MSG_SIZE))  
    3319     { 
    3320         elmt = self->buf_[idx]; 
    3321     }  
    3322     else 
    3323     { 
    3324         return NULL; 
    3325     } 
    3326     return PyString_FromStringAndSize(&elmt, 1); 
    3327 } 
    3328  
    3329 static PyObject * acc_info_set_buf 
    3330 (acc_info_Object *self, PyObject * args) 
    3331 { 
    3332     int idx; 
    3333     PyObject * str;      
    3334     char * s; 
    3335     if (!PyArg_ParseTuple(args,"iO",&idx, &str))  
    3336     { 
    3337         return NULL; 
    3338     } 
    3339     if ((idx >= 0) && (idx < PJ_ERR_MSG_SIZE))  
    3340     { 
    3341         s = PyString_AsString(str); 
    3342         if (s[0])  
    3343         { 
    3344             self->buf_[idx] = s[0]; 
    3345         }         
    3346         else  
    3347         { 
    3348             return NULL; 
    3349         } 
    3350     }  
    3351     else 
    3352     { 
    3353         return NULL; 
    3354     } 
    3355     Py_INCREF(Py_None); 
    3356     return Py_None; 
    3357 } 
    3358  
    3359 static PyMethodDef acc_info_methods[] = { 
    3360     { 
    3361         "get_buf", (PyCFunction)acc_info_get_buf, METH_VARARGS, 
    3362         "Return buf char at specified index" 
    3363     }, 
    3364     { 
    3365         "set_buf", (PyCFunction)acc_info_set_buf, METH_VARARGS, 
    3366         "Set buf at specified index" 
    3367     }, 
    3368          
    3369     {NULL}  /* Sentinel */ 
    3370 }; 
    3371  
    3372  
    3373  
    3374 /* 
    3375  * acc_info_members 
    3376  */ 
    3377 static PyMemberDef acc_info_members[] = 
    3378 { 
    3379     { 
    3380         "id", T_INT, offsetof(acc_info_Object, id), 0, 
    3381         "The account ID." 
    3382     }, 
    3383     { 
    3384         "is_default", T_INT, offsetof(acc_info_Object, is_default), 0, 
    3385         "Flag to indicate whether this is the default account. " 
    3386     }, 
    3387     { 
    3388         "acc_uri", T_OBJECT_EX, 
    3389         offsetof(acc_info_Object, acc_uri), 0, 
    3390         "Account URI" 
    3391     }, 
    3392     { 
    3393         "has_registration", T_INT, offsetof(acc_info_Object, has_registration), 
    3394         0, 
    3395         "Flag to tell whether this account has registration setting " 
    3396         "(reg_uri is not empty)." 
    3397     }, 
    3398     { 
    3399         "expires", T_INT, offsetof(acc_info_Object, expires), 0, 
    3400         "An up to date expiration interval for account registration session." 
    3401     }, 
    3402     { 
    3403         "status", T_INT, offsetof(acc_info_Object, status), 0, 
    3404         "Last registration status code. If status code is zero, " 
    3405         "the account is currently not registered. Any other value indicates " 
    3406         "the SIP status code of the registration. " 
    3407     }, 
    3408     { 
    3409         "status_text", T_OBJECT_EX, 
    3410         offsetof(acc_info_Object, status_text), 0, 
    3411         "String describing the registration status." 
    3412     }, 
    3413     { 
    3414         "online_status", T_INT, offsetof(acc_info_Object, online_status), 0, 
    3415         "Presence online status for this account. " 
    3416     }, 
    3417     {NULL}  /* Sentinel */ 
    3418 }; 
    3419  
    3420  
    3421  
    3422  
    3423 /* 
    3424  * acc_info_Type 
    3425  */ 
    3426 static PyTypeObject acc_info_Type = 
    3427 { 
    3428     PyObject_HEAD_INIT(NULL) 
    3429     0,                              /*ob_size*/ 
    3430     "py_pjsua.Acc_Info",      /*tp_name*/ 
    3431     sizeof(acc_info_Object),  /*tp_basicsize*/ 
    3432     0,                              /*tp_itemsize*/ 
    3433     (destructor)acc_info_dealloc,/*tp_dealloc*/ 
    3434     0,                              /*tp_print*/ 
    3435     0,                              /*tp_getattr*/ 
    3436     0,                              /*tp_setattr*/ 
    3437     0,                              /*tp_compare*/ 
    3438     0,                              /*tp_repr*/ 
    3439     0,                              /*tp_as_number*/ 
    3440     0,                              /*tp_as_sequence*/ 
    3441     0,                              /*tp_as_mapping*/ 
    3442     0,                              /*tp_hash */ 
    3443     0,                              /*tp_call*/ 
    3444     0,                              /*tp_str*/ 
    3445     0,                              /*tp_getattro*/ 
    3446     0,                              /*tp_setattro*/ 
    3447     0,                              /*tp_as_buffer*/ 
    3448     Py_TPFLAGS_DEFAULT,             /*tp_flags*/ 
    3449     "Acc Info objects",       /* tp_doc */ 
    3450     0,                              /* tp_traverse */ 
    3451     0,                              /* tp_clear */ 
    3452     0,                              /* tp_richcompare */ 
    3453     0,                              /* tp_weaklistoffset */ 
    3454     0,                              /* tp_iter */ 
    3455     0,                              /* tp_iternext */ 
    3456     acc_info_methods,                              /* tp_methods */ 
    3457     acc_info_members,         /* tp_members */ 
    3458     0,                              /* tp_getset */ 
    3459     0,                              /* tp_base */ 
    3460     0,                              /* tp_dict */ 
    3461     0,                              /* tp_descr_get */ 
    3462     0,                              /* tp_descr_set */ 
    3463     0,                              /* tp_dictoffset */ 
    3464     0,                              /* tp_init */ 
    3465     0,                              /* tp_alloc */ 
    3466     acc_info_new,             /* tp_new */ 
    3467  
    3468 }; 
    3469  
    3470  
    34711336 
    34721337/* 
     
    34741339 * !modified @ 051206 
    34751340 */ 
    3476 static PyObject *py_pjsua_acc_config_default 
    3477 (PyObject *pSelf, PyObject *pArgs) 
    3478 { 
    3479     acc_config_Object *obj; 
     1341static PyObject *py_pjsua_acc_config_default(PyObject *pSelf, PyObject *pArgs) 
     1342{ 
     1343    PyObj_pjsua_acc_config *obj; 
    34801344    pjsua_acc_config cfg; 
    3481     int i; 
    3482  
    3483     if (!PyArg_ParseTuple(pArgs, "")) 
    3484     { 
    3485         return NULL; 
    3486     } 
     1345 
     1346    PJ_UNUSED_ARG(pSelf); 
     1347 
     1348    if (!PyArg_ParseTuple(pArgs, "")) { 
     1349        return NULL; 
     1350    } 
     1351 
    34871352    pjsua_acc_config_default(&cfg); 
    3488     obj = (acc_config_Object *)acc_config_new(&acc_config_Type, NULL, NULL); 
    3489     obj->cred_count = cfg.cred_count; 
    3490     for (i = 0; i < PJSUA_MAX_ACC; i++)  
    3491     { 
    3492         /*obj->cred_info[i] = cfg.cred_info[i];*/ 
    3493         int ret; 
    3494         pjsip_cred_info_Object * ci =  
    3495             (pjsip_cred_info_Object *)pjsip_cred_info_new 
    3496             (&pjsip_cred_info_Type,NULL,NULL); 
    3497         ci->data = PyString_FromStringAndSize(cfg.cred_info[i].data.ptr,  
    3498             cfg.cred_info[i].data.slen); 
    3499         ci->realm = PyString_FromStringAndSize(cfg.cred_info[i].realm.ptr,  
    3500             cfg.cred_info[i].realm.slen); 
    3501         ci->scheme = PyString_FromStringAndSize(cfg.cred_info[i].scheme.ptr,  
    3502             cfg.cred_info[i].scheme.slen); 
    3503         ci->username = PyString_FromStringAndSize(cfg.cred_info[i].username.ptr,  
    3504             cfg.cred_info[i].username.slen); 
    3505         ci->data_type = cfg.cred_info[i].data_type; 
    3506         ret = PyList_SetItem((PyObject *)obj->cred_info,i,(PyObject *)ci); 
    3507         if (ret == -1) { 
    3508             return NULL; 
    3509         } 
    3510     } 
    3511      
    3512     Py_XDECREF(obj->force_contact); 
    3513     obj->force_contact =  
    3514         PyString_FromStringAndSize(cfg.force_contact.ptr,  
    3515         cfg.force_contact.slen); 
    3516     obj->priority = cfg.priority; 
    3517     Py_XDECREF(obj->id); 
    3518     obj->id =  
    3519         PyString_FromStringAndSize(cfg.id.ptr, cfg.id.slen); 
    3520     Py_XDECREF(obj->reg_uri); 
    3521     obj->reg_uri =  
    3522         PyString_FromStringAndSize(cfg.reg_uri.ptr, cfg.reg_uri.slen); 
    3523     obj->proxy_cnt = cfg.proxy_cnt; 
    3524     for (i = 0; i < PJSUA_MAX_ACC; i++)  
    3525     { 
    3526         PyObject * str; 
    3527         int ret; 
    3528         /*obj->proxy[i] = cfg.proxy[i];*/ 
    3529         str = PyString_FromStringAndSize(cfg.proxy[i].ptr, cfg.proxy[i].slen); 
    3530         ret = PyList_SetItem((PyObject *)obj->proxy,i,str); 
    3531         if (ret == -1) { 
    3532             return NULL; 
    3533         } 
    3534     } 
    3535     obj->publish_enabled = cfg.publish_enabled; 
    3536     obj->reg_timeout = cfg.reg_timeout; 
    3537          
     1353    obj = (PyObj_pjsua_acc_config *) 
     1354          PyObj_pjsua_acc_config_new(&PyTyp_pjsua_acc_config,  
     1355                                     NULL, NULL); 
     1356    PyObj_pjsua_acc_config_import(obj, &cfg); 
    35381357    return (PyObject *)obj; 
    35391358} 
     
    35421361 * py_pjsua_acc_get_count 
    35431362 */ 
    3544 static PyObject *py_pjsua_acc_get_count 
    3545 (PyObject *pSelf, PyObject *pArgs) 
     1363static PyObject *py_pjsua_acc_get_count(PyObject *pSelf, PyObject *pArgs) 
    35461364{ 
    35471365    int count; 
    3548     if (!PyArg_ParseTuple(pArgs, "")) 
    3549     { 
    3550         return NULL; 
    3551     } 
     1366 
     1367    PJ_UNUSED_ARG(pSelf); 
     1368 
     1369    if (!PyArg_ParseTuple(pArgs, "")) { 
     1370        return NULL; 
     1371    } 
     1372 
    35521373    count = pjsua_acc_get_count(); 
    35531374    return Py_BuildValue("i",count); 
     
    35571378 * py_pjsua_acc_is_valid 
    35581379 */ 
    3559 static PyObject *py_pjsua_acc_is_valid 
    3560 (PyObject *pSelf, PyObject *pArgs) 
     1380static PyObject *py_pjsua_acc_is_valid(PyObject *pSelf, PyObject *pArgs) 
    35611381{     
    35621382    int id; 
    35631383    int is_valid; 
    35641384 
    3565     if (!PyArg_ParseTuple(pArgs, "i", &id)) 
    3566     { 
    3567         return NULL; 
    3568     } 
    3569     is_valid = pjsua_acc_is_valid(id); 
    3570          
     1385    PJ_UNUSED_ARG(pSelf); 
     1386 
     1387    if (!PyArg_ParseTuple(pArgs, "i", &id)) { 
     1388        return NULL; 
     1389    } 
     1390 
     1391    is_valid = pjsua_acc_is_valid(id);   
    35711392    return Py_BuildValue("i", is_valid); 
    35721393} 
     
    35751396 * py_pjsua_acc_set_default 
    35761397 */ 
    3577 static PyObject *py_pjsua_acc_set_default 
    3578 (PyObject *pSelf, PyObject *pArgs) 
     1398static PyObject *py_pjsua_acc_set_default(PyObject *pSelf, PyObject *pArgs) 
    35791399{     
    35801400    int id; 
    35811401    int status; 
    35821402 
    3583     if (!PyArg_ParseTuple(pArgs, "i", &id)) 
    3584     { 
     1403    PJ_UNUSED_ARG(pSelf); 
     1404 
     1405    if (!PyArg_ParseTuple(pArgs, "i", &id)) { 
    35851406        return NULL; 
    35861407    } 
     
    35931414 * py_pjsua_acc_get_default 
    35941415 */ 
    3595 static PyObject *py_pjsua_acc_get_default 
    3596 (PyObject *pSelf, PyObject *pArgs) 
     1416static PyObject *py_pjsua_acc_get_default(PyObject *pSelf, PyObject *pArgs) 
    35971417{     
    35981418    int id; 
    35991419         
    3600     if (!PyArg_ParseTuple(pArgs, "")) 
    3601     { 
    3602         return NULL; 
    3603     } 
     1420    PJ_UNUSED_ARG(pSelf); 
     1421 
     1422    if (!PyArg_ParseTuple(pArgs, "")) { 
     1423        return NULL; 
     1424    } 
     1425 
    36041426    id = pjsua_acc_get_default(); 
    36051427         
     
    36111433 * !modified @ 051206 
    36121434 */ 
    3613 static PyObject *py_pjsua_acc_add 
    3614 (PyObject *pSelf, PyObject *pArgs) 
     1435static PyObject *py_pjsua_acc_add(PyObject *pSelf, PyObject *pArgs) 
    36151436{     
    36161437    int is_default; 
    36171438    PyObject * acObj; 
    3618     acc_config_Object * ac; 
    3619     pjsua_acc_config cfg; 
    3620      
    3621     int p_acc_id; 
     1439    PyObj_pjsua_acc_config * ac; 
     1440    int acc_id; 
    36221441    int status; 
    3623     int i; 
    3624  
    3625     if (!PyArg_ParseTuple(pArgs, "Oi", &acObj, &is_default)) 
    3626     { 
    3627         return NULL; 
    3628     } 
    3629  
    3630     pjsua_acc_config_default(&cfg); 
    3631     if (acObj != Py_None) 
    3632     { 
    3633         ac = (acc_config_Object *)acObj; 
    3634         cfg.cred_count = ac->cred_count; 
    3635         for (i = 0; i < PJSUA_MAX_ACC; i++)  
    3636         { 
    3637             /*cfg.cred_info[i] = ac->cred_info[i];*/ 
    3638             pjsip_cred_info_Object * ci = (pjsip_cred_info_Object *) 
    3639                                 PyList_GetItem((PyObject *)ac->cred_info,i); 
    3640             cfg.cred_info[i].data.ptr = PyString_AsString(ci->data); 
    3641             cfg.cred_info[i].data.slen = strlen(PyString_AsString(ci->data)); 
    3642             cfg.cred_info[i].realm.ptr = PyString_AsString(ci->realm); 
    3643             cfg.cred_info[i].realm.slen = strlen(PyString_AsString(ci->realm)); 
    3644             cfg.cred_info[i].scheme.ptr = PyString_AsString(ci->scheme); 
    3645             cfg.cred_info[i].scheme.slen = strlen 
    3646                                 (PyString_AsString(ci->scheme)); 
    3647             cfg.cred_info[i].username.ptr = PyString_AsString(ci->username); 
    3648             cfg.cred_info[i].username.slen = strlen 
    3649                                 (PyString_AsString(ci->username)); 
    3650             cfg.cred_info[i].data_type = ci->data_type; 
    3651         } 
    3652         cfg.force_contact.ptr = PyString_AsString(ac->force_contact); 
    3653         cfg.force_contact.slen = strlen(PyString_AsString(ac->force_contact)); 
    3654         cfg.id.ptr = PyString_AsString(ac->id); 
    3655         cfg.id.slen = strlen(PyString_AsString(ac->id)); 
    3656         cfg.priority = ac->priority; 
    3657         for (i = 0; i < PJSUA_MAX_ACC; i++)  
    3658         { 
    3659             /*cfg.proxy[i] = ac->proxy[i];*/ 
    3660             cfg.proxy[i].ptr = PyString_AsString 
    3661                                 (PyList_GetItem((PyObject *)ac->proxy,i)); 
    3662         } 
    3663         cfg.proxy_cnt = ac->proxy_cnt; 
    3664         cfg.publish_enabled = ac->publish_enabled; 
    3665         cfg.reg_timeout = ac->reg_timeout; 
    3666         cfg.reg_uri.ptr = PyString_AsString(ac->reg_uri); 
    3667         cfg.reg_uri.slen = strlen(PyString_AsString(ac->reg_uri)); 
    3668      
    3669         status = pjsua_acc_add(&cfg, is_default, &p_acc_id); 
     1442 
     1443    PJ_UNUSED_ARG(pSelf); 
     1444 
     1445    if (!PyArg_ParseTuple(pArgs, "Oi", &acObj, &is_default)) { 
     1446        return NULL; 
     1447    } 
     1448     
     1449    if (acObj != Py_None) { 
     1450        pjsua_acc_config cfg; 
     1451 
     1452        pjsua_acc_config_default(&cfg); 
     1453        ac = (PyObj_pjsua_acc_config *)acObj; 
     1454        PyObj_pjsua_acc_config_export(&cfg, ac); 
     1455        status = pjsua_acc_add(&cfg, is_default, &acc_id); 
    36701456    } else { 
    3671         status = pjsua_acc_add(NULL, is_default, &p_acc_id); 
    3672     } 
    3673      
    3674     return Py_BuildValue("ii", status, p_acc_id); 
     1457        status = PJ_EINVAL; 
     1458        acc_id = PJSUA_INVALID_ID; 
     1459    } 
     1460     
     1461    return Py_BuildValue("ii", status, acc_id); 
    36751462} 
    36761463 
     
    36791466 * !modified @ 051206 
    36801467 */ 
    3681 static PyObject *py_pjsua_acc_add_local 
    3682 (PyObject *pSelf, PyObject *pArgs) 
     1468static PyObject *py_pjsua_acc_add_local(PyObject *pSelf, PyObject *pArgs) 
    36831469{     
    36841470    int is_default; 
    36851471    int tid; 
    3686      
    36871472    int p_acc_id; 
    36881473    int status; 
    36891474         
    3690  
    3691     if (!PyArg_ParseTuple(pArgs, "ii", &tid, &is_default)) 
    3692     { 
     1475    PJ_UNUSED_ARG(pSelf); 
     1476 
     1477    if (!PyArg_ParseTuple(pArgs, "ii", &tid, &is_default)) { 
    36931478        return NULL; 
    36941479    } 
     
    37031488 * py_pjsua_acc_del 
    37041489 */ 
    3705 static PyObject *py_pjsua_acc_del 
    3706 (PyObject *pSelf, PyObject *pArgs) 
     1490static PyObject *py_pjsua_acc_del(PyObject *pSelf, PyObject *pArgs) 
    37071491{     
    37081492    int acc_id; 
    37091493    int status; 
     1494 
     1495    PJ_UNUSED_ARG(pSelf); 
    37101496 
    37111497    if (!PyArg_ParseTuple(pArgs, "i", &acc_id)) 
     
    37221508 * py_pjsua_acc_modify 
    37231509 */ 
    3724 static PyObject *py_pjsua_acc_modify 
    3725 (PyObject *pSelf, PyObject *pArgs) 
     1510static PyObject *py_pjsua_acc_modify(PyObject *pSelf, PyObject *pArgs) 
    37261511{        
    37271512    PyObject * acObj; 
    3728     acc_config_Object * ac; 
    3729     pjsua_acc_config cfg;        
     1513    PyObj_pjsua_acc_config * ac; 
    37301514    int acc_id; 
    37311515    int status; 
    3732     int i; 
    3733  
    3734     if (!PyArg_ParseTuple(pArgs, "iO", &acc_id, &acObj)) 
    3735     { 
    3736         return NULL; 
    3737     } 
    3738     if (acObj != Py_None) 
    3739     { 
    3740         ac = (acc_config_Object *)acObj; 
    3741         cfg.cred_count = ac->cred_count; 
    3742         for (i = 0; i < PJSUA_MAX_ACC; i++)  
    3743         { 
    3744             /*cfg.cred_info[i] = ac->cred_info[i];*/ 
    3745             pjsip_cred_info_Object * ci = (pjsip_cred_info_Object *) 
    3746                                 PyList_GetItem((PyObject *)ac->cred_info,i); 
    3747             cfg.cred_info[i].data.ptr = PyString_AsString(ci->data); 
    3748             cfg.cred_info[i].data.slen = strlen(PyString_AsString(ci->data)); 
    3749             cfg.cred_info[i].realm.ptr = PyString_AsString(ci->realm); 
    3750             cfg.cred_info[i].realm.slen = strlen(PyString_AsString(ci->realm)); 
    3751             cfg.cred_info[i].scheme.ptr = PyString_AsString(ci->scheme); 
    3752             cfg.cred_info[i].scheme.slen = strlen 
    3753                                 (PyString_AsString(ci->scheme)); 
    3754             cfg.cred_info[i].username.ptr = PyString_AsString(ci->username); 
    3755             cfg.cred_info[i].username.slen = strlen 
    3756                                 (PyString_AsString(ci->username)); 
    3757         } 
    3758         cfg.force_contact.ptr = PyString_AsString(ac->force_contact); 
    3759         cfg.force_contact.slen = strlen(PyString_AsString(ac->force_contact)); 
    3760         cfg.id.ptr = PyString_AsString(ac->id); 
    3761         cfg.id.slen = strlen(PyString_AsString(ac->id)); 
    3762         cfg.priority = ac->priority; 
    3763         for (i = 0; i < PJSUA_MAX_ACC; i++)  
    3764         { 
    3765             /*cfg.proxy[i] = ac->proxy[i];*/ 
    3766              cfg.proxy[i].ptr = PyString_AsString 
    3767                                 (PyList_GetItem((PyObject *)ac->proxy,i)); 
    3768         } 
    3769         cfg.proxy_cnt = ac->proxy_cnt; 
    3770         cfg.publish_enabled = ac->publish_enabled; 
    3771         cfg.reg_timeout = ac->reg_timeout; 
    3772         cfg.reg_uri.ptr = PyString_AsString(ac->reg_uri); 
    3773         cfg.reg_uri.slen = strlen(PyString_AsString(ac->reg_uri));       
     1516 
     1517    PJ_UNUSED_ARG(pSelf); 
     1518 
     1519    if (!PyArg_ParseTuple(pArgs, "iO", &acc_id, &acObj)) { 
     1520        return NULL; 
     1521    } 
     1522 
     1523    if (acObj != Py_None) { 
     1524        pjsua_acc_config cfg;    
     1525 
     1526        pjsua_acc_config_default(&cfg); 
     1527        ac = (PyObj_pjsua_acc_config *)acObj; 
     1528        PyObj_pjsua_acc_config_export(&cfg, ac); 
     1529 
    37741530        status = pjsua_acc_modify(acc_id, &cfg); 
    37751531    } else { 
    3776         status = pjsua_acc_modify(acc_id, NULL); 
     1532        status = PJ_EINVAL; 
    37771533    } 
    37781534    return Py_BuildValue("i", status); 
     
    37821538 * py_pjsua_acc_set_online_status 
    37831539 */ 
    3784 static PyObject *py_pjsua_acc_set_online_status 
    3785 (PyObject *pSelf, PyObject *pArgs) 
     1540static PyObject *py_pjsua_acc_set_online_status(PyObject *pSelf,  
     1541                                                PyObject *pArgs) 
    37861542{     
    37871543    int is_online;       
     
    37891545    int status;  
    37901546 
    3791     if (!PyArg_ParseTuple(pArgs, "ii", &acc_id, &is_online)) 
    3792     { 
     1547    PJ_UNUSED_ARG(pSelf); 
     1548 
     1549    if (!PyArg_ParseTuple(pArgs, "ii", &acc_id, &is_online)) { 
    37931550        return NULL; 
    37941551    } 
     
    38001557 
    38011558/* 
     1559 * py_pjsua_acc_set_online_status2 
     1560 */ 
     1561static PyObject *py_pjsua_acc_set_online_status2(PyObject *pSelf,  
     1562                                                 PyObject *pArgs) 
     1563{     
     1564    int is_online;       
     1565    int acc_id; 
     1566    int activity_id; 
     1567    const char *activity_text; 
     1568    pjrpid_element rpid; 
     1569    pj_status_t status;  
     1570 
     1571    PJ_UNUSED_ARG(pSelf); 
     1572 
     1573    if (!PyArg_ParseTuple(pArgs, "iiis", &acc_id, &is_online, 
     1574                          &activity_id, &activity_text)) { 
     1575        return NULL; 
     1576    } 
     1577 
     1578    pj_bzero(&rpid, sizeof(rpid)); 
     1579    rpid.activity = activity_id; 
     1580    rpid.note = pj_str((char*)activity_text); 
     1581 
     1582    status = pjsua_acc_set_online_status2(acc_id, is_online, &rpid); 
     1583 
     1584    return Py_BuildValue("i", status); 
     1585} 
     1586 
     1587/* 
    38021588 * py_pjsua_acc_set_registration 
    38031589 */ 
    3804 static PyObject *py_pjsua_acc_set_registration 
    3805 (PyObject *pSelf, PyObject *pArgs) 
     1590static PyObject *py_pjsua_acc_set_registration(PyObject *pSelf,  
     1591                                              PyObject *pArgs) 
    38061592{     
    38071593    int renew;   
     
    38091595    int status;  
    38101596 
    3811     if (!PyArg_ParseTuple(pArgs, "ii", &acc_id, &renew)) 
    3812     { 
     1597    PJ_UNUSED_ARG(pSelf); 
     1598 
     1599    if (!PyArg_ParseTuple(pArgs, "ii", &acc_id, &renew)) { 
    38131600        return NULL; 
    38141601    } 
     
    38231610 * !modified @ 051206 
    38241611 */ 
    3825 static PyObject *py_pjsua_acc_get_info 
    3826 (PyObject *pSelf, PyObject *pArgs) 
     1612static PyObject *py_pjsua_acc_get_info(PyObject *pSelf, PyObject *pArgs) 
    38271613{        
    38281614    int acc_id; 
    3829     acc_info_Object * obj; 
     1615    PyObj_pjsua_acc_info * obj; 
    38301616    pjsua_acc_info info; 
    38311617    int status;  
    3832     int i; 
    3833  
    3834     if (!PyArg_ParseTuple(pArgs, "i", &acc_id)) 
    3835     { 
    3836         return NULL; 
    3837     } 
    3838          
     1618 
     1619    PJ_UNUSED_ARG(pSelf); 
     1620 
     1621    if (!PyArg_ParseTuple(pArgs, "i", &acc_id)) { 
     1622        return NULL; 
     1623    } 
    38391624     
    38401625    status = pjsua_acc_get_info(acc_id, &info); 
    3841     if (status == PJ_SUCCESS)  
    3842     { 
    3843         obj = (acc_info_Object *)acc_info_new(&acc_info_Type,NULL, NULL); 
    3844         obj->acc_uri = 
    3845             PyString_FromStringAndSize(info.acc_uri.ptr,  
    3846             info.acc_uri.slen); 
    3847         for (i = 0; i < PJ_ERR_MSG_SIZE; i++)  
    3848         { 
    3849             obj->buf_[i] = info.buf_[i]; 
    3850         } 
    3851         obj->expires = info.expires; 
    3852         obj->has_registration = info.has_registration; 
    3853         obj->id = info.id; 
    3854         obj->is_default = info.is_default; 
    3855         obj->online_status = info.online_status; 
    3856         obj->status = info.status; 
    3857         obj->status_text = 
    3858             PyString_FromStringAndSize(info.status_text.ptr,  
    3859             info.status_text.slen); 
     1626    if (status == PJ_SUCCESS) { 
     1627        obj = (PyObj_pjsua_acc_info *) 
     1628            PyObj_pjsua_acc_info_new(&PyTyp_pjsua_acc_info,NULL, NULL); 
     1629        PyObj_pjsua_acc_info_import(obj, &info); 
    38601630        return Py_BuildValue("O", obj); 
    38611631    } else { 
     
    38761646    pjsua_acc_id id[PJSUA_MAX_ACC]; 
    38771647    unsigned c, i; 
     1648 
     1649    PJ_UNUSED_ARG(pSelf); 
     1650 
    38781651    if (!PyArg_ParseTuple(pArgs, "")) 
    38791652    { 
     
    39051678    pj_status_t status; 
    39061679    PyObject *list; 
    3907      
    39081680    pjsua_acc_info info[PJSUA_MAX_ACC]; 
    39091681    unsigned c, i; 
    3910     if (!PyArg_ParseTuple(pArgs, "")) 
    3911     { 
     1682 
     1683    PJ_UNUSED_ARG(pSelf); 
     1684 
     1685    if (!PyArg_ParseTuple(pArgs, "")) { 
    39121686        return NULL; 
    39131687    }    
     
    39171691     
    39181692    list = PyList_New(c); 
    3919     for (i = 0; i < c; i++)  
    3920     { 
    3921         int ret; 
    3922         int j; 
    3923         acc_info_Object *obj; 
    3924         obj = (acc_info_Object *)acc_info_new(&acc_info_Type,NULL,NULL); 
    3925         obj->acc_uri = PyString_FromStringAndSize 
    3926             (info[i].acc_uri.ptr, info[i].acc_uri.slen); 
    3927         for(j = 0; j < PJ_ERR_MSG_SIZE; j++)  
    3928         { 
    3929             obj->buf_[j] = info[i].buf_[j]; 
    3930         } 
    3931         obj->expires = info[i].expires; 
    3932         obj->has_registration = info[i].has_registration; 
    3933         obj->id = info[i].id; 
    3934         obj->is_default = info[i].is_default; 
    3935         obj->online_status = info[i].online_status; 
    3936         obj->status = info[i].status; 
    3937         obj->status_text = PyString_FromStringAndSize(info[i].status_text.ptr, 
    3938             info[i].status_text.slen); 
    3939         ret = PyList_SetItem(list, i, (PyObject *)obj); 
    3940         if (ret == -1) { 
    3941             return NULL; 
    3942         } 
     1693    for (i = 0; i < c; i++) { 
     1694        PyObj_pjsua_acc_info *obj; 
     1695        obj = (PyObj_pjsua_acc_info *) 
     1696              PyObj_pjsua_acc_info_new(&PyTyp_pjsua_acc_info, NULL, NULL); 
     1697 
     1698        PyObj_pjsua_acc_info_import(obj, &info[i]); 
     1699 
     1700        PyList_SetItem(list, i, (PyObject *)obj); 
    39431701    } 
    39441702     
     
    39491707 * py_pjsua_acc_find_for_outgoing 
    39501708 */ 
    3951 static PyObject *py_pjsua_acc_find_for_outgoing 
    3952 (PyObject *pSelf, PyObject *pArgs) 
    3953 {     
    3954          
     1709static PyObject *py_pjsua_acc_find_for_outgoing(PyObject *pSelf,  
     1710                                                PyObject *pArgs) 
     1711{        
    39551712    int acc_id;  
    39561713    PyObject * url; 
    39571714    pj_str_t str; 
     1715 
     1716    PJ_UNUSED_ARG(pSelf); 
    39581717 
    39591718    if (!PyArg_ParseTuple(pArgs, "O", &url)) 
     
    39721731 * py_pjsua_acc_find_for_incoming 
    39731732 */ 
    3974 static PyObject *py_pjsua_acc_find_for_incoming 
    3975 (PyObject *pSelf, PyObject *pArgs) 
     1733static PyObject *py_pjsua_acc_find_for_incoming(PyObject *pSelf,  
     1734                                                PyObject *pArgs) 
    39761735{        
    39771736    int acc_id;  
    39781737    PyObject * tmpObj; 
    3979     pjsip_rx_data_Object * obj; 
     1738    PyObj_pjsip_rx_data * obj; 
    39801739    pjsip_rx_data * rdata; 
    39811740 
     1741    PJ_UNUSED_ARG(pSelf); 
     1742 
    39821743    if (!PyArg_ParseTuple(pArgs, "O", &tmpObj)) 
    39831744    { 
     
    39861747    if (tmpObj != Py_None) 
    39871748    { 
    3988         obj = (pjsip_rx_data_Object *)tmpObj; 
     1749        obj = (PyObj_pjsip_rx_data *)tmpObj; 
    39891750        rdata = obj->rdata; 
    39901751        acc_id = pjsua_acc_find_for_incoming(rdata); 
     
    39991760 * !modified @ 061206 
    40001761 */ 
    4001 static PyObject *py_pjsua_acc_create_uac_contact 
    4002 (PyObject *pSelf, PyObject *pArgs) 
     1762static PyObject *py_pjsua_acc_create_uac_contact(PyObject *pSelf,  
     1763                                                PyObject *pArgs) 
    40031764{        
    40041765    int status; 
    40051766    int acc_id; 
    40061767    PyObject * pObj; 
    4007     pj_pool_Object * p; 
     1768    PyObj_pj_pool * p; 
    40081769    pj_pool_t * pool; 
    40091770    PyObject * strc; 
     
    40121773    pj_str_t uri; 
    40131774 
     1775    PJ_UNUSED_ARG(pSelf); 
     1776 
    40141777    if (!PyArg_ParseTuple(pArgs, "OiO", &pObj, &acc_id, &stru)) 
    40151778    { 
     
    40181781    if (pObj != Py_None) 
    40191782    { 
    4020         p = (pj_pool_Object *)pObj; 
     1783        p = (PyObj_pj_pool *)pObj; 
    40211784        pool = p->pool;     
    40221785        uri.ptr = PyString_AsString(stru); 
     
    40351798 * !modified @ 061206 
    40361799 */ 
    4037 static PyObject *py_pjsua_acc_create_uas_contact 
    4038 (PyObject *pSelf, PyObject *pArgs) 
     1800static PyObject *py_pjsua_acc_create_uas_contact(PyObject *pSelf,  
     1801                                                PyObject *pArgs) 
    40391802{        
    40401803    int status; 
    40411804    int acc_id;  
    40421805    PyObject * pObj; 
    4043     pj_pool_Object * p; 
     1806    PyObj_pj_pool * p; 
    40441807    pj_pool_t * pool; 
    40451808    PyObject * strc; 
    40461809    pj_str_t contact; 
    40471810    PyObject * rObj; 
    4048     pjsip_rx_data_Object * objr; 
     1811    PyObj_pjsip_rx_data * objr; 
    40491812    pjsip_rx_data * rdata; 
    40501813 
     1814    PJ_UNUSED_ARG(pSelf); 
     1815 
    40511816    if (!PyArg_ParseTuple(pArgs, "OiO", &pObj, &acc_id, &rObj)) 
    40521817    { 
     
    40551820    if (pObj != Py_None) 
    40561821    { 
    4057         p = (pj_pool_Object *)pObj; 
     1822        p = (PyObj_pj_pool *)pObj; 
    40581823        pool = p->pool; 
    40591824    } else { 
     
    40621827    if (rObj != Py_None) 
    40631828    { 
    4064         objr = (pjsip_rx_data_Object *)rObj; 
     1829        objr = (PyObj_pjsip_rx_data *)rObj; 
    40651830        rdata = objr->rdata; 
    40661831    } else { 
     
    41071872    "Modify account information."; 
    41081873static char pjsua_acc_set_online_status_doc[] = 
    4109     "int py_pjsua.acc_set_online_status (int acc_id, int is_online) " 
     1874    "int py_pjsua.acc_set_online_status2(int acc_id, int is_online) " 
     1875    "Modify account's presence status to be advertised " 
     1876    "to remote/presence subscribers."; 
     1877static char pjsua_acc_set_online_status2_doc[] = 
     1878    "int py_pjsua.acc_set_online_status (int acc_id, int is_online, " 
     1879                                         "int activity_id, string activity_text) " 
    41101880    "Modify account's presence status to be advertised " 
    41111881    "to remote/presence subscribers."; 
     
    41271897    "to used to reach to the specified URL."; 
    41281898static char pjsua_acc_find_for_incoming_doc[] = 
    4129     "int py_pjsua.acc_find_for_incoming (pjsip_rx_data_Object rdata) " 
     1899    "int py_pjsua.acc_find_for_incoming (PyObj_pjsip_rx_data rdata) " 
    41301900    "This is an internal function to find the most appropriate account " 
    41311901    "to be used to handle incoming calls."; 
    41321902static char pjsua_acc_create_uac_contact_doc[] = 
    4133     "string py_pjsua.acc_create_uac_contact (pj_pool_Object pool, " 
     1903    "string py_pjsua.acc_create_uac_contact (PyObj_pj_pool pool, " 
    41341904    "int acc_id, string uri) " 
    41351905    "Create a suitable URI to be put as Contact based on the specified " 
    41361906    "target URI for the specified account."; 
    41371907static char pjsua_acc_create_uas_contact_doc[] = 
    4138     "string py_pjsua.acc_create_uas_contact (pj_pool_Object pool, " 
    4139     "int acc_id, pjsip_rx_data_Object rdata) " 
     1908    "string py_pjsua.acc_create_uas_contact (PyObj_pj_pool pool, " 
     1909    "int acc_id, PyObj_pjsip_rx_data rdata) " 
    41401910    "Create a suitable URI to be put as Contact based on the information " 
    41411911    "in the incoming request."; 
     
    41481918 
    41491919/* 
    4150  * buddy_config_Object 
    4151  * Buddy Config 
    4152  */ 
    4153 typedef struct 
    4154 { 
    4155     PyObject_HEAD 
    4156     /* Type-specific fields go here. */ 
    4157      
    4158     PyObject * uri; 
    4159     int subscribe; 
    4160 } buddy_config_Object; 
    4161  
    4162  
    4163 /* 
    4164  * buddy_config_dealloc 
    4165  * deletes a buddy_config from memory 
    4166  */ 
    4167 static void buddy_config_dealloc(buddy_config_Object* self) 
    4168 { 
    4169     Py_XDECREF(self->uri);      
    4170     self->ob_type->tp_free((PyObject*)self); 
    4171 } 
    4172  
    4173  
    4174 /* 
    4175  * buddy_config_new 
    4176  * constructor for buddy_config object 
    4177  */ 
    4178 static PyObject * buddy_config_new(PyTypeObject *type, PyObject *args, 
    4179                                     PyObject *kwds) 
    4180 { 
    4181     buddy_config_Object *self; 
    4182  
    4183     self = (buddy_config_Object *)type->tp_alloc(type, 0); 
    4184     if (self != NULL) 
    4185     { 
    4186         self->uri = PyString_FromString(""); 
    4187         if (self->uri == NULL) 
    4188         { 
    4189             Py_DECREF(self); 
    4190             return NULL; 
    4191         }         
    4192     } 
    4193     return (PyObject *)self; 
    4194 } 
    4195  
    4196 /* 
    4197  * buddy_config_members 
    4198  */ 
    4199 static PyMemberDef buddy_config_members[] = 
    4200 { 
    4201      
    4202     { 
    4203         "uri", T_OBJECT_EX, 
    4204         offsetof(buddy_config_Object, uri), 0, 
    4205         "TBuddy URL or name address."         
    4206     }, 
    4207      
    4208     { 
    4209         "subscribe", T_INT,  
    4210         offsetof(buddy_config_Object, subscribe), 0, 
    4211         "Specify whether presence subscription should start immediately. " 
    4212     }, 
    4213      
    4214     {NULL}  /* Sentinel */ 
    4215 }; 
    4216  
    4217  
    4218  
    4219  
    4220 /* 
    4221  * buddy_config_Type 
    4222  */ 
    4223 static PyTypeObject buddy_config_Type = 
    4224 { 
    4225     PyObject_HEAD_INIT(NULL) 
    4226     0,                              /*ob_size*/ 
    4227     "py_pjsua.Buddy_Config",      /*tp_name*/ 
    4228     sizeof(buddy_config_Object),  /*tp_basicsize*/ 
    4229     0,                              /*tp_itemsize*/ 
    4230     (destructor)buddy_config_dealloc,/*tp_dealloc*/ 
    4231     0,                              /*tp_print*/ 
    4232     0,                              /*tp_getattr*/ 
    4233     0,                              /*tp_setattr*/ 
    4234     0,                              /*tp_compare*/ 
    4235     0,                              /*tp_repr*/ 
    4236     0,                              /*tp_as_number*/ 
    4237     0,                              /*tp_as_sequence*/ 
    4238     0,                              /*tp_as_mapping*/ 
    4239     0,                              /*tp_hash */ 
    4240     0,                              /*tp_call*/ 
    4241     0,                              /*tp_str*/ 
    4242     0,                              /*tp_getattro*/ 
    4243     0,                              /*tp_setattro*/ 
    4244     0,                              /*tp_as_buffer*/ 
    4245     Py_TPFLAGS_DEFAULT,             /*tp_flags*/ 
    4246     "Buddy Config objects",       /* tp_doc */ 
    4247     0,                              /* tp_traverse */ 
    4248     0,                              /* tp_clear */ 
    4249     0,                              /* tp_richcompare */ 
    4250     0,                              /* tp_weaklistoffset */ 
    4251     0,                              /* tp_iter */ 
    4252     0,                              /* tp_iternext */ 
    4253     0,                              /* tp_methods */ 
    4254     buddy_config_members,         /* tp_members */ 
    4255     0,                              /* tp_getset */ 
    4256     0,                              /* tp_base */ 
    4257     0,                              /* tp_dict */ 
    4258     0,                              /* tp_descr_get */ 
    4259     0,                              /* tp_descr_set */ 
    4260     0,                              /* tp_dictoffset */ 
    4261     0,                              /* tp_init */ 
    4262     0,                              /* tp_alloc */ 
    4263     buddy_config_new,             /* tp_new */ 
    4264  
    4265 }; 
    4266  
    4267 /* 
    4268  * buddy_info_Object 
    4269  * Buddy Info 
    4270  * !modified @ 071206 
    4271  */ 
    4272 typedef struct 
    4273 { 
    4274     PyObject_HEAD 
    4275     /* Type-specific fields go here. */  
    4276     int id; 
    4277     PyObject * uri; 
    4278     PyObject * contact; 
    4279     int status; 
    4280     PyObject * status_text; 
    4281     int monitor_pres; 
    4282     char buf_[256]; 
    4283 } buddy_info_Object; 
    4284  
    4285  
    4286 /* 
    4287  * buddy_info_dealloc 
    4288  * deletes a buddy_info from memory 
    4289  * !modified @ 071206 
    4290  */ 
    4291 static void buddy_info_dealloc(buddy_info_Object* self) 
    4292 { 
    4293     Py_XDECREF(self->uri); 
    4294     Py_XDECREF(self->contact); 
    4295     Py_XDECREF(self->status_text); 
    4296      
    4297     self->ob_type->tp_free((PyObject*)self); 
    4298 } 
    4299  
    4300  
    4301 /* 
    4302  * buddy_info_new 
    4303  * constructor for buddy_info object 
    4304  * !modified @ 071206 
    4305  */ 
    4306 static PyObject * buddy_info_new(PyTypeObject *type, PyObject *args, 
    4307                                     PyObject *kwds) 
    4308 { 
    4309     buddy_info_Object *self; 
    4310  
    4311     self = (buddy_info_Object *)type->tp_alloc(type, 0); 
    4312     if (self != NULL) 
    4313     { 
    4314         self->uri = PyString_FromString(""); 
    4315         if (self->uri == NULL) 
    4316         { 
    4317             Py_DECREF(self); 
    4318             return NULL; 
    4319         }         
    4320         self->contact = PyString_FromString(""); 
    4321         if (self->contact == NULL) 
    4322         { 
    4323             Py_DECREF(self); 
    4324             return NULL; 
    4325         } 
    4326         self->status_text = PyString_FromString(""); 
    4327         if (self->status_text == NULL) 
    4328         { 
    4329             Py_DECREF(self); 
    4330             return NULL; 
    4331         } 
    4332          
    4333     } 
    4334     return (PyObject *)self; 
    4335 } 
    4336  
    4337 /* 
    4338  * buddy_info_members 
    4339  * !modified @ 071206 
    4340  */ 
    4341 static PyMemberDef buddy_info_members[] = 
    4342 { 
    4343     { 
    4344         "id", T_INT,  
    4345         offsetof(buddy_info_Object, id), 0, 
    4346         "The buddy ID." 
    4347     }, 
    4348     { 
    4349         "uri", T_OBJECT_EX, 
    4350         offsetof(buddy_info_Object, uri), 0, 
    4351         "The full URI of the buddy, as specified in the configuration. "         
    4352     }, 
    4353     { 
    4354         "contact", T_OBJECT_EX, 
    4355         offsetof(buddy_info_Object, contact), 0, 
    4356         "Buddy's Contact, only available when presence subscription " 
    4357         "has been established to the buddy."         
    4358     }, 
    4359     { 
    4360         "status", T_INT,  
    4361         offsetof(buddy_info_Object, status), 0, 
    4362         "Buddy's online status. " 
    4363     }, 
    4364     { 
    4365         "status_text", T_OBJECT_EX, 
    4366         offsetof(buddy_info_Object, status_text), 0, 
    4367         "Text to describe buddy's online status."         
    4368     }, 
    4369     { 
    4370         "monitor_pres", T_INT,  
    4371         offsetof(buddy_info_Object, monitor_pres), 0, 
    4372         "Flag to indicate that we should monitor the presence information " 
    4373         "for this buddy (normally yes, unless explicitly disabled). " 
    4374     }, 
    4375      
    4376      
    4377     {NULL}  /* Sentinel */ 
    4378 }; 
    4379  
    4380  
    4381  
    4382  
    4383 /* 
    4384  * buddy_info_Type 
    4385  */ 
    4386 static PyTypeObject buddy_info_Type = 
    4387 { 
    4388     PyObject_HEAD_INIT(NULL) 
    4389     0,                              /*ob_size*/ 
    4390     "py_pjsua.Buddy_Info",      /*tp_name*/ 
    4391     sizeof(buddy_info_Object),  /*tp_basicsize*/ 
    4392     0,                              /*tp_itemsize*/ 
    4393     (destructor)buddy_info_dealloc,/*tp_dealloc*/ 
    4394     0,                              /*tp_print*/ 
    4395     0,                              /*tp_getattr*/ 
    4396     0,                              /*tp_setattr*/ 
    4397     0,                              /*tp_compare*/ 
    4398     0,                              /*tp_repr*/ 
    4399     0,                              /*tp_as_number*/ 
    4400     0,                              /*tp_as_sequence*/ 
    4401     0,                              /*tp_as_mapping*/ 
    4402     0,                              /*tp_hash */ 
    4403     0,                              /*tp_call*/ 
    4404     0,                              /*tp_str*/ 
    4405     0,                              /*tp_getattro*/ 
    4406     0,                              /*tp_setattro*/ 
    4407     0,                              /*tp_as_buffer*/ 
    4408     Py_TPFLAGS_DEFAULT,             /*tp_flags*/ 
    4409     "Buddy Info objects",       /* tp_doc */ 
    4410     0,                              /* tp_traverse */ 
    4411     0,                              /* tp_clear */ 
    4412     0,                              /* tp_richcompare */ 
    4413     0,                              /* tp_weaklistoffset */ 
    4414     0,                              /* tp_iter */ 
    4415     0,                              /* tp_iternext */ 
    4416     0,                              /* tp_methods */ 
    4417     buddy_info_members,         /* tp_members */ 
    4418     0,                              /* tp_getset */ 
    4419     0,                              /* tp_base */ 
    4420     0,                              /* tp_dict */ 
    4421     0,                              /* tp_descr_get */ 
    4422     0,                              /* tp_descr_set */ 
    4423     0,                              /* tp_dictoffset */ 
    4424     0,                              /* tp_init */ 
    4425     0,                              /* tp_alloc */ 
    4426     buddy_info_new,             /* tp_new */ 
    4427  
    4428 }; 
    4429  
    4430 /* 
    44311920 * py_pjsua_buddy_config_default 
    44321921 */ 
    4433 static PyObject *py_pjsua_buddy_config_default 
    4434 (PyObject *pSelf, PyObject *pArgs) 
     1922static PyObject *py_pjsua_buddy_config_default(PyObject *pSelf,  
     1923                                              PyObject *pArgs) 
    44351924{     
    4436     buddy_config_Object *obj;    
     1925    PyObj_pjsua_buddy_config *obj;       
    44371926    pjsua_buddy_config cfg; 
    44381927 
    4439     if (!PyArg_ParseTuple(pArgs, "")) 
    4440     { 
     1928    PJ_UNUSED_ARG(pSelf); 
     1929 
     1930    if (!PyArg_ParseTuple(pArgs, "")) { 
    44411931        return NULL; 
    44421932    } 
    44431933     
    44441934    pjsua_buddy_config_default(&cfg); 
    4445     obj = (buddy_config_Object *) buddy_config_new 
    4446                 (&buddy_config_Type,NULL,NULL); 
    4447     obj->uri = PyString_FromStringAndSize( 
    4448         cfg.uri.ptr, cfg.uri.slen 
    4449     ); 
    4450     obj->subscribe = cfg.subscribe; 
     1935    obj = (PyObj_pjsua_buddy_config *)  
     1936          PyObj_pjsua_buddy_config_new(&PyTyp_pjsua_buddy_config, NULL, NULL); 
     1937    PyObj_pjsua_buddy_config_import(obj, &cfg); 
    44511938     
    44521939    return (PyObject *)obj; 
     
    44561943 * py_pjsua_get_buddy_count 
    44571944 */ 
    4458 static PyObject *py_pjsua_get_buddy_count 
    4459 (PyObject *pSelf, PyObject *pArgs) 
     1945static PyObject *py_pjsua_get_buddy_count(PyObject *pSelf, PyObject *pArgs) 
    44601946{     
    44611947    int ret; 
    44621948 
    4463     if (!PyArg_ParseTuple(pArgs, "")) 
    4464     { 
     1949    PJ_UNUSED_ARG(pSelf); 
     1950 
     1951    if (!PyArg_ParseTuple(pArgs, "")) { 
    44651952        return NULL; 
    44661953    } 
     
    44731960 * py_pjsua_buddy_is_valid 
    44741961 */ 
    4475 static PyObject *py_pjsua_buddy_is_valid 
    4476 (PyObject *pSelf, PyObject *pArgs) 
     1962static PyObject *py_pjsua_buddy_is_valid(PyObject *pSelf, PyObject *pArgs) 
    44771963{     
    44781964    int id; 
    44791965    int is_valid; 
    44801966 
    4481     if (!PyArg_ParseTuple(pArgs, "i", &id)) 
    4482     { 
     1967    PJ_UNUSED_ARG(pSelf); 
     1968 
     1969    if (!PyArg_ParseTuple(pArgs, "i", &id)) { 
    44831970        return NULL; 
    44841971    } 
     
    44991986    pjsua_buddy_id id[PJSUA_MAX_BUDDIES]; 
    45001987    unsigned c, i; 
    4501     if (!PyArg_ParseTuple(pArgs, "")) 
    4502     { 
     1988 
     1989    PJ_UNUSED_ARG(pSelf); 
     1990 
     1991    if (!PyArg_ParseTuple(pArgs, "")) { 
    45031992        return NULL; 
    45041993    }    
     
    45061995    status = pjsua_enum_buddies(id, &c); 
    45071996    list = PyList_New(c); 
    4508     for (i = 0; i < c; i++)  
    4509     { 
    4510         int ret = PyList_SetItem(list, i, Py_BuildValue("i", id[i])); 
    4511         if (ret == -1)  
    4512         { 
    4513             return NULL; 
    4514         } 
     1997    for (i = 0; i < c; i++) { 
     1998        PyList_SetItem(list, i, Py_BuildValue("i", id[i])); 
    45151999    } 
    45162000     
     
    45222006 * !modified @ 071206 
    45232007 */ 
    4524 static PyObject *py_pjsua_buddy_get_info 
    4525 (PyObject *pSelf, PyObject *pArgs) 
     2008static PyObject *py_pjsua_buddy_get_info(PyObject *pSelf, PyObject *pArgs) 
    45262009{        
    45272010    int buddy_id; 
    4528     buddy_info_Object * obj; 
     2011    PyObj_pjsua_buddy_info * obj; 
    45292012    pjsua_buddy_info info; 
    45302013    int status;  
    4531     int i; 
    4532  
    4533     if (!PyArg_ParseTuple(pArgs, "i", &buddy_id)) 
    4534     { 
    4535         return NULL; 
    4536     } 
    4537          
    4538      
     2014 
     2015    PJ_UNUSED_ARG(pSelf); 
     2016 
     2017    if (!PyArg_ParseTuple(pArgs, "i", &buddy_id)) { 
     2018        return NULL; 
     2019    } 
     2020 
    45392021    status = pjsua_buddy_get_info(buddy_id, &info); 
    4540     if (status == PJ_SUCCESS)  
    4541     { 
    4542         obj = (buddy_info_Object *)buddy_info_new(&buddy_info_Type,NULL,NULL); 
    4543         obj->id = info.id; 
    4544         Py_XDECREF(obj->uri); 
    4545         obj->uri = 
    4546             PyString_FromStringAndSize(info.uri.ptr,  
    4547             info.uri.slen); 
    4548         Py_XDECREF(obj->contact); 
    4549         obj->contact = 
    4550             PyString_FromStringAndSize(info.contact.ptr,  
    4551             info.contact.slen); 
    4552         obj->status = info.status; 
    4553         Py_XDECREF(obj->status_text); 
    4554         obj->status_text = 
    4555             PyString_FromStringAndSize(info.status_text.ptr,  
    4556             info.status_text.slen); 
    4557         obj->monitor_pres = info.monitor_pres; 
    4558         for (i = 0; i < 256; i++)  
    4559         { 
    4560              
    4561             obj->buf_[i] = info.buf_[i]; 
    4562         } 
    4563          
     2022    if (status == PJ_SUCCESS) { 
     2023        obj = (PyObj_pjsua_buddy_info *) 
     2024              PyObj_pjsua_buddy_config_new(&PyTyp_pjsua_buddy_info,NULL,NULL); 
     2025        PyObj_pjsua_buddy_info_import(obj, &info);       
    45642026        return Py_BuildValue("O", obj); 
    45652027    } else { 
     
    45732035 * !modified @ 061206 
    45742036 */ 
    4575 static PyObject *py_pjsua_buddy_add 
    4576 (PyObject *pSelf, PyObject *pArgs) 
     2037static PyObject *py_pjsua_buddy_add(PyObject *pSelf, PyObject *pArgs) 
    45772038{    
    45782039    PyObject * bcObj; 
    4579     buddy_config_Object * bc; 
    4580          
    4581     pjsua_buddy_config cfg; 
    4582      
    4583     int p_buddy_id; 
     2040    int buddy_id; 
    45842041    int status; 
    45852042 
    4586     if (!PyArg_ParseTuple(pArgs, "O", &bcObj)) 
    4587     { 
    4588         return NULL; 
    4589     } 
    4590     if (bcObj != Py_None) 
    4591     { 
    4592         bc = (buddy_config_Object *)bcObj; 
    4593  
    4594         cfg.subscribe = bc->subscribe; 
    4595         cfg.uri.ptr = PyString_AsString(bc->uri); 
    4596         cfg.uri.slen = strlen(PyString_AsString(bc->uri));     
    4597      
    4598         status = pjsua_buddy_add(&cfg, &p_buddy_id); 
     2043    PJ_UNUSED_ARG(pSelf); 
     2044 
     2045    if (!PyArg_ParseTuple(pArgs, "O", &bcObj)) { 
     2046        return NULL; 
     2047    } 
     2048 
     2049    if (bcObj != Py_None) { 
     2050        pjsua_buddy_config cfg; 
     2051        PyObj_pjsua_buddy_config * bc; 
     2052 
     2053        bc = (PyObj_pjsua_buddy_config *)bcObj; 
     2054 
     2055        pjsua_buddy_config_default(&cfg); 
     2056        PyObj_pjsua_buddy_config_export(&cfg, bc);   
     2057     
     2058        status = pjsua_buddy_add(&cfg, &buddy_id); 
    45992059    } else { 
    4600         status = pjsua_buddy_add(NULL, &p_buddy_id); 
    4601     } 
    4602     return Py_BuildValue("ii", status, p_buddy_id); 
     2060        status = PJ_EINVAL; 
     2061        buddy_id = PJSUA_INVALID_ID; 
     2062    } 
     2063    return Py_BuildValue("ii", status, buddy_id); 
    46032064} 
    46042065 
     
    46062067 * py_pjsua_buddy_del 
    46072068 */ 
    4608 static PyObject *py_pjsua_buddy_del 
    4609 (PyObject *pSelf, PyObject *pArgs) 
     2069static PyObject *py_pjsua_buddy_del(PyObject *pSelf, PyObject *pArgs) 
    46102070{     
    46112071    int buddy_id; 
    46122072    int status; 
    46132073 
    4614     if (!PyArg_ParseTuple(pArgs, "i", &buddy_id)) 
    4615     { 
     2074    PJ_UNUSED_ARG(pSelf); 
     2075 
     2076    if (!PyArg_ParseTuple(pArgs, "i", &buddy_id)) { 
    46162077        return NULL; 
    46172078    } 
     
    46252086 * py_pjsua_buddy_subscribe_pres 
    46262087 */ 
    4627 static PyObject *py_pjsua_buddy_subscribe_pres 
    4628 (PyObject *pSelf, PyObject *pArgs) 
     2088static PyObject *py_pjsua_buddy_subscribe_pres(PyObject *pSelf, PyObject *pArgs) 
    46292089{     
    46302090    int buddy_id; 
     
    46322092    int subscribe; 
    46332093 
    4634     if (!PyArg_ParseTuple(pArgs, "ii", &buddy_id, &subscribe)) 
    4635     { 
     2094    PJ_UNUSED_ARG(pSelf); 
     2095 
     2096    if (!PyArg_ParseTuple(pArgs, "ii", &buddy_id, &subscribe)) { 
    46362097        return NULL; 
    46372098    } 
     
    46452106 * py_pjsua_pres_dump 
    46462107 */ 
    4647 static PyObject *py_pjsua_pres_dump 
    4648 (PyObject *pSelf, PyObject *pArgs) 
     2108static PyObject *py_pjsua_pres_dump(PyObject *pSelf, PyObject *pArgs) 
    46492109{     
    46502110    int verbose; 
    46512111 
    4652     if (!PyArg_ParseTuple(pArgs, "i", &verbose)) 
    4653     { 
     2112    PJ_UNUSED_ARG(pSelf); 
     2113 
     2114    if (!PyArg_ParseTuple(pArgs, "i", &verbose)) { 
    46542115        return NULL; 
    46552116    } 
     
    46652126 * !modified @ 071206 
    46662127 */ 
    4667 static PyObject *py_pjsua_im_send 
    4668 (PyObject *pSelf, PyObject *pArgs) 
     2128static PyObject *py_pjsua_im_send(PyObject *pSelf, PyObject *pArgs) 
    46692129{     
    46702130    int status; 
     
    46772137    pjsua_msg_data msg_data; 
    46782138    PyObject * omdObj; 
    4679     msg_data_Object * omd; 
     2139    PyObj_pjsua_msg_data * omd; 
    46802140     
    46812141    int user_data; 
    46822142    pj_pool_t *pool; 
    46832143 
    4684     
     2144    PJ_UNUSED_ARG(pSelf); 
     2145 
    46852146    if (!PyArg_ParseTuple(pArgs, "iOOOOi", &acc_id,  
    46862147                &st, &smt, &sc, &omdObj, &user_data)) 
     
    46882149        return NULL; 
    46892150    } 
    4690     if (smt != Py_None) 
    4691     { 
     2151    if (smt != Py_None) { 
    46922152        mime_type = &tmp_mime_type; 
    4693         tmp_mime_type.ptr = PyString_AsString(smt); 
    4694         tmp_mime_type.slen = strlen(PyString_AsString(smt)); 
     2153        tmp_mime_type = PyString_to_pj_str(smt); 
    46952154    } else { 
    46962155        mime_type = NULL; 
    46972156    } 
    4698     to.ptr = PyString_AsString(st); 
    4699     to.slen = strlen(PyString_AsString(st)); 
    4700      
    4701     content.ptr = PyString_AsString(sc); 
    4702     content.slen = strlen(PyString_AsString(sc)); 
    4703     if (omdObj != Py_None) 
    4704     { 
     2157    to = PyString_to_pj_str(st); 
     2158        content = PyString_to_pj_str(sc); 
     2159 
     2160    if (omdObj != Py_None) { 
    47052161                 
    4706         omd = (msg_data_Object *)omdObj; 
    4707         msg_data.content_type.ptr = PyString_AsString(omd->content_type); 
    4708         msg_data.content_type.slen = strlen 
    4709                         (PyString_AsString(omd->content_type)); 
    4710         msg_data.msg_body.ptr = PyString_AsString(omd->msg_body); 
    4711         msg_data.msg_body.slen = strlen(PyString_AsString(omd->msg_body)); 
     2162        omd = (PyObj_pjsua_msg_data *)omdObj; 
     2163        msg_data.content_type = PyString_to_pj_str(omd->content_type); 
     2164        msg_data.msg_body = PyString_to_pj_str(omd->msg_body); 
    47122165        pool = pjsua_pool_create("pjsua", POOL_SIZE, POOL_SIZE); 
    47132166 
     
    47282181 * py_pjsua_im_typing 
    47292182 */ 
    4730 static PyObject *py_pjsua_im_typing 
    4731 (PyObject *pSelf, PyObject *pArgs) 
     2183static PyObject *py_pjsua_im_typing(PyObject *pSelf, PyObject *pArgs) 
    47322184{     
    47332185    int status; 
     
    47382190    pjsua_msg_data msg_data; 
    47392191    PyObject * omdObj; 
    4740     msg_data_Object * omd; 
     2192    PyObj_pjsua_msg_data * omd; 
    47412193    pj_pool_t * pool; 
    47422194 
    4743     if (!PyArg_ParseTuple(pArgs, "iOiO", &acc_id, &st, &is_typing, &omdObj)) 
    4744     { 
     2195    PJ_UNUSED_ARG(pSelf); 
     2196 
     2197    if (!PyArg_ParseTuple(pArgs, "iOiO", &acc_id, &st, &is_typing, &omdObj)) { 
    47452198        return NULL; 
    47462199    } 
    47472200         
    4748     to.ptr = PyString_AsString(st); 
    4749     to.slen = strlen(PyString_AsString(st));     
    4750     if (omdObj != Py_None) 
    4751     { 
    4752         omd = (msg_data_Object *)omdObj; 
    4753         msg_data.content_type.ptr = PyString_AsString(omd->content_type); 
    4754         msg_data.content_type.slen = strlen 
    4755                         (PyString_AsString(omd->content_type)); 
    4756         msg_data.msg_body.ptr = PyString_AsString(omd->msg_body); 
    4757         msg_data.msg_body.slen = strlen(PyString_AsString(omd->msg_body)); 
     2201    to = PyString_to_pj_str(st); 
     2202 
     2203    if (omdObj != Py_None) { 
     2204        omd = (PyObj_pjsua_msg_data *)omdObj; 
     2205        msg_data.content_type = PyString_to_pj_str(omd->content_type); 
     2206        msg_data.msg_body = PyString_to_pj_str(omd->msg_body); 
    47582207        pool = pjsua_pool_create("pjsua", POOL_SIZE, POOL_SIZE); 
    47592208 
     
    48112260 
    48122261/* 
    4813  * codec_info_Object 
     2262 * PyObj_pjsua_codec_info 
    48142263 * Codec Info 
    48152264 * !modified @ 071206 
     
    48232272    pj_uint8_t priority;     
    48242273    char buf_[32]; 
    4825 } codec_info_Object; 
     2274} PyObj_pjsua_codec_info; 
    48262275 
    48272276 
     
    48312280 * !modified @ 071206 
    48322281 */ 
    4833 static void codec_info_dealloc(codec_info_Object* self) 
     2282static void codec_info_dealloc(PyObj_pjsua_codec_info* self) 
    48342283{ 
    48352284    Py_XDECREF(self->codec_id);     
     
    48472296                                    PyObject *kwds) 
    48482297{ 
    4849     codec_info_Object *self; 
    4850  
    4851     self = (codec_info_Object *)type->tp_alloc(type, 0); 
     2298    PyObj_pjsua_codec_info *self; 
     2299 
     2300    PJ_UNUSED_ARG(args); 
     2301    PJ_UNUSED_ARG(kwds); 
     2302 
     2303    self = (PyObj_pjsua_codec_info *)type->tp_alloc(type, 0); 
    48522304    if (self != NULL) 
    48532305    { 
     
    48722324    { 
    48732325        "codec_id", T_OBJECT_EX, 
    4874         offsetof(codec_info_Object, codec_id), 0, 
     2326        offsetof(PyObj_pjsua_codec_info, codec_id), 0, 
    48752327        "Codec unique identification."         
    48762328    }, 
     
    48782330    { 
    48792331        "priority", T_INT,  
    4880         offsetof(codec_info_Object, priority), 0, 
     2332        offsetof(PyObj_pjsua_codec_info, priority), 0, 
    48812333        "Codec priority (integer 0-255)." 
    48822334    }, 
     
    48912343 
    48922344/* 
    4893  * codec_info_Type 
    4894  */ 
    4895 static PyTypeObject codec_info_Type = 
     2345 * PyTyp_pjsua_codec_info 
     2346 */ 
     2347static PyTypeObject PyTyp_pjsua_codec_info = 
    48962348{ 
    48972349    PyObject_HEAD_INIT(NULL) 
    48982350    0,                              /*ob_size*/ 
    48992351    "py_pjsua.Codec_Info",      /*tp_name*/ 
    4900     sizeof(codec_info_Object),  /*tp_basicsize*/ 
     2352    sizeof(PyObj_pjsua_codec_info),  /*tp_basicsize*/ 
    49012353    0,                              /*tp_itemsize*/ 
    49022354    (destructor)codec_info_dealloc,/*tp_dealloc*/ 
     
    49382390 
    49392391/* 
    4940  * conf_port_info_Object 
     2392 * PyObj_pjsua_conf_port_info 
    49412393 * Conf Port Info 
    49422394 */ 
     
    49552407    PyListObject * listeners; 
    49562408 
    4957 } conf_port_info_Object; 
     2409} PyObj_pjsua_conf_port_info; 
    49582410 
    49592411 
     
    49622414 * deletes a conf_port_info from memory 
    49632415 */ 
    4964 static void conf_port_info_dealloc(conf_port_info_Object* self) 
     2416static void conf_port_info_dealloc(PyObj_pjsua_conf_port_info* self) 
    49652417{ 
    49662418    Py_XDECREF(self->name);     
     
    49772429                                    PyObject *kwds) 
    49782430{ 
    4979     conf_port_info_Object *self; 
    4980  
    4981     self = (conf_port_info_Object *)type->tp_alloc(type, 0); 
     2431    PyObj_pjsua_conf_port_info *self; 
     2432 
     2433    PJ_UNUSED_ARG(args); 
     2434    PJ_UNUSED_ARG(kwds); 
     2435 
     2436    self = (PyObj_pjsua_conf_port_info *)type->tp_alloc(type, 0); 
    49822437    if (self != NULL) 
    49832438    { 
     
    50062461    { 
    50072462        "slot_id", T_INT,  
    5008         offsetof(conf_port_info_Object, slot_id), 0, 
     2463        offsetof(PyObj_pjsua_conf_port_info, slot_id), 0, 
    50092464        "Conference port number." 
    50102465    }, 
    50112466    { 
    50122467        "name", T_OBJECT_EX, 
    5013         offsetof(conf_port_info_Object, name), 0, 
     2468        offsetof(PyObj_pjsua_conf_port_info, name), 0, 
    50142469        "Port name"         
    50152470    }, 
    50162471    { 
    50172472        "clock_rate", T_INT,  
    5018         offsetof(conf_port_info_Object, clock_rate), 0, 
     2473        offsetof(PyObj_pjsua_conf_port_info, clock_rate), 0, 
    50192474        "Clock rate" 
    50202475    }, 
    50212476    { 
    50222477        "channel_count", T_INT,  
    5023         offsetof(conf_port_info_Object, channel_count), 0, 
     2478        offsetof(PyObj_pjsua_conf_port_info, channel_count), 0, 
    50242479        "Number of channels." 
    50252480    }, 
    50262481    { 
    50272482        "samples_per_frame", T_INT,  
    5028         offsetof(conf_port_info_Object, samples_per_frame), 0, 
     2483        offsetof(PyObj_pjsua_conf_port_info, samples_per_frame), 0, 
    50292484        "Samples per frame " 
    50302485    }, 
    50312486    { 
    50322487        "bits_per_sample", T_INT,  
    5033         offsetof(conf_port_info_Object, bits_per_sample), 0, 
     2488        offsetof(PyObj_pjsua_conf_port_info, bits_per_sample), 0, 
    50342489        "Bits per sample" 
    50352490    }, 
    50362491    { 
    50372492        "listener_cnt", T_INT,  
    5038         offsetof(conf_port_info_Object, listener_cnt), 0, 
     2493        offsetof(PyObj_pjsua_conf_port_info, listener_cnt), 0, 
    50392494        "Number of listeners in the array." 
    50402495    }, 
    50412496    { 
    50422497        "listeners", T_OBJECT_EX, 
    5043         offsetof(conf_port_info_Object, listeners), 0, 
     2498        offsetof(PyObj_pjsua_conf_port_info, listeners), 0, 
    50442499        "Array of listeners (in other words, ports where this port " 
    50452500        "is transmitting to" 
     
    50532508 
    50542509/* 
    5055  * conf_port_info_Type 
    5056  */ 
    5057 static PyTypeObject conf_port_info_Type = 
     2510 * PyTyp_pjsua_conf_port_info 
     2511 */ 
     2512static PyTypeObject PyTyp_pjsua_conf_port_info = 
    50582513{ 
    50592514    PyObject_HEAD_INIT(NULL) 
    50602515    0,                              /*ob_size*/ 
    50612516    "py_pjsua.Conf_Port_Info",      /*tp_name*/ 
    5062     sizeof(conf_port_info_Object),  /*tp_basicsize*/ 
     2517    sizeof(PyObj_pjsua_conf_port_info),  /*tp_basicsize*/ 
    50632518    0,                              /*tp_itemsize*/ 
    50642519    (destructor)conf_port_info_dealloc,/*tp_dealloc*/ 
     
    51002555 
    51012556/* 
    5102  * pjmedia_port_Object 
     2557 * PyObj_pjmedia_port 
    51032558 */ 
    51042559typedef struct 
     
    51072562    /* Type-specific fields go here. */ 
    51082563    pjmedia_port * port; 
    5109 } pjmedia_port_Object; 
    5110  
    5111  
    5112 /* 
    5113  * pjmedia_port_Type 
    5114  */ 
    5115 static PyTypeObject pjmedia_port_Type = 
     2564} PyObj_pjmedia_port; 
     2565 
     2566 
     2567/* 
     2568 * PyTyp_pjmedia_port 
     2569 */ 
     2570static PyTypeObject PyTyp_pjmedia_port = 
    51162571{ 
    51172572    PyObject_HEAD_INIT(NULL) 
    51182573    0,                         /*ob_size*/ 
    51192574    "py_pjsua.PJMedia_Port",        /*tp_name*/ 
    5120     sizeof(pjmedia_port_Object),    /*tp_basicsize*/ 
     2575    sizeof(PyObj_pjmedia_port),    /*tp_basicsize*/ 
    51212576    0,                         /*tp_itemsize*/ 
    51222577    0,                         /*tp_dealloc*/ 
     
    51412596 
    51422597/* 
    5143  * pjmedia_snd_dev_info_Object 
     2598 * PyObj_pjmedia_snd_dev_info 
    51442599 * PJMedia Snd Dev Info 
    51452600 */ 
     
    51552610    PyObject * name; 
    51562611 
    5157 } pjmedia_snd_dev_info_Object; 
     2612} PyObj_pjmedia_snd_dev_info; 
    51582613 
    51592614 
     
    51622617 * deletes a pjmedia_snd_dev_info from memory 
    51632618 */ 
    5164 static void pjmedia_snd_dev_info_dealloc(pjmedia_snd_dev_info_Object* self) 
     2619static void pjmedia_snd_dev_info_dealloc(PyObj_pjmedia_snd_dev_info* self) 
    51652620{ 
    51662621    Py_XDECREF(self->name);         
     
    51762631                                    PyObject *kwds) 
    51772632{ 
    5178     pjmedia_snd_dev_info_Object *self; 
    5179  
    5180     self = (pjmedia_snd_dev_info_Object *)type->tp_alloc(type, 0); 
     2633    PyObj_pjmedia_snd_dev_info *self; 
     2634 
     2635    PJ_UNUSED_ARG(args); 
     2636    PJ_UNUSED_ARG(kwds); 
     2637 
     2638    self = (PyObj_pjmedia_snd_dev_info *)type->tp_alloc(type, 0); 
    51812639    if (self != NULL) 
    51822640    { 
     
    52002658    { 
    52012659        "name", T_OBJECT_EX, 
    5202         offsetof(pjmedia_snd_dev_info_Object, name), 0, 
     2660        offsetof(PyObj_pjmedia_snd_dev_info, name), 0, 
    52032661        "Device name"         
    52042662    }, 
    52052663    { 
    52062664        "input_count", T_INT,  
    5207         offsetof(pjmedia_snd_dev_info_Object, input_count), 0, 
     2665        offsetof(PyObj_pjmedia_snd_dev_info, input_count), 0, 
    52082666        "Max number of input channels" 
    52092667    }, 
    52102668    { 
    52112669        "output_count", T_INT,  
    5212         offsetof(pjmedia_snd_dev_info_Object, output_count), 0, 
     2670        offsetof(PyObj_pjmedia_snd_dev_info, output_count), 0, 
    52132671        "Max number of output channels" 
    52142672    }, 
    52152673    { 
    52162674        "default_samples_per_sec", T_INT,  
    5217         offsetof(pjmedia_snd_dev_info_Object, default_samples_per_sec), 0, 
     2675        offsetof(PyObj_pjmedia_snd_dev_info, default_samples_per_sec), 0, 
    52182676        "Default sampling rate." 
    52192677    }, 
     
    52272685 
    52282686/* 
    5229  * pjmedia_snd_dev_info_Type 
    5230  */ 
    5231 static PyTypeObject pjmedia_snd_dev_info_Type = 
     2687 * PyTyp_pjmedia_snd_dev_info 
     2688 */ 
     2689static PyTypeObject PyTyp_pjmedia_snd_dev_info = 
    52322690{ 
    52332691    PyObject_HEAD_INIT(NULL) 
    52342692    0,                              /*ob_size*/ 
    52352693    "py_pjsua.PJMedia_Snd_Dev_Info",      /*tp_name*/ 
    5236     sizeof(pjmedia_snd_dev_info_Object),  /*tp_basicsize*/ 
     2694    sizeof(PyObj_pjmedia_snd_dev_info),  /*tp_basicsize*/ 
    52372695    0,                              /*tp_itemsize*/ 
    52382696    (destructor)pjmedia_snd_dev_info_dealloc,/*tp_dealloc*/ 
     
    52742732 
    52752733/* 
    5276  * pjmedia_codec_param_info_Object 
     2734 * PyObj_pjmedia_codec_param_info 
    52772735 * PJMedia Codec Param Info 
    52782736 */ 
     
    52892747    pj_uint8_t  pt;      
    52902748 
    5291 } pjmedia_codec_param_info_Object; 
     2749} PyObj_pjmedia_codec_param_info; 
    52922750 
    52932751 
     
    53012759    { 
    53022760        "clock_rate", T_INT,  
    5303         offsetof(pjmedia_codec_param_info_Object, clock_rate), 0, 
     2761        offsetof(PyObj_pjmedia_codec_param_info, clock_rate), 0, 
    53042762        "Sampling rate in Hz" 
    53052763    }, 
    53062764    { 
    53072765        "channel_cnt", T_INT,  
    5308         offsetof(pjmedia_codec_param_info_Object, channel_cnt), 0, 
     2766        offsetof(PyObj_pjmedia_codec_param_info, channel_cnt), 0, 
    53092767        "Channel count" 
    53102768    }, 
    53112769    { 
    53122770        "avg_bps", T_INT,  
    5313         offsetof(pjmedia_codec_param_info_Object, avg_bps), 0, 
     2771        offsetof(PyObj_pjmedia_codec_param_info, avg_bps), 0, 
    53142772        "Average bandwidth in bits/sec" 
    53152773    }, 
    53162774    { 
    53172775        "frm_ptime", T_INT,  
    5318         offsetof(pjmedia_codec_param_info_Object, frm_ptime), 0, 
     2776        offsetof(PyObj_pjmedia_codec_param_info, frm_ptime), 0, 
    53192777        "Base frame ptime in msec." 
    53202778    }, 
    53212779    { 
    53222780        "pcm_bits_per_sample", T_INT,  
    5323         offsetof(pjmedia_codec_param_info_Object, pcm_bits_per_sample), 0, 
     2781        offsetof(PyObj_pjmedia_codec_param_info, pcm_bits_per_sample), 0, 
    53242782        "Bits/sample in the PCM side" 
    53252783    }, 
    53262784    { 
    53272785        "pt", T_INT,  
    5328         offsetof(pjmedia_codec_param_info_Object, pt), 0, 
     2786        offsetof(PyObj_pjmedia_codec_param_info, pt), 0, 
    53292787        "Payload type" 
    53302788    }, 
     
    53372795 
    53382796/* 
    5339  * pjmedia_codec_param_info_Type 
    5340  */ 
    5341 static PyTypeObject pjmedia_codec_param_info_Type = 
     2797 * PyTyp_pjmedia_codec_param_info 
     2798 */ 
     2799static PyTypeObject PyTyp_pjmedia_codec_param_info = 
    53422800{ 
    53432801    PyObject_HEAD_INIT(NULL) 
    53442802    0,                              /*ob_size*/ 
    53452803    "py_pjsua.PJMedia_Codec_Param_Info",      /*tp_name*/ 
    5346     sizeof(pjmedia_codec_param_info_Object),  /*tp_basicsize*/ 
     2804    sizeof(PyObj_pjmedia_codec_param_info),  /*tp_basicsize*/ 
    53472805    0,                              /*tp_itemsize*/ 
    53482806    0,/*tp_dealloc*/ 
     
    53762834 
    53772835/* 
    5378  * pjmedia_codec_param_setting_Object 
     2836 * PyObj_pjmedia_codec_param_setting 
    53792837 * PJMedia Codec Param Setting 
    53802838 */ 
     
    53922850    pj_uint8_t  dec_fmtp_mode;  
    53932851 
    5394 } pjmedia_codec_param_setting_Object; 
     2852} PyObj_pjmedia_codec_param_setting; 
    53952853 
    53962854 
     
    54042862    { 
    54052863        "frm_per_pkt", T_INT,  
    5406         offsetof(pjmedia_codec_param_setting_Object, frm_per_pkt), 0, 
     2864        offsetof(PyObj_pjmedia_codec_param_setting, frm_per_pkt), 0, 
    54072865        "Number of frames per packet" 
    54082866    }, 
    54092867    { 
    54102868        "vad", T_INT,  
    5411         offsetof(pjmedia_codec_param_setting_Object, vad), 0, 
     2869        offsetof(PyObj_pjmedia_codec_param_setting, vad), 0, 
    54122870        "Voice Activity Detector" 
    54132871    }, 
    54142872    { 
    54152873        "penh", T_INT,  
    5416         offsetof(pjmedia_codec_param_setting_Object, penh), 0, 
     2874        offsetof(PyObj_pjmedia_codec_param_setting, penh), 0, 
    54172875        "Perceptual Enhancement" 
    54182876    }, 
    54192877    { 
    54202878        "plc", T_INT,  
    5421         offsetof(pjmedia_codec_param_setting_Object, plc), 0, 
     2879        offsetof(PyObj_pjmedia_codec_param_setting, plc), 0, 
    54222880        "Packet loss concealment" 
    54232881    }, 
    54242882    { 
    54252883        "reserved", T_INT,  
    5426         offsetof(pjmedia_codec_param_setting_Object, reserved), 0, 
     2884        offsetof(PyObj_pjmedia_codec_param_setting, reserved), 0, 
    54272885        "Reserved, must be zero" 
    54282886    }, 
    54292887    { 
    54302888        "cng", T_INT,  
    5431         offsetof(pjmedia_codec_param_setting_Object, cng), 0, 
     2889        offsetof(PyObj_pjmedia_codec_param_setting, cng), 0, 
    54322890        "Comfort Noise Generator" 
    54332891    }, 
    54342892    { 
    54352893        "enc_fmtp_mode", T_INT,  
    5436         offsetof(pjmedia_codec_param_setting_Object, enc_fmtp_mode), 0, 
     2894        offsetof(PyObj_pjmedia_codec_param_setting, enc_fmtp_mode), 0, 
    54372895        "Mode param in fmtp (def:0)" 
    54382896    }, 
    54392897    { 
    54402898        "dec_fmtp_mode", T_INT,  
    5441         offsetof(pjmedia_codec_param_setting_Object, dec_fmtp_mode), 0, 
     2899        offsetof(PyObj_pjmedia_codec_param_setting, dec_fmtp_mode), 0, 
    54422900        "Mode param in fmtp (def:0)" 
    54432901    }, 
     
    54502908 
    54512909/* 
    5452  * pjmedia_codec_param_setting_Type 
    5453  */ 
    5454 static PyTypeObject pjmedia_codec_param_setting_Type = 
     2910 * PyTyp_pjmedia_codec_param_setting 
     2911 */ 
     2912static PyTypeObject PyTyp_pjmedia_codec_param_setting = 
    54552913{ 
    54562914    PyObject_HEAD_INIT(NULL) 
    54572915    0,                              /*ob_size*/ 
    54582916    "py_pjsua.PJMedia_Codec_Param_Setting",      /*tp_name*/ 
    5459     sizeof(pjmedia_codec_param_setting_Object),  /*tp_basicsize*/ 
     2917    sizeof(PyObj_pjmedia_codec_param_setting),  /*tp_basicsize*/ 
    54602918    0,                              /*tp_itemsize*/ 
    54612919    0,/*tp_dealloc*/ 
     
    54892947 
    54902948/* 
    5491  * pjmedia_codec_param_Object 
     2949 * PyObj_pjmedia_codec_param 
    54922950 * PJMedia Codec Param 
    54932951 */ 
     
    54972955    /* Type-specific fields go here. */  
    54982956     
    5499     pjmedia_codec_param_info_Object * info; 
    5500     pjmedia_codec_param_setting_Object * setting; 
    5501  
    5502 } pjmedia_codec_param_Object; 
     2957    PyObj_pjmedia_codec_param_info * info; 
     2958    PyObj_pjmedia_codec_param_setting * setting; 
     2959 
     2960} PyObj_pjmedia_codec_param; 
    55032961 
    55042962 
     
    55072965 * deletes a pjmedia_codec_param from memory 
    55082966 */ 
    5509 static void pjmedia_codec_param_dealloc(pjmedia_codec_param_Object* self) 
     2967static void pjmedia_codec_param_dealloc(PyObj_pjmedia_codec_param* self) 
    55102968{ 
    55112969    Py_XDECREF(self->info);         
     
    55222980                                    PyObject *kwds) 
    55232981{ 
    5524     pjmedia_codec_param_Object *self; 
    5525  
    5526     self = (pjmedia_codec_param_Object *)type->tp_alloc(type, 0); 
     2982    PyObj_pjmedia_codec_param *self; 
     2983 
     2984    PJ_UNUSED_ARG(args); 
     2985    PJ_UNUSED_ARG(kwds); 
     2986 
     2987    self = (PyObj_pjmedia_codec_param *)type->tp_alloc(type, 0); 
    55272988    if (self != NULL) 
    55282989    { 
    5529         self->info = (pjmedia_codec_param_info_Object *) 
    5530             PyType_GenericNew(&pjmedia_codec_param_info_Type, NULL, NULL); 
     2990        self->info = (PyObj_pjmedia_codec_param_info *) 
     2991            PyType_GenericNew(&PyTyp_pjmedia_codec_param_info, NULL, NULL); 
    55312992        if (self->info == NULL) 
    55322993        { 
     
    55342995            return NULL; 
    55352996        }         
    5536         self->setting = (pjmedia_codec_param_setting_Object *) 
    5537             PyType_GenericNew(&pjmedia_codec_param_setting_Type, NULL, NULL); 
     2997        self->setting = (PyObj_pjmedia_codec_param_setting *) 
     2998            PyType_GenericNew(&PyTyp_pjmedia_codec_param_setting, NULL, NULL); 
    55382999        if (self->setting == NULL) 
    55393000        { 
     
    55533014    { 
    55543015        "info", T_OBJECT_EX, 
    5555         offsetof(pjmedia_codec_param_Object, info), 0, 
     3016        offsetof(PyObj_pjmedia_codec_param, info), 0, 
    55563017        "The 'info' part of codec param describes the capability of the codec," 
    55573018        " and the value should NOT be changed by application."         
     
    55593020    { 
    55603021        "setting", T_OBJECT_EX, 
    5561         offsetof(pjmedia_codec_param_Object, setting), 0,  
     3022        offsetof(PyObj_pjmedia_codec_param, setting), 0,  
    55623023        "The 'setting' part of codec param describes various settings to be " 
    55633024        "applied to the codec. When the codec param is retrieved from the " 
     
    55773038 
    55783039/* 
    5579  * pjmedia_codec_param_Type 
    5580  */ 
    5581 static PyTypeObject pjmedia_codec_param_Type = 
     3040 * PyTyp_pjmedia_codec_param 
     3041 */ 
     3042static PyTypeObject PyTyp_pjmedia_codec_param = 
    55823043{ 
    55833044    PyObject_HEAD_INIT(NULL) 
    55843045    0,                              /*ob_size*/ 
    55853046    "py_pjsua.PJMedia_Codec_Param",      /*tp_name*/ 
    5586     sizeof(pjmedia_codec_param_Object),  /*tp_basicsize*/ 
     3047    sizeof(PyObj_pjmedia_codec_param),  /*tp_basicsize*/ 
    55873048    0,                              /*tp_itemsize*/ 
    55883049    (destructor)pjmedia_codec_param_dealloc,/*tp_dealloc*/ 
     
    56313092    int ret; 
    56323093     
     3094    PJ_UNUSED_ARG(pSelf); 
     3095 
    56333096    if (!PyArg_ParseTuple(pArgs, "")) 
    56343097    { 
     
    56473110{     
    56483111    int ret; 
     3112 
     3113    PJ_UNUSED_ARG(pSelf); 
     3114 
    56493115    if (!PyArg_ParseTuple(pArgs, "")) 
    56503116    { 
     
    56673133    pjsua_conf_port_id id[PJSUA_MAX_CONF_PORTS]; 
    56683134    unsigned c, i; 
     3135 
     3136    PJ_UNUSED_ARG(pSelf); 
     3137 
    56693138    if (!PyArg_ParseTuple(pArgs, "")) 
    56703139    { 
     
    56953164{        
    56963165    int id; 
    5697     conf_port_info_Object * obj; 
     3166    PyObj_pjsua_conf_port_info * obj; 
    56983167    pjsua_conf_port_info info; 
    56993168    int status;  
    57003169    int i; 
    57013170 
     3171    PJ_UNUSED_ARG(pSelf); 
     3172 
    57023173    if (!PyArg_ParseTuple(pArgs, "i", &id)) 
    57033174    { 
     
    57073178     
    57083179    status = pjsua_conf_get_port_info(id, &info); 
    5709     obj = (conf_port_info_Object *)conf_port_info_new 
    5710             (&conf_port_info_Type,NULL,NULL); 
     3180    obj = (PyObj_pjsua_conf_port_info *)conf_port_info_new 
     3181            (&PyTyp_pjsua_conf_port_info,NULL,NULL); 
    57113182    obj->bits_per_sample = info.bits_per_sample; 
    57123183    obj->channel_count = info.bits_per_sample; 
     
    57323203    int p_id; 
    57333204    PyObject * oportObj; 
    5734     pjmedia_port_Object * oport; 
     3205    PyObj_pjmedia_port * oport; 
    57353206    pjmedia_port * port; 
    57363207    PyObject * opoolObj; 
    5737     pj_pool_Object * opool; 
     3208    PyObj_pj_pool * opool; 
    57383209    pj_pool_t * pool; 
    57393210     
    57403211    int status;  
    57413212     
     3213    PJ_UNUSED_ARG(pSelf); 
    57423214 
    57433215    if (!PyArg_ParseTuple(pArgs, "OO", &opoolObj, &oportObj)) 
     
    57473219    if (opoolObj != Py_None) 
    57483220    { 
    5749         opool = (pj_pool_Object *)opoolObj; 
     3221        opool = (PyObj_pj_pool *)opoolObj; 
    57503222                pool = opool->pool; 
    57513223    } else { 
     
    57553227    if (oportObj != Py_None) 
    57563228    { 
    5757         oport = (pjmedia_port_Object *)oportObj; 
     3229        oport = (PyObj_pjmedia_port *)oportObj; 
    57583230                port = oport->port; 
    57593231    } else { 
     
    57773249    int status;  
    57783250     
     3251    PJ_UNUSED_ARG(pSelf); 
    57793252 
    57803253    if (!PyArg_ParseTuple(pArgs, "i", &id)) 
     
    57983271    int status;  
    57993272     
     3273    PJ_UNUSED_ARG(pSelf); 
    58003274 
    58013275    if (!PyArg_ParseTuple(pArgs, "ii", &source, &sink)) 
     
    58193293    int status;  
    58203294     
     3295    PJ_UNUSED_ARG(pSelf); 
    58213296 
    58223297    if (!PyArg_ParseTuple(pArgs, "ii", &source, &sink)) 
     
    58433318    int status;  
    58443319     
     3320    PJ_UNUSED_ARG(pSelf); 
    58453321 
    58463322    if (!PyArg_ParseTuple(pArgs, "Oi", &filename, &options)) 
     
    58643340    int id, port_id;     
    58653341     
     3342    PJ_UNUSED_ARG(pSelf); 
    58663343 
    58673344    if (!PyArg_ParseTuple(pArgs, "i", &id)) 
     
    58863363    int status;  
    58873364     
     3365    PJ_UNUSED_ARG(pSelf); 
    58883366 
    58893367    if (!PyArg_ParseTuple(pArgs, "iI", &id, &samples)) 
     
    59073385    int status;  
    59083386     
     3387    PJ_UNUSED_ARG(pSelf); 
    59093388 
    59103389    if (!PyArg_ParseTuple(pArgs, "i", &id)) 
     
    59373416    int status;  
    59383417     
     3418    PJ_UNUSED_ARG(pSelf); 
    59393419 
    59403420    if (!PyArg_ParseTuple(pArgs, "OiOii", &filename,  
     
    59673447    int id, port_id;     
    59683448     
     3449    PJ_UNUSED_ARG(pSelf); 
    59693450 
    59703451    if (!PyArg_ParseTuple(pArgs, "i", &id)) 
     
    59883469    int status;  
    59893470     
     3471    PJ_UNUSED_ARG(pSelf); 
    59903472 
    59913473    if (!PyArg_ParseTuple(pArgs, "i", &id)) 
     
    60103492    pjmedia_snd_dev_info info[SND_DEV_NUM]; 
    60113493    unsigned c, i; 
     3494 
     3495    PJ_UNUSED_ARG(pSelf); 
     3496 
    60123497    if (!PyArg_ParseTuple(pArgs, "")) 
    60133498    { 
     
    60253510        char * str; 
    60263511         
    6027         pjmedia_snd_dev_info_Object * obj; 
    6028         obj = (pjmedia_snd_dev_info_Object *)pjmedia_snd_dev_info_new 
    6029             (&pjmedia_snd_dev_info_Type, NULL, NULL); 
     3512        PyObj_pjmedia_snd_dev_info * obj; 
     3513        obj = (PyObj_pjmedia_snd_dev_info *)pjmedia_snd_dev_info_new 
     3514            (&PyTyp_pjmedia_snd_dev_info, NULL, NULL); 
    60303515        obj->default_samples_per_sec = info[i].default_samples_per_sec; 
    60313516        obj->input_count = info[i].input_count; 
     
    60583543    int status;  
    60593544     
     3545    PJ_UNUSED_ARG(pSelf); 
    60603546 
    60613547    if (!PyArg_ParseTuple(pArgs, "")) 
     
    60793565    int status;  
    60803566     
     3567    PJ_UNUSED_ARG(pSelf); 
    60813568 
    60823569    if (!PyArg_ParseTuple(pArgs, "ii", &capture_dev, &playback_dev)) 
     
    61003587    int status;  
    61013588     
     3589    PJ_UNUSED_ARG(pSelf); 
    61023590 
    61033591    if (!PyArg_ParseTuple(pArgs, "")) 
     
    61193607{        
    61203608     
    6121     pjmedia_port_Object * obj;   
    6122      
     3609    PyObj_pjmedia_port * obj;    
     3610     
     3611    PJ_UNUSED_ARG(pSelf); 
     3612 
    61233613    if (!PyArg_ParseTuple(pArgs, "")) 
    61243614    { 
     
    61263616    }    
    61273617      
    6128     obj = (pjmedia_port_Object *)PyType_GenericNew 
    6129         (&pjmedia_port_Type, NULL, NULL); 
     3618    obj = (PyObj_pjmedia_port *)PyType_GenericNew 
     3619        (&PyTyp_pjmedia_port, NULL, NULL); 
    61303620    obj->port = pjsua_set_no_snd_dev(); 
    61313621    return Py_BuildValue("O", obj); 
     
    61423632    int status;  
    61433633     
     3634    PJ_UNUSED_ARG(pSelf); 
    61443635 
    61453636    if (!PyArg_ParseTuple(pArgs, "ii", &tail_ms, &options)) 
     
    61643655    unsigned p_tail_ms; 
    61653656 
     3657    PJ_UNUSED_ARG(pSelf); 
     3658 
    61663659    if (!PyArg_ParseTuple(pArgs, "")) 
    61673660    { 
     
    61863679    pjsua_codec_info info[PJMEDIA_CODEC_MGR_MAX_CODECS]; 
    61873680    unsigned c, i; 
     3681 
     3682    PJ_UNUSED_ARG(pSelf); 
     3683 
    61883684    if (!PyArg_ParseTuple(pArgs, "")) 
    61893685    { 
     
    61993695        int ret; 
    62003696        int j; 
    6201         codec_info_Object * obj; 
    6202         obj = (codec_info_Object *)codec_info_new 
    6203             (&codec_info_Type, NULL, NULL); 
     3697        PyObj_pjsua_codec_info * obj; 
     3698        obj = (PyObj_pjsua_codec_info *)codec_info_new 
     3699            (&PyTyp_pjsua_codec_info, NULL, NULL); 
    62043700        obj->codec_id = PyString_FromStringAndSize 
    62053701            (info[i].codec_id.ptr, info[i].codec_id.slen); 
     
    62313727    pj_uint8_t priority; 
    62323728     
     3729    PJ_UNUSED_ARG(pSelf); 
     3730 
    62333731    if (!PyArg_ParseTuple(pArgs, "OB", &id, &priority)) 
    62343732    { 
     
    62543752    pj_str_t str; 
    62553753    pjmedia_codec_param param; 
    6256     pjmedia_codec_param_Object *obj; 
    6257      
    6258      
     3754    PyObj_pjmedia_codec_param *obj; 
     3755     
     3756    PJ_UNUSED_ARG(pSelf); 
     3757 
    62593758    if (!PyArg_ParseTuple(pArgs, "O", &id)) 
    62603759    { 
     
    62643763    str.slen = strlen(PyString_AsString(id)); 
    62653764    status = pjsua_codec_get_param(&str, &param); 
    6266     obj = (pjmedia_codec_param_Object *)pjmedia_codec_param_new 
    6267         (&pjmedia_codec_param_Type, NULL, NULL); 
     3765    obj = (PyObj_pjmedia_codec_param *)pjmedia_codec_param_new 
     3766        (&PyTyp_pjmedia_codec_param, NULL, NULL); 
    62683767    obj->info->avg_bps = param.info.avg_bps; 
    62693768    obj->info->channel_cnt = param.info.channel_cnt; 
     
    62953794    pjmedia_codec_param param; 
    62963795    PyObject * tmpObj; 
    6297     pjmedia_codec_param_Object *obj; 
    6298      
    6299      
     3796    PyObj_pjmedia_codec_param *obj; 
     3797     
     3798    PJ_UNUSED_ARG(pSelf); 
     3799 
    63003800    if (!PyArg_ParseTuple(pArgs, "OO", &id, &tmpObj)) 
    63013801    { 
     
    63073807    if (tmpObj != Py_None) 
    63083808    { 
    6309         obj = (pjmedia_codec_param_Object *)tmpObj; 
     3809        obj = (PyObj_pjmedia_codec_param *)tmpObj; 
    63103810        param.info.avg_bps = obj->info->avg_bps; 
    63113811        param.info.channel_cnt = obj->info->channel_cnt; 
     
    63433843static char pjsua_conf_add_port_doc[] = 
    63443844    "int, int py_pjsua.conf_add_port " 
    6345     "(py_pjsua.PJ_Pool pool, py_pjsua.PJMedia_Port port) " 
     3845    "(py_pjsua.Pj_Pool pool, py_pjsua.PJMedia_Port port) " 
    63463846    "Add arbitrary media port to PJSUA's conference bridge. " 
    63473847    "Application can use this function to add the media port " 
     
    64433943 
    64443944/* 
    6445  * pj_time_val_Object 
     3945 * PyObj_pj_time_val 
    64463946 * PJ Time Val 
    64473947 */ 
     
    64533953    long msec; 
    64543954 
    6455 } pj_time_val_Object; 
     3955} PyObj_pj_time_val; 
    64563956 
    64573957 
     
    64653965    { 
    64663966        "sec", T_INT,  
    6467         offsetof(pj_time_val_Object, sec), 0, 
     3967        offsetof(PyObj_pj_time_val, sec), 0, 
    64683968        "The seconds part of the time" 
    64693969    }, 
    64703970    { 
    64713971        "msec", T_INT,  
    6472         offsetof(pj_time_val_Object, sec), 0, 
     3972        offsetof(PyObj_pj_time_val, sec), 0, 
    64733973        "The milliseconds fraction of the time" 
    64743974    }, 
     
    64823982 
    64833983/* 
    6484  * pj_time_val_Type 
    6485  */ 
    6486 static PyTypeObject pj_time_val_Type = 
     3984 * PyTyp_pj_time_val 
     3985 */ 
     3986static PyTypeObject PyTyp_pj_time_val = 
    64873987{ 
    64883988    PyObject_HEAD_INIT(NULL) 
    64893989    0,                              /*ob_size*/ 
    64903990    "py_pjsua.PJ_Time_Val",      /*tp_name*/ 
    6491     sizeof(pj_time_val_Object),  /*tp_basicsize*/ 
     3991    sizeof(PyObj_pj_time_val),  /*tp_basicsize*/ 
    64923992    0,                              /*tp_itemsize*/ 
    64933993    0,/*tp_dealloc*/ 
     
    65214021 
    65224022/* 
    6523  * call_info_Object 
     4023 * PyObj_pjsua_call_info 
    65244024 * Call Info 
    65254025 */ 
     
    65444044    int media_dir; 
    65454045    int conf_slot; 
    6546     pj_time_val_Object * connect_duration; 
    6547     pj_time_val_Object * total_duration; 
     4046    PyObj_pj_time_val * connect_duration; 
     4047    PyObj_pj_time_val * total_duration; 
    65484048    struct { 
    65494049        char local_info[128]; 
     
    65554055    } buf_; 
    65564056 
    6557 } call_info_Object; 
     4057} PyObj_pjsua_call_info; 
    65584058 
    65594059 
     
    65624062 * deletes a call_info from memory 
    65634063 */ 
    6564 static void call_info_dealloc(call_info_Object* self) 
     4064static void call_info_dealloc(PyObj_pjsua_call_info* self) 
    65654065{ 
    65664066    Py_XDECREF(self->local_info); 
     
    65844084                                    PyObject *kwds) 
    65854085{ 
    6586     call_info_Object *self; 
    6587  
    6588     self = (call_info_Object *)type->tp_alloc(type, 0); 
     4086    PyObj_pjsua_call_info *self; 
     4087 
     4088    PJ_UNUSED_ARG(args); 
     4089    PJ_UNUSED_ARG(kwds); 
     4090 
     4091    self = (PyObj_pjsua_call_info *)type->tp_alloc(type, 0); 
    65894092    if (self != NULL) 
    65904093    { 
     
    66314134            return NULL; 
    66324135        } 
    6633         self->connect_duration = (pj_time_val_Object *)PyType_GenericNew 
    6634             (&pj_time_val_Type,NULL,NULL); 
     4136        self->connect_duration = (PyObj_pj_time_val *)PyType_GenericNew 
     4137            (&PyTyp_pj_time_val,NULL,NULL); 
    66354138        if (self->connect_duration == NULL) 
    66364139        { 
     
    66384141            return NULL; 
    66394142        } 
    6640         self->total_duration = (pj_time_val_Object *)PyType_GenericNew 
    6641             (&pj_time_val_Type,NULL,NULL); 
     4143        self->total_duration = (PyObj_pj_time_val *)PyType_GenericNew 
     4144            (&PyTyp_pj_time_val,NULL,NULL); 
    66424145        if (self->total_duration == NULL) 
    66434146        { 
     
    66564159    { 
    66574160        "id", T_INT,  
    6658         offsetof(call_info_Object, id), 0, 
     4161        offsetof(PyObj_pjsua_call_info, id), 0, 
    66594162        "Call identification" 
    66604163    }, 
    66614164    { 
    66624165        "role", T_INT,  
    6663         offsetof(call_info_Object, role), 0, 
     4166        offsetof(PyObj_pjsua_call_info, role), 0, 
    66644167        "Initial call role (UAC == caller)" 
    66654168    }, 
    66664169    { 
    66674170        "acc_id", T_INT,  
    6668         offsetof(call_info_Object, acc_id), 0, 
     4171        offsetof(PyObj_pjsua_call_info, acc_id), 0, 
    66694172        "The account ID where this call belongs." 
    66704173    }, 
    66714174    { 
    66724175        "local_info", T_OBJECT_EX, 
    6673         offsetof(call_info_Object, local_info), 0, 
     4176        offsetof(PyObj_pjsua_call_info, local_info), 0, 
    66744177        "Local URI"         
    66754178    }, 
    66764179    { 
    66774180        "local_contact", T_OBJECT_EX, 
    6678         offsetof(call_info_Object, local_contact), 0, 
     4181        offsetof(PyObj_pjsua_call_info, local_contact), 0, 
    66794182        "Local Contact"         
    66804183    }, 
    66814184    { 
    66824185        "remote_info", T_OBJECT_EX, 
    6683         offsetof(call_info_Object, remote_info), 0, 
     4186        offsetof(PyObj_pjsua_call_info, remote_info), 0, 
    66844187        "Remote URI"         
    66854188    }, 
    66864189    { 
    66874190        "remote_contact", T_OBJECT_EX, 
    6688         offsetof(call_info_Object, remote_contact), 0, 
     4191        offsetof(PyObj_pjsua_call_info, remote_contact), 0, 
    66894192        "Remote Contact"         
    66904193    }, 
    66914194    { 
    66924195        "call_id", T_OBJECT_EX, 
    6693         offsetof(call_info_Object, call_id), 0, 
     4196        offsetof(PyObj_pjsua_call_info, call_id), 0, 
    66944197        "Dialog Call-ID string"         
    66954198    }, 
    66964199    { 
    66974200        "state", T_INT,  
    6698         offsetof(call_info_Object, state), 0, 
     4201        offsetof(PyObj_pjsua_call_info, state), 0, 
    66994202        "Call state" 
    67004203    }, 
    67014204    { 
    67024205        "state_text", T_OBJECT_EX, 
    6703         offsetof(call_info_Object, state_text), 0, 
     4206        offsetof(PyObj_pjsua_call_info, state_text), 0, 
    67044207        "Text describing the state "         
    67054208    }, 
    67064209    { 
    67074210        "last_status", T_INT,  
    6708         offsetof(call_info_Object, last_status), 0, 
     4211        offsetof(PyObj_pjsua_call_info, last_status), 0, 
    67094212        "Last status code heard, which can be used as cause code" 
    67104213    }, 
    67114214    { 
    67124215        "last_status_text", T_OBJECT_EX, 
    6713         offsetof(call_info_Object, last_status_text), 0, 
     4216        offsetof(PyObj_pjsua_call_info, last_status_text), 0, 
    67144217        "The reason phrase describing the status."         
    67154218    }, 
    67164219    { 
    67174220        "media_status", T_INT,  
    6718         offsetof(call_info_Object, media_status), 0, 
     4221        offsetof(PyObj_pjsua_call_info, media_status), 0, 
    67194222        "Call media status." 
    67204223    }, 
    67214224    { 
    67224225        "media_dir", T_INT,  
    6723         offsetof(call_info_Object, media_dir), 0, 
     4226        offsetof(PyObj_pjsua_call_info, media_dir), 0, 
    67244227        "Media direction" 
    67254228    }, 
    67264229    { 
    67274230        "conf_slot", T_INT,  
    6728         offsetof(call_info_Object, conf_slot), 0, 
     4231        offsetof(PyObj_pjsua_call_info, conf_slot), 0, 
    67294232        "The conference port number for the call" 
    67304233    }, 
    67314234    { 
    67324235        "connect_duration", T_OBJECT_EX, 
    6733         offsetof(call_info_Object, connect_duration), 0, 
     4236        offsetof(PyObj_pjsua_call_info, connect_duration), 0, 
    67344237        "Up-to-date call connected duration(zero when call is not established)" 
    67354238    }, 
    67364239    { 
    67374240        "total_duration", T_OBJECT_EX, 
    6738         offsetof(call_info_Object, total_duration), 0, 
     4241        offsetof(PyObj_pjsua_call_info, total_duration), 0, 
    67394242        "Total call duration, including set-up time"         
    67404243    }, 
     
    67474250 
    67484251/* 
    6749  * call_info_Type 
    6750  */ 
    6751 static PyTypeObject call_info_Type = 
     4252 * PyTyp_pjsua_call_info 
     4253 */ 
     4254static PyTypeObject PyTyp_pjsua_call_info = 
    67524255{ 
    67534256    PyObject_HEAD_INIT(NULL) 
    67544257    0,                              /*ob_size*/ 
    67554258    "py_pjsua.Call_Info",      /*tp_name*/ 
    6756     sizeof(call_info_Object),  /*tp_basicsize*/ 
     4259    sizeof(PyObj_pjsua_call_info),  /*tp_basicsize*/ 
    67574260    0,                              /*tp_itemsize*/ 
    67584261    (destructor)call_info_dealloc,/*tp_dealloc*/ 
     
    68014304    int count; 
    68024305 
     4306    PJ_UNUSED_ARG(pSelf); 
     4307 
    68034308    if (!PyArg_ParseTuple(pArgs, "")) 
    68044309    { 
     
    68214326    int count;   
    68224327     
     4328    PJ_UNUSED_ARG(pSelf); 
    68234329 
    68244330    if (!PyArg_ParseTuple(pArgs, "")) 
     
    68434349    pjsua_transport_id id[PJSUA_MAX_CALLS]; 
    68444350    unsigned c, i; 
     4351 
     4352    PJ_UNUSED_ARG(pSelf); 
     4353 
    68454354    if (!PyArg_ParseTuple(pArgs, "")) 
    68464355    { 
     
    68774386    pjsua_msg_data msg_data; 
    68784387    PyObject * omdObj; 
    6879     msg_data_Object * omd; 
     4388    PyObj_pjsua_msg_data * omd; 
    68804389    int user_data; 
    68814390    int call_id; 
    68824391    pj_pool_t * pool; 
     4392 
     4393    PJ_UNUSED_ARG(pSelf); 
    68834394 
    68844395    if (!PyArg_ParseTuple 
     
    68924403    if (omdObj != Py_None)  
    68934404    { 
    6894         omd = (msg_data_Object *)omdObj; 
     4405        omd = (PyObj_pjsua_msg_data *)omdObj; 
    68954406        msg_data.content_type.ptr = PyString_AsString(omd->content_type); 
    68964407        msg_data.content_type.slen = strlen 
     
    69224433    int isActive;        
    69234434     
     4435    PJ_UNUSED_ARG(pSelf); 
    69244436 
    69254437    if (!PyArg_ParseTuple(pArgs, "i", &call_id)) 
     
    69434455    int hasMedia;        
    69444456     
     4457    PJ_UNUSED_ARG(pSelf); 
    69454458 
    69464459    if (!PyArg_ParseTuple(pArgs, "i", &call_id)) 
     
    69644477    int port_id;         
    69654478     
     4479    PJ_UNUSED_ARG(pSelf); 
    69664480 
    69674481    if (!PyArg_ParseTuple(pArgs, "i", &call_id)) 
     
    69844498    int call_id; 
    69854499    int status; 
    6986     call_info_Object * oi; 
     4500    PyObj_pjsua_call_info * oi; 
    69874501    pjsua_call_info info; 
    69884502     
     4503    PJ_UNUSED_ARG(pSelf); 
    69894504 
    69904505    if (!PyArg_ParseTuple(pArgs, "i", &call_id)) 
     
    69974512    if (status == PJ_SUCCESS)  
    69984513    { 
    6999         oi = (call_info_Object *)call_info_new(&call_info_Type, NULL, NULL); 
     4514        oi = (PyObj_pjsua_call_info *)call_info_new(&PyTyp_pjsua_call_info, NULL, NULL); 
    70004515        oi->acc_id = info.acc_id; 
    70014516        pj_ansi_snprintf(oi->buf_.call_id, sizeof(oi->buf_.call_id), 
     
    70574572    int status; 
    70584573 
     4574    PJ_UNUSED_ARG(pSelf); 
     4575 
    70594576    if (!PyArg_ParseTuple(pArgs, "ii", &call_id, &user_data)) 
    70604577    { 
     
    70774594    void * user_data;    
    70784595     
     4596    PJ_UNUSED_ARG(pSelf); 
    70794597 
    70804598    if (!PyArg_ParseTuple(pArgs, "i", &call_id)) 
     
    71024620    pjsua_msg_data msg_data; 
    71034621    PyObject * omdObj; 
    7104     msg_data_Object * omd;     
     4622    PyObj_pjsua_msg_data * omd;     
    71054623    pj_pool_t * pool; 
     4624 
     4625    PJ_UNUSED_ARG(pSelf); 
    71064626 
    71074627    if (!PyArg_ParseTuple(pArgs, "iIOO", &call_id, &code, &sr, &omdObj)) 
     
    71194639    if (omdObj != Py_None)  
    71204640    { 
    7121         omd = (msg_data_Object *)omdObj; 
     4641        omd = (PyObj_pjsua_msg_data *)omdObj; 
    71224642        msg_data.content_type.ptr = PyString_AsString(omd->content_type); 
    71234643        msg_data.content_type.slen = strlen 
     
    71534673    pjsua_msg_data msg_data; 
    71544674    PyObject * omdObj; 
    7155     msg_data_Object * omd;     
     4675    PyObj_pjsua_msg_data * omd;     
    71564676    pj_pool_t * pool = NULL; 
     4677 
     4678    PJ_UNUSED_ARG(pSelf); 
    71574679 
    71584680    if (!PyArg_ParseTuple(pArgs, "iIOO", &call_id, &code, &sr, &omdObj)) 
     
    71704692    if (omdObj != Py_None)  
    71714693    { 
    7172         omd = (msg_data_Object *)omdObj; 
     4694        omd = (PyObj_pjsua_msg_data *)omdObj; 
    71734695        msg_data.content_type.ptr = PyString_AsString(omd->content_type); 
    71744696        msg_data.content_type.slen = strlen 
     
    71964718    int call_id;     
    71974719    pjsua_msg_data msg_data; 
    7198         PyObject * omdObj; 
    7199     msg_data_Object * omd;     
     4720    PyObject * omdObj; 
     4721    PyObj_pjsua_msg_data * omd;     
    72004722    pj_pool_t * pool; 
    72014723 
     4724    PJ_UNUSED_ARG(pSelf); 
     4725 
    72024726    if (!PyArg_ParseTuple(pArgs, "iO", &call_id, &omdObj)) 
    72034727    { 
     
    72074731    if (omdObj != Py_None)  
    72084732    { 
    7209         omd = (msg_data_Object *)omdObj; 
     4733        omd = (PyObj_pjsua_msg_data *)omdObj; 
    72104734        msg_data.content_type.ptr = PyString_AsString(omd->content_type); 
    72114735        msg_data.content_type.slen = strlen 
     
    72344758    pjsua_msg_data msg_data; 
    72354759    PyObject * omdObj; 
    7236     msg_data_Object * omd;     
     4760    PyObj_pjsua_msg_data * omd;     
    72374761    pj_pool_t * pool; 
    72384762 
     4763    PJ_UNUSED_ARG(pSelf); 
     4764 
    72394765    if (!PyArg_ParseTuple(pArgs, "iiO", &call_id, &unhold, &omdObj)) 
    72404766    { 
     
    72444770    if (omdObj != Py_None) 
    72454771    { 
    7246         omd = (msg_data_Object *)omdObj; 
     4772        omd = (PyObj_pjsua_msg_data *)omdObj; 
    72474773        msg_data.content_type.ptr = PyString_AsString(omd->content_type); 
    72484774        msg_data.content_type.slen = strlen 
     
    72724798    pjsua_msg_data msg_data; 
    72734799    PyObject * omdObj; 
    7274     msg_data_Object * omd;     
     4800    PyObj_pjsua_msg_data * omd;     
    72754801    pj_pool_t * pool; 
     4802 
     4803    PJ_UNUSED_ARG(pSelf); 
    72764804 
    72774805    if (!PyArg_ParseTuple(pArgs, "iOO", &call_id, &sd, &omdObj)) 
     
    72854813    if (omdObj != Py_None) 
    72864814    { 
    7287         omd = (msg_data_Object *)omdObj; 
     4815        omd = (PyObj_pjsua_msg_data *)omdObj; 
    72884816        msg_data.content_type.ptr = PyString_AsString(omd->content_type); 
    72894817        msg_data.content_type.slen = strlen 
     
    73134841    pjsua_msg_data msg_data; 
    73144842    PyObject * omdObj; 
    7315     msg_data_Object * omd;     
     4843    PyObj_pjsua_msg_data * omd;     
    73164844    pj_pool_t * pool; 
     4845 
     4846    PJ_UNUSED_ARG(pSelf); 
    73174847 
    73184848    if (!PyArg_ParseTuple 
     
    73244854    if (omdObj != Py_None) 
    73254855    { 
    7326         omd = (msg_data_Object *)omdObj;     
     4856        omd = (PyObj_pjsua_msg_data *)omdObj;     
    73274857        msg_data.content_type.ptr = PyString_AsString(omd->content_type); 
    73284858        msg_data.content_type.slen = strlen 
     
    73524882    int status; 
    73534883 
     4884    PJ_UNUSED_ARG(pSelf); 
     4885 
    73544886    if (!PyArg_ParseTuple(pArgs, "iO", &call_id, &sd)) 
    73554887    { 
     
    73774909    pjsua_msg_data msg_data; 
    73784910    PyObject * omdObj; 
    7379     msg_data_Object * omd;     
     4911    PyObj_pjsua_msg_data * omd;     
    73804912    int user_data; 
    73814913    pj_pool_t * pool; 
     4914 
     4915    PJ_UNUSED_ARG(pSelf); 
    73824916 
    73834917    if (!PyArg_ParseTuple 
     
    73994933    if (omdObj != Py_None) 
    74004934    { 
    7401         omd = (msg_data_Object *)omdObj; 
     4935        omd = (PyObj_pjsua_msg_data *)omdObj; 
    74024936        msg_data.content_type.ptr = PyString_AsString(omd->content_type); 
    74034937        msg_data.content_type.slen = strlen 
     
    74294963    pjsua_msg_data msg_data; 
    74304964    PyObject * omdObj; 
    7431     msg_data_Object * omd;     
     4965    PyObj_pjsua_msg_data * omd;     
    74324966    pj_pool_t * pool; 
     4967 
     4968    PJ_UNUSED_ARG(pSelf); 
    74334969 
    74344970    if (!PyArg_ParseTuple(pArgs, "iiO", &call_id, &is_typing, &omdObj)) 
     
    74394975    if (omdObj != Py_None) 
    74404976    { 
    7441         omd = (msg_data_Object *)omdObj; 
     4977        omd = (PyObj_pjsua_msg_data *)omdObj; 
    74424978        msg_data.content_type.ptr = PyString_AsString(omd->content_type); 
    74434979        msg_data.content_type.slen = strlen 
     
    74624998{        
    74634999 
     5000    PJ_UNUSED_ARG(pSelf); 
     5001 
    74645002    if (!PyArg_ParseTuple(pArgs, "")) 
    74655003    { 
     
    74885026    int status; 
    74895027 
     5028    PJ_UNUSED_ARG(pSelf); 
     5029 
    74905030    if (!PyArg_ParseTuple(pArgs, "iiIO", &call_id, &with_media, &maxlen, &si)) 
    74915031    { 
     
    75115051    char buf[1024]; 
    75125052    int detail; 
     5053 
     5054    PJ_UNUSED_ARG(pSelf); 
    75135055 
    75145056    if (!PyArg_ParseTuple(pArgs, "i", &detail)) 
     
    77225264    }, 
    77235265    { 
    7724         "transport_register", py_pjsua_transport_register, METH_VARARGS, 
    7725         pjsua_transport_register_doc 
    7726     }, 
    7727     { 
    77285266        "transport_enum_transports", py_pjsua_enum_transports, METH_VARARGS, 
    77295267        pjsua_enum_transports_doc 
     
    77805318        "acc_set_online_status", py_pjsua_acc_set_online_status, METH_VARARGS, 
    77815319        pjsua_acc_set_online_status_doc 
     5320    }, 
     5321    { 
     5322        "acc_set_online_status2", py_pjsua_acc_set_online_status2, METH_VARARGS, 
     5323        pjsua_acc_set_online_status2_doc 
    77825324    }, 
    77835325    { 
     
    80675609    PyEval_InitThreads(); 
    80685610 
    8069     if (PyType_Ready(&callback_Type) < 0) 
     5611    if (PyType_Ready(&PyTyp_pjsua_callback) < 0) 
    80705612        return; 
    8071     if (PyType_Ready(&config_Type) < 0) 
     5613    if (PyType_Ready(&PyTyp_pjsua_config) < 0) 
    80725614        return; 
    8073     if (PyType_Ready(&logging_config_Type) < 0) 
     5615    if (PyType_Ready(&PyTyp_pjsua_logging_config) < 0) 
    80745616        return; 
    8075     if (PyType_Ready(&msg_data_Type) < 0) 
     5617    if (PyType_Ready(&PyTyp_pjsua_msg_data) < 0) 
    80765618        return; 
    8077     media_config_Type.tp_new = PyType_GenericNew; 
    8078     if (PyType_Ready(&media_config_Type) < 0) 
     5619    PyTyp_pjsua_media_config.tp_new = PyType_GenericNew; 
     5620    if (PyType_Ready(&PyTyp_pjsua_media_config) < 0) 
    80795621        return; 
    8080     pjsip_event_Type.tp_new = PyType_GenericNew; 
    8081     if (PyType_Ready(&pjsip_event_Type) < 0) 
     5622    PyTyp_pjsip_event.tp_new = PyType_GenericNew; 
     5623    if (PyType_Ready(&PyTyp_pjsip_event) < 0) 
    80825624        return; 
    8083     pjsip_rx_data_Type.tp_new = PyType_GenericNew; 
    8084     if (PyType_Ready(&pjsip_rx_data_Type) < 0) 
     5625    PyTyp_pjsip_rx_data.tp_new = PyType_GenericNew; 
     5626    if (PyType_Ready(&PyTyp_pjsip_rx_data) < 0) 
    80855627        return; 
    8086     pj_pool_Type.tp_new = PyType_GenericNew; 
    8087     if (PyType_Ready(&pj_pool_Type) < 0) 
     5628    PyTyp_pj_pool_t.tp_new = PyType_GenericNew; 
     5629    if (PyType_Ready(&PyTyp_pj_pool_t) < 0) 
    80885630        return; 
    8089     pjsip_endpoint_Type.tp_new = PyType_GenericNew; 
    8090     if (PyType_Ready(&pjsip_endpoint_Type) < 0) 
     5631    PyTyp_pjsip_endpoint.tp_new = PyType_GenericNew; 
     5632    if (PyType_Ready(&PyTyp_pjsip_endpoint) < 0) 
    80915633        return; 
    8092     pjmedia_endpt_Type.tp_new = PyType_GenericNew; 
    8093     if (PyType_Ready(&pjmedia_endpt_Type) < 0) 
     5634    PyTyp_pjmedia_endpt.tp_new = PyType_GenericNew; 
     5635    if (PyType_Ready(&PyTyp_pjmedia_endpt) < 0) 
    80945636        return; 
    8095     pj_pool_factory_Type.tp_new = PyType_GenericNew; 
    8096     if (PyType_Ready(&pj_pool_factory_Type) < 0) 
     5637    PyTyp_pj_pool_factory.tp_new = PyType_GenericNew; 
     5638    if (PyType_Ready(&PyTyp_pj_pool_factory) < 0) 
    80975639        return; 
    8098     pjsip_cred_info_Type.tp_new = PyType_GenericNew; 
    8099     if (PyType_Ready(&pjsip_cred_info_Type) < 0) 
     5640    PyTyp_pjsip_cred_info.tp_new = PyType_GenericNew; 
     5641    if (PyType_Ready(&PyTyp_pjsip_cred_info) < 0) 
    81005642        return; 
    81015643 
    81025644    /* LIB TRANSPORT */ 
    81035645 
    8104     if (PyType_Ready(&transport_config_Type) < 0) 
     5646    if (PyType_Ready(&PyTyp_pjsua_transport_config) < 0) 
    81055647        return; 
    8106     if (PyType_Ready(&host_port_Type) < 0) 
     5648     
     5649    if (PyType_Ready(&PyTyp_pjsua_transport_info) < 0) 
    81075650        return; 
    81085651     
    8109     if (PyType_Ready(&transport_info_Type) < 0) 
     5652    /* END OF LIB TRANSPORT */ 
     5653 
     5654    /* LIB ACCOUNT */ 
     5655 
     5656     
     5657    if (PyType_Ready(&PyTyp_pjsua_acc_config) < 0) 
    81105658        return; 
    8111      
    8112     pjsip_transport_Type.tp_new = PyType_GenericNew; 
    8113     if (PyType_Ready(&pjsip_transport_Type) < 0) 
     5659    if (PyType_Ready(&PyTyp_pjsua_acc_info) < 0) 
    81145660        return; 
    81155661 
    8116     /* END OF LIB TRANSPORT */ 
    8117  
    8118     /* LIB ACCOUNT */ 
    8119  
    8120      
    8121     if (PyType_Ready(&acc_config_Type) < 0) 
     5662    /* END OF LIB ACCOUNT */ 
     5663 
     5664    /* LIB BUDDY */ 
     5665 
     5666    if (PyType_Ready(&PyTyp_pjsua_buddy_config) < 0) 
    81225667        return; 
    8123     if (PyType_Ready(&acc_info_Type) < 0) 
    8124         return; 
    8125  
    8126     /* END OF LIB ACCOUNT */ 
    8127  
    8128     /* LIB BUDDY */ 
    8129  
    8130     if (PyType_Ready(&buddy_config_Type) < 0) 
    8131         return; 
    8132     if (PyType_Ready(&buddy_info_Type) < 0) 
     5668    if (PyType_Ready(&PyTyp_pjsua_buddy_info) < 0) 
    81335669        return; 
    81345670 
     
    81375673    /* LIB MEDIA */ 
    81385674   
    8139     if (PyType_Ready(&codec_info_Type) < 0) 
     5675    if (PyType_Ready(&PyTyp_pjsua_codec_info) < 0) 
    81405676        return; 
    81415677 
    8142     if (PyType_Ready(&conf_port_info_Type) < 0) 
     5678    if (PyType_Ready(&PyTyp_pjsua_conf_port_info) < 0) 
    81435679        return; 
    81445680 
    8145     pjmedia_port_Type.tp_new = PyType_GenericNew; 
    8146     if (PyType_Ready(&pjmedia_port_Type) < 0) 
     5681    PyTyp_pjmedia_port.tp_new = PyType_GenericNew; 
     5682    if (PyType_Ready(&PyTyp_pjmedia_port) < 0) 
    81475683        return; 
    81485684 
    8149     if (PyType_Ready(&pjmedia_snd_dev_info_Type) < 0) 
     5685    if (PyType_Ready(&PyTyp_pjmedia_snd_dev_info) < 0) 
    81505686        return; 
    81515687 
    8152     pjmedia_codec_param_info_Type.tp_new = PyType_GenericNew; 
    8153     if (PyType_Ready(&pjmedia_codec_param_info_Type) < 0) 
     5688    PyTyp_pjmedia_codec_param_info.tp_new = PyType_GenericNew; 
     5689    if (PyType_Ready(&PyTyp_pjmedia_codec_param_info) < 0) 
    81545690        return; 
    8155     pjmedia_codec_param_setting_Type.tp_new = PyType_GenericNew; 
    8156     if (PyType_Ready(&pjmedia_codec_param_setting_Type) < 0) 
     5691    PyTyp_pjmedia_codec_param_setting.tp_new = PyType_GenericNew; 
     5692    if (PyType_Ready(&PyTyp_pjmedia_codec_param_setting) < 0) 
    81575693        return; 
    81585694 
    8159     if (PyType_Ready(&pjmedia_codec_param_Type) < 0) 
     5695    if (PyType_Ready(&PyTyp_pjmedia_codec_param) < 0) 
    81605696        return; 
    81615697 
     
    81645700    /* LIB CALL */ 
    81655701 
    8166     pj_time_val_Type.tp_new = PyType_GenericNew; 
    8167     if (PyType_Ready(&pj_time_val_Type) < 0) 
     5702    PyTyp_pj_time_val.tp_new = PyType_GenericNew; 
     5703    if (PyType_Ready(&PyTyp_pj_time_val) < 0) 
    81685704        return; 
    81695705 
    8170     if (PyType_Ready(&call_info_Type) < 0) 
     5706    if (PyType_Ready(&PyTyp_pjsua_call_info) < 0) 
    81715707        return; 
    81725708 
     
    81775713    ); 
    81785714 
    8179     Py_INCREF(&callback_Type); 
    8180     PyModule_AddObject(m, "Callback", (PyObject *)&callback_Type); 
    8181  
    8182     Py_INCREF(&config_Type); 
    8183     PyModule_AddObject(m, "Config", (PyObject *)&config_Type); 
    8184  
    8185     Py_INCREF(&media_config_Type); 
    8186     PyModule_AddObject(m, "Media_Config", (PyObject *)&media_config_Type); 
    8187  
    8188     Py_INCREF(&logging_config_Type); 
    8189     PyModule_AddObject(m, "Logging_Config", (PyObject *)&logging_config_Type); 
    8190  
    8191     Py_INCREF(&msg_data_Type); 
    8192     PyModule_AddObject(m, "Msg_Data", (PyObject *)&msg_data_Type); 
    8193  
    8194     Py_INCREF(&pjsip_event_Type); 
    8195     PyModule_AddObject(m, "PJSIP_Event", (PyObject *)&pjsip_event_Type); 
    8196  
    8197     Py_INCREF(&pjsip_rx_data_Type); 
    8198     PyModule_AddObject(m, "PJSIP_RX_Data", (PyObject *)&pjsip_rx_data_Type); 
    8199  
    8200     Py_INCREF(&pj_pool_Type); 
    8201     PyModule_AddObject(m, "PJ_Pool", (PyObject *)&pj_pool_Type); 
    8202  
    8203     Py_INCREF(&pjsip_endpoint_Type); 
    8204     PyModule_AddObject(m, "PJSIP_Endpoint", (PyObject *)&pjsip_endpoint_Type); 
    8205  
    8206     Py_INCREF(&pjmedia_endpt_Type); 
    8207     PyModule_AddObject(m, "PJMedia_Endpt", (PyObject *)&pjmedia_endpt_Type); 
    8208  
    8209     Py_INCREF(&pj_pool_factory_Type); 
     5715    Py_INCREF(&PyTyp_pjsua_callback); 
     5716    PyModule_AddObject(m, "Callback", (PyObject *)&PyTyp_pjsua_callback); 
     5717 
     5718    Py_INCREF(&PyTyp_pjsua_config); 
     5719    PyModule_AddObject(m, "Config", (PyObject *)&PyTyp_pjsua_config); 
     5720 
     5721    Py_INCREF(&PyTyp_pjsua_media_config); 
     5722    PyModule_AddObject(m, "Media_Config", (PyObject *)&PyTyp_pjsua_media_config); 
     5723 
     5724    Py_INCREF(&PyTyp_pjsua_logging_config); 
     5725    PyModule_AddObject(m, "Logging_Config", (PyObject *)&PyTyp_pjsua_logging_config); 
     5726 
     5727    Py_INCREF(&PyTyp_pjsua_msg_data); 
     5728    PyModule_AddObject(m, "Msg_Data", (PyObject *)&PyTyp_pjsua_msg_data); 
     5729 
     5730    Py_INCREF(&PyTyp_pjsip_event); 
     5731    PyModule_AddObject(m, "Pjsip_Event", (PyObject *)&PyTyp_pjsip_event); 
     5732 
     5733    Py_INCREF(&PyTyp_pjsip_rx_data); 
     5734    PyModule_AddObject(m, "Pjsip_Rx_Data", (PyObject *)&PyTyp_pjsip_rx_data); 
     5735 
     5736    Py_INCREF(&PyTyp_pj_pool_t); 
     5737    PyModule_AddObject(m, "Pj_Pool", (PyObject *)&PyTyp_pj_pool_t); 
     5738 
     5739    Py_INCREF(&PyTyp_pjsip_endpoint); 
     5740    PyModule_AddObject(m, "Pjsip_Endpoint", (PyObject *)&PyTyp_pjsip_endpoint); 
     5741 
     5742    Py_INCREF(&PyTyp_pjmedia_endpt); 
     5743    PyModule_AddObject(m, "Pjmedia_Endpt", (PyObject *)&PyTyp_pjmedia_endpt); 
     5744 
     5745    Py_INCREF(&PyTyp_pj_pool_factory); 
    82105746    PyModule_AddObject( 
    8211         m, "PJ_Pool_Factory", (PyObject *)&pj_pool_factory_Type 
     5747        m, "Pj_Pool_Factory", (PyObject *)&PyTyp_pj_pool_factory 
    82125748    ); 
    82135749 
    8214     Py_INCREF(&pjsip_cred_info_Type); 
    8215     PyModule_AddObject(m, "PJSIP_Cred_Info", 
    8216         (PyObject *)&pjsip_cred_info_Type 
     5750    Py_INCREF(&PyTyp_pjsip_cred_info); 
     5751    PyModule_AddObject(m, "Pjsip_Cred_Info", 
     5752        (PyObject *)&PyTyp_pjsip_cred_info 
    82175753    ); 
    82185754 
    82195755    /* LIB TRANSPORT */ 
    82205756 
    8221     Py_INCREF(&transport_config_Type); 
     5757    Py_INCREF(&PyTyp_pjsua_transport_config); 
    82225758    PyModule_AddObject 
    8223         (m, "Transport_Config", (PyObject *)&transport_config_Type); 
    8224     Py_INCREF(&host_port_Type); 
    8225     PyModule_AddObject(m, "Host_Port", (PyObject *)&host_port_Type); 
    8226      
    8227     Py_INCREF(&transport_info_Type); 
    8228     PyModule_AddObject(m, "Transport_Info", (PyObject *)&transport_info_Type); 
    8229      
    8230     Py_INCREF(&pjsip_transport_Type); 
    8231     PyModule_AddObject(m, "PJSIP_Transport", (PyObject *)&pjsip_transport_Type); 
     5759        (m, "Transport_Config", (PyObject *)&PyTyp_pjsua_transport_config); 
     5760     
     5761    Py_INCREF(&PyTyp_pjsua_transport_info); 
     5762    PyModule_AddObject(m, "Transport_Info", (PyObject *)&PyTyp_pjsua_transport_info); 
     5763     
    82325764 
    82335765    /* END OF LIB TRANSPORT */ 
     
    82365768 
    82375769     
    8238     Py_INCREF(&acc_config_Type); 
    8239     PyModule_AddObject(m, "Acc_Config", (PyObject *)&acc_config_Type); 
    8240     Py_INCREF(&acc_info_Type); 
    8241     PyModule_AddObject(m, "Acc_Info", (PyObject *)&acc_info_Type); 
     5770    Py_INCREF(&PyTyp_pjsua_acc_config); 
     5771    PyModule_AddObject(m, "Acc_Config", (PyObject *)&PyTyp_pjsua_acc_config); 
     5772    Py_INCREF(&PyTyp_pjsua_acc_info); 
     5773    PyModule_AddObject(m, "Acc_Info", (PyObject *)&PyTyp_pjsua_acc_info); 
    82425774 
    82435775    /* END OF LIB ACCOUNT */ 
     
    82455777    /* LIB BUDDY */ 
    82465778     
    8247     Py_INCREF(&buddy_config_Type); 
    8248     PyModule_AddObject(m, "Buddy_Config", (PyObject *)&buddy_config_Type); 
    8249     Py_INCREF(&buddy_info_Type); 
    8250     PyModule_AddObject(m, "Buddy_Info", (PyObject *)&buddy_info_Type); 
     5779    Py_INCREF(&PyTyp_pjsua_buddy_config); 
     5780    PyModule_AddObject(m, "Buddy_Config", (PyObject *)&PyTyp_pjsua_buddy_config); 
     5781    Py_INCREF(&PyTyp_pjsua_buddy_info); 
     5782    PyModule_AddObject(m, "Buddy_Info", (PyObject *)&PyTyp_pjsua_buddy_info); 
    82515783 
    82525784    /* END OF LIB BUDDY */ 
     
    82545786    /* LIB MEDIA */ 
    82555787 
    8256     Py_INCREF(&codec_info_Type); 
    8257     PyModule_AddObject(m, "Codec_Info", (PyObject *)&codec_info_Type); 
    8258     Py_INCREF(&conf_port_info_Type); 
    8259     PyModule_AddObject(m, "Conf_Port_Info", (PyObject *)&conf_port_info_Type); 
    8260     Py_INCREF(&pjmedia_port_Type); 
    8261     PyModule_AddObject(m, "PJMedia_Port", (PyObject *)&pjmedia_port_Type); 
    8262     Py_INCREF(&pjmedia_snd_dev_info_Type); 
     5788    Py_INCREF(&PyTyp_pjsua_codec_info); 
     5789    PyModule_AddObject(m, "Codec_Info", (PyObject *)&PyTyp_pjsua_codec_info); 
     5790    Py_INCREF(&PyTyp_pjsua_conf_port_info); 
     5791    PyModule_AddObject(m, "Conf_Port_Info", (PyObject *)&PyTyp_pjsua_conf_port_info); 
     5792    Py_INCREF(&PyTyp_pjmedia_port); 
     5793    PyModule_AddObject(m, "PJMedia_Port", (PyObject *)&PyTyp_pjmedia_port); 
     5794    Py_INCREF(&PyTyp_pjmedia_snd_dev_info); 
    82635795    PyModule_AddObject(m, "PJMedia_Snd_Dev_Info",  
    8264         (PyObject *)&pjmedia_snd_dev_info_Type); 
    8265     Py_INCREF(&pjmedia_codec_param_info_Type); 
     5796        (PyObject *)&PyTyp_pjmedia_snd_dev_info); 
     5797    Py_INCREF(&PyTyp_pjmedia_codec_param_info); 
    82665798    PyModule_AddObject(m, "PJMedia_Codec_Param_Info",  
    8267         (PyObject *)&pjmedia_codec_param_info_Type); 
    8268     Py_INCREF(&pjmedia_codec_param_setting_Type); 
     5799        (PyObject *)&PyTyp_pjmedia_codec_param_info); 
     5800    Py_INCREF(&PyTyp_pjmedia_codec_param_setting); 
    82695801    PyModule_AddObject(m, "PJMedia_Codec_Param_Setting",  
    8270         (PyObject *)&pjmedia_codec_param_setting_Type); 
    8271     Py_INCREF(&pjmedia_codec_param_Type); 
     5802        (PyObject *)&PyTyp_pjmedia_codec_param_setting); 
     5803    Py_INCREF(&PyTyp_pjmedia_codec_param); 
    82725804    PyModule_AddObject(m, "PJMedia_Codec_Param",  
    8273         (PyObject *)&pjmedia_codec_param_Type); 
     5805        (PyObject *)&PyTyp_pjmedia_codec_param); 
    82745806 
    82755807    /* END OF LIB MEDIA */ 
     
    82775809    /* LIB CALL */ 
    82785810 
    8279     Py_INCREF(&pj_time_val_Type); 
    8280     PyModule_AddObject(m, "PJ_Time_Val", (PyObject *)&pj_time_val_Type); 
    8281  
    8282     Py_INCREF(&call_info_Type); 
    8283     PyModule_AddObject(m, "Call_Info", (PyObject *)&call_info_Type); 
     5811    Py_INCREF(&PyTyp_pj_time_val); 
     5812    PyModule_AddObject(m, "PJ_Time_Val", (PyObject *)&PyTyp_pj_time_val); 
     5813 
     5814    Py_INCREF(&PyTyp_pjsua_call_info); 
     5815    PyModule_AddObject(m, "Call_Info", (PyObject *)&PyTyp_pjsua_call_info); 
    82845816 
    82855817    /* END OF LIB CALL */ 
  • pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h

    r1424 r1430  
    571571     * \code 
    572572     # call_id: integer 
    573      # digit:   integer 
     573     # digit:   digit string 
    574574 
    575575     def on_dtmf_digit(call_id, digit): 
Note: See TracChangeset for help on using the changeset viewer.