Question regarding SIP and HTTP Call Flow Control

18 views
Skip to first unread message

phoenix6789

unread,
Jan 20, 2010, 12:59:18 AM1/20/10
to Sipper
Hi,

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.

Nasir Khan

unread,
Jan 20, 2010, 1:54:44 AM1/20/10
to sip...@googlegroups.com
Using Timers is not that complicated, you can use code similar to the following.

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.

phoenix6789

unread,
Jan 20, 2010, 11:56:14 PM1/20/10
to Sipper
Thanks that did the trick. For what I'm testing I need to send the
response before sending a subsequent message.

regards,

Dave.

Reply all
Reply to author
Forward
0 new messages