Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Changing host part of the "TO&quo...

2010-06-14
2013-05-09
  • Pavel Despot
    Pavel Despot
    2010-06-14

    Hello, everyone.

    Ok, I'm ready for the comments… :)  For the life of me, I can't figure out how to change anything in the TO header. 

    I'm able to tweak the "FROM" using the uac_replace_from function, I can change the Request URI using the rewritehost function, but I can't figure out how to change the TO header!

    I can't find a function that does it and, according to the Scripting Variables page, the $tu variable is read only (I even tried it and no luck).

    I'm sure this is simple, but I just can't figure it out.

    Here's my latest attempt:

            if (is_method("REGISTER"))
            {
                    uac_replace_from("xxxxxxxxxx","sip:xxxxxxxxxx@someserver.com");
                    rewritehost("someserver.com");
                    $var(tu)="someserver.com";
                    forward("xxx.xxx.xxx.xxx");
            }

    As always, help is very much appreciated.

    Best regards,
    -Pavel

     
  • Hi Pavel,

    $tu is  a read-only variable :)

    But try the uac_replace_to() function, similar to uac_replace_from() - it is available starting with 1.6.

    Regards,
    Bogdan