[SR-Users] Processing Async HTTP Requests in Real-time

Brett Nemeroff brett+kamailio at voicefoxtelephony.com
Thu Aug 18 23:50:36 CEST 2022


Hello Kamailio Team!

I've tried following the documentation for http_async_query() with
suspend=1 and not getting results I'm expecting. Perhaps I'm
misunderstanding the documentation.

Basically I'm performing a http_async_query() with suspend set to 1 and a
"route_name" set to HTTP_REPLY.

When my query executes, it appears that Kamailio stops processing in that
route block, suspends, and then when a reply is available, it continues in
HTTP_REPLY. That makes sense. I pull the return value and set some $var and
$avp. When I get to the end of the HTTP_REPLY block, I'm EXPECTING it to
RESUME FROM the suspended location from the original route block, which it
does NOT seem to do. Is that expected?

For what it's worth, I did test just continuing my route logic in
HTTP_REPLY and just forgetting about the original route block (moved all
the remaining processing logic into HTTP_REPLY) However, existing $avp and
$vars that were already set within the transaction were not set. So that's
not possible either.

I'm pretty sure there is a right way to do this without getting hacky. Can
someone help me out?

And yes, I know what I'm trying to do sounds like sync, but I want async to
handle high volume and the potential for my external URL to lightly block.
I believe the right way to do this is with async+suspending.

Thank you,
Brett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20220818/32b7e196/attachment.htm>


More information about the sr-users mailing list