Before to reply a 302, I need to change the contact header in order to specify the URI of the new callee.
 
For example A call B, but from the config file I know B wants to redirect calls to C. So I must specify the URI of user C in the contact header of the 302 message
 
In your example, you change only the domain:
A call B@test.fr and you change the message to A call B@test.com
 
Christophe


De : Greg Fausak [mailto:lgfausak@gmail.com]
Envoyé : mardi 22 août 2006 15:44
À : Christophe Irles
Cc : OpenSER
Objet : Re: [Users] Create 302 message and modify contact header

I don't know if this is right, but:

if(is_method("INVITE"))
{
rewritehostport("test.com");
sl_send_reply("302", "Moved Temporarily");
}

seems to work for me.

I'd try loading some branches if you want more than one
item in the contact header. Just guessing though, I'm usually
the recipient of a 302!

-g

On Aug 22, 2006, at 8:24 AM, Christophe Irles wrote:

Hi,

I checked archive without any result... >From an openSER rule, I want to create a 302 message if a specific RURI is used.

First I need to change the contact header to specify the URI of the new callee.

I tried something like that:
avp_printf("$avp(s:100)", "sip:test@christophe.fr;target=$ruri;cause=486;");
avp_pushto("$ct", "$avp(s:100)"); # => error generated on this line

ERROR:avpops:fixup_pushto_avp: unsupported destination "$ct"; expected $ru,$du,$br

So how can I modify the contact header ?

Just after the update on the contact header I envisaged to use this function
sl_send_reply(302, "Moved Temporarily")

Is it correct ? Is there a better way to 'create' 302 message in this case ?
I check UAC_REDIRECT module but I don't think I can use it in this case or perhaps I missed something

Before to use a 302 message I succesfully tested to create a new INVITE with the $ruri modified correctly. But I would like to create a 302 message to prevent any problem of authentication.

Thanks,
Christophe

_______________________________________________
Users mailing list
Users@openser.org
http://openser.org/cgi-bin/mailman/listinfo/users