[Serusers] Modified "To" header on REGISTER

caio elcaio at gmail.com
Fri Jan 30 19:03:11 CET 2009


Hi,

Does anybody know about this situation?
Please, any comment is welcome...
Thanks

Caio

caio escribió:
> Hello,
> 
> Does save() method of registrar module use original sip message or can 
> it use a modified one like for example by the subst() method of textops 
> module?
> 
> For example:
> 
> A coming "To" header of the a REGISTER is modified and then the save() 
> is called:
> 
> Code:
> # REGISTER
> subst_uri('/^(.*)sip:(ip_address)(.*)$/\1sip:mydomain\3/i');
> subst('/^To:(.*)sip:(.*)@(ip_address)(.*)$/To:\1sip:\2\@mydomain\4/i');
> save("location");
> 
> Log:
> 
> Jan 12 10:09:34 [/usr/sbin/ser] subst_run: matched (0, 17): 
> [sip:200.2.127.187]_
> Jan 12 10:09:34 [/usr/sbin/ser] textops: subst_uri_f: match - old uri= 
> [sip:ip_address], new uri= [sip:mydomain]_
> Jan 12 10:09:34 [/usr/sbin/ser] subst_run: running. r=0_
> Jan 12 10:09:34 [/usr/sbin/ser] subst_run: matched (172, 40): [To: 
> "579997" <sip:579997 at ip_address>_]_
> Jan 12 10:09:34 [/usr/sbin/ser] textops: subst_f: replacing at offset 
> 208 [To: "579997" <sip:579997 at ip_address>_] with [To: "579997" 
> <sip:579997 at mydomain>_]_
> 
> 
> Cheers..
> Caio




More information about the sr-users mailing list