I have a wireshark capture that contains a lot of sip subscribe and notify. I am using mate to do the filtering. Each gop will contain normally 4 PDUS (Subscribe-200OK, Notify-200OK). I can filter the first and last pdu of all Gops, but I would like to filter only the 2nd or 3rd pdu of all gops. Does anyone have an idea on how I can achieve this. Is it a filter that I don't know about or some more work in the mate script?. Here is the mate script.
Thanks so much in advance. asked 21 Apr ‘16, 11:37 Carlos Lopez edited 21 Apr ‘16, 13:56 |
One Answer:
Okay, so we've moved from a generic requirement, which was almost impossible to fulfil, to a specific one. Much easier, I tell ya :-) My suggestion here is to forge a dedicated GoP AVP using a So you'd use a "flag" AVP which would be added to the GoP's AVPL when either the 200(SUBSCRIBE) or the NOTIFY arrive while this flag AVP hasn't been created yet, and the value of this AVP would be either "200" or "NOTIFY" depending on which message has caused it to be added to the GoP's AVPL. There is another important thing, a So the complete code would be something like:
EDIT: To respond the title of the question rather than the particular need, the approach actually could be generalized in terms that you could
So an example of the result would look like this:
answered 22 Apr ‘16, 14:23 sindy edited 23 Apr ‘16, 02:40 Hi Sindy. Thanks a lot for your help. The result on your first proposal, I thought I had a capture which contained the notify before the 200OK for subscribe, but I didn’t. then I modified the capture I have as follows: ,(exported hex capture, reversed the order in two places of the 200OK for subscribe <-> notify and imported back to wireshark), then added the first proposal in mate but it always inserted in the attribute of all the Gops the following:
Then I tried your 2nd proposal and I can see in the packets I reversed, the following:
On those I didn't reverse the order I saw this:
Can you spot what the issue is with the first proposal? (23 Apr '16, 06:17) Carlos Lopez
if you want a Wireshark feature, you can always file a bug with severity "Enhancement". But be prepared that MATE is not widely popular so enhancements to it may have a very low priority.
Seemingly not without the capture, as I cannot see anything wrong in my MATE code even now. So please publish your modified capture (i.e. the one containing some NOTIFY before 200(SUBSCRIBE)) somewhere like Cloudshark (a preferred option on this site), Google Drive, Dropbox, ... and put a login-free link to it here. Nevertheless:
I'm wondering what is the goal of the whole exercise here. Normally, the order of sending of those two messages depends on the SIP stack processing the received SUBSCRIBE, so it should be the same for all SUBSCRIBE-initiated dialogs; the order of reception of the two messages may be swapped due to the nature of the meshed packet networks (even if no packets are lost), so the issuer of the SUBSCRIBE must be prepared for such situation and shouldn't expect the two messages to come in any particular order. The sole purpose of the first NOTIFY is to inform the subscriber about the state of the subscribed object as soon as possible, not to affect the state diagram of the dialog. (23 Apr '16, 06:46) sindy The issue is that the application I am working on is throwing some errors and I suspect the reception of resp and req in different order was the culprit, for sure this is a bug, but I haven't been able to probe that, at least not until now, in any case I got your first proposal and remove the extra as last step and the result looks better now. Here it is. Thanks so much for your help. I am very grateful.
(23 Apr ‘16, 07:39) Carlos Lopez
That’s quite odd, as the first proposal contains another mechanism to ensure that the Normally, the “list of PDU types already encountered in the GoP” (methods and their responses) is growing with each PDU, but the I went so far as to use one of the subscribe-notify captures in my archive and arrange the four packets in question both ways (using (23 Apr ‘16, 08:18) sindy |
I don’t know any way to filter/refer to a PDU of a particular position within a GoP. Is your example just an example or you are really interested in the 200 to the SUBSCRIBE and/or the first and mandatory NOTIFY, or you’ve used that message exchange just as an example?
Hi Sindy. In this case I just want to check if the Notify is seen before the 200OK for Subscribe. Any idea how to filter this?. for the whole capture? I imagined that by printing the 2nd pdu for all gops I might see the issue I am looking for. Thanks.