Skip to content

Commit 04aea0e

Browse files
authored
Fix undefined symbol error in Python pjsua modules by commenting out deprecated pjsua_transport_set_enable (#4486)
1 parent 0beb7bc commit 04aea0e

File tree

4 files changed

+46
-2
lines changed

4 files changed

+46
-2
lines changed

pjsip-apps/src/py_pjsua/py_pjsua.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,10 @@ static PyObject *py_pjsua_transport_get_info(PyObject *pSelf, PyObject *pArgs)
12591259

12601260
/*
12611261
* py_pjsua_transport_set_enable
1262+
* NOTE: This function is commented out because pjsua_transport_set_enable
1263+
* has been deprecated and is no longer available in the PJSUA API.
12621264
*/
1265+
/*
12631266
static PyObject *py_pjsua_transport_set_enable
12641267
(PyObject *pSelf, PyObject *pArgs)
12651268
{
@@ -1277,6 +1280,7 @@ static PyObject *py_pjsua_transport_set_enable
12771280
12781281
return Py_BuildValue("i",status);
12791282
}
1283+
*/
12801284

12811285
/*
12821286
* py_pjsua_transport_close
@@ -1312,6 +1316,11 @@ static char pjsua_transport_get_info_doc[] =
13121316
"void py_pjsua.transport_get_info "
13131317
"(py_pjsua.Transport_ID id, py_pjsua.Transport_Info info) "
13141318
"Get information about transports.";
1319+
/*
1320+
* NOTE: pjsua_transport_set_enable_doc is commented out because the
1321+
* corresponding function has been deprecated and is no longer available.
1322+
*/
1323+
/*
13151324
static char pjsua_transport_set_enable_doc[] =
13161325
"void py_pjsua.transport_set_enable "
13171326
"(py_pjsua.Transport_ID id, int enabled) "
@@ -1320,6 +1329,7 @@ static char pjsua_transport_set_enable_doc[] =
13201329
"Disabling a transport does not necessarily close the socket, "
13211330
"it will only discard incoming messages and prevent the transport "
13221331
"from being used to send outgoing messages.";
1332+
*/
13231333
static char pjsua_transport_close_doc[] =
13241334
"void py_pjsua.transport_close (py_pjsua.Transport_ID id, int force) "
13251335
"Close the transport. If transport is forcefully closed, "
@@ -5266,10 +5276,16 @@ static PyMethodDef py_pjsua_methods[] =
52665276
"transport_get_info", py_pjsua_transport_get_info, METH_VARARGS,
52675277
pjsua_transport_get_info_doc
52685278
},
5279+
/*
5280+
* NOTE: transport_set_enable is commented out because the underlying
5281+
* pjsua_transport_set_enable function has been deprecated.
5282+
*/
5283+
/*
52695284
{
52705285
"transport_set_enable", py_pjsua_transport_set_enable, METH_VARARGS,
52715286
pjsua_transport_set_enable_doc
52725287
},
5288+
*/
52735289
{
52745290
"transport_close", py_pjsua_transport_close, METH_VARARGS,
52755291
pjsua_transport_close_doc
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
This Python pjsua module is now deprecated. Please use PJSUA2 SWIG binding instead.
2+
3+
For more information on building and using the PJSUA2 Python module, please see:
4+
https://docs.pjsip.org/en/latest/pjsua2/building.html#building-python-swig-module
5+
6+
The PJSUA2 Python module provides a more modern and actively maintained Python API
7+
for PJSIP functionality.

pjsip-apps/src/python/_pjsua.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,10 @@ static PyObject *py_pjsua_transport_get_info(PyObject *pSelf, PyObject *pArgs)
12471247

12481248
/*
12491249
* py_pjsua_transport_set_enable
1250+
* NOTE: This function is commented out because pjsua_transport_set_enable
1251+
* has been deprecated and is no longer available in the PJSUA API.
12501252
*/
1253+
/*
12511254
static PyObject *py_pjsua_transport_set_enable(PyObject *pSelf,
12521255
PyObject *pArgs)
12531256
{
@@ -1264,6 +1267,7 @@ static PyObject *py_pjsua_transport_set_enable(PyObject *pSelf,
12641267
12651268
return Py_BuildValue("i", status);
12661269
}
1270+
*/
12671271

12681272
/*
12691273
* py_pjsua_transport_close
@@ -1298,6 +1302,11 @@ static char pjsua_transport_get_info_doc[] =
12981302
"void _pjsua.transport_get_info "
12991303
"(_pjsua.Transport_ID id, _pjsua.Transport_Info info) "
13001304
"Get information about transports.";
1305+
/*
1306+
* NOTE: pjsua_transport_set_enable_doc is commented out because the
1307+
* corresponding function has been deprecated and is no longer available.
1308+
*/
1309+
/*
13011310
static char pjsua_transport_set_enable_doc[] =
13021311
"void _pjsua.transport_set_enable "
13031312
"(_pjsua.Transport_ID id, int enabled) "
@@ -1306,6 +1315,7 @@ static char pjsua_transport_set_enable_doc[] =
13061315
"Disabling a transport does not necessarily close the socket, "
13071316
"it will only discard incoming messages and prevent the transport "
13081317
"from being used to send outgoing messages.";
1318+
*/
13091319
static char pjsua_transport_close_doc[] =
13101320
"void _pjsua.transport_close (_pjsua.Transport_ID id, int force) "
13111321
"Close the transport. If transport is forcefully closed, "
@@ -4061,10 +4071,16 @@ static PyMethodDef py_pjsua_methods[] =
40614071
"transport_get_info", py_pjsua_transport_get_info, METH_VARARGS,
40624072
pjsua_transport_get_info_doc
40634073
},
4074+
/*
4075+
* NOTE: transport_set_enable is commented out because the underlying
4076+
* pjsua_transport_set_enable function has been deprecated.
4077+
*/
4078+
/*
40644079
{
40654080
"transport_set_enable", py_pjsua_transport_set_enable, METH_VARARGS,
40664081
pjsua_transport_set_enable_doc
40674082
},
4083+
*/
40684084
{
40694085
"transport_close", py_pjsua_transport_close, METH_VARARGS,
40704086
pjsua_transport_close_doc

pjsip-apps/src/python/pjsua.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,17 +604,22 @@ def info(self):
604604
self._lib._err_check("info()", self, -1, "Invalid transport")
605605
return TransportInfo(ti)
606606

607+
# NOTE: enable() and disable() methods are commented out because the underlying
608+
# pjsua_transport_set_enable function has been deprecated and is no longer available.
609+
# Please use PJSUA2 SWIG binding for modern transport management functionality.
610+
"""
607611
def enable(self):
608-
"""Enable this transport."""
612+
\"\"\"Enable this transport.\"\"\"
609613
lck = self._lib.auto_lock()
610614
err = _pjsua.transport_set_enable(self._id, True)
611615
self._lib._err_check("enable()", self, err)
612616
613617
def disable(self):
614-
"""Disable this transport."""
618+
\"\"\"Disable this transport.\"\"\"
615619
lck = self._lib.auto_lock()
616620
err = _pjsua.transport_set_enable(self._id, 0)
617621
self._lib._err_check("disable()", self, err)
622+
"""
618623

619624
def close(self, force=False):
620625
"""Close and destroy this transport.

0 commit comments

Comments
 (0)