From ac64b4d347d44102ffbcf14c7ad0c791d1f85cfc Mon Sep 17 00:00:00 2001 From: "Olle E. Johansson" Date: Fri, 3 Jun 2016 22:06:36 +0200 Subject: [PATCH] httpapitest Fixing test function --- test/mod_httpapitest/httpapitest.c | 2 +- test/mod_httpapitest/test/curlapi.cfg | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/test/mod_httpapitest/httpapitest.c b/test/mod_httpapitest/httpapitest.c index 0b68953d2c3..e9ee5381bfb 100644 --- a/test/mod_httpapitest/httpapitest.c +++ b/test/mod_httpapitest/httpapitest.c @@ -55,7 +55,7 @@ static int w_testcurl_connect(struct sip_msg* _m, char* _con, char * _url, char* /* Exported functions */ static cmd_export_t cmds[] = { - {"test_http_connect", (cmd_function)w_testcurl_connect, 2, fixup_testcurl_connect, + {"test_http_connect", (cmd_function)w_testcurl_connect, 3, fixup_testcurl_connect, fixup_free_testcurl_connect, REQUEST_ROUTE|ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE}, }; diff --git a/test/mod_httpapitest/test/curlapi.cfg b/test/mod_httpapitest/test/curlapi.cfg index 6082c707dd0..2dc29ab855f 100644 --- a/test/mod_httpapitest/test/curlapi.cfg +++ b/test/mod_httpapitest/test/curlapi.cfg @@ -18,16 +18,15 @@ loadmodule "xlog.so" # For extended logging with pseudovariables loadmodule "kex.so" # Kamailio extensions: # Script flags and basic mi commands (version, pwd, get_statistics) # -loadmodule "tm.so" # Transactions are needed in order to fork -loadmodule "tmx.so" # Kamailio extras to TM # loadmodule "sl.so" # Stateless replies - needed by registrar.so loadmodule "rtimer.so" # For ticks loadmodule "htable.so" # For init event route -loadmodule "http_client.so" # THe CURL module -loadmodule "httpapitest.so" # THe CURL module loadmodule "cfgutils.so" # Memory debugging +loadmodule "http_client.so" # The HTTP client module +loadmodule "httpapitest.so" # The HTTP client API test module -using the API to http_client.so + # main routing logic modparam("http_client", "connection_timeout", 42); @@ -48,11 +47,6 @@ onreply_route { xlog("L_INFO", "<-- Incoming response: $rs $rr - from $si\n"); } -branch_route[BRANCH_ROUTE] -{ - xlog("L_INFO", " --> Outgoing branch $T_branch_idx : $rm from $si to $ru \n"); -} - onsend_route { xlog("ONSEND --> Sending from $sndfrom(proto):$sndfrom(ip):$sndfrom(port) to $sndto(proto):$sndto(ip):$sndto(port) \n"); @@ -63,7 +57,7 @@ event_route[htable:mod-init] { xlog("L_ERR", "### Kamailio starting $timef(HH:mm) \n"); $avp(gurka) = ""; - $var(res) = http_connect("lisa", "", "$avp(gurka)"); + $var(res) = test_http_connect("lisa", "", "$avp(gurka)"); xlog("L_ERR", "-- Lisa http_client connection: $avp(gurka) Result $var(res)\n");