@Override
    public boolean nextPacket(Packet packet) {

        try {
            if (packet.hasProtocol(Protocol.IPv4)) {
                final IPPacket ip = (IPPacket) packet.getPacket(Protocol.IPv4);
                if (ip.isFragmented()) {
                    packet = handleFragmentation(ip);
                    if (packet == null) {
                        return true;
                    }
                }
            }

            if (this.sipStreamHandler != null && packet.hasProtocol(Protocol.SIP)) {
                this.sipStreamHandler.processFrame(packet);
            } else if (this.rtpStreamHandler != null && packet.hasProtocol(Protocol.RTP)) {
                this.rtpStreamHandler.processFrame(packet);
            }
        } catch (final IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (final PacketParseException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        return true;

    }
@ Override public boolean nextPacket ( Packet packet ) { try { if ( packet . hasProtocol ( Protocol . IPv4 ) ) { final IPPacket ip = ( IPPacket ) packet . getPacket ( Protocol . IPv4 ) ; if ( ip . isFragmented ( ) ) { packet = handleFragmentation ( ip ) ; if ( packet == null ) { return true ; } } } if ( this . sipStreamHandler != null && packet . hasProtocol ( Protocol . SIP ) ) { this . sipStreamHandler . processFrame ( packet ) ; } else if ( this . rtpStreamHandler != null && packet . hasProtocol ( Protocol . RTP ) ) { this . rtpStreamHandler . processFrame ( packet ) ; } } catch ( final IOException e ) { e . printStackTrace ( ) ; } catch ( final PacketParseException e ) { e . printStackTrace ( ) ; } return true ; }
{@inheritDoc}