Can't make Inbound Calls, Outbound works

Hello everyone,

I’m setting up a new Asterisk server at home for the first time and using DIDLogic as my Sip Provider.

Can someone take a look at my Sip.conf and Extensions.conf files as I’m not sure they are correct.

When dialing out, it works fine, When dialing in, the phone rings for about 1 minute then nothing.

Would appreciate any help. Thanks!!!

FYI I have replaced several lines from both text files removing names, users, and passwords to protect my accounts.

## Sip.conf
----------
[general]
context=provider                 ; Default context for incoming calls. Defaults to 'default'
allow=ulaw
allow=alaw
allow=gsm
allowoverlap=no                 ; Disable overlap dialing support. (Default is yes)
udpbindaddr=0.0.0.0             ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
tcpenable=no                    ; Enable server for incoming TCP connections (default is no)
tcpbindaddr=0.0.0.0             ; IP address for TCP server to bind to (0.0.0.0 binds to all interfaces)
transport=udp                   ; Set the default transports.  The order determines the primary default transport.
srvlookup=yes                   ; Enable DNS SRV lookups on outbound calls
qualify=yes
register => USER:PASS@sip.didlogic.net


[authentication]
[basic-options](!)                ; a template
        dtmfmode=rfc2833
        context=from-office
        type=friend
[natted-phone](!,basic-options)   ; another template inheriting basic-options
        directmedia=no
        host=dynamic
[public-phone](!,basic-options)   ; another template inheriting basic-options
        directmedia=yes
[my-codecs](!)                    ; a template for my preferred codecs
        disallow=all
        allow=ilbc
        allow=g729
        allow=gsm
        allow=g723
        allow=ulaw
[ulaw-phone](!)                   ; and another one for ulaw-only
        disallow=all
        allow=ulaw

[PHONE1]
        type=friend
        context=phones
        allow=ulaw,alaw
        username=PHONE1
        secret=PASS
        host=dynamic
        dtmfmode=rfc2833
        nat=no
        canreinvite=no
        callerid="PHONE1"

[PHONE2]
        type=friend
        context=phones
        allow=ulaw,alaw
        secret=PHONE2
        host=dynamic
        dtmfmode=rfc2833

[PHONE3]
        type=friend
        context=phones
        allow=ulaw,alaw
        username=PHONE3
        secret=PASS
        host=dynamic
        dtmfmode=rfc2833
        nat=no
        canreinvite=no
        callerid="PHONE3"

[DIDLOGIC]
        host=sip.didlogic.net
        secret=PASS
        type=friend
        context=provider
        username=PASS
        qualify=yes
        fromuser=DIDLOGIC
        canreinvite=no
        disallow=all
        allow=ulaw
        allow=alaw
        allow=gsm
        insecure=port,invite
## Extensions.conf




----------

[phones]

exten => 100,1,NoOp(First Line)
same => n,NoOp(Second Line)
same => n,Hangup

exten => 1260,1,NoOp(Call to PHONE1)
same => n,Dial(SIP/PHONE1)
same => n,HangUp

exten => 1261,1,NoOp(Call to PHONE2)
same => n,Dial(SIP/PHONE2)
same => n,HangUp

exten => 1262,1,NoOp(Call to PHONE3)
same => n,Playback(one-moment-please)
same => n,Dial(SIP/PHONE3)
same => n,HangUp

exten => _0X.,1,NoOp(${EXTEN:1})
same => n,Goto(outgoing,${EXTEN:1},1)


[provider]

;exten => _X.,1,Goto(phones,1260,1)





exten => s,1,Log(NOTICE, Incoming call from ${CALLERID(all)})
exten => s,n,Dial(SIP/PHONE1)
exten => s,n,Hangup()
; End of the "provider" context

[outgoing]

exten => _X.,1,Dial(SIP/PROVIDER/${EXTEN})

I would guess you are behind NAT but have not told Asterisk how to find its public address.

Incidentally, you should check type (peer is usually better), canreinvite (deprecated for directmedia), username (deprecated for defaultuser and nor normally the same as the secret), and insecure (do you really need port?), but these are not causing your problem.

To go further, you will need to provide the sip set debug on output for the incoming INVITE, and verbose logs…

Thank you so much for replying.

I’m honestly not sure if I need any of that extra lines. I was just following video tutorials on youtube honestly.

I can modify them today and make sure outbound calling still works.

I have the debug lines below, are the verbose logs stored somewhere or are they only what pop up on screen?

Sorry I’m noob to this. Thanks

PS. Also removed all instances of my username below with the word USER.

Thanks

SIP DEBUG

http://pastebin.com/DpXcbTqv

Website won’t let me post it here saying only can post two links for new users.

Your outbound registration is telling the remote side an internal LAN IP address to be reached on, like @david551 though. You will need to configure the “externip” setting in general with your external IP address and “localnet” with your local network, such as 172.16.1.0/255.255.255.0. You will also need to ensure that your port is forwarded.

Thanks for replying, still having issues.

So I tried installing a softphone on my computer, after adding the settings in I was able to make and receive calls without messing around with firewall settings. So at this point, I know everything should be working with my account.

However with Asterisk, I’m still only able to dial out and not receive calls.

I have a dynamic IP Address but I still tried to set the externip command to my external IP address as well as setting
localnet to my internal networks IP address.

That still didn’t work.

I also swapped out externip with externhost and set it to my dyndns account.

Still no luck. Which port would I need to open?

I can try and do that next. Thanks

You need to open and forward port 5060 and the range 10000-20000.

IT WORKS!

Thank You So Much!

One more question, I setup a destination nat. Is this secure? I hear lots of stuff about accounts getting hacked so I’m just curious. Thanks again

I don’t know the details of your router or how it works so I’d rather not answer that. You should definitely investigate best practices though and how best to deal with it.