Index: pjproject/branches/projects/pjsua2/pjsip-apps/src/pygui/account.py
===================================================================
--- pjproject/branches/projects/pjsua2/pjsip-apps/src/pygui/account.py	(revision 4657)
+++ pjproject/branches/projects/pjsua2/pjsip-apps/src/pygui/account.py	(revision 4663)
@@ -34,4 +34,5 @@
 import accountsetting
 import application
+import call
 
 # Account class
@@ -47,4 +48,5 @@
 		self.cfgChanged = False
 		self.buddyList = []
+                self.callList = []
 
 	def statusText(self):
@@ -73,7 +75,28 @@
 			status = '- not created -'
 		return status
+        
+        def makeCall(self):
+                mycall = call.Call(self.app, self, pj.PJSUA_INVALID_ID)
+                callPrm = pj.CallOpParam()
+                callPrm.opt.audioCount = 1
+                callPrm.opt.videoCount = 0
+                mycall.uri = "sip:test1@pjsip.org"
+                self.callList.append(mycall)
+                mycall.makeCall(mycall.uri, callPrm)
 	
 	def onRegState(self, prm):
 		self.app.updateAccount(self)
+
+        def onIncomingCall(self, prm):
+                mycall = call.Call(self.app, self, prm.callId)
+                self.callList.append(mycall)
+                self.app.updateCall(self)
+                callPrm = pj.CallOpParam()
+                msg = "Incoming call for account '%s'" % self.cfg.idUri
+		if msgbox.askquestion(msg, 'Accept call?', default=msgbox.YES) == u'yes':
+                        callPrm.statusCode = 200
+                        mycall.answer(callPrm)
+                else:
+                        mycall.hangup(callPrm)
 
 
Index: pjproject/branches/projects/pjsua2/pjsip-apps/src/pygui/application.py
===================================================================
--- pjproject/branches/projects/pjsua2/pjsip-apps/src/pygui/application.py	(revision 4657)
+++ pjproject/branches/projects/pjsua2/pjsip-apps/src/pygui/application.py	(revision 4663)
@@ -191,4 +191,14 @@
 		self._onTimer()
 
+        def updateCall(self, acc):
+                iid = str(acc.randId)
+                for call in acc.callList:
+                        calliid = str(call.randId)
+                        uri, status = call.statusText()
+                        if self.tv.exists(calliid):
+                                self.tv.item(call.iid, text=uri, values=(status,))
+                        else:
+                                call.iid = self.tv.insert(iid, 0, calliid, open=True, text=uri, values=(status,))
+
 	def updateAccount(self, acc):
 		iid = str(acc.randId)
@@ -270,5 +280,5 @@
 		self.accMenu = tk.Menu(top, tearoff=False)
 		# Labels, must match with _onAccContextMenu()
-		labels = ['Unregister', 'Reregister', 'Add buddy...', '-',
+		labels = ['Call', '-', 'Unregister', 'Reregister', 'Add buddy...', '-',
 			  'Online', 'Invisible', 'Away', 'Busy', '-',
 			  'Settings...', '-',
@@ -351,5 +361,7 @@
 			return
 		
-		if label=='Unregister':
+                if label=='Call':
+                        acc.makeCall()
+		elif label=='Unregister':
 			acc.setRegistration(False)
 		elif label=='Reregister':
Index: pjproject/branches/projects/pjsua2/pjsip-apps/src/pygui/call.py
===================================================================
--- pjproject/branches/projects/pjsua2/pjsip-apps/src/pygui/call.py	(revision 4663)
+++ pjproject/branches/projects/pjsua2/pjsip-apps/src/pygui/call.py	(revision 4663)
@@ -0,0 +1,69 @@
+# $Id$
+#
+# pjsua Python GUI Demo
+#
+# Copyright (C)2013 Teluu Inc. (http://www.teluu.com)
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
+#
+import sys
+if sys.version_info[0] >= 3: # Python 3
+	import tkinter as tk
+	from tkinter import ttk
+	from tkinter import messagebox as msgbox
+else:
+	import Tkinter as tk
+	import tkMessageBox as msgbox
+	import ttk
+
+import random
+import pjsua2 as pj
+import application
+
+# Call class
+class Call(pj.Call):
+	"""
+	High level Python Call object, derived from pjsua2's Call object.
+	"""
+	def __init__(self, app, acc, callId):
+		pj.Call.__init__(self, acc, callId)
+		self.app = app
+                self.acc = acc
+                self.uri = ''
+                self.randId = random.randint(1, 9999)
+
+	def statusText(self):
+                uri = ''
+		status = '?'
+		if self.isActive():
+			ci = self.getInfo()
+                        status = ci.stateText
+                        uri = ci.remoteURI
+		else:
+			status = '- not established -'
+		return uri, status
+	
+	def onCallState(self, prm):
+                ci = self.getInfo()
+                if ci.state == pj.PJSIP_INV_STATE_DISCONNECTED:
+                        iid = str(self.randId)
+			self.acc.callList.remove(self)
+			self.app.tv.delete( (iid,) )
+                        del self
+                else:
+                        self.app.updateCall(self.acc)
+
+if __name__ == '__main__':
+	application.main()
