You will need to use JSONP to wrap the data in a callback and mimetype it as text/javascript
to circumvent the cross-domain policy.
What are some good examples of JQuery using JSONP talking to .net?
The title mentions .net, but the server-side environment isn't relevant to the client implementation.
A viable alternative is to setup a server side script on your own domain that will forward the request using CURL (or any other http lib) and then output the response to the script's XHR request. This method sets up a catchall between your client-side scripts and the remote domain you are trying to access, as curl or any other server-side http lib is not bound by cross-domain policy.
EDIT
I'm going to do a little more to detail my second approach since you say you need to send a post. Just as proof of concept, I'm going to use PHP to detail what needs to be done, but it should be simple to port this general idea over to another scripting language.
Let's say I can make a catchall script on your domain at www.yourdomain.com/data.php
The logic in that file needs to read all my post vars out of the http request, put them into a curl instance as a request to a new domain, execute that request, and then output that requests' response back out to my ajax XHR so that it was like there never was an intermediary in the first place.
I like to use jscol's OOCurl to make the syntax for curl a little bit prettier.
<?
reqire_once('path/to/oocurl.php');
$c = new Curl('voip.otherdomain.com/api'); // instantiate with the url endpoint for the api
$c->post = True;
// Set the postfields for the child request to the same as the parent
$c->postfields = $_POST;
//Bust if there is an error and output that instead
$c->failoneerror = True;
$response = $c->exec();
if($c->errno()){
//there was an error, what was it?
header('Status:' . $c->info(CURLINFO_HTTP_CODE));
echo $c->error();
}else{
//success, echo output
header('Content-type: application/json');
echo $response;
}
?>
Sending your ajax requests to this kind of a script will transparently hand them off to the other domain specified in the constructor to CURL. Please note here that I've assumed the return mimetype is json - you may need to adjust this to suit your API.
If you have authentication credentials for your api, you will need to code them into the request manually as additional post vars and also secure the endpoint using an hmac. This is really specific to how you are doing your client/server side interaction and goes a little bit outside the scope of the redirector... basically just make sure you have a server defined hash salt and have the digest send with your post request, to make sure that third parties can't simply post to your intermediary endpt.
EDIT
In case anyone stumbles in from Google, I made a library with my own take on this approach available here.