I have a table to store all agent activities like below,
+----+---------+-------------+-------------+
| id | subject | type | relation_id |
+----+---------+-------------+-------------+
| 1 | Call | lead | 25 |
| 2 | Visit | Opportunity | 25 |
+----+---------+-------------+-------------+
+----+---------+-----------+------------------+
| id | Subject | lead | Opportunity |
+----+---------+-----------+------------------+
| 1 | Call | lead_name | |
| 2 | Visit | | Opportunity_name |
+----+---------+-----------+------------------+