Inbound route is not ringing

Hi everybody,

Started out playing with this and all been fairly easy to configure/use and
Extensions, ring group and call between extensions works perfect.
Outgoing calls works too, but not incomming (caller [me trying to ring in] is just disconnected).
What have I missed here? Seems like I’v tried anything (but the right thing :slight_smile:
No incomming calls, whatever I’ve tried and read about. Now I’m totally lost. Please help, anyone.

Now I’ve tried so many options/seetings from community posts that I’ve even lost what I have done and not.
I can see the incomming call in the asterisk log, but there is silence in the inbound route.

Data/hardware/setup
Private home, 1 channel. Gigaset handsets on a N300A IP
Provider: Affinity - Sweden
Phone: 0452-34567 (also used for id and username)
Password: password
Host sip.clubtele.se
Router: Linksys WRT1900ACS (IP 192.168.1.1) - SIP ALG turned off (no ports forwarded)
FreePBX/Asterisk on a PI (RasPBX) (IP 192.168.1.100)
Gigaset N300A IP (IP 192.168.1.158)
Incomming call from cell (in log): 0701234567

Inbound and outboud calls works ok on X-lite softphone (with above data)
Inbound and outboud also works ok on Gigaset having the N300A IP configured directly to the provider (with above data).

*** Trunk-***
TAB General:
Trunkname Affinity
Outbound caler ID: 045234567
CID opt: Allow any CID
Max channels 1

TAB Number manipulation:
No settings done

TAB Sip settings Outgoing:
Trunk name Affinity
Peer details.
(only the first four lines is needed for outgoing to work)
type=peer
host=sip.clubtele.se
username=045234567
secret=password
disallow=all
allow=alaw

TAB Sip settings incomming:
User context 045234567
User details:
(I’m lost here since it doesn’t work - this is only current settings)
type=user
host=sip.clubtele.se
username=045234567
secret=password
context=from-trunk
Register string: 045234567:[email protected]

Settings -> SIP settings
TAB General
Allow anonymous inbound SIP calls: NO (yes don’t work either)
NAT - auto detected and set (static IP)
IP 44.33.22.11
Local Netw. 192.168.1.1 / 255.255.255.0
192.168.1.0 / 24

RTP ports 10001 - 20000, chekcsum yes, strict yes
STUN/TURN - default blank
Codecs alaw, ulaw g722, gsm

TAB Chain SIP
NAT yes
IP config Static (but we only have dynamic from ISP, but is the same)

Registrations settings (probably the defaults):
Timeout 20
Attempts 0
Min Expire 60
Max Expire 3600
Default expire 120

Bind address: blank
Bin port_ 5060
Allow SIP Guest YES (No doesn’t work either)
SRV lookup NO

*** Outbound route ***
Name: PhoneOut
Outbound CID 045234567
Trunk Sequence: Affinity (selected trunk)
This is working perfectly.

*** Inbound route ***
Name PhoneHome (stupid name ok, but stil for test)
DID/CID: Any/Any
CID priority NO (Yes doesn’t work either)
Destination: Extension 58 (a ring group with extensions doesn’t work either)
Signal Ringing: NO (Yes doesn’t work either)

I also right now have 2 more inbounds for test (but no luck there either)
did/cid 045234567/any
did/cid “_X.”/any
also tried (and more):
did/cid any/cell-phone-number

From Asterisk logg:
Warning part (should not be any problem)
[2016-07-19 01:03:20] VERBOSE[27205] pbx.c: – Time to restore hints and swap in new dialplan: 0.000045 sec
[2016-07-19 01:03:20] VERBOSE[27205] pbx.c: – Time to delete the old dialplan: 0.004792 sec
[2016-07-19 01:03:20] VERBOSE[27205] pbx.c: – Total time merge_contexts_delete: 0.008459 sec
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘from-did-direct’ tries to include nonexistent context ‘ext-findmefollow’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘from-internal-xfer’ tries to include nonexistent context ‘from-internal-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘from-internal-noxfer’ tries to include nonexistent context ‘from-internal-noxfer-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘from-pstn’ tries to include nonexistent context ‘from-pstn-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘from-internal-noxfer-additional’ tries to include nonexistent context ‘from-internal-noxfer-additional-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘from-internal-additional’ tries to include nonexistent context ‘from-internal-additional-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘macro-parked-call’ tries to include nonexistent context ‘macro-parked-call-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘func-apply-sipheaders’ tries to include nonexistent context ‘func-apply-sipheaders-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘func-set-sipheader’ tries to include nonexistent context ‘func-set-sipheader-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘macro-dial-one’ tries to include nonexistent context ‘macro-dial-one-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘macro-hangupcall’ tries to include nonexistent context ‘macro-hangupcall-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘macro-blkvm-check’ tries to include nonexistent context ‘macro-blkvm-check-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘macro-blkvm-clr’ tries to include nonexistent context ‘macro-blkvm-clr-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘macro-blkvm-set’ tries to include nonexistent context ‘macro-blkvm-set-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘macro-blkvm-setifempty’ tries to include nonexistent context ‘macro-blkvm-setifempty-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘originate-skipvm’ tries to include nonexistent context ‘originate-skipvm-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘macro-simple-dial’ tries to include nonexistent context ‘macro-simple-dial-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘macro-exten-vm’ tries to include nonexistent context ‘macro-exten-vm-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘macro-vm’ tries to include nonexistent context ‘macro-vm-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘macro-block-cf’ tries to include nonexistent context ‘macro-block-cf-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘macro-setmusic’ tries to include nonexistent context ‘macro-setmusic-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘macro-dial-confirm’ tries to include nonexistent context ‘macro-dial-confirm-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘from-dahdi’ tries to include nonexistent context ‘from-dahdi-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘from-zaptel’ tries to include nonexistent context ‘from-zaptel-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘macro-outbound-callerid’ tries to include nonexistent context ‘macro-outbound-callerid-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘macro-user-callerid’ tries to include nonexistent context ‘macro-user-callerid-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘macro-privacy-mgr’ tries to include nonexistent context ‘macro-privacy-mgr-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘macro-dialout-trunk’ tries to include nonexistent context ‘macro-dialout-trunk-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘sub-pincheck’ tries to include nonexistent context ‘sub-pincheck-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘macro-auto-blkvm’ tries to include nonexistent context ‘macro-auto-blkvm-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘macro-auto-confirm’ tries to include nonexistent context ‘macro-auto-confirm-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘macro-confirm’ tries to include nonexistent context ‘macro-confirm-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘sub-presencestate-display’ tries to include nonexistent context ‘sub-presencestate-display-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘bad-number’ tries to include nonexistent context ‘bad-number-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘app-blackhole’ tries to include nonexistent context ‘app-blackhole-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘outrt-1’ tries to include nonexistent context ‘outrt-1-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘outbound-allroutes’ tries to include nonexistent context ‘outbound-allroutes-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘macro-prepend-cid’ tries to include nonexistent context ‘macro-prepend-cid-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘from-trunk-sip-affinity’ tries to include nonexistent context ‘from-trunk-sip-affinity-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘ext-trunk’ tries to include nonexistent context ‘ext-trunk-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘from-did-direct-ivr’ tries to include nonexistent context ‘from-did-direct-ivr-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘ext-local’ tries to include nonexistent context ‘ext-local-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘ext-did-0002’ tries to include nonexistent context ‘ext-did-0002-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘ext-did-catchall’ tries to include nonexistent context ‘ext-did-catchall-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘ext-did-0001’ tries to include nonexistent context ‘ext-did-0001-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘ext-did’ tries to include nonexistent context ‘ext-did-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘ext-test’ tries to include nonexistent context ‘ext-test-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘app-chanspy’ tries to include nonexistent context ‘app-chanspy-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘app-zapbarge’ tries to include nonexistent context ‘app-zapbarge-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘app-pickup’ tries to include nonexistent context ‘app-pickup-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘findmefollow-ringallv2’ tries to include nonexistent context ‘findmefollow-ringallv2-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘ext-local-confirm’ tries to include nonexistent context ‘ext-local-confirm-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘macro-dial’ tries to include nonexistent context ‘macro-dial-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘app-userlogonoff’ tries to include nonexistent context ‘app-userlogonoff-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘app-blacklist-last’ tries to include nonexistent context ‘app-blacklist-last-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘app-blacklist-remove’ tries to include nonexistent context ‘app-blacklist-remove-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘app-blacklist-add-invalid’ tries to include nonexistent context ‘app-blacklist-add-invalid-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘app-blacklist-add’ tries to include nonexistent context ‘app-blacklist-add-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘app-blacklist-check’ tries to include nonexistent context ‘app-blacklist-check-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘app-blacklist’ tries to include nonexistent context ‘app-blacklist-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘app-vmmain’ tries to include nonexistent context ‘app-vmmain-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘app-dialvm’ tries to include nonexistent context ‘app-dialvm-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘vm-callme’ tries to include nonexistent context ‘vm-callme-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘sub-rgsetcid’ tries to include nonexistent context ‘sub-rgsetcid-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘ext-group’ tries to include nonexistent context ‘ext-group-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘macro-systemrecording’ tries to include nonexistent context ‘macro-systemrecording-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘systemrecording-gui’ tries to include nonexistent context ‘systemrecording-gui-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘app-page-stream’ tries to include nonexistent context ‘app-page-stream-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘app-paging’ tries to include nonexistent context ‘app-paging-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘autoanswer’ tries to include nonexistent context ‘autoanswer-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘macro-autoanswer’ tries to include nonexistent context ‘macro-autoanswer-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘ext-intercom-users’ tries to include nonexistent context ‘ext-intercom-users-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘ext-intercom’ tries to include nonexistent context ‘ext-intercom-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘sub-hr12format’ tries to include nonexistent context ‘sub-hr12format-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘app-speakingclock’ tries to include nonexistent context ‘app-speakingclock-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘’ tries to include nonexistent context ‘-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘sub-hr24format’ tries to include nonexistent context ‘sub-hr24format-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘app-speakextennum’ tries to include nonexistent context ‘app-speakextennum-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘app-echo-test-echo’ tries to include nonexistent context ‘app-echo-test-echo-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘app-echo-test’ tries to include nonexistent context ‘app-echo-test-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘app-calltrace-perform’ tries to include nonexistent context ‘app-calltrace-perform-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘app-calltrace’ tries to include nonexistent context ‘app-calltrace-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘ext-featurecodes’ tries to include nonexistent context ‘ext-featurecodes-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘macro-one-touch-record’ tries to include nonexistent context ‘macro-one-touch-record-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘sub-record-check’ tries to include nonexistent context ‘sub-record-check-custom’
[2016-07-19 01:03:20] WARNING[27205] pbx.c: Context ‘sub-record-cancel’ tries to include nonexistent context ‘sub-record-cancel-custom’
[2016-07-19 01:03:20] VERBOSE[27205] loader.c: – Reloading module ‘res_adsi.so’ (ADSI Resource)

Incomming call part (in 3d row I can see the call):
[2016-07-19 01:13:10] SECURITY[1803] res_security_log.c: SecurityEvent=“ChallengeSent”,EventTV=“1468883590-263835”,Severity=“Informational”,Service=“SIP”,EventVersion=“1”,AccountID=“57”,SessionID=“0x71c03714”,LocalAddress=“IPV4/UDP/192.168.1.100/5060”,RemoteAddress=“IPV4/UDP/192.168.1.158/5060”,Challenge=“4090dcb7”
[2016-07-19 01:13:10] SECURITY[1803] res_security_log.c: SecurityEvent=“SuccessfulAuth”,EventTV=“1468883590-301469”,Severity=“Informational”,Service=“SIP”,EventVersion=“1”,AccountID=“57”,SessionID=“0x71c03714”,LocalAddress=“IPV4/UDP/192.168.1.100/5060”,RemoteAddress=“IPV4/UDP/192.168.1.158/5060”,UsingPassword=“1”
[2016-07-19 01:13:13] SECURITY[1803] res_security_log.c: SecurityEvent=“ChallengeSent”,EventTV=“1468883593-207285”,Severity=“Informational”,Service=“SIP”,EventVersion=“1”,AccountID="sip:[email protected];user=phone",SessionID=“0x71c3c62c”,LocalAddress=“IPV4/UDP/44.33.22.11/5060”,RemoteAddress=“IPV4/UDP/62.80.216.2/5060”,Challenge=“45451642”
[2016-07-19 01:13:17] SECURITY[1803] res_security_log.c: SecurityEvent=“ChallengeSent”,EventTV=“1468883597-615017”,Severity=“Informational”,Service=“SIP”,EventVersion=“1”,AccountID=“59”,SessionID=“0x71ccb354”,LocalAddress=“IPV4/UDP/192.168.1.100/5060”,RemoteAddress=“IPV4/UDP/192.168.1.158/5060”,Challenge=“5a3760f8”
[2016-07-19 01:13:17] SECURITY[1803] res_security_log.c: SecurityEvent=“SuccessfulAuth”,EventTV=“1468883597-653361”,Severity=“Informational”,Service=“SIP”,EventVersion=“1”,AccountID=“59”,SessionID=“0x71ccb354”,LocalAddress=“IPV4/UDP/192.168.1.100/5060”,RemoteAddress=“IPV4/UDP/192.168.1.158/5060”,UsingPassword=“1”
[2016-07-19 01:13:20] SECURITY[1803] res_security_log.c: SecurityEvent=“ChallengeSent”,EventTV=“1468883600-245879”,Severity=“Informational”,Service=“SIP”,EventVersion=“1”,AccountID=“54”,SessionID=“0x71d5aacc”,LocalAddress=“IPV4/UDP/192.168.1.100/5060”,RemoteAddress=“IPV4/UDP/192.168.1.158/5060”,Challenge=“47e2e2c7”
[2016-07-19 01:13:20] SECURITY[1803] res_security_log.c: SecurityEvent=“SuccessfulAuth”,EventTV=“1468883600-284314”,Severity=“Informational”,Service=“SIP”,EventVersion=“1”,AccountID=“54”,SessionID=“0x71d5aacc”,LocalAddress=“IPV4/UDP/192.168.1.100/5060”,RemoteAddress=“IPV4/UDP/192.168.1.158/5060”,UsingPassword=“1”

From the WIKI to trace calls.
Unfortenately no wanpipemon in my system for tracing.
tcpdump was present but didn’t work either.

So, yes I’ve no tried for more than a week and is now defeated.
Hope someone with more knowledge than me, can give me a hint where I have failed.
Where is the darn checkbox I’ve missed after so many hours??

// Kim - Sweden - qunaki

hello:
there is no incoming call routing logs.

I do believe that you need to set up the “standard” router port forwarding for this to work: This would include ports 5060. 5061, and the RTP block (10000-20000). This way, your provider can reach your PBX from the outside world.

If you are using Chan-SIP for your incoming connection, you will also need to make sure which port (5060 or 5061) the incoming call will be arriving on. If you set up the SIP connection to your provider in Chan-SIP, the default port for that (from the Distro) is 5061. You may also need to let your provider know that you are using a non-standard port for your incoming traffic.

In an effort to obfuscate your incoming SIP connection (and assuming your provider allows it) you may want to “move” the local port number (the one your provider connects to) to something a little more non-standard. Ports like 6050 and 9061 are useful and make it harder for script-kiddie to find your SIP connection port.

Hi James,

I’m new to this sw (and it seems like I never become familliar with all linux distros), so I don’t even know were that incooming log might be stored.
The asterisk log and freepbx I know where they are. Does it have a specific name?

Hi cynjut,

Thanks for your reply - appreciate it from both of you and James.
But don’t you think it’s odd that it works directly with x-lite and directly to the Gigasets (no ports changed)?
Saw another answer (god knows where right now), that if one had to direct ports; then there was something else that was not right configured.

But I’ll try your advices and we’ll see where I land.
Just brought home a snom from my work, so I’ll se what that will give me.

// Kim

Not really - both of those systems use STUN servers to set up the NAT requirements for the system. In other words, those phones know and understand what needs to happen to get through the firewall.

For a server, the incoming data (the SYN packets for the system) need to be routed to a port on your firewall, which then forwards them (with appropriate header changes) to your internal server.

Now, if your system is “in the wild” (has a routable address) then none of this applies and you need to look at your firewall setup.

Basically, look up “asterisk one way audio NAT” to get a feel for the kinds of changes that need to happen to a server behind a firewall.

Ok Mr D,

Ok, sounds fare about the STUN-handling, so I port forwarded port 5060, 5061 + intervall 10000-20000 [both TCP/UDP - don’t bother trying it out] to my PBX (192.168.1.100).
Guess I had no luck here, still the same - no inward calls.
(at work we have another VoIP-supplier and had the stun settings sent to us - a silly checkbox made it all work… - that is a MyPBX Standard hw).

Tried the Snom - can do internals and outbound, but no inbound.
Feels like James is right - I have to get info from the call log (tried trace route calls).
But that didn’t show me anything - just old outgoing calls.

Remember English is not my mother of tounge. I feel like a retard sometimes and don’t get the picture about the language, i.e. I read but apparently don’t understand.

Thanks again for being with me so far.

// Kim

the system incoming routing does not really care your phones through NAT or STUN. If your phones are not regiestered, at least remoe side call can come into the incoming routing, maybe there is no voice only if you face NAT issues. It looks you do not get the incoming call in the system with right logic or maybe your remote donot call to this system with the routing.

The logs on the router is crap from the incomming part on the Linksys, every ip-address is going to port 51586.

The outgoing log is ok, I can see the gigaset (192.168.1.158) calling 148.251.x.x on port “sip” <- linksys unfortenately adress it with namne, not portnumber.

Have opened/redirected the ports to FreePBX, but that didn’t do it.
Worst is trying port forwards with:
http://www.yougetsignal.com/tools/open-ports/
and http://ping.eu/port-chk/
Both says 5060 is closed.

But right now I have a worse problem. 4am one handset woke me up ringin, and ringin again (tossed it far away).
This still keeps on going. I have random numbers calling one handset. Right now I have had several hundreds of call, with 5 min intervalls - and only to one handset.
Numbers are random to, 108, 109, 10101, 503, 800, 511, 701 etc.
I haven’t used the system to log to know where to stop this “abuse”.
To get rid of it I will kill that extension now, restart, and redo it.
Heck what annoying it is - it is absolutely not a feature I want in my system.
Right now 110 is calling, so I have to go :-).

Dude the port forward that you made is an open door to attacks. Those calls are coming from there, close the ports.
If you register with a provider you don’t need to port forward. In you sip settings change the localnet setting. What you have there doesn’t work.
Just put the following

192.168.1.0/255.255.255.0

remove the rest.

Yeah! I had a bit of calls, made me and the family go crazy.
Factory reseted the Gigaset, but it came back.
The port forward with the (trying out) setting: Allow Anonymous Inbound SIP Calls made this.
So yes it’s all gone, and it’s quiet again.

Those local settings was set by Detect Network settings, but thansfor the warning.
Agree that port forwarding should not be need to be used.
A real firewall should only be setup to accept specific aip-adresses on specified ports, but that is tons of work before it’s all set.

Right now not even outgoing works. It must be the softphone registered ok with the supplier and FreePBX used that registering.
Thus I only needed the four lines on the Peer and it worked. After rebooting the PBX, I now can’t make any outgoing calls either.

If your softphone worked then there is a sip firewall somewhere in the way. Change the bind port of asterisk e.g.42589 and try again.

astbox.
First thought the ghost calls came from the gigasets itself. Factory reseted and restored everything, but it came back.
Deleted the port forwards and deselected “allow anonymous sip calls” and it went silent. Yes, I knew there should not be needed to portforward - but I was clutching at straws.
Unfortenately even outbound went silent with an internal gigaset error code 814 - “General socket layer error: socket is not reachable”.
Felt like I tried everything I could do. But late last night I finally dumped in a stored backup into the gigaset N300A and the phones started to work again. Rebooted the FreePBX also, and after that inbound calls started to worked too - finally.
Rebooted it again, brushed my teeth, tried again and it still worked.
Glad I went to bed… 1.30 AM :-).

What ever was the real reason not working/working I thank you for your suggestions. Now I’m at least on the right track.
Now I have backed (even made a spare card) it all up and it feels like I now can start play.

Rebooting now took a while to get it work again - but I can live with that (will not reboot to often).
But oddly my test-Gigaset is not calling the outbound route, but to my internal Snom-phone (another gigaset tried, worked ok) - odd, but that’s another problem.
Now I can start configure my system - again thanks a lot.

Going crazy here, I’m whom was glad for a minute ago. Now I’m back to square one again about the inbound calls.

Found the Gigaset handset problem: The backup a shoveled in had that phone to registered directly to the sip trunk (sip.clubtele.se) (I’ve tried a lot so that was not a surprise).
Sp i changed it back to register to the trunk again. Now that phone is working ok.
Unfortenately the inbound calls went dead the same second. Apparently it was the Gigaset that made the registration and FreePBX could handle it after that (a stupid solution, but I have a spare phone…).

Sunday tried wiresharking the x-lite- software. But most of those request was rejected by the sip-provider, yet it works.
REGISTER sip:sipclubtele.se -> 401 Unauthorized
REGISTER sip:sipclubtele.se -> 200 OK
SUBSCRIBE sip:[email protected] -> 405 Method now allowed
INVITE sip:[email protected] -> 401 Unauthorized
Here I made an outbound call. Send Request ACK, call was made,trying, ringing, caneled - all was ok.
Then I tried an inbound call: INVITE, trying, ringing etc. - also ok.

Wish I could do it with the PBX too.
Sometimes I can catch attempts from the asterisk full-log, but then they dissapear.
[2016-07-24 23:33:47] NOTICE[1893] chan_sip.c: Failed to authenticate on REGISTER to ‘[email protected]’ (Tries 3)
[2016-07-24 23:34:07] NOTICE[1893] chan_sip.c: – Registration for ‘[email protected]’ timed out, trying again (Attempt #5)
[2016-07-24 23:34:07] NOTICE[1893] chan_sip.c: Failed to authenticate on REGISTER to ‘[email protected]’ (Tries 3)

(Register works with Gigasets too and there is 5060 as the default port. I’ll try different bind ports now 5160 and a higher one suggested).

Just a moment. Connect to your freepbx and try to ping the sip.clubtele.se. Post here what do you get. Also make sure that the gigaset phones register with the FreePBX. Finally run the following command and post what you get

ip addr

#1:
PING sip.clubtele.se (62.80.216.2) 56(84) bytes of data.
64 bytes from aff-htg-sbc.leissner.se (62.80.216.2): icmp_seq=1 ttl=55 time=16.0 ms
64 bytes from aff-htg-sbc.leissner.se (62.80.216.2): icmp_seq=2 ttl=55 time=16.5 ms
64 bytes from aff-htg-sbc.leissner.se (62.80.216.2): icmp_seq=3 ttl=55 time=16.0 ms
64 bytes from aff-htg-sbc.leissner.se (62.80.216.2): icmp_seq=4 ttl=55 time=15.9 ms
64 bytes from aff-htg-sbc.leissner.se (62.80.216.2): icmp_seq=5 ttl=55 time=16.3 ms
64 bytes from aff-htg-sbc.leissner.se (62.80.216.2): icmp_seq=6 ttl=55 time=15.9 ms
^C
sip.clubtele.se ping statistics —
6 packets transmitted, 6 received, 0% packet loss, time 5006ms
rtt min/avg/max/mdev = 15.955/16.149/16.561/0.274 ms

This is pinged using putty.exe, else I don’t know where to ping from in the UI.

#2:
Yes, all the 4 phones are registred with FreePBX and works fine (except from that one that was for a little while connected directly to voip-supplier),

#3:
root@raspbx:~# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:69:55:ba brd ff:ff:ff:ff:ff:ff
inet 192.168.1.100/24 brd 192.168.1.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::dc72:b141:a8a5:53c9/64 scope link
valid_lft forever preferred_lft forever
root@raspbx:~#

Don’t know if it matters, but FreePBX tries to register with [email protected], as x-lite register with sip:sip.clubtele.se
Tried to alter the registerstring, but no luck.
FreePBX doesn’t register, while x-lite and gigaset does at frist try.
Else I think everything will work, once it does - it has when the gigaset registered it for the PBX, then inbound worked too.

From the asterisk full-log (filtered with word “clubtele”):
[2016-07-25 22:04:15] NOTICE[1781] chan_sip.c: –
Registration for ‘[email protected]’ timed out, trying again (Attempt

21)

[2016-07-25 22:04:15] NOTICE[1781] chan_sip.c: Failed to authenticate on REGISTER to ‘[email protected]’ (Tries 3)

From x-lite registering with ok (wireshark data):
Request REGISTER sip:sip.clubtele.se (which was replied OK, code 200)

Frame 50: 874 bytes on wire (6992 bits), 874 bytes captured (6992 bits)
Encapsulation type: Ethernet (1)
Arrival Time: Jul 24, 2016 17:02:26.888399000 V�steuropa, sommartid
[Time shift for this packet: 0.000000000 seconds]
Epoch Time: 1469372546.888399000 seconds
[Time delta from previous captured frame: 0.013191000 seconds]
[Time delta from previous displayed frame: 0.013191000 seconds]
[Time since reference or first frame: 7.998399000 seconds]
Frame Number: 50
Frame Length: 874 bytes (6992 bits)
Capture Length: 874 bytes (6992 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: eth:ethertype:ip:udp:sip]
[Coloring Rule Name: UDP]
[Coloring Rule String: udp]
Ethernet II, Src: Azurewav_7d:7e:7e (dc:85:de:7d:7e:7e), Dst: BelkinIn_2e:1d:71 (14:91:82:2e:1d:71)
Internet Protocol Version 4, Src: 192.168.1.186, Dst: 62.80.216.2
User Datagram Protocol, Src Port: 51079 (51079), Dst Port: 5060 (5060)
Session Initiation Protocol (REGISTER)
Request-Line: REGISTER sip:sip.clubtele.se SIP/2.0
Method: REGISTER
Request-URI: sip:sip.clubtele.se
Request-URI Host Part: sip.clubtele.se
[Resent Packet: False]
Message Header
Via: SIP/2.0/UDP 192.168.1.186:51079;branch=z9hG4bK-524287-1—c0ddad7ce203d601;rport
Max-Forwards: 70
Contact: sip:[email protected]:51079;rinstance=c1037f71102f3379
To: "045234567"sip:[email protected]
From: "045234567"sip:[email protected];tag=56bfed27
Call-ID: 79961NmJhMmNiZjY3MjA2NGRhODZkODhmZTM0MTUxNzVkYTQ
CSeq: 2 REGISTER
Expires: 3600
Allow: SUBSCRIBE, NOTIFY, INVITE, ACK, CANCEL, BYE, REFER, INFO, OPTIONS, MESSAGE
User-Agent: X-Lite release 4.9.3 stamp 79961
[truncated]Authorization: Digest username=“045234567”,realm=“clubtele.se”,nonce=“1469372543:60242b3fb9bbab9ea19b90dcad089774”,uri=“sip:sip.clubtele.se”,response=“dc0886e0b49ef5c9fcfd4e5cbf410705”,cnonce=“31d00380ce235bcdfe87f497653fdb56”,
Content-Length: 0

Reply was:
Frame 51: 469 bytes on wire (3752 bits), 469 bytes captured (3752 bits)
Encapsulation type: Ethernet (1)
Arrival Time: Jul 24, 2016 17:02:26.906417000 V�steuropa, sommartid
[Time shift for this packet: 0.000000000 seconds]
Epoch Time: 1469372546.906417000 seconds
[Time delta from previous captured frame: 0.018018000 seconds]
[Time delta from previous displayed frame: 0.018018000 seconds]
[Time since reference or first frame: 8.016417000 seconds]
Frame Number: 51
Frame Length: 469 bytes (3752 bits)
Capture Length: 469 bytes (3752 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: eth:ethertype:ip:udp:sip]
[Coloring Rule Name: UDP]
[Coloring Rule String: udp]
Ethernet II, Src: BelkinIn_2e:1d:71 (14:91:82:2e:1d:71), Dst: Azurewav_7d:7e:7e (dc:85:de:7d:7e:7e)
Internet Protocol Version 4, Src: 62.80.216.2, Dst: 192.168.1.186
User Datagram Protocol, Src Port: 5060 (5060), Dst Port: 51079 (51079)
Session Initiation Protocol (200)
Status-Line: SIP/2.0 200 OK
Status-Code: 200
[Resent Packet: False]
[Request Frame: 50]
[Response Time (ms): 18]
Message Header
Via: SIP/2.0/UDP 192.168.1.186:51079;branch=z9hG4bK-524287-1—c0ddad7ce203d601;rport=51079
Contact: sip:[email protected]:51079;expires=3600
To: "045234567"sip:[email protected];tag=4fee9412
From: "045234567"sip:[email protected];tag=56bfed27
Call-ID: 79961NmJhMmNiZjY3MjA2NGRhODZkODhmZTM0MTUxNzVkYTQ
CSeq: 2 REGISTER
Date: Sun, 24 Jul 2016 15:02:23 GMT
Content-Length: 0

BTW (forgot to mention): Tired both port 5160 (the new default) and 51079 (used successfully on X-lite - which has always had the password deleted - and has been closed/or uninstalled to not let it interfear).
And when the inbound worked yesterday was apparently not the real truth. It happened to be the same phone I had in the inbound trunk as the only extension as the one I had connected directly - bad thing to do, I know (tried to connect another one now and that only one rang [now I’ve done so many settings I can’t recall all the ones, but somethings say in my head that even the snom rang then - which it shouln’t. So now I’m lost what was what and happened when - sorry] - unmarked the new one for non incomming calls and nothing happened, cell was disconnected).

Found out there was a call log CDR
Scanning that and I find 3 old incomming calls in that log (but it has not made it thrugh to the inbound - 'cause then I’d stopped changes anything).

Call Date, Recording, System, CallerID, Outbound CallerID, DID, App, Destination, Disposition, Duration
2016-07-09 16:09:00 1468073340.7 0708123456 Congestions [from-sip-external] ANSWERED 00:12

2016-07-09 16:03:18 1468072998.6 0708123456 Congestions [from-sip-external] ANSWERED 00:12

2016-07-08 21:51:34 1468007494.3 0708123456 Congestions [from-sip-external] ANSWERED 00:12

one expanded:
Time, Event, CNAM, CNUM, ANI, DID, AMA, exten, context, App, channel
2016-07-09 16:03:18 CHAN_START 0708123456 070812345 DEFAULT 04523456 from-sip-external SIP/clubtele.se-00000006

2016-07-09 16:03:18 ANSWER 0708123456 0708123456 0708123456 045234567 DEFAULT s from-sip-external Answer SIP/clubtele.se-00000006

2016-07-09 16:03:30 HANGUP 0708123456 0708123456 0708123456 045234567 DEFAULT h from-sip-external SIP/clubtele.se-00000006

2016-07-09 16:03:30 CHAN_END 0708123456 0708123456 0708123456 045234567 DEFAULT h from-sip-external SIP/clubtele.se-00000006

2016-07-09 16:03:30 LINKEDID_END 0708123456 0708123456 0708123456 045234567 DEFAULT h from-sip-external SIP/clubtele.se-00000006

These look like the spoke calls I had when the port was forwarded.
Duration 12 seconds for all, but these where real calls.
CDR is full of those ghosts, and I didn’t find a good way to delete them (easier see what’s in the log for real).
Some say they are stored in the full-log others say db-stored.

From Reports - Asterisk Info - Registries:
Host dnsmgr Username Refresh State Reg.Time
sip.clubtele.se:5060 Y sip 120 Auth. Sent
1 SIP registrations.

From Reports - Asterisk Info - Subscriptions:
AMPUSER/Exten is unavailable.

-= Registered Asterisk Dial Plan Hints =-
                 55@ext-local           : SIP/55,CustomPresenc  State:Idle            Watchers  0
                 56@ext-local           : SIP/56,CustomPresenc  State:Idle            Watchers  0
                 57@ext-local           : SIP/57,CustomPresenc  State:Idle            Watchers  0
                 58@ext-local           : SIP/58,CustomPresenc  State:Idle            Watchers  0
                 59@ext-local           : SIP/59,CustomPresenc  State:Idle            Watchers  0
             _*80X.@ext-local           : ${DB(AMPUSER/${EXTEN  State:Unavailable     Watchers  0

Found out about Asterisk CLI and installed it.
Debug sip.
Here I can se the calls comming in with INVITE, but some ACK with NAT get errorcode 401.
Something refuse to take it the last step.

CLI SIP DEBUG:
<------------->
[2016-07-28 22:14:36] VERBOSE[1679] chan_sip.c: — (13 headers 0 lines) —
[2016-07-28 22:14:36] VERBOSE[1679] chan_sip.c: Really destroying SIP dialog ‘[email protected]:5060’ Method: OPTIONS
[2016-07-28 22:14:47] VERBOSE[1679] chan_sip.c:
<— SIP read from UDP:62.80.216.2:5060 —>
INVITE sip:[email protected]:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP 62.80.216.2:5060;branch=z9hG4bK-524287-1—8a86d04b08139d3f;rport
Max-Forwards: 70
Contact: sip:[email protected]
To: "045234567"sip:[email protected]:5060;user=phone
From: "070823456"sip:[email protected];user=phone;tag=90c0cf25
Call-ID: hWYwDBOIXS4a6mFOjtx__Q…
CSeq: 1 INVITE
Session-Expires: 3600;refresher=uac
Min-SE: 3600
Allow: INVITE, ACK, BYE, CANCEL
Content-Type: application/sdp
Supported: timer
User-Agent: LEICA-1.8.39-RC3
X-Ecan: On
Content-Length: 444

v=0
o=- 47381316 0 IN IP4 88.131.198.35
s=Cisco SDP 0
c=IN IP4 88.131.198.35
t=0 0
m=audio 38948 RTP/AVP 8 18 0 101
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sqn:0
a=cdsc: 1 audio RTP/AVP 8 18 0 101
a=cdsc: 5 image udptl t38
a=cpar: a=T38FaxVersion:0
a=cpar: a=T38FaxRateManagement:transferredTCF
a=cpar: a=T38FaxMaxDatagram:160
a=cpar: a=T38FaxUdpEC:t38UDPRedundancy
a=X-sqn:0
a=X-cap: 1 image udptl t38
a=sendrecv
<------------->
[2016-07-28 22:14:47] VERBOSE[1679] chan_sip.c: — (16 headers 18 lines) —
[2016-07-28 22:14:47] VERBOSE[1679] chan_sip.c: Sending to 62.80.216.2:5060 (NAT)
[2016-07-28 22:14:47] VERBOSE[1679][C-0000000a] chan_sip.c: Sending to 62.80.216.2:5060 (NAT)
[2016-07-28 22:14:47] VERBOSE[1679][C-0000000a] chan_sip.c: Using INVITE request as basis request - hWYwDBOIXS4a6mFOjtx__Q…
[2016-07-28 22:14:47] VERBOSE[1679][C-0000000a] chan_sip.c: Found peer ‘affinity’ for ‘070823456’ from 62.80.216.2:5060
[2016-07-28 22:14:47] VERBOSE[1679][C-0000000a] chan_sip.c:
<— Reliably Transmitting (NAT) to 62.80.216.2:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 62.80.216.2:5060;branch=z9hG4bK-524287-1—8a86d04b08139d3f;received=62.80.216.2;rport=5060
From: "070823456"sip:[email protected];user=phone;tag=90c0cf25
To: "045234567"sip:[email protected]:5060;user=phone;tag=as242ff9fa
Call-ID: hWYwDBOIXS4a6mFOjtx__Q…
CSeq: 1 INVITE
Server: FPBX-13.0.163(11.22.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce="7367e6b6"
Content-Length: 0

<------------>
[2016-07-28 22:14:47] VERBOSE[1679][C-0000000a] chan_sip.c: Scheduling destruction of SIP dialog ‘hWYwDBOIXS4a6mFOjtx__Q…’ in 32000 ms (Method: INVITE)
[2016-07-28 22:14:47] SECURITY[1633] res_security_log.c: SecurityEvent=“ChallengeSent”,EventTV=“1469736887-385124”,Severity=“Informational”,Service=“SIP”,EventVersion=“1”,AccountID="sip:[email protected];user=phone",SessionID=“0x7668cc14”,LocalAddress=“IPV4/UDP/46.59.21.14/5060”,RemoteAddress=“IPV4/UDP/62.80.216.2/5060”,Challenge=“7367e6b6”
[2016-07-28 22:14:47] VERBOSE[1679] chan_sip.c:
<— SIP read from UDP:62.80.216.2:5060 —>
ACK sip:[email protected]:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP 62.80.216.2:5060;branch=z9hG4bK-524287-1—8a86d04b08139d3f;rport
Max-Forwards: 70
To: "045234567"sip:[email protected]:5060;user=phone;tag=as242ff9fa
From: "070823456"sip:[email protected];user=phone;tag=90c0cf25
Call-ID: hWYwDBOIXS4a6mFOjtx__Q…
CSeq: 1 ACK
Content-Length: 0

<------------->
[2016-07-28 22:14:47] VERBOSE[1679] chan_sip.c: — (8 headers 0 lines) —
[2016-07-28 22:15:00] SECURITY[1633] res_security_log.c: SecurityEvent=“SuccessfulAuth”,EventTV=“1469736900-617897”,Severity=“Informational”,Service=“AMI”,EventVersion=“1”,AccountID=“admin”,SessionID=“0x761014bc”,LocalAddress=“IPV4/TCP/127.0.0.1/5038”,RemoteAddress=“IPV4/TCP/127.0.0.1/54950”,UsingPassword=“0”,SessionTV=“1469736900-617880”
[2016-07-28 22:15:02] SECURITY[1633] res_security_log.c: SecurityEvent=“SuccessfulAuth”,EventTV=“1469736902-148310”,Severity=“Informational”,Service=“AMI”,EventVersion=“1”,AccountID=“admin”,SessionID=“0x761014bc”,LocalAddress=“IPV4/TCP/127.0.0.1/5038”,RemoteAddress=“IPV4/TCP/127.0.0.1/54954”,UsingPassword=“0”,SessionTV=“1469736902-148290”
[2016-07-28 22:15:04] SECURITY[1633] res_security_log.c: SecurityEvent=“SuccessfulAuth”,EventTV=“1469736904-785242”,Severity=“Informational”,Service=“AMI”,EventVersion=“1”,AccountID=“admin”,SessionID=“0x7661274c”,LocalAddress=“IPV4/TCP/127.0.0.1/5038”,RemoteAddress=“IPV4/TCP/127.0.0.1/54958”,UsingPassword=“0”,SessionTV=“1469736904-785224”
[2016-07-28 22:15:06] SECURITY[1633] res_security_log.c: SecurityEvent=“SuccessfulAuth”,EventTV=“1469736906-527135”,Severity=“Informational”,Service=“AMI”,EventVersion=“1”,AccountID=“admin”,SessionID=“0x7663f4cc”,LocalAddress=“IPV4/TCP/127.0.0.1/5038”,RemoteAddress=“IPV4/TCP/127.0.0.1/54962”,UsingPassword=“0”,SessionTV=“1469736906-527109”
[2016-07-28 22:15:06] SECURITY[1633] res_security_log.c: SecurityEvent=“SuccessfulAuth”,EventTV=“1469736906-538226”,Severity=“Informational”,Service=“AMI”,EventVersion=“1”,AccountID=“admin”,SessionID=“0x722d197c”,LocalAddress=“IPV4/TCP/127.0.0.1/5038”,RemoteAddress=“IPV4/TCP/127.0.0.1/54966”,UsingPassword=“0”,SessionTV=“1469736906-538202”

Also found this link about no incomming calls and 401 error.

The problem/solution in the link was, secret on extensions should be erased. Should it be no password at all set in the extensions pxb registering then (and also in FreePBX of course)?
Seems like a bit odd, and some insecure. Even more odd since I have a ring group in the inbound route - that should have the incomming call.

Isn’t it typical. At 1 AM phones started to ring here at home (familly’s sleeping).
I’ll hope it’ll do it tomorrow too (can’t test right now).
Right now I don’t know what made it work (it’s too late) . hopefylly it will work after a reboot too.
I’ll update on how it went (after endless of hours/days/weeks trying).