Debian Codegraph @

Xpjproject/pjsip-apps/src/pygui/endpoint.py

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