[OpenSIPS-Devel] GEtting the proper CSeq value from a module
Vlad Paiu
vladpaiu at opensips.org
Wed Mar 12 11:47:31 CET 2014
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 at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
More information about the Devel
mailing list