INSERT INTO wa_message (campaign_id, phone_id)
SELECT 1, pb.id
FROM phone_book pb
WHERE pb.source_id = 1
  -- AND pb.status = 'Active'
  AND NOT EXISTS (
      SELECT 1 
      FROM wa_message wm
      WHERE wm.phone_id = pb.id
        AND wm.campaign_id = 1
  );