Hi there,
I was trying to do this in OpenSER 1.2.2: failure_route[1] { if (t_check_status("302")){ xlog("L_ERR", "302 source ip address is $si"); if (src_ip == 192.168.5.1) { # Do something }; }; };
But the proxy sending the 302 (192.168.5.1) is not the one who ends up in my logs, instead my sip-server (192.168.1.1) who initiated the call ends up in the log.
"302 source ip address is 192.168.1.1".
Have I understood the "$si" psuedo variable wrong? Can I find the correct source address of the 302-message somehow?
Br, /Tobias
Hi Tobias,
It is nothing bogus or funny :)...
Shortly, in failure route, you re-process the original INVITE (and not the reply that trigger the route). So you will see the source ip of the request ;).
For more on this, see the admin training material : http://www.voice-sistem.ro/downloads/2007.08.29-Admin-Course/
Regards, Bogdan
Tobias Lindgren wrote:
Hi there,
I was trying to do this in OpenSER 1.2.2: failure_route[1] { if (t_check_status("302")){ xlog("L_ERR", "302 source ip address is $si"); if (src_ip == 192.168.5.1) { # Do something }; }; };
But the proxy sending the 302 (192.168.5.1) is not the one who ends up in my logs, instead my sip-server (192.168.1.1) who initiated the call ends up in the log.
"302 source ip address is 192.168.1.1".
Have I understood the "$si" psuedo variable wrong? Can I find the correct source address of the 302-message somehow?
Br, /Tobias
Users mailing list Users@lists.openser.org http://lists.openser.org/cgi-bin/mailman/listinfo/users
Hi Bogdan,
cool, didn't know that, thanks!
Br, /Tobias
Bogdan-Andrei Iancu said the following on 2008-02-15 15:26:
Hi Tobias,
It is nothing bogus or funny :)...
Shortly, in failure route, you re-process the original INVITE (and not the reply that trigger the route). So you will see the source ip of the request ;).
For more on this, see the admin training material : http://www.voice-sistem.ro/downloads/2007.08.29-Admin-Course/
Regards, Bogdan
Tobias Lindgren wrote:
Hi there,
I was trying to do this in OpenSER 1.2.2: failure_route[1] { if (t_check_status("302")){ xlog("L_ERR", "302 source ip address is $si"); if (src_ip == 192.168.5.1) { # Do something }; }; };
But the proxy sending the 302 (192.168.5.1) is not the one who ends up in my logs, instead my sip-server (192.168.1.1) who initiated the call ends up in the log.
"302 source ip address is 192.168.1.1".
Have I understood the "$si" psuedo variable wrong? Can I find the correct source address of the 302-message somehow?
Br, /Tobias
Users mailing list Users@lists.openser.org http://lists.openser.org/cgi-bin/mailman/listinfo/users
Bogdan,
can you please hint me of a way to make decisions with the information in the 302? Could I use the "on_reply"-route for this or am I still only re-processing INVITEs there aswell?
Br, /Tobias
Tobias Lindgren said the following on 2008-02-15 15:28:
Hi Bogdan,
cool, didn't know that, thanks!
Br, /Tobias
Bogdan-Andrei Iancu said the following on 2008-02-15 15:26:
Hi Tobias,
It is nothing bogus or funny :)...
Shortly, in failure route, you re-process the original INVITE (and not the reply that trigger the route). So you will see the source ip of the request ;).
For more on this, see the admin training material : http://www.voice-sistem.ro/downloads/2007.08.29-Admin-Course/
Regards, Bogdan
Tobias Lindgren wrote:
Hi there,
I was trying to do this in OpenSER 1.2.2: failure_route[1] { if (t_check_status("302")){ xlog("L_ERR", "302 source ip address is $si"); if (src_ip == 192.168.5.1) { # Do something }; }; };
But the proxy sending the 302 (192.168.5.1) is not the one who ends up in my logs, instead my sip-server (192.168.1.1) who initiated the call ends up in the log.
"302 source ip address is 192.168.1.1".
Have I understood the "$si" psuedo variable wrong? Can I find the correct source address of the 302-message somehow?
Br, /Tobias
Users mailing list Users@lists.openser.org http://lists.openser.org/cgi-bin/mailman/listinfo/users
Hi Tobias,
Have you looked at the uac_redirect module first?
Regards, Bogdan
Tobias Lindgren wrote:
Bogdan,
can you please hint me of a way to make decisions with the information in the 302? Could I use the "on_reply"-route for this or am I still only re-processing INVITEs there aswell?
Br, /Tobias
Tobias Lindgren said the following on 2008-02-15 15:28:
Hi Bogdan,
cool, didn't know that, thanks!
Br, /Tobias
Bogdan-Andrei Iancu said the following on 2008-02-15 15:26:
Hi Tobias,
It is nothing bogus or funny :)...
Shortly, in failure route, you re-process the original INVITE (and not the reply that trigger the route). So you will see the source ip of the request ;).
For more on this, see the admin training material : http://www.voice-sistem.ro/downloads/2007.08.29-Admin-Course/
Regards, Bogdan
Tobias Lindgren wrote:
Hi there,
I was trying to do this in OpenSER 1.2.2: failure_route[1] { if (t_check_status("302")){ xlog("L_ERR", "302 source ip address is $si"); if (src_ip == 192.168.5.1) { # Do something }; }; };
But the proxy sending the 302 (192.168.5.1) is not the one who ends up in my logs, instead my sip-server (192.168.1.1) who initiated the call ends up in the log.
"302 source ip address is 192.168.1.1".
Have I understood the "$si" psuedo variable wrong? Can I find the correct source address of the 302-message somehow?
Br, /Tobias
Users mailing list Users@lists.openser.org http://lists.openser.org/cgi-bin/mailman/listinfo/users
Hello,
yes I'm using that one. What I'm trying to do is to rewrite the hostpart of the URI after doing get_redirects, but preferrably only after 302s with a special number.
Br, /Tobias
Bogdan-Andrei Iancu said the following on 2008-02-19 17:00:
Hi Tobias,
Have you looked at the uac_redirect module first?
Regards, Bogdan
Tobias Lindgren wrote:
Bogdan,
can you please hint me of a way to make decisions with the information in the 302? Could I use the "on_reply"-route for this or am I still only re-processing INVITEs there aswell?
Br, /Tobias
Tobias Lindgren said the following on 2008-02-15 15:28:
Hi Bogdan,
cool, didn't know that, thanks!
Br, /Tobias
Bogdan-Andrei Iancu said the following on 2008-02-15 15:26:
Hi Tobias,
It is nothing bogus or funny :)...
Shortly, in failure route, you re-process the original INVITE (and not the reply that trigger the route). So you will see the source ip of the request ;).
For more on this, see the admin training material : http://www.voice-sistem.ro/downloads/2007.08.29-Admin-Course/
Regards, Bogdan
Tobias Lindgren wrote:
Hi there,
I was trying to do this in OpenSER 1.2.2: failure_route[1] { if (t_check_status("302")){ xlog("L_ERR", "302 source ip address is $si"); if (src_ip == 192.168.5.1) { # Do something }; }; };
But the proxy sending the 302 (192.168.5.1) is not the one who ends up in my logs, instead my sip-server (192.168.1.1) who initiated the call ends up in the log.
"302 source ip address is 192.168.1.1".
Have I understood the "$si" psuedo variable wrong? Can I find the correct source address of the 302-message somehow?
Br, /Tobias
Users mailing list Users@lists.openser.org http://lists.openser.org/cgi-bin/mailman/listinfo/users
Hi Tobias,
get_redirects() already pushes the contacts as branches, so I'm afraid you cannot change them anymore..... And even if you try yo change the 3xx reply in on_reply route (before failure route), the changes will not be vizible in failure route...
Regards, Bogdan
Tobias Lindgren wrote:
Hello,
yes I'm using that one. What I'm trying to do is to rewrite the hostpart of the URI after doing get_redirects, but preferrably only after 302s with a special number.
Br, /Tobias
Bogdan-Andrei Iancu said the following on 2008-02-19 17:00:
Hi Tobias,
Have you looked at the uac_redirect module first?
Regards, Bogdan
Tobias Lindgren wrote:
Bogdan,
can you please hint me of a way to make decisions with the information in the 302? Could I use the "on_reply"-route for this or am I still only re-processing INVITEs there aswell?
Br, /Tobias
Tobias Lindgren said the following on 2008-02-15 15:28:
Hi Bogdan,
cool, didn't know that, thanks!
Br, /Tobias
Bogdan-Andrei Iancu said the following on 2008-02-15 15:26:
Hi Tobias,
It is nothing bogus or funny :)...
Shortly, in failure route, you re-process the original INVITE (and not the reply that trigger the route). So you will see the source ip of the request ;).
For more on this, see the admin training material : http://www.voice-sistem.ro/downloads/2007.08.29-Admin-Course/
Regards, Bogdan
Tobias Lindgren wrote:
Hi there,
I was trying to do this in OpenSER 1.2.2: failure_route[1] { if (t_check_status("302")){ xlog("L_ERR", "302 source ip address is $si"); if (src_ip == 192.168.5.1) { # Do something }; }; };
But the proxy sending the 302 (192.168.5.1) is not the one who ends up in my logs, instead my sip-server (192.168.1.1) who initiated the call ends up in the log.
"302 source ip address is 192.168.1.1".
Have I understood the "$si" psuedo variable wrong? Can I find the correct source address of the 302-message somehow?
Br, /Tobias
Users mailing list Users@lists.openser.org http://lists.openser.org/cgi-bin/mailman/listinfo/users
Hi, If get_redirect() is already pushing the contacts as branches, then what is the purpose / benefit / drawback of doing something like this:
taken from sipwise online config:
if(!get_redirects("1:1")) {
xlog("L_ERROR", "Failed to fetch contact '$ct' from 301/302 - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n"); acc_db_request("480", "acc"); t_reply("480", "Temporarily Unavailable"); exit; } # get last URI from destination-set and set it as R-URI avp_delete("$avp(s:tmp)/g"); $avp(s:tmp) = $ds; avp_subst("$avp(s:tmp)", "/.*(sip:.+@[^:;>]+).*$/\1/"); avp_pushto("$ru", "$avp(s:tmp)");
I'd greatly appreciate your answers as they will help me better understand the use of branches/destination set.
Thanks.
Hi Zahid,
To be honest, I do not see the purpose of this:
# get last URI from destination-set and set it as R-URI avp_delete("$avp(s:tmp)/g"); $avp(s:tmp) = $ds; avp_subst("$avp(s:tmp)", "/.*(sip:.+@[^:;>]+).*$/\1/"); avp_pushto("$ru", "$avp(s:tmp)");
This code fetches the first branch (by using the $ds pv and the regexp) and push it as RURI; but if there is no following append_branch(), it has 0 effect. And if it does append_branch somewhere later, it will just duplicate a branch....
Maybe Andreas (here CCed) can give you some details on this.....
Regards, Bogdan
Zahid Mehmood wrote:
Hi, If get_redirect() is already pushing the contacts as branches, then what is the purpose / benefit / drawback of doing something like this:
taken from sipwise online config:
if(!get_redirects("1:1")) { xlog("L_ERROR", "Failed to fetch contact '$ct' from
301/302 - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n"); acc_db_request("480", "acc"); t_reply("480", "Temporarily Unavailable"); exit; } # get last URI from destination-set and set it as R-URI avp_delete("$avp(s:tmp)/g"); $avp(s:tmp) = $ds; avp_subst("$avp(s:tmp)", "/.*(sip:.+@[^:;>]+).*$/\1/"); avp_pushto("$ru", "$avp(s:tmp)");
I'd greatly appreciate your answers as they will help me better understand the use of branches/destination set.
Thanks.
Hi,
Puh, it's been a while since I wrote that, so let me think :) As far as I remember, the idea was to extract the first branch and push it into R-URI, then jump somewhere into the route sections where quite some R-URI manipulation and checking is done (and most of the functions can only operate on r-uri, so...)... after that, the ruri is again appended as branch before sending it out. Only problem is that you can only use one destination.
Bogdan, what exactly do you mean by "if it does append_branch somewhere later, it will just duplicate a branch"?
Cheers, Andreas
Bogdan-Andrei Iancu wrote:
Hi Zahid,
To be honest, I do not see the purpose of this:
# get last URI from destination-set and set it as R-URI avp_delete("$avp(s:tmp)/g"); $avp(s:tmp) = $ds; avp_subst("$avp(s:tmp)", "/.*(sip:.+@[^:;>]+).*$/\1/"); avp_pushto("$ru", "$avp(s:tmp)");
This code fetches the first branch (by using the $ds pv and the regexp) and push it as RURI; but if there is no following append_branch(), it has 0 effect. And if it does append_branch somewhere later, it will just duplicate a branch....
Maybe Andreas (here CCed) can give you some details on this.....
Regards, Bogdan
Zahid Mehmood wrote:
Hi, If get_redirect() is already pushing the contacts as branches, then what is the purpose / benefit / drawback of doing something like this:
taken from sipwise online config:
if(!get_redirects("1:1")) { xlog("L_ERROR", "Failed to fetch contact '$ct' from
301/302 - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n"); acc_db_request("480", "acc"); t_reply("480", "Temporarily Unavailable"); exit; } # get last URI from destination-set and set it as R-URI avp_delete("$avp(s:tmp)/g"); $avp(s:tmp) = $ds; avp_subst("$avp(s:tmp)", "/.*(sip:.+@[^:;>]+).*$/\1/"); avp_pushto("$ru", "$avp(s:tmp)");
I'd greatly appreciate your answers as they will help me better understand the use of branches/destination set.
Thanks.
Hi Andreas,
Andreas Granig wrote:
Hi,
Puh, it's been a while since I wrote that, so let me think :) As far as I remember, the idea was to extract the first branch and push it into R-URI, then jump somewhere into the route sections where quite some R-URI manipulation and checking is done (and most of the functions can only operate on r-uri, so...)... after that, the ruri is again appended as branch before sending it out. Only problem is that you can only use one destination.
Bogdan, what exactly do you mean by "if it does append_branch somewhere later, it will just duplicate a branch"?
I mean get_redirects() function adds (internally) a new branch (from the contact of the 3xx reply). And you take its value (via $ds), do whatever you do with it, and add it again from script (append_branch) -> you have 2 branches...
This in my opinion on this piece of script, but there is also the chance I'm missing something here...I haven't tried it ;)
Regards, Bogdan
Cheers, Andreas
Bogdan-Andrei Iancu wrote:
Hi Zahid,
To be honest, I do not see the purpose of this:
# get last URI from destination-set and set it as R-URI avp_delete("$avp(s:tmp)/g"); $avp(s:tmp) = $ds; avp_subst("$avp(s:tmp)", "/.*(sip:.+@[^:;>]+).*$/\1/"); avp_pushto("$ru", "$avp(s:tmp)");
This code fetches the first branch (by using the $ds pv and the regexp) and push it as RURI; but if there is no following append_branch(), it has 0 effect. And if it does append_branch somewhere later, it will just duplicate a branch....
Maybe Andreas (here CCed) can give you some details on this.....
Regards, Bogdan
Zahid Mehmood wrote:
Hi, If get_redirect() is already pushing the contacts as branches, then what is the purpose / benefit / drawback of doing something like this:
taken from sipwise online config:
if(!get_redirects("1:1")) { xlog("L_ERROR", "Failed to fetch contact '$ct' from
301/302 - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n"); acc_db_request("480", "acc"); t_reply("480", "Temporarily Unavailable"); exit; } # get last URI from destination-set and set it as R-URI avp_delete("$avp(s:tmp)/g"); $avp(s:tmp) = $ds; avp_subst("$avp(s:tmp)", "/.*(sip:.+@[^:;>]+).*$/\1/"); avp_pushto("$ru", "$avp(s:tmp)");
I'd greatly appreciate your answers as they will help me better understand the use of branches/destination set.
Thanks.