Twelve states require the consent of all parties to a conversation. Those jurisdictions are California, Connecticut, Florida, Illinois, Maryland, Massachusetts, Michigan, Montana, Nevada, New Hampshire, Pennsylvania and Washington.
In these states, if there are more than two people involved in the conversation,
all parties involved in or privy to the conversation as it happens,
must consent to the taping.
So, in other words, if you live in one of those states and even one other person (besides you and your ex) is taking part in the conversation... then you need to obtain consent from that person as well.
Regardless of the state, it is almost always illegal to record a conversation to which you are not a party, do not have consent to tape, and could not naturally overhear.
Federal law and most state laws also make it illegal to disclose the contents of an illegally intercepted call or communication.
So, if your intent is to gain evidence against someone and "make it stick", you need to make sure that what you plan on doing is legal.
Even if you were able to record a conversation that contained threatening and harassing remarks, if you obtained it illegally it wouldn't be permissible when you tried to get a restraining order.
Recording Telephone Conversations
American Legal Guide on Recording Telephone Conversations (USA)