Hi,
I am trying to register my Asterisk as a Client at a SIP provider which provides PSTN access so that I can dail in and out on PSTN using SIP softphone (X-Lite). Now, I am able to register Asterisk against the SIP provider and get incoming calls on softphone too. But the problem is with outgoing calls. After dailing the PSTN number the PSTN phone rings but even after picking the PSTN phone the softphone displays calling 0xxxxxxxxxx (PSTN number). Then finally the sip softphone displays “Call Failed: Service Unavailable” and you hear the voice “The person you called is unavailable”.
The Settings in sip.conf are:
general
port = 5060
bindaddr = 0.0.0.0
context = others
sipdebug = no
realm = domain.com
trustrpid = yes
sendrpid = yes
register => uname@domain.com:pwd:authname@IP/46
registertimeout=20
registerattempts=10
my_provider
type=peer
fromuser=uname
fromdomain=domain.com
canreinvite=no
secret=pwd
insecure=very
host= ip
qualify=yes
nat=no
The configuration in extensions.conf is as follows:
exten => _0.,1,Dial(SIP/${EXTEN:1}@my_provider)
The output on Asterisk CLI is:
Executing 04045834323@tutorial:1 Dial(“SIP/alice-c0000a60”, “SIP/4045834323@my_provider”) in new stack
— Called 4045834323@my_provider
== Everyone is busy/congested at this time (1:0/0/1)
== Auto fallthrough, channel ‘SIP/alice-c0000a60’ status is ‘CHANUNAVAIL’
Can someone please explain where and what I am doing wrong?
Thanks.
Are you sure your provider is allowing outbound calls? Sometimes they only offer inbound calls.
You could take asterisk out of the equation by using xlite to connect directly to this sip provider.
Also, i notice you are not dialing a 1 before the area code. Try dialing 014045834323.
9 is the standard number for getting an outside line in the united states. Why are you using 0? Of course either will work fine, but I would recommend sticking to the standard.
Thanks for the quick reply…
Yes, the provider does support outgoing calls. I have tried making outgoing calls with X-Lite itself. They work fine.
Also, I didn’t know 9 is the standard, I will surely change it to 9.
Thanks once again.
Did you try including a 1 before the area code? I don’t know that that will work, just want to verify you have tried.
I see that your Sip.conf does not specify what codecs to use. In each sip entry it is recommended that you only allow codecs that you specify(not even sure what the default behavior is, perhaps all are allowed…).
add these lines to your sip config for each of the sip peers:
disallow=all
allow=ulaw
This will only allow ulaw to be used. It is pretty much the most basic codec, its normal telephone quality, but the bandwidth is reasonably high(about 64k per channel, or 1/24th of a t-1 line).
Here is my sip.conf for your reference. I do not have a SIP provider in my configuration, i am using an h.323 trunk to connect to another pbx to provide outside lines.
[general]
context=default
allowoverlap=no
bindport=5060
bindaddr=10.1.1.6
[6601]
type=friend
dtmfmode=inband
context=default
disallow=all
allow=ulaw
mailbox=6601@default
host=dynamic
username=6601
secret=6601
canreinvite=no
[6602]
type=friend
dtmfmode=inband
context=default
disallow=all
allow=ulaw
mailbox=6602@default
host=dynamic
username=6602
secret=6602
canreinvite=no
In spite of specifying the codecs, it doesn’t work. Its still the same, there is no difference in behaviour of Sip softphone or Asterisk.
I tried prepending the number with 1 also, but still no success.
You should ask your voip provider if they can provide any assistance.
If you are not tied to your current provider you might check out voipvoip.com/ not really sure how good they are, but they are cheap and i think they gave me a free trial or something. It has specific instructions for asterisk.