Re: pjsip Digest, Vol 136, Issue 10

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



That worked. For the benefit of others,

And thanks for quick response and help. Appreciated.

How can I edit the sample python code in the same page to include this line, so that others dont face this issue?

 ep_cfg.uaConfig.threadCnt = 0; #Python does not like PJSUA2's thread.


---------------------------------
def pjsua2_test():
  # Create and initialize the library
  ep_cfg = pj.EpConfig()

  ep_cfg.uaConfig.threadCnt = 0; #Python does not like PJSUA2's thread.
  ep = pj.Endpoint()
  ep.libCreate()
  ep.libInit(ep_cfg)


----------------------------------

Thanks,

From: pjsip <pjsip-bounces@xxxxxxxxxxxxxxx> on behalf of pjsip-request@xxxxxxxxxxxxxxx <pjsip-request@xxxxxxxxxxxxxxx>
Sent: Sunday, December 30, 2018 10:30 PM
To: pjsip@xxxxxxxxxxxxxxx
Subject: pjsip Digest, Vol 136, Issue 10
 
Send pjsip mailing list submissions to
        pjsip@xxxxxxxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
or, via email, send a message with subject or body 'help' to
        pjsip-request@xxxxxxxxxxxxxxx

You can reach the person managing the list at
        pjsip-owner@xxxxxxxxxxxxxxx

When replying, please edit your Subject line so it is more specific
than "Re: Contents of pjsip digest..."


Today's Topics:

   1. Re: pjsip 2.8 TRANSPORT_ADAPTER_SAMPLE segmentation fault
      (Hector Nunez)
   2. Re: Python account registration call back issue : aarch64
      installation (Bergman, Mats)
   3. Question about get H264 raw streaming in background of iOS
      app (Kent Liu)


----------------------------------------------------------------------

Message: 1
Date: Sun, 30 Dec 2018 15:27:55 +0000 (UTC)
From: Hector Nunez <hndiaz@xxxxxxxxx>
To: Hector Nunez via pjsip <pjsip@xxxxxxxxxxxxxxx>
Subject: Re: pjsip 2.8 TRANSPORT_ADAPTER_SAMPLE segmentation
        fault
Message-ID: <264750681.4106129.1546183675072@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset="utf-8"

 Hi,
I added this error in stackoverflow, if I use any previous versions like 2.7 it works fine.
https://stackoverflow.com/questions/53507832/pjsip-2-8-transport-adapter-sample-segmentation-fault?noredirect=1#comment94003334_53507832

Thanks
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20181230/17c23889/attachment-0001.html>

------------------------------

Message: 2
Date: Sun, 30 Dec 2018 16:23:16 +0000
From: "Bergman, Mats" <mats.bergman@xxxxxxxxxxxxxxxx>
To: pjsip list <pjsip@xxxxxxxxxxxxxxx>
Subject: Re: Python account registration call back issue :
        aarch64 installation
Message-ID:
        <HE1PR0701MB2699D4FFE10C8C77F8BF8E05F2B10@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
       
Content-Type: text/plain; charset="us-ascii"

I had problems with core dumps as well and had to set number of threads to 0
  ep_cfg.uaConfig.threadCnt = 0

After this change then you need to use ep.libHandleEvents (delay_in_ms) instead of any blocking delay function in your main loop.

I got that information from following part of the documentation https://www.pjsip.org/docs/book-latest/html/intro_pjsua2.html#threading:
..."Often though, especially if you use PJSUA2 with high level languages such as Python, it is required to disable PJSUA2 internal worker threads by setting EpConfig.uaConfig.threadCnt to 0, because the high level environment doesn't like to be called by external thread (such as PJSIP's worker thread)."...

Hope it helps
/ Mats

From: pjsip [mailto:pjsip-bounces@xxxxxxxxxxxxxxx] On Behalf Of Sekar S
Sent: den 29 december 2018 08:10
To: pjsip@xxxxxxxxxxxxxxx
Subject: Python account registration call back issue : aarch64 installation

Hi,

When I try following python code, getting segment fault (refer to console log below).

Note:

1. Platform ==> aarch64 (Ubuntu Bionic) and using pjsua2
2. If I use acc = pj.Account(); instead of acc = Account();, it works. But I will not be able to get registration confirmation message
3. 'onRegStarted' is handled. Corresponding message is printed.
4. I tried ./configure  --enable-shared  --disable-sdl --disable-ffmpeg --disable-v412 --disable-openh264 --disable-libwebrtc as well as ./configure  --enable-shared  to build the library etc

Any help?

Thanks


------Code----------------------------------------------------------------------------------------------------------

import pjsua2 as pj
import time

# Subclass to extend the Account and get notifications etc.
class Account(pj.Account):
  def __init__(self, *args, **kwargs):
      super().__init__(*args, **kwargs)
  def onRegStarted(self, prm):
      print ("Registration started callback received >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
  def onRegState(self, prm):
      print ("***OnRegState: " )


# pjsua2 test function
def pjsua2_test():
  # Create and initialize the library
  ep_cfg = pj.EpConfig()

  ep_cfg.logConfig.level = 5;
  ep_cfg.uaConfig.maxCalls = 4;
  #ep_cfg.mediaConfig.sndClockRate = 16000;  #Giving error.

  ep = pj.Endpoint()
  ep.libCreate()
  ep.libInit(ep_cfg)

  # Create SIP transport. Error handling sample is shown
  sipTpConfig = pj.TransportConfig();
  sipTpConfig.port = 5060;
  ep.transportCreate(pj.PJSIP_TRANSPORT_UDP, sipTpConfig);

  # Start the library
  ep.libStart();

  acfg = pj.AccountConfig();
  acfg.idUri = "sip:user@xxxxxxxxxxxx:5060";
  acfg.regConfig.registrarUri = "sip:proxy.sipthor.net:5060";
  #acfg.proxies[0] = ("sip:proxy.sipthor.net:5060");



  cred = pj.AuthCredInfo("digest", "*", "user", 0, "pass");
  acfg.sipConfig.authCreds.append( cred );
  # Create the account
  acc = Account();
  print ("Calling registration >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> " )

  acc.create(acfg);
  print ("Registration Initiated >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> " )
  # Here we don't have anything else to do..
  time.sleep(20);

  # Destroy the library
  #ep.libDestroy()

#
# main()
#
if __name__ == "__main__":
  pjsua2_test()

--------------------------------------------------------------------------------------------------------------------


---------------------------------Error message----------------------------------------------------------------------
$ python3 test.py
06:59:18.940         os_core_unix.c !pjlib 2.8-svn for POSIX initialized
06:59:18.942         sip_endpoint.c  .Creating endpoint instance...
06:59:18.942                  pjlib  .select() I/O Queue created (0x15288f18)
06:59:18.942         sip_endpoint.c  .Module "mod-msg-print" registered
06:59:18.943        sip_transport.c  .Transport manager created.
06:59:18.943           pjsua_core.c  .PJSUA state changed: NULL --> CREATED
06:59:18.943         sip_endpoint.c  .Module "mod-pjsua-log" registered
06:59:18.943         sip_endpoint.c  .Module "mod-tsx-layer" registered
06:59:18.943         sip_endpoint.c  .Module "mod-stateful-util" registered
06:59:18.943         sip_endpoint.c  .Module "mod-ua" registered
06:59:18.943         sip_endpoint.c  .Module "mod-100rel" registered
06:59:18.943         sip_endpoint.c  .Module "mod-pjsua" registered
06:59:18.943         sip_endpoint.c  .Module "mod-invite" registered
06:59:19.027             alsa_dev.c  ..ALSA driver found 7 devices
06:59:19.027             alsa_dev.c  ..ALSA initialized
06:59:19.027                  pjlib  ..select() I/O Queue created (0x152dea08)
06:59:19.040         sip_endpoint.c  .Module "mod-evsub" registered
06:59:19.040         sip_endpoint.c  .Module "mod-presence" registered
06:59:19.040         sip_endpoint.c  .Module "mod-mwi" registered
06:59:19.040         sip_endpoint.c  .Module "mod-refer" registered
06:59:19.040         sip_endpoint.c  .Module "mod-pjsua-pres" registered
06:59:19.040         sip_endpoint.c  .Module "mod-pjsua-im" registered
06:59:19.040         sip_endpoint.c  .Module "mod-pjsua-options" registered
06:59:19.041           pjsua_core.c  .1 SIP worker threads created
06:59:19.041           pjsua_core.c  .pjsua version 2.8-svn for Linux-4.19/aarch64/glibc-2.27 initialized
06:59:19.041           pjsua_core.c  .PJSUA state changed: CREATED --> INIT
06:59:19.042           pjsua_core.c  SIP UDP socket reachable at 192.168.1.11:5060
06:59:19.042          udp0x15127990  SIP UDP transport started, published address is 192.168.1.11:5060
06:59:19.042           pjsua_core.c  PJSUA state changed: INIT --> STARTING
06:59:19.042         sip_endpoint.c  .Module "mod-unsolicited-mwi" registered
06:59:19.042           pjsua_core.c  .PJSUA state changed: STARTING --> RUNNING
Calling registration >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
06:59:19.043            pjsua_acc.c  Adding account: id=sip:USERXXXXX@xxxxxxxxxxxx:5060
06:59:19.043            pjsua_acc.c  .Account sip:USERXXXXX@xxxxxxxxxxxx:5060 added with id 0
06:59:19.043            pjsua_acc.c  .Acc 0: setting registration..
06:59:19.686           pjsua_core.c  ...TX 519 bytes Request msg REGISTER/cseq=22074 (tdta0x152a7828) to UDP 81.23.228.129:5060:
REGISTER sip:proxy.sipthor.net:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.11:5060;rport;branch=z9hG4bKPjbe03e2c7-26a8-473c-915b-c52fb5c7ebe3
Max-Forwards: 70
From: <sip:USERXXXXX@xxxxxxxxxxxx>;tag=25125e72-4ef2-4dc1-b7f2-db00dc029ef2
To: <sip:USERXXXXX@xxxxxxxxxxxx>
Call-ID: 3bfb393d-7383-405b-8fca-e06299cffecf
CSeq: 22074 REGISTER
Contact: <sip:USERXXXXX@192.168.1.11:5060;ob>
Expires: 300
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Content-Length:  0


--end msg--
Registration started callback received >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
06:59:19.687            pjsua_acc.c  ..Acc 0: Registration sent
Registration Initiated >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
06:59:19.833           pjsua_core.c  .RX 526 bytes Response msg 401/REGISTER/cseq=22074 (rdata0x152a3448) from UDP 81.23.228.129:5060:
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.11:5060;received=192.168.1.11;rport=5060;branch=z9hG4bKPjbe03e2c7-26a8-473c-915b-c52fb5c7ebe3
From: <sip:USERXXXXX@xxxxxxxxxxxx>;tag=25125e72-4ef2-4dc1-b7f2-db00dc029ef2
To: <sip:USERXXXXX@xxxxxxxxxxxx>;tag=e7d4d6b46afb9bf88242924a8d869ebf.429b
Call-ID: 3bfb393d-7383-405b-8fca-e06299cffecf
CSeq: 22074 REGISTER
WWW-Authenticate: Digest realm="sip2sip.info", nonce="5c271b65a6ae547b3af27622dae9fc546bb6808d"
Server: SIP Thor on OpenSIPS XS 1.11
Content-Length: 0


--end msg--
06:59:19.834           pjsua_core.c  ....TX 714 bytes Request msg REGISTER/cseq=22075 (tdta0x152a7828) to UDP 81.23.228.129:5060:
REGISTER sip:proxy.sipthor.net:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.11:5060;rport;branch=z9hG4bKPjc2034788-dc95-4433-9c20-73b64baffe15
Max-Forwards: 70
From: <sip:USERXXXXX@xxxxxxxxxxxx>;tag=25125e72-4ef2-4dc1-b7f2-db00dc029ef2
To: <sip:USERXXXXX@xxxxxxxxxxxx>
Call-ID: 3bfb393d-7383-405b-8fca-e06299cffecf
CSeq: 22075 REGISTER
Contact: <sip:USERXXXXX@192.168.1.11:5060;ob>
Expires: 300
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Authorization: Digest username="USERXXXXX", realm="sip2sip.info", nonce="5c271b65a6ae547b3af27622dae9fc546bb6808d", uri="sip:proxy.sipthor.net:5060", response="66b9f9d0dc0390af41274c8de4f26ffe"
Content-Length:  0


--end msg--
06:59:20.036           pjsua_core.c  .RX 792 bytes Response msg 200/REGISTER/cseq=22075 (rdata0xffff80008798) from UDP 81.23.228.129:5060:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.11:5060;received=192.168.1.11;rport=5060;branch=z9hG4bKPjc2034788-dc95-4433-9c20-73b64baffe15
From: <sip:USERXXXXX@xxxxxxxxxxxx>;tag=25125e72-4ef2-4dc1-b7f2-db00dc029ef2
To: <sip:USERXXXXX@xxxxxxxxxxxx>;tag=e7d4d6b46afb9bf88242924a8d869ebf.1ca9
Call-ID: 3bfb393d-7383-405b-8fca-e06299cffecf
CSeq: 22075 REGISTER
Contact: <sip:USERXXXXX@192.168.1.11:5060;ob>;expires=300;received="sip:81.23.228.129:5060;target=%73%69%70:%32%32%33.%32%32%39.%32%34%34.%32%30%38:%35%30%36%30", <sip:02581793@192.168.1.10:36279;transport=tls>;expires=376;received="sip:81.23.228.129:5060;target=%73%69%70:%32%32%33.%32%32%39.%32%34%34.%32%30%38:%33%34%37%38%35%3b%74%72%61%6e%73%70%6f%72%74%3d%74%6c%73"
Server: SIP Thor on OpenSIPS XS 1.11
Content-Length: 0


--end msg--
06:59:20.037            pjsua_acc.c  ....SIP outbound status for acc 0 is not active
06:59:20.037            pjsua_acc.c  ....sip:USERXXXXX@xxxxxxxxxxxx:5060: registration success, status=200 (OK), will re-register in 300 seconds
06:59:20.037            pjsua_acc.c  ....Keep-alive timer started for acc 0, destination:81.23.228.129:5060:15, interval:1430523921s
Segmentation fault

----------------------------------------------------



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20181230/04f6adf2/attachment-0001.html>

------------------------------

Message: 3
Date: Mon, 31 Dec 2018 00:23:49 +0800
From: Kent Liu <chir0615@xxxxxxxxx>
To: pjsip@xxxxxxxxxxxxxxx
Subject: Question about get H264 raw streaming in background
        of iOS app
Message-ID:
        <CAPPCoDDfnoZwm8wDXns8SS1QBx+B3P+96Q9vzJZKw_cEQRKTTg@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset="utf-8"

Dears,

We already make the audio/video call work fine with iOS CallKit no matter
in foreground or background.
But we are struggling in how to make a iOS app record the raw H264 when app
in background.
Record H264 raw data would be possible when App is running in foreground.
But when user answer incoming call without unlock iOS device, it will make
iOS app running in background.
At this situation, video media stream will be stopped due to openGL video
view can't be started in background.
Before we can record the H264 raw data, we need to make the media stream of
video running  even in background or without display to a view/window.

Is it possible to make it? any suggestion or hint would be appreciated.
Thanks.

BR,

Chir
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20181231/7d91c1ec/attachment-0001.html>

------------------------------

Subject: Digest Footer

_______________________________________________
pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


------------------------------

End of pjsip Digest, Vol 136, Issue 10
**************************************
_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux