Crash when using PJSUA2 python

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

 



Hi pjsip people,
I'm trying to create a small python-based SIP client using pjsua2 and
its python bindings. However, pjsip segfaults during the registration
process (I am using a valid account). The registration is sent, and an
OK is returned, but then it seems that it's crashing when trying to
call one of the callbacks of my Account class, which I've inherited
from pjsua2.Account. I've even tried to run the python test
application mentioned in the documentation (which I've attached
below), and it also crashes at the same place. However, if I replace
the "acc = Account()" line with "acc = pj.Account()", it doesn't
crash. Another thing worth mentioning: If I run the pygui example (the
tkinter app), and use the app to register with the same account
details, it works fine. So what is wrong with the code example below?
I've successfully built the pjproject using the instructions the
pjsip.org.  
I just don't know where to start looking for the problem. Any help
would be much appreciated!
Regards,Carl
===================================
import osimport timeimport sysimport pjsua2 as pj
class Account(pj.Account):  def onRegState(self, prm):      print
"***OnRegState: " + prm.reason
def pjsua2_test():  ep_cfg = pj.EpConfig()  ep = pj.Endpoint() 
ep.libCreate()  ep.libInit(ep_cfg)
  sipTpConfig = pj.TransportConfig()  sipTpConfig.port = 5060 
ep.transportCreate(pj.PJSIP_TRANSPORT_UDP, sipTpConfig)   
ep.libStart()  acfg = pj.AccountConfig()  acfg.idUri =
"sip:6000 at 192.168.0.50"  acfg.regConfig.registrarUri =
"sip:192.168.0.50"  cred = pj.AuthCredInfo("digest", "*", "6000", 0,
"6000")  acfg.sipConfig.authCreds.append( cred )  acc = Account() 
acc.create(acfg)  time.sleep(10)  ep.libDestroy()
if __name__ == "__main__":  pjsua2_test()

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20151222/49afc43d/attachment.html>


[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