blob: d76dbf3ff93816cb080fcb95a91815ab161589ec [file] [log] [blame]
Alexandre Lision67916dd2014-01-24 13:33:04 -05001# $Id$
2#
3# pjsua Python GUI Demo
4#
5# Copyright (C)2013 Teluu Inc. (http://www.teluu.com)
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
19# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20#
21import sys
22if sys.version_info[0] >= 3: # Python 3
23 import tkinter as tk
24 from tkinter import ttk
25 from tkinter import messagebox as msgbox
26else:
27 import Tkinter as tk
28 import tkMessageBox as msgbox
29 import ttk
30
31import pjsua2 as pj
32import application
33
34
35class Endpoint(pj.Endpoint):
36 """
37 This is high level Python object inherited from pj.Endpoint
38 """
39 instance = None
40 def __init__(self):
41 pj.Endpoint.__init__(self)
42 Endpoint.instance = self
43
44
45def validateUri(uri):
46 return Endpoint.instance.utilVerifyUri(uri) == pj.PJ_SUCCESS
47
48def validateSipUri(uri):
49 return Endpoint.instance.utilVerifySipUri(uri) == pj.PJ_SUCCESS
50
51
52if __name__ == '__main__':
53 application.main()