Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Asterisk 13 Outgoing call error

Status
Not open for further replies.

eddv123

Technical User
Oct 13, 2016
19
GB
Hi,

I am relatively new to Asterisk and currently getting to know the CLI.

I have a basic setup of which internal calls work without issues and I have a Sip Trunk registered with SIP Gate.

If I try to make an outbound call however I get an error that:

Call from '6001' (10.5.10.10:5060) to extension 'number dialed' rejected because extension not found in context 'from-internal'.

Please note that "number dialed is text I have replaced for the original number (for obvious reasons)- as well as my SIP credentials for the trunk which I have changed, but disregard (as it is registered).

My sip.conf and extensions.conf are below:

sip.conf:

[general]
transport=udp
udpbindaddr=0.0.0.0

register => 23edgg4d:fdd34edd@sipconnect.sipgate.co.uk/23edgg4d

[sipgate]
type = peer
host = sipconnect.sipgate.co.uk
context=from-internal
outboundproxy=sipconnect.sipgate.co.uk
port = 5060
username = 23edgg4d
fromuser = 23edgg4d
fromdomain = sipconnect.sipgate.co.uk
secret = fdd34edd
dtmfmode = rfc2833
insecure = port,invite
canreinvite = no
registertimeout = 600
disallow=all
allow=alaw
allow=ulaw

[6001]
type=friend
context=from-internal
host=dynamic
secret=unsecurepassword
disallow=all
allow=ulaw

[6002]
type=friend
context=from-internal
host=dynamic
secret=unsecurepassword
disallow=all
allow=ulaw

Extensions.conf

[from-internal]
include => sipgate

exten=>6001,1,Dial(SIP/6001,20)
exten=>6001,n,VoiceMail(6001@vm-demo,u)

exten=>6002,1,Dial(SIP/6002,20)
exten=>6002,n,VoiceMail(6002@vm-demo,u)

exten=>0XXXXXXXXXX,1,Dial(SIP/sipgate,20)

NOTE: I am not interested in installing the FreePBX GUI as I want to understand the CLI.

Thanks!
 
Two things.

Being you, I'd change the sipgate SIP trunk password that you put into your post ASAP!!! Effectively, anyone who reads your post can use your trunk with the credentials to make calls for free until you change the password.

To match any external number dialed, you need to indicate that you specified a pattern - that is done by prefixing the pattern with an underscore. For example,
[pre]exten => _XXXXXXXXXX,1,Dial(SIP/sipgate,20)[/pre]
could be used to match any 10 digit number.
 
Hi Ucxguy,

See my previous post - you will see I put a note in to say ignore this, the trunk ID and password I have changed for that very reason - don't worry, I will try your suggestion however I think I may of already tried this.

Tell me - why is it saying not from internal when my settings clearly state it is.

Where does it take the context credentials from, as I can see several places but all seem to be set correctly.


Thanks.
 
Solved with:

exten => _X.,1,Set(CALLERID(num)=SIP-ID)
exten => _X.,n,Dial(SIP/${EXTEN}@sipgate,30,trg)
exten => _X.,n,Hangup
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top