Python pjsua & pjsua2

AM
Arthur Murray
Mon, Oct 21, 2019 2:32 AM

Hello,
I am trying to figure out how to answer and make calls from the
command line in python (ubuntu 18).

When trying the example python script
"pjproject-2.9/pjsip-apps/src/python/samples/simplecall.py
sip:100@127.0.0.1:5060" it fails an assertion when closing (after
pressing ENTER):

19:19:26.546          pjsua_core.c  .PJSUA state changed: CLOSING --> NULL
19:19:26.546          pjsua_core.c  .PJSUA destroyed...
python: ../src/pjsua-lib/pjsua_call.c:2389: pjsua_call_get_user_data:
Assertion `call_id>=0 && call_id<(int)pjsua_var.ua_cfg.max_calls'
failed.
zsh: abort (core dumped)

I set the log level to 4 to see the PJSUA agent being destroyed.
"lib.init(log_cfg = pj.LogConfig(level=4, callback=log_cb))"

Is that sample incorrect python code or a problem with pjsua_core
destroying PJSUA before pjsua_call checks
"pjsua_var.ua_cfg.max_calls"?

A similar thing happens with the sample "python/samples/call.py" if it
makes a call:
19:27:42.392      sip_transaction.c  .Stopping transaction layer module
python: ../src/pjsua-lib/pjsua_acc.c:622: pjsua_acc_get_user_data:
Assertion `pjsua_var.acc[acc_id].valid' failed.

I have read that pjsua has been deprecated, so maybe they aren't
supposed to be used anymore?

I can't find a similar "call.py" showing how to use python pjsua2 from
the command line. The "pygui" samples have GUI code and I'm looking
for an exact equivalent for the simple "call.py".  Does one exist?  I
have read the "Book" but there is no example on answering and making
calls from the command line.

Hello, I am trying to figure out how to answer and make calls from the command line in python (ubuntu 18). When trying the example python script "pjproject-2.9/pjsip-apps/src/python/samples/simplecall.py sip:100@127.0.0.1:5060" it fails an assertion when closing (after pressing ENTER): 19:19:26.546 pjsua_core.c .PJSUA state changed: CLOSING --> NULL 19:19:26.546 pjsua_core.c .PJSUA destroyed... python: ../src/pjsua-lib/pjsua_call.c:2389: pjsua_call_get_user_data: Assertion `call_id>=0 && call_id<(int)pjsua_var.ua_cfg.max_calls' failed. zsh: abort (core dumped) I set the log level to 4 to see the PJSUA agent being destroyed. "lib.init(log_cfg = pj.LogConfig(level=4, callback=log_cb))" Is that sample incorrect python code or a problem with pjsua_core destroying PJSUA before pjsua_call checks "pjsua_var.ua_cfg.max_calls"? A similar thing happens with the sample "python/samples/call.py" if it makes a call: 19:27:42.392 sip_transaction.c .Stopping transaction layer module python: ../src/pjsua-lib/pjsua_acc.c:622: pjsua_acc_get_user_data: Assertion `pjsua_var.acc[acc_id].valid' failed. I have read that pjsua has been deprecated, so maybe they aren't supposed to be used anymore? I can't find a similar "call.py" showing how to use python pjsua2 from the command line. The "pygui" samples have GUI code and I'm looking for an exact equivalent for the simple "call.py". Does one exist? I have read the "Book" but there is no example on answering and making calls from the command line.