- Timestamp:
- Dec 13, 2013 1:28:16 AM (11 years ago)
- Location:
- pjproject/branches/projects/pjsua2/pjsip-apps/src/pygui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/pjsua2/pjsip-apps/src/pygui/account.py
r4686 r4690 52 52 self.deleting = False 53 53 54 """ 55 def findBuddy2(self, uri): 56 # TODO: proper URI comparison 57 for bud in self.buddyList: 58 if bud.cfg.uri in uri or uri in bud.cfg.uri: 59 return bud 60 return None 61 """ 62 63 def findChat(self, uri_str, call_inst = None): 54 def findChat(self, uri_str): 64 55 uri = ch.ParseSipUri(uri_str) 65 56 if not uri: return None 66 57 67 58 for chat in self.chatList: 68 if chat.isUriParticipant(uri): 69 if call_inst and chat.isCallRegistered(call_inst): 70 return chat 71 elif not call_inst and chat.isPrivate(): 72 return chat 59 if chat.isUriParticipant(uri) and chat.isPrivate(): 60 return chat 73 61 return None 74 62 -
pjproject/branches/projects/pjsua2/pjsip-apps/src/pygui/chat.py
r4687 r4690 182 182 return uri in self._participantList 183 183 184 def isCallRegistered(self, call_inst):185 return call_inst in self._callList186 187 184 def registerCall(self, uri_str, call_inst): 188 185 uri = ParseSipUri(uri_str) … … 200 197 if show_text_chat: 201 198 self._gui.textShowHide(True) 202 203 # helper204 def dumpParticipantList(self):205 print "Number of participants: %d" % (len(self._participantList))206 for b in self._participantList:207 print b.cfg.uri208 199 209 200 def addParticipant(self, uri, call_inst=None): … … 264 255 265 256 def setTypingIndication(self, from_uri_str, is_typing): 266 267 268 269 257 # notify GUI 258 self._gui.textSetTypingIndication(from_uri_str, is_typing) 259 # now relay to all participants 260 self._sendTypingIndication(is_typing, from_uri_str) 270 261 271 262 def startCall(self): … … 274 265 call_param.opt.audioCount = 1 275 266 call_param.opt.videoCount = 0 267 fails = [] 276 268 for idx, p in enumerate(self._participantList): 277 269 # just skip if call is instantiated 278 if len(self._callList)>=idx+1 andself._callList[idx]:270 if self._callList[idx]: 279 271 continue 280 272 … … 288 280 except: 289 281 self._callList[idx] = None 290 self._gui.audioUpdateState(bud.cfg.uri, gui.AudioState.FAILED) 282 self._gui.audioUpdateState(uri_str, gui.AudioState.FAILED) 283 fails.append(p) 291 284 292 # kick the disconnected participant, but the last (avoid zombie chat) 293 if not self.isPrivate(): 294 self.kickParticipant(p) 285 for p in fails: 286 # kick participants with call failure, but spare the last (avoid zombie chat) 287 if not self.isPrivate(): 288 self.kickParticipant(p) 295 289 296 290 def stopCall(self): … … 301 295 c.hangup(pj.CallOpParam()) 302 296 303 if not self.isPrivate():304 self.kickParticipant(p)305 306 297 def updateCallState(self, thecall, info = None): 307 298 # info is optional here, just to avoid calling getInfo() twice (in the caller and here) -
pjproject/branches/projects/pjsua2/pjsip-apps/src/pygui/chatgui.py
r4686 r4690 246 246 self.btnRxMute = ttk.Button(self.rxVolFrm, width=8, text='Mute', command=self._onRxMute) 247 247 self.btnRxMute.pack(side=tk.LEFT) 248 self.rxVol = tk.Scale(self.rxVolFrm, orient=tk.HORIZONTAL, from_=0.0, to=10.0, showvalue= 0) #, tickinterval=10.0, showvalue=1)248 self.rxVol = tk.Scale(self.rxVolFrm, orient=tk.HORIZONTAL, from_=0.0, to=10.0, showvalue=1) #, tickinterval=10.0, showvalue=1) 249 249 self.rxVol.set(5.0) 250 250 self.rxVol.bind("<ButtonRelease-1>", self._onRxVol)
Note: See TracChangeset
for help on using the changeset viewer.