Stefan Sayer writes:
> onSessionStart is called when the session starts, which in master can
> also happen e.g. when the ACK is received.
> you can get the headers in onInvite
> def onInvite(self, hdrs):
> ...
> def onSessionStart(self):
> ...
stefan,
i placed header stuff to onInvite, but after that onSessionStart is
never called. below is a complete example. i only get to syslog
Oct 19 14:45:57 sip sems[23177]: [#b548ab70] [ivr_log, Ivr.cpp:78] INFO:
Ivr-Python: At announcement onInvite
and then invite request times out, i.e., the session is never started.
obviously i'm missing something big here. 1.4 version of the app works,
where there is no onIvite function and headers are handled in
onSessionStart.
-- juha
--------------------------------------------------------------------------
import os
from log import *
from ivr import *
from p_app_param.p_app_param import *
APPLICATION = "announcement"
announce = 1
disconnect = 2
class IvrDialog(IvrDialogBase):
def onInvite(self, hdrs):
info("At announcement onInvite")
self.params = P_App_Param(getHeader(hdrs, "P-App-Param"))
self.path = self.params.getKeyValue("Path")
if not self.path:
self.path = "/tmp/default_en.wav"
def onSessionStart(self):
info("At announcement onSessionStart")
self.announcement = IvrAudioFile()
self.announcement.open(self.path, ivr.AUDIO_READ, False)
self.enqueue(self.announcement, None)
def onEmptyQueue(self):
if not self.queueIsEmpty():
return
self.bye()
self.stopSession()
return
def onBye(self):
self.stopSession()
return
def onSipRequest(self, hdrs):
pass
def onSipReply(self, code, reason):
pass
_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev