Skip to content

Instantly share code, notes, and snippets.

@eloycoto
Created May 26, 2017 08:58
Show Gist options
  • Save eloycoto/38385b9114bb747e7057442e008b3be4 to your computer and use it in GitHub Desktop.
Save eloycoto/38385b9114bb747e7057442e008b3be4 to your computer and use it in GitHub Desktop.
#!KAMAILIO
debug=4
log_facility=LOG_LOCAL7
log_name="kamailio"
mpath="/usr/lib/x86_64-linux-gnu/kamailio/modules/"
loadmodule "sl.so"
loadmodule "pv.so"
loadmodule "tm.so"
loadmodule "tmx.so"
loadmodule "textops.so"
loadmodule "xlog.so"
loadmodule "tsilo.so"
loadmodule "http_async_client.so"
loadmodule "usrloc.so"
loadmodule "registrar.so"
modparam("http_async_client", "connection_timeout", 10000)
modparam("http_async_client", "tls_verify_host", 0)
modparam("http_async_client", "tls_verify_peer", 0)
modparam("tsilo", "hash_size", 1024)
modparam("tsilo", "use_domain", 1)
debug=2
log_stderror=no
pv_buffer_size=4096
request_route {
$avp(test)="10";
xlog("REQUEST_ROUTE|test=$avp(test)");
$var(target_url) = "http://localhost:9000/data.json";
http_async_query("$var(target_url)", "HTTP_REPLY");
sl_send_reply("200", "OK");
exit;
}
route[HTTP_REPLY] {
xlog("HTTP_REPLY|test=$avp(test)");
xlog("L_INFO", "HTTP_REPLY| body='$http_rb'");
}
May 26 09:58:21 kamailio[11064]: ERROR: <script>: REQUEST_ROUTE|test=10
May 26 09:58:21 kamailio[11091]: ERROR: <script>: HTTP_REPLY|test=<null>
May 26 09:58:21 kamailio[11091]: INFO: <script>: HTTP_REPLY| body='{"lola": 1}#012'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment