Hi,
that's very strange, your usage of the module is fine (at least the
snippet you posted), so there must be something else.
Did you take a trace between kamailio and the http server, as suggested?

Regards,

Federico

On Sun, Feb 15, 2026 at 1:59 PM Sarju Garg <[email protected]> wrote:
>
> Hi Federico,
>
> Thanks. We were making some more changes, and we see that this kind of 
> configuration does not work
>
> $http_req(hdr) =
> "Content-Type: application/json\r\n"
> "Accept: application/json\r\n"
> "Connection: keep-alive";''
>
> We upgraded the version to 6.1, and also we changed the line as you rightly 
> points but the print is not happening, but now with these 2 changes
>
> $http_req(hdr) ="Content-Type: application/json";
> $http_req(hdr) =""Accept: application/json";
> $http_req(hdr) =""Connection: keep-alive";''
>
> And a version upgrade. I am not sure if it helped
>
> Regards
> Sarju
>
>
> On 15/02/26, 2:33 PM, "Federico Cabiddu" <[email protected] 
> <mailto:[email protected]>> wrote:
>
>
> Hi,
> are you sure that the body of the request is actually empty?
> In your code you log its value before setting it so it's obviously
> null at that point.
> Can you take a trace between kamailio and the http server to look at
> the actual request? Do you have access to the http server's log to
> understand with it's replying 400?
>
>
> Regards,
>
>
> Federico
>
>
> On Sun, Feb 15, 2026 at 6:58 AM Sarju Garg <[email protected] 
> <mailto:[email protected]>> wrote:
> >
> > Hi all,
> >
> >
> >
> > We are new to Kamailio world.
> >
> >
> >
> > I have written a very small code, where we want to just receive INVITE and 
> > send 480 and trigger external application on http interface. I am only 
> > sending 1 INVITE/ACK request for now.
> >
> >
> >
> > Code:
> >
> > request_route {
> >
> > t_newtran();
> >
> > xlog("L_WARN", "APP-1 Receive Incoming call $rm\n");
> >
> > t_send_reply("480", "Temporarily Unavailable");
> >
> > jansson_set("string", "callingMSISDN", "calling", "$var(body)");
> >
> > xlog(" OUT => BODY:\n$var(body)\n");
> >
> > xlog("HTTP OUT => BODY:\n$http_req(body)\n");
> >
> > $http_req(suspend) = 0;
> >
> > $http_req(body) = $var(body);
> >
> > http_async_query(http://10.20.10.120:7000/v1/mca-events 
> > <http://10.20.10.120:7000/v1/mca-events>, "HTTP_REPLY");
> >
> > exit;
> >
> >
> >
> > Output
> >
> >
> >
> > loading modules under config path: /usr/local/lib64/kamailio/modules/
> >
> > Listening on
> >
> > udp: 10.20.10.119:5065
> >
> > Aliases:
> >
> > udp: signaling-server1:5065
> >
> > *: 10.20.10.119:*
> >
> >
> >
> > 1(37861) WARNING: <script>: APP-1 Receive Incoming call INVITE
> >
> > 1(37861) ERROR: <script>: OUT => BODY:
> >
> > {"callingMSISDN":"calling"}
> >
> > 1(37861) ERROR: <script>: HTTP OUT => BODY:
> >
> > <null>
> >
> > 2(37862) WARNING: <script>: APP-1 Receive Incoming call ACK
> >
> > 2(37862) ERROR: <script>: OUT => BODY:
> >
> > {"callingMSISDN":"calling"}
> >
> > 2(37862) ERROR: <script>: HTTP OUT => BODY:
> >
> > <null>
> >
> > 8(37868) ERROR: <script>: HTTP request failed or returned error: <null>, 
> > status: 400
> >
> > 8(37868) ERROR: <script>: HTTP request failed or returned error: <null>, 
> > status: 400
> >
> >
> >
> > We are not able to set the parameter in body. For now a dummy value in 
> > inserted.
> >
> >
> >
> > As per 
> > https://www.kamailio.org/docs/modules/stable/modules/http_async_client.html 
> > <https://www.kamailio.org/docs/modules/stable/modules/http_async_client.html>
> >
> >
> >
> > http_req is allowed in async calls.
> >
> >
> >
> > The following is the version.
> >
> >
> >
> > root@signaling-server1:/usr/local/etc/kamailio# kamailio -v
> >
> > version: kamailio 6.0.5 (x86_64/linux) 900efe
> >
> > flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, 
> > USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, MEM_JOIN_FREE, Q_MALLOC, 
> > F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, 
> > USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, 
> > HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
> >
> > ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_SEND_BUFFER_SIZE 
> > 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
> >
> > poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
> >
> > id: 900efe
> >
> > compiled on 17:28:47 Feb 6 2026 with gcc 13.3.0
> >
> >
> >
> > Also, I want to maintain HTTP Connection so plan to use $http_hdr for 
> > Connection: KeepAlive.
> >
> >
> >
> > Please guide us in this matter.
> >
> >
> >
> > Regards
> >
> > Sarju
> >
> >
> >
> >
> >
> > Important: keep the mailing list in the recipients, do not reply only to 
> > the sender!
>
>
>
_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to