So I recently tried to use our voipfone sip trunk to make outgoing calls through Asterisk, but every time I was met with the voice message:
Sorry your call can’t be connected. Please try again.
No explanation as to why the call could not be connected, but a wild guess was either lack of funds or an incorrect (incompatible) voice codec. Of course I had plenty of funds in my account, so it wouldn’t be that… of course it was that…!
Thanks largely to the guidance here…
…I was able to get everything working again.
Step 1. Enable sip debugging
If you are using standard SIP:
myuser@myhost:~# asterisk -r myhost*CLI> sip set debug on
If you are using PJSIP, as I am:
myuser@myhost:~# asterisk -r myhost*CLI> pjsip set logger on
Step 2. Attempt to make a call, look out for “no funds” in the resulting output.
<--- Received SIP response (506 bytes) from UDP:22.214.171.124:5060 ---> SIP/2.0 603 No Funds Via: SIP/2.0/UDP 126.96.36.199:5060;branch=z9hG4bKPjtWSYFBs-zTgo2KBlXF9F-P6g9ZK.vxV4;received=188.8.131.52;rport=55789 From: <sip:+firstname.lastname@example.org>;tag=NF.2onpp6RwXWwzv5EZ1AEhPqYg5ZWRc To: <sip:email@example.com>;tag=VF833277c221dd5bcb746022eee871 Call-ID: lRNbTh5BCdgKXFxUUtXOQXNAzO5dkcIq CSeq: 2697 INVITE User-Agent: Voipfone Sip Network Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER Contact: <sip:firstname.lastname@example.org> Content-Length: 0
Step 3: Fix the From Header
As outlined in the NewsPaint link at the top, it is the From header with which Voipfone take issue. They require the bit before the @ to be your Voipfone username. In a standard SIP setup, as outlined in NewsPaint, just change your fromuser and all will be well. With PJSIP, and specifically in my case PJSIP with FreePBX, I found that changing the Outbound CallerID to be my Voipfone username was the golden ticket. Once that’s done, rerun your test and you should be able to make calls and see the following in the PJSIP debug:
<--- Transmitting SIP request (424 bytes) to UDP:184.108.40.206:5060 ---> ACK sip:email@example.com:5060 SIP/2.0 Via: SIP/2.0/UDP 220.127.116.11:5060;rport;branch=z9hG4bKPjhqy0-4Ze4JfeuCuHTJfyohKk3hWEY72A From: <sip:firstname.lastname@example.org>;tag=46qJcC9IEiSdoi3e6hg.RTJ7.cmlvyAM To: <sip:email@example.com>;tag=VF3e77bf499c95471cab435113528a Call-ID: WsaWl2hr828RYQTo0F4hZgQSnmvP9T2h CSeq: 30 ACK Max-Forwards: 70 User-Agent: FPBX-18.104.22.168(13.9.1) Content-Length: 0