Woman open toilet box bird stuck inside

A Starling got stuck in the box around our toilet waste pipe (must have found a hole in the wall or roof and travelled through the hollow spaces in the walls). It was making a huge racket banging. Once he got out we just opened the bathroom window and he flew out.