[Serusers] Using forward_tcp help

Greger V. Teigre greger at teigre.com
Mon Oct 9 10:05:58 CEST 2006


I would put a break after save_noreply() if I were you (to avoid calling 
save later on)
and then you don't really need the second test for ips (enclosing the 
forwards).
Except from that, it looks ok.
g-)


Nhadie Ramos wrote:
> Hi All,
>
> I have the REGISTER part of my ser.cfg below, what do you think is 
> wrong because it doesn't replicate it.
> Do i have to do any changes on parameters of required modules?
>
>
>                if (method=="REGISTER") {
>
>                        if ((src_ip=="10.10.10.20") || 
> (src_ip=="10.10.10.30")) {
>                                if (isflagset(8)) {xlog("L_INFO", 
> "Register: Source is either 10.10.10.20 or 10.10.10.30\n");};
>                                save_noreply("location");
>                        } else if (!www_authorize("mydomain.com", 
> "subscriber")) {
>                                if (isflagset(8)) {xlog("L_INFO", 
> "Register: asking for authentication\n");};
>                                www_challenge("mydomain.com", "0");
>                                break;
>                        };
>
>                        if (isflagset(8)) {xlog("L_INFO", "Register: 
> Authorized, saving location\n");};
>
>                        if (!save("location")) {
>
>                                sl_reply_error();
>
>                        } else {
>                                if (isflagset(8)) {xlog("L_INFO", 
> "Register: Authorized, saving location\n");};
>
>                                if ((!src_ip=="10.10.10.20") || 
> (!src_ip=="10.10.10.30")) {
>                                        if (isflagset(8)) 
> {xlog("L_INFO", "Register: Replicating to 10.10.10.20\n");};
>                                        forward_tcp("10.10.10.20", 5060);
>                                        forward_tcp("10.10.10.30", 5060);
>                                };
>                        };
>                        break;
>                };
>
> _______________________________________________
> Serusers mailing list
> Serusers at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serusers
>
>



More information about the sr-users mailing list