[Serusers] maxfwd.so and problems with "mf_process_maxfwd_header()" function

reticent tavis.lists at galaxytelecom.net
Wed May 11 22:58:34 CEST 2005


After a little testing it seems that the problem is related to calling
"mf_process_maxfwd_header()" more than once before the call is routed.

So the function is dealing with the sip message as it came in instead of
the in-memory copy (where the header has already been added)

Perhaps it would be useful if the "mf_process_maxfwd_header()" was able
to work with the in-memory copy of a sip message.  For people who are
doing dynamic call forwarding it is useful to have this feature to catch
forwarding loops for local users

Tests Done:

1. create a simple config with only several maxfwd lines, a t_relay()
and a break;
--
if ( !mf_process_maxfwd_header("10") )
{
    if ( method != "ACK" )
    {
        sl_send_reply("483", "Too many hops");
    }

    log(1, "Message Max-Forwards == 0");
    break;
}

if ( !mf_process_maxfwd_header("10") )
{
    if ( method != "ACK" )
    {
        sl_send_reply("483", "Too many hops");
    }

    log(1, "Message Max-Forwards == 0");
    break;
}


if ( !mf_process_maxfwd_header("10") )
{
    if ( method != "ACK" )
    {
        sl_send_reply("483", "Too many hops");
    }

    log(1, "Message Max-Forwards == 0");
    break;
}


if ( !mf_process_maxfwd_header("10") )
{
    if ( method != "ACK" )
    {
        sl_send_reply("483", "Too many hops");
    }

    log(1, "Message Max-Forwards == 0");
    break;
}

t_relay();
break;

--

reticent wrote:

>I've configured call forwarding in my SER script but to catch a
>situation where a user forwards to another user that is forwarding back
>to the first user i've added a second "if (
>!mf_process_maxfwd_header("10") )" stanza to the SER script.
>
>
>However, i'm finding that it will actually add additional "Max-Forwards"
>headers to the SIP message as opposed to decrimenting one that is
>already there:
>--
>Max-Forwards:  9.
>Record-Route: *REMOVED*
>Max-Forwards: 10.
>Max-Forwards: 10.
>--
>
>I am under the impression that when called the
>mf_process_maxfwd_header() function should search the message for the
>"Max-Forwards" header and only add additional headers if it is missing.
>
>tavis
>
>_______________________________________________
>Serusers mailing list
>serusers at lists.iptel.org
>http://lists.iptel.org/mailman/listinfo/serusers
>
>
>  
>





More information about the sr-users mailing list