[Users] Contact header modification

Stefan Jenkner stefan.jenkner at s2005.tu-chemnitz.de
Tue Mar 27 12:00:02 CEST 2007


Michel Bensoussan wrote:
> Hello.
>
> Is there a way to modify the contact header?
>
> For example:
>
>                        
> REGISTER                                                           
> REGISTER
> UA -----------------------------------------------> openser
> ----------------------------------------------------> Registrar
> IP:1.0.0.1      contact: ua at 1.0.0.1             
> IP:1.0.0.2                   contact: ua at 1.0.0.2
>
> The idea is to ensure that incoming call (INVITE) will path through
> the openser.

Hello,

I have the same problem und tried this (won't work).
I think that the public ip address of the ua is the problem.

if(is_method("REGISTER") && uri!=myself )
{
    xlog("L_ALERT", "CONTACT: $ct\n");
   
    # trying 1
    subst('/^Contact:(.*)@[a-zA-Z0-9.]+(.*)$/Contact:\1 at 1.0.0.2\2/ig');
   
    # trying 2
    if(remove_hf("Contact")) {
       insert_hf("Contact: <sip:bob at 1.0.0.2;transport=udp>\r\n","CSeq");
    }
   
    # trying 3
    # modification of fix_contact(), expand rfc1918nets to

    # trying 4
    #expansion of  rfc1918nets[] in mediaproxy.c

    # trying 5
    #set src_ip to 1.0.0.2, then run fix_contact();
    #does it make sense? if yes, how to do this?

    xlog("L_ALERT", "CONTACT: $ct (FIXED?)\n");

}

Is there anyone out there that can help?

Thanks in advance,
 Stefan Jenkner






More information about the Users mailing list