[SR-Users] error handling

Oliver Roth oliver.roth at triotel.ch
Sun Nov 24 20:44:05 CET 2013

Sorry – I do not understand what you mean …

I added the following code at the end of the failure_route – seems to work

        if (t_grep_status("404")){
                xlog("L_INFO", "ORO Status 404 - not found");
                t_reply("404", "not found");

Von: sr-users-bounces at lists.sip-router.org [mailto:sr-users-bounces at lists.sip-router.org] Im Auftrag von Brandon Armstead
Gesendet: Sonntag, 24. November 2013 20:41
An: Kamailio (SER) - Users Mailing List
Cc: Kamailio (SER) - Users Mailing List
Betreff: Re: [SR-Users] error handling


Sent from my iPhone

On Nov 24, 2013, at 11:20 AM, Oliver Roth <oliver.roth at triotel.ch<mailto:oliver.roth at triotel.ch>> wrote:
Hi all

Question about error handling with kamailio.

We send call to carrier and get back error 404.
In carrierfailureroute we catch up this error and send call to an internal freeswitch that plays a voiceprompt saying: “destination not available”

In accounting this calls is collected like a “normal” call – cause the internal freeswitch did the connection.
I would like to play the voiceprompt but get the error 404 and see the call in the missed calls acc table.

With 486 (busy) it is simple because we do not need an rtp response … just fast busy.

How can we handle this for errors we need to play a voiceprompt?

What we do in failure route:

failure_route[MANAGE_FAILURE] {

        if (t_grep_status("486")){
                xlog("L_INFO", "Status 486 - busy");
                t_reply("486", "Busy");


        if (t_is_canceled()) {

        xlog("L_INFO", "failure_route rd: $rd replCode:  $T_reply_code trunk_in: $avp(s:trunk_in) Tree: $avp(s:tree), rU:  $rU, todirection $avp(s:todirection) fu: $fu\n");

        if(!cr_next_domain("$avp(s:cr_pref_carr)", "$avp(s:tree)", "$rU", "$avp(s:trunk_in)", "$T_reply_code", "$avp(s:tree)" )){
                xlog("cr_next_domain failed");

        if(!cr_route("$avp(s:cr_pref_carr)", "$avp(s:tree)", "$rU", "$rU", "call_id", "$avp(s:todirection)" )){
                xlog("cr_route failed");

        xlog("L_INFO", "failure_route rd: $rd replCode:  $T_reply_code trunk_in: $avp(s:trunk_in) Tree: $avp(s:tree), rU:  $rU, todirection $avp(s:todirection) fu: $fu \n");
        $avp(s:trunk_out) = $avp(s:todirection);

        xlog(, "L_INFO", "RELAY - FailureRoute: Outbound sent via $avp(s:trunk_out) rU $rU -------------------------------------------------------- ");
        if (is_method("INVITE"))
                setflag(FLT_ACC); # do accounting
                setflag(FLT_ACCMISSED); # oro 28.10.13



        if (!t_relay()) {
                xlog("failureroute t_relay failed");

SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users at lists.sip-router.org<mailto:sr-users at lists.sip-router.org>
E-Mail ist virenfrei.
Von AVG überprüft - www.avg.de<http://www.avg.de>
Version: 2014.0.4158 / Virendatenbank: 3629/6863 - Ausgabedatum: 24.11.2013
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20131124/a4780ef8/attachment.html>

More information about the sr-users mailing list