title: Flink Streaming: How to implement windows which are defined by a start and end element?
body: <p>I have data in the following format,</p>
  
  <blockquote>
    <p>SIP|2405463430|4115474257|8.205142580136622E12|Tue Nov 08 16:58:58 IST
    2016|INVITE RTP|2405463430|4115474257|8.205142580136622E12|Tue Nov 08
    16:58:58 IST 2016|0 RTP|2405463430|4115474257|8.205142580136622E12|Tue
    Nov 08 16:58:58 IST 2016|1
    RTP|2405463430|4115474257|8.205142580136622E12|Tue Nov 08 16:58:58 IST
    2016|2 RTP|2405463430|4115474257|8.205142580136622E12|Tue Nov 08
    16:58:58 IST 2016|3 RTP|2405463430|4115474257|8.205142580136622E12|Tue
    Nov 08 16:58:58 IST 2016|4
    RTP|2405463430|4115474257|8.205142580136622E12|Tue Nov 08 16:58:58 IST
    2016|5 RTP|2405463430|4115474257|8.205142580136622E12|Tue Nov 08
    16:58:58 IST 2016|6 RTP|2405463430|4115474257|8.205142580136622E12|Tue
    Nov 08 16:58:58 IST 2016|7
    RTP|2405463430|4115474257|8.205142580136622E12|Tue Nov 08 16:58:58 IST
    2016|8 RTP|2405463430|4115474257|8.205142580136622E12|Tue Nov 08
    16:58:58 IST 2016|9 SIP|2405463430|4115474257|8.205142580136622E12|Tue
    Nov 08 16:58:58 IST 2016|BYE</p>
  </blockquote>
  
  <p>I want my window to start when a <code>SIP-INVITE</code> message is encountered and trigger an event when a <code>SIP-BYE</code> message is encountered, performing some aggregations.</p>
  
  <p>How do I do this? The <code>SIP-INVITE</code> message comes at any point in time for a given user, and I might also have multiple <code>SIP-INVITE</code> messages for multiple users coming at the same time.</p>