Further slight placation

This commit is contained in:
Maff 2019-05-03 19:44:43 +01:00
parent c53aa77758
commit 92c3fe8c72
1 changed files with 13 additions and 17 deletions

View File

@ -25,10 +25,18 @@ from random import shuffle
##
## If you can get this working using PJSUA2, a pull request would be greatly appreciated.
state=None
# Application scaffolding
# logger functions
# Utility classes, used basically as enums or generics
class State(object):
running=False
class PJStates:
init=0
deinit=1
class SIPStates:
ringing=180
answer=200
#Utility and state definitions
state=State()
# Logging
def PJLog(level, line, length):
Log(level+1, "pjsip", line)
def Log(level, source, line, error=False):
@ -37,7 +45,7 @@ def Log(level, source, line, error=False):
pfx='!'
print("%s %s: %s" % (pfx*level, source, line))
sys.stdout.flush()
#Generic signal handler
# Signal handling
def sighandle(_signo, _stack_frame):
global state
Log(1, "sighandler", "caught signal %s" % _signo)
@ -55,18 +63,6 @@ def sighandle(_signo, _stack_frame):
state.running=False
pass
# Utility classes, used basically as enums or generics
class State(object):
running=False
class PJStates:
init=0
deinit=1
class SIPStates:
ringing=180
answer=200
state=State()
# Classes
# Account Callback class
class AccountCb(pj.AccountCallback):