Incoming Trunk /

Continuing the discussion from Configuring Trunk -

[cut quote]

I adjusted my SIP settings, also using their advice, I can get incoming call /once/ … and then repeated calls to the same number end up on providers’ log as ‘no answer’. (the first call also gets into ‘the number is not in service’… queue, don’t know why.)

(My PBX is behind 1:1 NAT and firewall is set up and it is correct, as I have an ordinary SIP phone {on another int/ext ip} attached to the same provider and that works)

System is latest Freepbx from cdrom with all updates up to yesterday.

You modified the config files like they suggested? Those instructions are not for systems with FreePBX.

You have to configure with trunks and routes.

@SkykingOH - I did not mod Asterisk files directly, if that’s what you mean - I tried to find appropriate places in the FreePBX GUI wizards where to put what;
I shall also mention, I changed some things re. the default, e.g. changed into Users & Extensions mode [because some users will have more than 1 extension]
I have done a Trunk : (given it a descriptive name, then in the PEER Details:


then underneath
User Context : entered [my_SIP_username] into that one, then
in the USER details:


In [my_PBX_address]/admin/config.php?display=sipsettings i tried changing NAT to different modes (mostly tried yes, no and route); canreinvite is set to NO;

Side note, my system spews some curious errors into log too :

[2014-07-23 09:10:34] ERROR[1823] pbx.c: You have to be kidding-- add exten '' to context app-blacklist? Figure out a name and call me back. Action ignored.

also this

[2014-07-23 09:10:41] WARNING[1878] sip/config_parser.c: nat=yes is deprecated, use nat=force_rport,comedia instead


[2014-07-23 09:10:42] WARNING[1823] pbx_config.c: The use of '_.' for an extension is strongly discouraged and can have unexpected behavior. Please use '_X.' instead at line 1744 of /etc/asterisk/extensions_additional.conf

look curious…

As i mentioned, upon successful registration, I get this in CDR : (trimmed&anonymized)

2014-07-24 16:46:55	CHAN_START	[caller]	[caller]			DEFAULT	[trunk]	from-sip-external		SIP/[server_ip]-00000002				
2014-07-24 16:46:55	ANSWER	[caller]	[caller]	[caller]	[trunk]	DEFAULT	s	from-sip-external	Answer	SIP/[server_ip]-00000002				
2014-07-24 16:47:03	HANGUP	[caller]	[caller]	[caller]	[trunk]	DEFAULT	h	from-sip-external		SIP/[server_ip]-00000002				
2014-07-24 16:47:03	CHAN_END	[caller]	[caller]	[caller]	[trunk]	DEFAULT	h	from-sip-external		SIP/[server_ip]-00000002				
2014-07-24 16:47:03	LINKEDID_END	[caller]	[caller]	[caller]	[trunk]	DEFAULT	h	from-sip-external		SIP/[server_ip]-00000002	

Detailed Call Detail Records
2014-07-24 16:46:55		1406216815.2	[caller]			Congestion	s [from-sip-external]	ANSWERED	00:08

but I only get it ONCE per PBX full restart, and after that, the providers’ server isn’t giving me any more calls, only logging attempts as ‘no answer’…

All I want for now is, that incoming calls start working reliably, hence I did not set up outgoing routes - incoming however is set, with destination set to ring all numbers (users) (for at least a test) - and I don’t know what am I actually missing…

I have tried modifying Asterisk SIP settings (nat: yes/no/never/route) (current setting: route)
also now my trunk config looks like: (all this, in FREEPBX GUI!)

Trunk name : [myuniquetrunkname]
Peer details:


USER Context : [sip_username]
USER Details:
context=from-trunk <<< this I think was causing it to tangle into congestion queue before

Also I tried using register string:


where I tried DID of either being the ‘internal’ Blueface extension number, or the ‘full geographic’ 353xxxxxxxx - no change in behavior…

and I’m getting in Reports-> Asterisk Info->Sip Peers:

Name/username: [myuniquetrunkname]/[sip_username]
Host:  [providers’ IP] 
Dyn :
Forcerport: No
Comedia: No
Port: 5060
Status: OK (36ms)

And still,
I can only receive a call through the providers’ account ONCE (per pbx restart or some timeout which I haven’t figured out yet… )
Subsequent attempts to ring the number [from same [landline] or from another [mobile/android] phone] end up denied and provider lists them as ‘no answer’ in their CDR (my android mobile phone shows just ‘call ended’, a landline phone beeps me the ‘unavailable’/‘call ended’ beeps (tu-ta-ti, sorry for the phonics…)).

[edit: log disclaimer]
And, of course, when it succeeds, logs [i’ve split verbose and full] look OK - no errors are reported for the duration of the call - but when I get ‘no answer’ on caller side, NOTHING relevant appears in any of the logs at all…

Please can someone hint what the … am I missing ?

OK so thanks to cdolese help on IRC, it’s been established, that:

  • if call is answered, same caller can get through to dest every time

  • if call is hung up by caller BEFORE dest can aswer, my provider seems to block it from calling again.

  • but only until ‘amportal restart’ is done on my side - so re-register is forced - after that it works OK again for every caller.

  • a SIP ATA conf’d 100% alike re/ NAT only diff. IP, this problem doesn’t happen: call gets through whether caller hung up or not before.

THX & Regs.

With help of the provider, the issue has been resolved.

My issue was actually a couple of things:

  • I meddled too much with SIP registration / keep-alive timers (Settings -> Asterisk SIP settings -> Media &RTP Settings and Registration settings
    (Registration settings are now : registertimeout: 120, minexpiry 60, maxexpiry 3600, defaultexpiry 120) (still looking for what the ‘factory defaults’ were…) found ± OK by looking at ngrep output, where Blueface’s packets had expires: 113 or so)

  • my server is behind NAT but 1:1 Nat’d to specific static IP address [though only on port 5060 and the RTP range of ports] - I had to set NAT to YES on Asterisk SIP Settings, Blueface support said they detect it being behind NAT and send keepalives themselves… that still persists, but with more than 1 incoming SIP trunk, and call routing set on BF, impact is not really that observable since BF call routing handles this: if one trunk is not reachable, it tries the other ones;

  • I found that registration DID has to be set equal to BF SIP Username so that register string that works looks like this : SIPUsername:[email protected][blueface server address]/SIPUsername so that when registered, your host is displayed as [email protected]:port in Blueface status;

(notice NO ext number or geographic or IrishVoIP after the: just username)
(blueface server address : tested on, this being business-end, /not/ tried

  • with DID/reg.string as above, incoming trunks have to have the SIPUsername in DID Number field - FreePBX warns about it but it does work fine (for me anyway)

  • when looking at asterisk -vvvvr the cause for the above becomes quite apparent: when incoming line is ringing, DID is reported as the SIPUsername

…all said above, is YMMV of course and I am still learning…

Hi, I am having similar issues occasionally, was it easy to get help from Blueface?
Are they familiar with Freepbx GUI?

If you ask correct questions, you will get correct answers - but not for specifics like FreePBX, no.

Spent hours on this, even after getting pointers from Blueface. After much goggling I found a post that was very useful I edited /etc/hosts and added a line:

No issues since!



this by itself is (to me, sorry) not enough for an answer, even if it actually works: it would hint that the blueface host name is not being resolved quick and reliably enough ? Just a couple of wild guesses: What are your DNS settings ? your /etc/resolv.conf ? Where is your server taking the DNS answers from ? Maybe running ngrep on your server watching port 53 (yes /both/ tcp and udp) would go for another hint?
(my server runs on my network ‘alongside’ the intranet name resolver which also is the first on the list of DNS servers, but mainly caches requests to DNS; and I use and as the next ones on the list)

Also the thread you’re quoting has this rather interesting ending too.

I have actually reduced the max expiry time from 3600 to 900 seconds and it’s working acceptably since about 1.5-2 weeks.


There was another ‘hitch’ which was my dialplan: I had ALL the internal devices under one user… so only one call at a time could ‘ring’. So I created users (in d&e mode) and put them into ring group, and assigned devices to extensions, then it still wasn’t working as expected… until I changed the ringing strategy to ‘hunt’ instead of ringall.

Maybe there is another option I am missing: how to make the ring group ring all phones but still accept 2 concurrent “ring’s” from outside (i.e. not tell the originator of the slightly-later-received ring that it’s busy?) (without using IVR to ‘handle’ the call, I should add)

Phones are a mix of Cisco SPA112 and SPA301 (and MicroSIP on computers). CW is on and concurrency is set to no limit on FPBX. Also FreePBX 12.0.1rc32 (I like the new look too)

Incredibly difficult for you, I’m pretty sure that no-one knows what you are talking about, see my other post to you.