1. Register in a SIP server
2. Make an outgoing call to SIP contact
3. Close the connection.
import linphone
import logging
import sys
from PyQt4.QtCore import QTimer
from PyQt4.QtGui import QApplication
def main():
logging.basicConfig(level=logging.INFO)
app = QApplication(sys.argv)
def log_handler(level, msg):
method = getattr(logging, level)
method(msg)
def global_state_changed(*args, **kwargs):
logging.warning("global_state_changed: %r %r" % (args, kwargs))
def registration_state_changed(core, call, state, message):
logging.warning("registration_state_changed: " + str(state) + ", " + message)
callbacks = {
'global_state_changed': global_state_changed,
'registration_state_changed': registration_state_changed,
}
linphone.set_log_handler(log_handler)
core = linphone.Core.new(callbacks, None, None)
ai = linphone.AuthInfo.new(None, None, None, None, None, None)
ai.username = '101'
ai.passwd = 'passw0rd'
ai.domain = '192.168.88.160'
core.add_auth_info(ai)
core.iterate
main()