Can't make external calls inn to Asterisk

Hello there

I am new to Asterisk, so bear with me, i think i understand the flow, but i am not completely sure, i think i am on the right track.

devices
1 Grandstream SIP/100
2 Zoiper softphone SIP/101

Ok, we are using CentOs 5.4 freshly installed, and Asterisk installed with yum repos.
We are using a SIP trunk. To make incoming and external calls.

I’ve got 2 problems.

1, is that our main number doesn’t show up on my mobile phone when i make an external call from my Grandstream SIP phone.
which is registred on my asterisk, i get a hidden number showing up on my mobile phone.
With Zoiper softphone i get a number which don’t belong to us, and when i dial that number back again, i get an answering machine who says that this number is not in use, and it is used for “commercial” use when numbers is not registred, this is ok.
2, when i try to call our main number, we get busy sound. When i say this, i mean external calls in to our Asterisk.
[Apr 30 11:28:37] NOTICE[7360]: chan_sip.c:20059 handle_request_invite: Call from ‘’ to extension ‘4767209610’ rejected because extension not found.
the number 4767209610 is our main number, our public number, this is btw in Norway +47 is our country code.

So the external call is handled by the Asterisk, but it cant put it trough to SIP/100, my grandstream.

SIP.conf:

[code][general]
context=default ; Default context for incoming calls
;allowguest=no ; Allow or reject guest calls (default is yes)
;match_auth_username=yes ; if available, match user entry using the
; ‘username’ field from the authentication line
; instead of the From: field.
allowoverlap=no ; Disable overlap dialing support. (Default is yes)
;allowtransfer=no ; Disable all transfers (unless enabled in peers or users)
; Default is enabled
;realm=mydomain.tld ; Realm for digest authentication
; defaults to “asterisk”. If you set a system name in
; asterisk.conf, it defaults to that system name
; Realms MUST be globally unique according to RFC 3261
; Set this to your host name or domain name
udpbindaddr=0.0.0.0 ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
; Optionally add a port number, 192.168.1.1:5062 (default is port 5060)
useragent=Phonect_Asterisk ; Fra Phonect Manual

Register => 47xxxxxxxx:mypasswd@odin.service.ipallover.net

[phonect_01]
type=peer
context=default
username=47xxxxxxxx
secret=mypasswd
host=domain.name.from.SIP.provider
useragent=Phonect_Asterisk
canrenvite=no
disallow=all
allow=alaw
allow=ulaw

; Abacus test entries
[100]
type=friend
username=100
secret=1234
host=dynamic
context=abacus_test
disallow=all
allow=ulaw
allow=alaw

[roald]
type=friend
username=roald
secret=1234
host=dynamic
context=abacus_test

[/code]

Abacus_test is what i want to test.

in sip.conf
srvlookup=yes is further down the file.

extensions.conf

[code][globals]
SIPTRUNK1=SIP/phonect_01 ; SIP trunk fra Phonect
CONSOLE=Console/dsp ; Console interface for demo
;CONSOLE=DAHDI/1
;CONSOLE=Phone/phone0
IAXINFO=guest ; IAXtel username/password
;IAXINFO=myuser:mypass
TRUNK=DAHDI/G2 ; Trunk interface

;Abacus test extension

[abacus_test]

exten => s,1,Noop(Extract DID from SIP TO header )
exten => s,2,Goto(from-trunk,${CUT(CUT(SIP_HEADER(To),@,1),:,2):2},1)

; Direkte internnummer
exten => 100,1,Dial(SIP/100)
exten => 101,1,Dial(SIP/roald)

; Tast 0+nummer for å ringe eksternt
exten => _0X.,1,NoOp(Ringer til nr ${EXTEN:1})
exten => _0X.,n,Dial(${SIPTRUNK1}/${EXTEN:1})
exten => _0X.,n,Goto(${DIALSTATUS})
exten => _0X.,n(BUSY),Busy
exten => _0X.,n(NOANSWER),Hangup

[from-trunk]
; Eksterne, inngående samtaler
exten => 67209610,1,Dial(SIP/100)
exten => 67209611,1,Dial(SIP/101)
[/code]

there is some norwegian language and comments in the .conf file, but i think u understand.

So, i hope anyone out there could help me understand why i can’t make external callsin to asterisk and my sip/100 grandstream, and why our public phone number 67209610 won’t show when i’m making external calls from my grandstream.

Thanks in advance!

Aksel

Most of this relates to your service provider, not to Asterisk.

I’d say that your SIP to PSTN gateway providers doesn’t have network operator status and that calls with CLI set are being marked anonymous and calls without CLI are being given the number of the outgoing PSTN line that they use.

In some countries, only network operators are trusted to provide valid CLID. However, it may also be that you are sending them an extension number, rather than a valid PSTN format number.

[quote=“david55”]Most of this relates to your service provider, not to Asterisk.

I’d say that your SIP to PSTN gateway providers doesn’t have network operator status and that calls with CLI set are being marked anonymous and calls without CLI are being given the number of the outgoing PSTN line that they use.

In some countries, only network operators are trusted to provide valid CLID. However, it may also be that you are sending them an extension number, rather than a valid PSTN format number.[/quote]

Thank you for the response.

Matter of fact, is that this installation is a plain asterisk installation. And a couple of weeks ago, i installed AsteriskNOW for testing, and i could make external calls to Asterisk and my SIP phone, and outbound calls. Regarding my SIP provider, yes maybe, they don’t have the possibilty to provide a valid CLID, i dunno. But regarding inbound calls, do you have any ideas?

Thank you,

Regards Aksel

The To header contains 4767209610. That will not match s.

hmmm…

I edited extension.conf

From:

[from-trunk] ; Eksterne, inngående samtaler exten => 67209610,1,Dial(SIP/100) exten => 67209611,1,Dial(SIP/101)

TO

[from-trunk]
; Eksterne, inng�ende samtaler
exten => s,1,Dial(SIP/100)
exten => s,1,Dial(SIP/101)

And tried this, got busy again, and this in ACL
[Apr 30 15:50:33] NOTICE[7988]: chan_sip.c:20059 handle_request_invite: Call from ‘’ to extension ‘4767209610’ rejected because extension not found.
== Using SIP RTP CoS mark 5
[Apr 30 15:50:48] NOTICE[7988]: chan_sip.c:20059 handle_request_invite: Call from ‘’ to extension ‘4767209610’ rejected because extension not found.

Was this incorrect?

But those extensions aren’t in the default section, which is the one that you appear to be using for your SIP provider.

Then i am a bit confused, could you show me what to edit then?
I really appreciate your help.

is: [from-trunk] the wrong name? in extensions.conf

More likely is that default is the wrong name in sip.conf.

Thank you again, but i’m still a bit confused,
could please help me sorting this out with default settings?

Thanks…

context=default username=47xxxxxxxx

[quote=“david55”]context=default username=47xxxxxxxx[/quote]

? Where should i put this?
I already have this in my trunk sequence in sip.conf…

You asked which “default” should not be “default”. This is the one. It should specify the context that actually includes 47…

[quote=“aksel”]1, is that our main number doesn’t show up on my mobile phone when i make an external call from my Grandstream SIP phone. which is registred on my asterisk, i get a hidden number showing up on my mobile phone.
With Zoiper softphone i get a number which don’t belong to us, and when i dial that number back again, i get an answering machine who says that this number is not in use, and it is used for “commercial” use when numbers is not registred, this is ok.[/quote]
This explanation by David is pretty clear why your CID isn’t shown correctly to the callee. If your VoSP lets you assign your CID, then perhaps you can add fromuser= on your trunk to see if that will resolve the CID issue.

[quote=“aksel”]2, when i try to call our main number, we get busy sound. When i say this, i mean external calls in to our Asterisk.

[Apr 30 11:28:37] NOTICE[7360]: chan_sip.c:20059 handle_request_invite: Call from ‘’ to extension ‘4767209610’ rejected because extension not found.

the number 4767209610 is our main number, our public number, this is btw in Norway +47 is our country code.[/quote]
On your sip.conf file, you have the following line:

points to the the default context and your default context doesn’t seem to have any means to process the call. Try to change the above Register line so that it will point to an existing context that can process an incoming call. For example, you have a [from-trunk] context and if you change the above Register line to one of the following, perhaps it will work.

or

OTOH, you may want to download/read this free Asterisk: The Future of Telephony, 2nd Edition e-book if you want to learn on how to configure/maintain/operate a plain-vanilla Asterisk PBX system.

Hello again.

Thank you very much for your help!

In some cases i managed to fix my problems.
But the main issue didn’t work, and that was external calls in to Asterisk, but that has changed.
I managed to speak to an expert, who made me a simple sip.conf and extensions.conf file for me.
So i can now use asterisk as a plain in/out pbx, and will work on this for further setups like vm and so on.

I really appreciate the help from you!

And i’ve got 3 books about asterisk now! From PACKT

Regards Aksel