[Serusers] mangling request URI according to To: and userlocation value

Francesco Fondelli francesco.fondelli at gmail.com
Tue Oct 18 10:50:25 CEST 2005


Hi all,

let's say SER receives this invite:

INVITE sip:foopbx at ip.com SIP/2.0
Via: ...
To: "058633345880101" <058633345880101 at ip.com>
[cut]

and assume that there is an entry in the user location table
for ''foopbx at ip.com" (ie it registered with SER)

and assume that entry in userloc has a "Server: Bar 1.0 PBX" value


I'm wondering if is possible to do something like that:

	if (!lookup("location")) {
    		log(1, "User not in user database...\n");
		route(whatever);
		break;
	};

        if(get_server_string_from_userloc() =~ "Bar 1.0 PBX") {
                take the number from the "To:" header and
                write it in the request uri. So the forwarded msg will
look like:
                INVITE sip:058633345880101 at ip.com SIP/2.0
                Via: ...
                To: "058633345880101" <058633345880101 at ip.com>
                [cut]
        };


thank you very much, I really need your help

Ciao
FF




More information about the sr-users mailing list