[Users] Create 302 message and modify contact header

Daniel-Constantin Mierla daniel at voice-system.ro
Tue Aug 22 16:03:39 CEST 2006


If you got OpenSER sources, look into examples directory, you have a 
redirect.cfg file. Online, you can browse it via:

http://openser.cvs.sourceforge.net/openser/sip-server/examples/redirect.cfg?revision=1.2&view=markup

Cheers,
Daniel


On 08/22/06 16:58, Christophe Irles wrote:
>  
> 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 at test.fr and you change the message to A call B at test.com 
> <mailto:B at test.com>
>  
> Christophe
>
> ------------------------------------------------------------------------
> *De :* Greg Fausak [mailto:lgfausak at 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 at christophe.fr 
>> <mailto:test at 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 at openser.org <mailto:Users at openser.org>
>> http://openser.org/cgi-bin/mailman/listinfo/users
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/users
>   




More information about the Users mailing list