From: Aviv Shaham <email@example.com>
Date: Fri, 07 Nov 2014 09:18:23 -0700
Nexmo doesn't seem to handle it well if your first specified codec is L16. Try to set
absolute_codec_string to PCMU and see if that helps.
Also note that there is no need to include custom SIP headers such as api_key, api_secret, and answer_url when you make an outbound call.
Since you mentioned also needing inbound - keep in mind that when you use Nexmo's built-in "Forward to SIP" setting for each number in the dashboard, the dialed number will not be passed as a SIP variable and you have no way of knowing it once you receive the SIP invite. One way to get around this is to have your application buy & update numbers via the Nexmo API and set a custom SIP address per Nexmo DID, for example:
firstname.lastname@example.org and then have a dialplan such as:
nexmo_forwarded_for session variable will now expose to you the dialed Nexmo phone number allowing your application or XML dialplan to use it.