Hi Daniel

I hope you are doing well. Looking for your support on kamailio.

I am a new for kamailio. I want to build setup OBD Based Missed Call Solution


  1.
I able to send http request on kamailio but call not getting dial due to some 
reason

Here is my code. Could you help me to resolve the issue.

#!KAMAILIO

####### Global Parameters #########

debug=3
log_stderror=yes
memdbg=5
memlog=5
children=8

tcp_accept_no_cl=yes
auto_aliases=no

listen=udp:172.26.12.138:5060
listen=tcp:0.0.0.0:8080

alias=your.public.ip   # optional

####### Modules Section ########

loadmodule "sl.so"
loadmodule "tm.so"
loadmodule "tmx.so"
loadmodule "rr.so"
loadmodule "pv.so"
loadmodule "xlog.so"
loadmodule "textops.so"
loadmodule "maxfwd.so"
loadmodule "sanity.so"
loadmodule "siputils.so"
loadmodule "xhttp.so"
loadmodule "uac.so"

####### Module Parameters ########

# --- TM
modparam("tm", "fr_timer", 5000)
modparam("tm", "fr_inv_timer", 30000)

# --- RR
modparam("rr", "enable_double_rr", 1)
modparam("rr", "append_fromtag", 1)

# --- UAC (authentication profile)
# format:
# name => sip:proxy, username, password
modparam("uac", "uac_reg",
    "obd => sip:GSM-Gateway-IP:5060,2555,123456"
)

####### Routing Logic ########

request_route {

    # Sanity checks
    if (!sanity_check("1511", "7")) {
        xlog("L_ERR", "Sanity failed\n");
        drop;
    }

    if (!mf_process_maxfwd_header("10")) {
        sl_send_reply("483", "Too Many Hops");
        exit;
    }

    # Handle HTTP requests
    if ($Rp == 8080 && $rm == "GET") {
        route(HTTP);
        exit;
    }

    # SIP requests (only outbound calls expected)
    if (is_method("INVITE")) {
        record_route();
        t_relay();
        exit;
    }

    if (is_method("ACK|BYE|CANCEL")) {
        t_relay();
        exit;
    }

    sl_send_reply("404", "Not Here");
    exit;
}

####### HTTP ROUTE ########

route[HTTP] {

    if ($hu =~ "^/call") {

        # Example:
        # http://IP:8080/call?msisdn=9999909109

        $var(msisdn) = $param(msisdn);

        if ($var(msisdn) == "") {
            xhttp_reply("400", "text/plain", "Missing msisdn\n");
            exit;
        }

        xlog("L_INFO", "HTTP Call request for $var(msisdn)\n");

        route(OBD_CALL);
        xhttp_reply("200", "text/plain", "Call initiated\n");
        exit;
    }

    xhttp_reply("404", "text/plain", "Invalid URL\n");
    exit;
}

####### OUTBOUND CALL ROUTE ########

route[OBD_CALL] {

    $var(dst_uri) = "sip:" + $var(msisdn) + "@GSM-Gateway-IP:5060";

    xlog("L_INFO", "Calling $var(dst_uri)\n");

    uac_req_send(
        "INVITE",
        $var(dst_uri),
        "sip:[email protected]",
        "sip:" + $var(msisdn) + "@your.domain",
        "",
        "obd"
    );

    exit;
}


_______________________________________________
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