[OpenSIPS-Devel] GEtting the proper CSeq value from a module

2014-03-12 Thread Saúl Ibarra Corretgé
Hi all,

I'm trying to find the proper way to fix 
https://github.com/OpenSIPS/opensips/issues/165 since we are close to a 
release. I need to obtain the CSeq value for a request/response, but get_cseq 
is not going to cut it. If dialog ping is used it could be internally mangled, 
so I want the mangled value.

I thought I could get the cseq_n value from the transaction as in 
https://github.com/OpenSIPS/opensips/blob/master/modules/tm/h_table.h#L235-L240 
but unfortunately the docs disagree with the real world. cseq_n contains 
doesn't contain the number but the header itself.

The aforementioned issue raises because the header is something like CSeq:42 
(note the lack of a space). So it looks like I'd need to manually parse the 
CSeq header here?!

So, TLDR, how is a module supposed to get the CSeq for a request/response, even 
in the case OpenSIPS modifies it?


Thanks,

--
Saúl Ibarra Corretgé
AG Projects




___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


Re: [OpenSIPS-Devel] GEtting the proper CSeq value from a module

2014-03-12 Thread Vlad Paiu

Hello,

Indeed in the case of the in-dialog pinging, the cseq might change and 
get_cseq is not going to be accurate for such cases.


What we can do is to have the dialog module change the number pointer in 
the actual cseq parsed structure to point to the lump added by the 
dialog module in case of pinging ( very similar to what 
fix_nated_contact is doing when fixing the contact header ).


Alternatively, if you're using the TM module to get the actual CSEQ 
header, you can use parse_cseq() from parser/parse_cseq.h to extract the 
actual CSEQ number.


Best Regards,

Vlad Paiu
OpenSIPS Developer
http://www.opensips-solutions.com

On 12.03.2014 09:48, Saúl Ibarra Corretgé wrote:

Hi all,

I'm trying to find the proper way to fix 
https://github.com/OpenSIPS/opensips/issues/165 since we are close to a 
release. I need to obtain the CSeq value for a request/response, but get_cseq 
is not going to cut it. If dialog ping is used it could be internally mangled, 
so I want the mangled value.

I thought I could get the cseq_n value from the transaction as in 
https://github.com/OpenSIPS/opensips/blob/master/modules/tm/h_table.h#L235-L240 
but unfortunately the docs disagree with the real world. cseq_n contains 
doesn't contain the number but the header itself.

The aforementioned issue raises because the header is something like CSeq:42 
(note the lack of a space). So it looks like I'd need to manually parse the CSeq header 
here?!

So, TLDR, how is a module supposed to get the CSeq for a request/response, even 
in the case OpenSIPS modifies it?


Thanks,

--
Saúl Ibarra Corretgé
AG Projects




___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel



___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


Re: [OpenSIPS-Devel] GEtting the proper CSeq value from a module

2014-03-12 Thread Saúl Ibarra Corretgé
Hi Vlad,

On Mar 12, 2014, at 11:47 AM, Vlad Paiu wrote:

 Hello,
 
 Indeed in the case of the in-dialog pinging, the cseq might change and 
 get_cseq is not going to be accurate for such cases.
 
 What we can do is to have the dialog module change the number pointer in the 
 actual cseq parsed structure to point to the lump added by the dialog module 
 in case of pinging ( very similar to what fix_nated_contact is doing when 
 fixing the contact header ).
 

That would be nice.

 Alternatively, if you're using the TM module to get the actual CSEQ header, 
 you can use parse_cseq() from parser/parse_cseq.h to extract the actual CSEQ 
 number.
 

Actually, I'm not sure what I'm doing is correct, if the cseq_n from the 
transaction supposed to be updated already in case dialog ping is enabled?


Regards,

--
Saúl Ibarra Corretgé
AG Projects




___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel