I'm at a bit of a loss, I've got a number of SER proxies in use and all are working quite well with one exception.
I've configured the proxies to sit between SIP handsets and a SIP capable PBX. All phones register with the proxy at their location and the PBX makes all requests for phones to the proxy. This normally works well. However, for the phones to be able to place outbound calls, I configured the SER proxy to pass all location lookup failures on to the PBX. The PBX then (seeing the request from a registered location) will place the call out. All of this works fine.
The problem comes when one of the phones is not registered properly with the SER proxy and the PBX requests it. The request fails the location lookup and is sent back to the PBX. To correct this I've tried matching the "src_ip" to see if the request is from the PBX however this doesn't appear to work. I have the following condition in the ser.cfg, shouldn't this stop requests from 1.2.3.4 being sent back to 1.2.3.4?
if (!lookup("location")) {
log(1, "Location lookup failure.");
if (src_ip=="1.2.3.4") || (src_ip=="1.2.3.6") {
log(1, "Request from first server."); sl_reply_error();
} else {
rewritehost("1.2.3.4"); log (1, "Sending request to the first server."); t_on_negative("1"); t_relay(); };
break; };
Hi,
On Wednesday 21 May 2003 23:14, Jamin W. Collins wrote:
The problem comes when one of the phones is not registered properly with the SER proxy and the PBX requests it. The request fails the location lookup and is sent back to the PBX. To correct this I've tried matching the "src_ip" to see if the request is from the PBX however this doesn't appear to work. I have the following condition in the ser.cfg, shouldn't this stop requests from 1.2.3.4 being sent back to 1.2.3.4?
if (!lookup("location")) {
log(1, "Location lookup failure."); if (src_ip=="1.2.3.4") || (src_ip=="1.2.3.6") {
^ ^ ^ ^ Please remove the "" around the IPs. And i'm not sure if the () || () works for an if. Please try (()||()) instead to be safe (optional it should be possible to ommit the brackets around the IP compares e.g. (||) ).
log(1, "Request from first server."); sl_reply_error(); } else { rewritehost("1.2.3.4"); log (1, "Sending request to the first server."); t_on_negative("1"); t_relay();
This statement causes the behavior you are describing. You set the destination to 1.2.3.4 and rely it.
Regards Nils Ohlmeier
}; break;
};
On May 21, 2003 at 23:23, Nils Ohlmeier nils@iptel.org wrote:
Hi,
On Wednesday 21 May 2003 23:14, Jamin W. Collins wrote:
The problem comes when one of the phones is not registered properly with the SER proxy and the PBX requests it. The request fails the location lookup and is sent back to the PBX. To correct this I've tried matching the "src_ip" to see if the request is from the PBX however this doesn't appear to work. I have the following condition in the ser.cfg, shouldn't this stop requests from 1.2.3.4 being sent back to 1.2.3.4?
if (!lookup("location")) {
log(1, "Location lookup failure."); if (src_ip=="1.2.3.4") || (src_ip=="1.2.3.6") {
^ ^ ^ ^
Please remove the "" around the IPs.
This is a bug. I will fix it. Anyway is faster not to use "" (using quotes will perform a rev. dns lookup if the argument is a name and not an ip).
And i'm not sure if the () || () works for an if. Please try (()||()) instead
It works (or at least it should).
Andrei