Max Forward Header Function

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Max Forward Header Function

Faisal Rehman
Hi Everybody,

I have a very tiny & crazy question but it is confusing me & I couldn't find its accurate answer over google that why we use "!" this before mf_process_maxfwd_header function in the main routing block. I have also seen this symbol with other functions like !is_method("REGISTER|MESSAGE") so what's its soul purpose?

How can I test the functionality of just the mf_process_maxfwd_header function?

 
Regards,

Faisal Rehman

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Max Forward Header Function

Vlad Paiu
Hi,

The '!' symbol has the same meaning as in any other programming language, to negate the return code of the function.

So if you look at the return code of the mf_process_maxfwd_header at [1], you will see it returns a positive return code when the processing of the Max-Forward header succeeds, and a negative return code if the Max-Forward value is 0 or if there was another failure.

[1] http://www.opensips.org/html/docs/modules/1.7.x/maxfwd.html#id249099

Regards,
Vlad Paiu
OpenSIPS Developer

On 01/25/2012 02:44 PM, Faisal Rehman wrote:
Hi Everybody,

I have a very tiny & crazy question but it is confusing me & I couldn't find its accurate answer over google that why we use "!" this before mf_process_maxfwd_header function in the main routing block. I have also seen this symbol with other functions like !is_method("REGISTER|MESSAGE") so what's its soul purpose?

How can I test the functionality of just the mf_process_maxfwd_header function?

 
Regards,

Faisal Rehman
_______________________________________________ Users mailing list [hidden email] http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Max Forward Header Function

Faisal Rehman
Hi Vlad,

Okay I got the functionality of "!" symbol & also got different return codes while testing on a local server. But I am stuck with one thing that I am getting this in the wireshark logs either the max_value for the mf_process_maxfwd_header is 1 or 10:

564d700c00f837-1--d87543-;rport..Max-Forwards: 70..Cont
  act: <sip:1000@192.168.150.23:16222>..To: "3333"<sip:3333@192.168.150.160:5161>..From: "testing"<sip:1000@192.168.150.160:5161>;tag=3421ec3e..Call-ID: ba600752f22e
  9018ZjQ0MGViNzJlZTE5OTY2M2NkZjE3MWY1Nzk5ODVlNGI...CSeq: 1 INVITE..Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE,

I know that 70 is the recommended Max Forwards initial value but will it be the same either we use max_value 1 or 10?

Regards,

Faisal Rehman

From: Vlad Paiu <[hidden email]>
To: [hidden email]
Sent: Wednesday, January 25, 2012 7:16 PM
Subject: Re: [OpenSIPS-Users] Max Forward Header Function

Hi,

The '!' symbol has the same meaning as in any other programming language, to negate the return code of the function.

So if you look at the return code of the mf_process_maxfwd_header at [1], you will see it returns a positive return code when the processing of the Max-Forward header succeeds, and a negative return code if the Max-Forward value is 0 or if there was another failure.

[1] http://www.opensips.org/html/docs/modules/1.7.x/maxfwd.html#id249099

Regards,
Vlad Paiu
OpenSIPS Developer

On 01/25/2012 02:44 PM, Faisal Rehman wrote:
Hi Everybody,

I have a very tiny & crazy question but it is confusing me & I couldn't find its accurate answer over google that why we use "!" this before mf_process_maxfwd_header function in the main routing block. I have also seen this symbol with other functions like !is_method("REGISTER|MESSAGE") so what's its soul purpose?

How can I test the functionality of just the mf_process_maxfwd_header function?

 
Regards,

Faisal Rehman
_______________________________________________ Users mailing list [hidden email] http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Max Forward Header Function

Vlad Paiu
Hi,

The parameter to mf_process_maxfwd_header will only be added to the message if the message did not initially contain a Max-Forwards header.
If the header exists, the default behavior is to decrement the header value by one. Please check again the readme for the function.

[1] http://www.opensips.org/html/docs/modules/1.7.x/maxfwd.html#id249099

Regards,
Vlad
Vlad Paiu
OpenSIPS Developer

On 01/26/2012 03:05 PM, Faisal Rehman wrote:
Hi Vlad,

Okay I got the functionality of "!" symbol & also got different return codes while testing on a local server. But I am stuck with one thing that I am getting this in the wireshark logs either the max_value for the mf_process_maxfwd_header is 1 or 10:

564d700c00f837-1--d87543-;rport..Max-Forwards: 70..Cont
  act: [hidden email]..To: "3333"[hidden email]..From: "testing"[hidden email];tag=3421ec3e..Call-ID: ba600752f22e
  9018ZjQ0MGViNzJlZTE5OTY2M2NkZjE3MWY1Nzk5ODVlNGI...CSeq: 1 INVITE..Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE,

I know that 70 is the recommended Max Forwards initial value but will it be the same either we use max_value 1 or 10?

Regards,

Faisal Rehman

From: Vlad Paiu [hidden email]
To: [hidden email]
Sent: Wednesday, January 25, 2012 7:16 PM
Subject: Re: [OpenSIPS-Users] Max Forward Header Function

Hi,

The '!' symbol has the same meaning as in any other programming language, to negate the return code of the function.

So if you look at the return code of the mf_process_maxfwd_header at [1], you will see it returns a positive return code when the processing of the Max-Forward header succeeds, and a negative return code if the Max-Forward value is 0 or if there was another failure.

[1] http://www.opensips.org/html/docs/modules/1.7.x/maxfwd.html#id249099

Regards,
Vlad Paiu
OpenSIPS Developer

On 01/25/2012 02:44 PM, Faisal Rehman wrote:
Hi Everybody,

I have a very tiny & crazy question but it is confusing me & I couldn't find its accurate answer over google that why we use "!" this before mf_process_maxfwd_header function in the main routing block. I have also seen this symbol with other functions like !is_method("REGISTER|MESSAGE") so what's its soul purpose?

How can I test the functionality of just the mf_process_maxfwd_header function?

 
Regards,

Faisal Rehman
_______________________________________________ Users mailing list [hidden email] http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________ Users mailing list [hidden email] http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Max Forward Header Function

Faisal Rehman
Hi Vlad,

Exactly I have seen the value being decremented to 1 while live testing.
 
Thanks for your help!!

Faisal Rehman

From: Vlad Paiu <[hidden email]>
To: [hidden email]
Sent: Friday, January 27, 2012 3:56 PM
Subject: Re: [OpenSIPS-Users] Max Forward Header Function

Hi,

The parameter to mf_process_maxfwd_header will only be added to the message if the message did not initially contain a Max-Forwards header.
If the header exists, the default behavior is to decrement the header value by one. Please check again the readme for the function.

[1] http://www.opensips.org/html/docs/modules/1.7.x/maxfwd.html#id249099

Regards,
Vlad
Vlad Paiu
OpenSIPS Developer

On 01/26/2012 03:05 PM, Faisal Rehman wrote:
Hi Vlad,

Okay I got the functionality of "!" symbol & also got different return codes while testing on a local server. But I am stuck with one thing that I am getting this in the wireshark logs either the max_value for the mf_process_maxfwd_header is 1 or 10:

564d700c00f837-1--d87543-;rport..Max-Forwards: 70..Cont
  act: [hidden email]..To: "3333"[hidden email]..From: "testing"[hidden email];tag=3421ec3e..Call-ID: ba600752f22e
  9018ZjQ0MGViNzJlZTE5OTY2M2NkZjE3MWY1Nzk5ODVlNGI...CSeq: 1 INVITE..Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE,

I know that 70 is the recommended Max Forwards initial value but will it be the same either we use max_value 1 or 10?

Regards,

Faisal Rehman

From: Vlad Paiu [hidden email]
To: [hidden email]
Sent: Wednesday, January 25, 2012 7:16 PM
Subject: Re: [OpenSIPS-Users] Max Forward Header Function

Hi,

The '!' symbol has the same meaning as in any other programming language, to negate the return code of the function.

So if you look at the return code of the mf_process_maxfwd_header at [1], you will see it returns a positive return code when the processing of the Max-Forward header succeeds, and a negative return code if the Max-Forward value is 0 or if there was another failure.

[1] http://www.opensips.org/html/docs/modules/1.7.x/maxfwd.html#id249099

Regards,
Vlad Paiu
OpenSIPS Developer

On 01/25/2012 02:44 PM, Faisal Rehman wrote:
Hi Everybody,

I have a very tiny & crazy question but it is confusing me & I couldn't find its accurate answer over google that why we use "!" this before mf_process_maxfwd_header function in the main routing block. I have also seen this symbol with other functions like !is_method("REGISTER|MESSAGE") so what's its soul purpose?

How can I test the functionality of just the mf_process_maxfwd_header function?

 
Regards,

Faisal Rehman
_______________________________________________ Users mailing list [hidden email] http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________ Users mailing list [hidden email] http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users