drouting and strip

dpinedo
2013-02-11
2013-05-09
  • dpinedo
    dpinedo
    2013-02-11

    Hello,

    I'm trying to use the dynamic  routing module and the strip function.
    I'd like to route calls in function of a prefix I add in the SIP URI, and when the route has been resolved I'd like to strip the prefix.
    I have tried setting the parameter strip in the dr_gateways, but doesn't strip nothing from the to_uri.
    I have tried using the strip(int) function but only works if I invoke it before to invoke the route() function, and that is not valid for me because I use that prefix for routing.

    Any Idea?

     
  • dpinedo
    dpinedo
    2013-02-12

    The problem seems to be, that the SIP URI is modified along the script, but when the INVITE is forwarded it does it with the original to_URI.

    But I don't know how to solve it.

     
  • dpinedo
    dpinedo
    2013-02-12

    I have been trying without using the dynamic routing module, doing a forward directly, but I obtain the same result.
    # account only INVITEs
    if (is_method("INVITE")) {
    xlog("calling route3 $ru\n");
    strip(2);
    xlog("calling route3 $ru\n");
    forward("89.1.10.172");
    exit;
    }

    Using this script I can see in the first log the complete URI, on the second log I can see that the strip has been done correctly, but when I receive the call in the 89.1.10.172 machine I receive the complete URI (without strip).

    I don't know what I'm doing wrong.
    Any idea?

     
  • dpinedo
    dpinedo
    2013-02-12

    I have find the solution,
    The problem is that the strip doesn't modify the to header. My server (a PRISM server) takes the to header, so I was seeing the uri without strip.
    I have solved it modifying the to header:
    uac_replace_to("$ru");