Changeset 4609 for pjproject/trunk/pjsip-apps/src/python/_pjsua.h
- Timestamp:
- Oct 2, 2013 3:19:54 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/python/_pjsua.h
r4581 r4609 1770 1770 const pjsua_acc_config *cfg) 1771 1771 { 1772 PyObj_pjsua_transport_config *tconf; 1772 1773 unsigned i; 1773 1774 … … 1826 1827 1827 1828 Py_XDECREF(obj->rtp_transport_cfg); 1828 PyObj_pjsua_transport_config *tconf; 1829 tconf = (PyObj_pjsua_transport_config*) PyObj_pjsua_transport_config_new(&PyTyp_pjsua_transport_config,NULL, NULL); 1829 tconf = (PyObj_pjsua_transport_config*) 1830 PyObj_pjsua_transport_config_new(&PyTyp_pjsua_transport_config, 1831 NULL, NULL); 1830 1832 PyObj_pjsua_transport_config_import(tconf, &cfg->rtp_cfg); 1831 1833 obj->rtp_transport_cfg = (PyObject *) tconf; … … 1835 1837 PyObj_pjsua_acc_config *obj) 1836 1838 { 1839 PyObj_pjsua_transport_config *tconf; 1837 1840 unsigned i; 1838 1841 … … 1881 1884 cfg->srtp_secure_signaling = obj->srtp_secure_signaling; 1882 1885 1883 PyObj_pjsua_transport_config *tconf; 1884 tconf = (PyObj_pjsua_transport_config*) obj->rtp_transport_cfg; 1885 PyObj_pjsua_transport_config_export(&cfg->rtp_cfg, tconf); 1886 tconf = (PyObj_pjsua_transport_config*)obj->rtp_transport_cfg; 1887 PyObj_pjsua_transport_config_export(&cfg->rtp_cfg, tconf); 1886 1888 } 1887 1889 … … 3585 3587 3586 3588 3587 3588 3589 ////////////////////////////////////////////////////////////////////////////// 3590 /* 3591 * PyObj_pjsip_rx_data 3592 */ 3593 typedef struct 3594 { 3595 PyObject_HEAD 3596 3597 /* Type-specific fields go here. */ 3598 PyObject *msg_info_buffer; // string 3599 PyObject *msg_info_info; // string 3600 3601 } PyObj_pjsip_rx_data; 3602 3603 /* 3604 * PyObj_pjsip_rx_data_dealloc 3605 * deletes rx_data from memory 3606 */ 3607 static void PyObj_pjsip_rx_data_delete(PyObj_pjsip_rx_data* self) 3608 { 3609 Py_XDECREF(self->msg_info_buffer); 3610 Py_XDECREF(self->msg_info_info); 3611 3612 self->ob_type->tp_free((PyObject*)self); 3613 } 3614 3615 3616 static void PyObj_pjsip_rx_data_import(PyObj_pjsip_rx_data *obj, pjsip_rx_data *rx_data) 3617 { 3618 Py_XDECREF(obj->msg_info_buffer); 3619 obj->msg_info_buffer = PyString_FromString(rx_data->msg_info.msg_buf); 3620 Py_XDECREF(obj->msg_info_info); 3621 obj->msg_info_info = PyString_FromString(pjsip_rx_data_get_info(rx_data)); 3622 } 3623 3624 3625 /* 3626 * PyObj_pjsip_rx_data_new 3627 * constructor for PyObj_pjsip_rx_data object 3628 */ 3629 static PyObject * PyObj_pjsip_rx_data_new(PyTypeObject *type, PyObject *args, PyObject *kwds) 3630 { 3631 PyObj_pjsip_rx_data *self; 3632 3633 PJ_UNUSED_ARG(args); 3634 PJ_UNUSED_ARG(kwds); 3635 3636 self = (PyObj_pjsip_rx_data *)type->tp_alloc(type, 0); 3637 if (self != NULL) { 3638 self->msg_info_buffer = PyString_FromString(""); 3639 self->msg_info_info = PyString_FromString(""); 3640 } 3641 3642 return (PyObject *)self; 3643 } 3644 3645 3646 3647 /* 3648 * PyObj_pjsip_rx_data_members 3649 */ 3650 static PyMemberDef PyObj_pjsip_rx_data_members[] = 3651 { 3652 { 3653 "msg_info_buffer", T_OBJECT_EX, 3654 offsetof(PyObj_pjsip_rx_data, msg_info_buffer), 0, 3655 "Entire SIP-Message" 3656 }, 3657 { 3658 "msg_info_info", T_OBJECT_EX, 3659 offsetof(PyObj_pjsip_rx_data, msg_info_info), 0, 3660 "Message Info" 3661 }, 3662 3663 {NULL} /* Sentinel */ 3664 }; 3665 3666 /* 3667 * PyTyp_pjsip_rx_data 3668 */ 3669 static PyTypeObject PyTyp_pjsip_rx_data = 3670 { 3671 PyObject_HEAD_INIT(NULL) 3672 0, /*ob_size*/ 3673 "_pjsua.Pjsip_Rx_Data", /*tp_name*/ 3674 sizeof(PyObj_pjsip_rx_data), /*tp_basicsize*/ 3675 0, /*tp_itemsize*/ 3676 (destructor)PyObj_pjsip_rx_data_delete,/*tp_dealloc*/ 3677 0, /*tp_print*/ 3678 0, /*tp_getattr*/ 3679 0, /*tp_setattr*/ 3680 0, /*tp_compare*/ 3681 0, /*tp_repr*/ 3682 0, /*tp_as_number*/ 3683 0, /*tp_as_sequence*/ 3684 0, /*tp_as_mapping*/ 3685 0, /*tp_hash */ 3686 0, /*tp_call*/ 3687 0, /*tp_str*/ 3688 0, /*tp_getattro*/ 3689 0, /*tp_setattro*/ 3690 0, /*tp_as_buffer*/ 3691 Py_TPFLAGS_DEFAULT, /*tp_flags*/ 3692 "PJSIP request data information", /* tp_doc */ 3693 0, /* tp_traverse */ 3694 0, /* tp_clear */ 3695 0, /* tp_richcompare */ 3696 0, /* tp_weaklistoffset */ 3697 0, /* tp_iter */ 3698 0, /* tp_iternext */ 3699 0, /* tp_methods */ 3700 PyObj_pjsip_rx_data_members, /* tp_members */ 3701 0, /* tp_getset */ 3702 0, /* tp_base */ 3703 0, /* tp_dict */ 3704 0, /* tp_descr_get */ 3705 0, /* tp_descr_set */ 3706 0, /* tp_dictoffset */ 3707 0, /* tp_init */ 3708 0, /* tp_alloc */ 3709 PyObj_pjsip_rx_data_new, /* tp_new */ 3710 3711 }; 3712 3713 3714 3715 ////////////////////////////////////////////////////////////////////////////// 3589 3716 3590 3717 #endif /* __PY_PJSUA_H__ */
Note: See TracChangeset
for help on using the changeset viewer.