So far Sipper has been awesome at giving me one-stop-shop control of a
fairly complex scenario that fell apart rather quickly with my
previous attempts at chaining different tools together to get the same
call flow working. I managed to get the call flow operational using
SIPp and SoapUI...but the scenario quickly fell apart under traffic.
I think Sipper has the functionality that I need to get my scenario
working.
However, I've hit a call-flow control problem and I'm not sure the
best way to resolve it. I started down a path of trying to use states
and timers...but that ugly really fast...and I figured there must some
magic that I'm missing.
What I need to do is send a SIP Request message after sending back an
HTTP response. If I could figure out a way to forcefully send the
HTTP response immediately rather than letting the method return, then
I could launch the SIP message from the on_http_request() method().
Do you have any suggestions on the simplest way of accomplishing
this?
thanks,
Dave Adams.
def on_http_get(req, res, session)
res.body = "<HTML>Sending some HTML data back</HTML>"
res['Content-Type'] = "text/html"
session.schedule_timer_for("send_notify", 10)
end
def on_timer(session, task)
if task.tid == "send_notify"
session.request_with("notify")
end
end
This would trigger right after sending the HTTP response. In SIPr we are using the Ruby HTTP Servlet API underneath and the responses are sent on method return.
Alternatively if your call flow permits you can send the SIP request before returning from the on_http method and thereby you may not need to set timers.
Hope this helps.
regards,
Dave.