Alexandre Lision | 67916dd | 2014-01-24 13:33:04 -0500 | [diff] [blame^] | 1 | # $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 | # |
| 21 | import sys |
| 22 | if sys.version_info[0] >= 3: # Python 3 |
| 23 | import tkinter as tk |
| 24 | from tkinter import ttk |
| 25 | from tkinter import messagebox as msgbox |
| 26 | else: |
| 27 | import Tkinter as tk |
| 28 | import tkMessageBox as msgbox |
| 29 | import ttk |
| 30 | |
| 31 | import pjsua2 as pj |
| 32 | import application |
| 33 | |
| 34 | |
| 35 | class 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 | |
| 45 | def validateUri(uri): |
| 46 | return Endpoint.instance.utilVerifyUri(uri) == pj.PJ_SUCCESS |
| 47 | |
| 48 | def validateSipUri(uri): |
| 49 | return Endpoint.instance.utilVerifySipUri(uri) == pj.PJ_SUCCESS |
| 50 | |
| 51 | |
| 52 | if __name__ == '__main__': |
| 53 | application.main() |