Advertisement
Guest User

Untitled

a guest
Oct 21st, 2016
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.68 KB | None | 0 0
  1. import pjsua
  2.  
  3.  
  4. class MyAccountCallback(pjsua.AccountCallback):
  5.     def __init__(self, account=None):
  6.         pjsua.AccountCallback.__init__(self, account)
  7.  
  8.     def on_incoming_call(self, call):
  9.         call.hangup(501, "Sorry, not ready to accept calls yet")
  10.  
  11.     def on_reg_state(self):
  12.         print "Registration complete, status=", self.account.info().reg_status, \
  13.               "(" + self.account.info().reg_reason + ")"
  14.  
  15. sip_url="sip.nextfone.com.bd"
  16. sip_username="09614449000"
  17. sip_password="45621548649"
  18. lib = pjsua.Lib()
  19.  
  20. acc_cfg = pjsua.AccountConfig(sip_url, sip_username, sip_password)
  21.  
  22. acc_cb = MyAccountCallback()
  23. acc = lib.create_account(acc_cfg, cb=acc_cb)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement