No outgoing calls? (incoming OK ...)


FreePBX 12.0.70 (in the flavor “Incredipble PBX v 12.0.30” distributed by Ward Mundy, PBX-in-a-Flash, PIAF)
Asterisk 13.6.0
Rasbian 7`


a) SIP connecting in principle works from home net:
Test: Zoiper on PC with direct registration at VoIP trunk Germen Telekom, works in both directions

b) networking in principle works
incoming calls from Telekom (over VoIP trunk) are terminated on the Asterisk PBX, the correct endpoints ring, call can be accepted, voice works both ways, call termination ok

c) outgoing calls do NOT work.
Asterisk sends REGISTER to Telekom (or any other configured trunk, it’s the same with all of them), get a REJECT and does NOT send a new REGISTER with auth information.

No joy at all …

-- Executing [[email protected]:1] Macro("PJSIP/6009-00000028", "user-callerid,LIMIT,EXTERNAL,") in new stack
-- Executing [[email protected]:1] Set("PJSIP/6009-00000028", "TOUCH_MONITOR=1495794155.241") in new stack
-- Executing [[email protected]:2] Set("PJSIP/6009-00000028", "AMPUSER=6009") in new stack
-- Executing [[email protected]:3] GotoIf("PJSIP/6009-00000028", "0?report") in new stack
-- Executing [[email protected]:15] ExecIf("PJSIP/6009-00000028", "1?Set(DIAL_TRUNK_OPTIONS=M(setmusic^1FM-60s-today))") in new stack
-- Executing [[email protected]:16] ExecIf("PJSIP/6009-00000028", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^1FM-60s-today)M(confirm))") in new stack
-- Executing [[email protected]:17] Macro("PJSIP/6009-00000028", "dialout-trunk-predial-hook,") in new stack
-- Executing [[email protected]:1] MacroExit("PJSIP/6009-00000028", "") in new stack
-- Executing [[email protected]:18] GotoIf("PJSIP/6009-00000028", "0?bypass,1") in new stack
-- Executing [[email protected]:19] ExecIf("PJSIP/6009-00000028", "1?Set(CONNECTEDLINE(num,i)=017x564yyyy)") in new stack
-- Executing [[email protected]:20] ExecIf("PJSIP/6009-00000028", "1?Set(CONNECTEDLINE(name,i)=CID:01738964133)") in new stack
-- Executing [[email protected]:21] GotoIf("PJSIP/6009-00000028", "0?customtrunk") in new stack
-- Executing [[email protected]:22] Dial("PJSIP/6009-00000028", "PJSIP/[email protected],300,M(setmusic^1FM-60s-today)") in new stack
-- Called PJSIP/[email protected]
== Everyone is busy/congested at this time (1:0/0/1)
-- Executing [[email protected]:23] NoOp("PJSIP/6009-00000028", "Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 21") in new stack

Call flow for db99ec3a-31cf-4d8c-8f5a-49a58c364a73 (Color by Request/Response)
│SIP/2.0 200 OK │Via: SIP/2.0/UDP 84.178.yyy.zzz:5060;received=84.178.yyy.zzz;rport=5060;branch=z9hG4bKPj23966b68-40b2-
──────────┬───────── ──────────┬─────────│b1-8cac-8681eccad821
│ REGISTER │ │To: <sip:[email protected]>;tag=h7g4Esbg_92fb3a4d0e5db6f8e0c950f8c6a3522d
13:09:05.481550 │ ──────────────────────────> │ │From: <sip:[email protected]>;tag=7ab1ef92-2309-48ab-bd17-398bc690b5d4
+0.014514 │ 200 OK │ │Call-ID: db99ec3a-31cf-4d8c-8f5a-49a58c364a73
13:09:05.496064 │ <────────────────────────── │ │CSeq: 19985 REGISTER
+650.010981 │ REGISTER │ │Contact: <sip:[email protected]:5060>;expires=660
13:19:55.507045 │ ──────────────────────────> │ │P-Associated-Uri: <sip:[email protected]>
+0.014459 │ 200 OK │ │P-Associated-Uri: <tel:+4951XX92XZZZ>
13:19:55.521504 │ <────────────────────────── │ │Service-Route: <sip:;transport=udp;lr>
+650.016296 │ REGISTER │ │Content-Length: 0
13:30:45.537800 │ ──────────────────────────> │ │Authentication-Info: qop=auth,rspauth="a89e2fa5e75d1a74fdf4cae83023966e",cnonce="bab4ea33-27b0-40b9-
+0.014319 │ 200 OK │ │aa-83898e4be771",nc=00000001
13:30:45.552119 │ <────────────────────────── │ │
+650.013206 │ REGISTER │ │
13:41:35.565325 │ ──────────────────────────> │ │
+0.112846 │ 401 Unauthorized 010330345 │ │
13:41:35.678171 │ <────────────────────────── │ │
+0.018954 │ REGISTER │ │
13:41:35.697125 │ ──────────────────────────> │ │
+0.077489 │ 200 OK │ │
13:41:35.774614 │ <────────────────────────── │ │
+650.017069 │ REGISTER │ │
13:52:25.791683 │ ──────────────────────────> │ │
+0.014575 │ 200 OK │ │
13:52:25.806258 │ <────────────────────────── │ │
+650.035921 │ REGISTER │ │
14:03:15.842179 │ ──────────────────────────> │ │
+0.014282 │ 200 OK │ │
14:03:15.856461 │ <────────────────────────── │ │
+650.005191 │ REGISTER │ │
14:14:05.861652 │ ──────────────────────────> │ │
+0.014066 │ 200 OK │ │
14:14:05.875718 │ <────────────────────────── │ │

There must be a principle error in the Asterisk config - but … where?

It looks like Asterisk does not register correctly :frowning:

at least the FreePBX generated pjsip*.conf file do look different from this:

But: HOW do I enter the correct values into the FreePBX WebGUI? Changing asterisk conf files does not work of course, as the next “save” from the GUI will overwirte everything

client_uri=sip:[email protected]:5060


contact=sip:[email protected]:5060



(password empty is the advised setting… Telekom authenticates only against the DSL line used)





Any help appriciated

KInd regards

Lot’s of people seem to be having problems with PJSIP, especially on trunks.
Plenty of threads here discussing that.
Change the trunk to chanSIP and that might make your problems go away.

Well, I did try chan_sip

That was a total deasaster. No REGISTER, no incoming calls, no outgoing calls, nothing worked

You where probably using a port that did not agree with your vendor , generally they expect 5060,This is not what is Used by Current versions of FreePBX for chan_sip, that is used by chan_pjsip, but you can easily swap them in the gui.

Well, yes, I do know that and I did use port 5060 (with chan_sip and chan_pjsip), which is the one German Telekom expects,

I’ve always had this problem (in UK) if I use public IP in asterisk sip settings, I changed it to fixed and it worked ok; but as I don’t have a fixed IP I had to use dynamic IP instead.
this may be your problem from beginning.

Sorry, but what do you mean?

In “General SIP settings” of course I do set the actual public IP address of my DSL connection.
This is a nearly static address, it changes once a week or so, an even then a bash shell script updated the pjsip settings files and restarts asterisk automatically.

I do not have a switch “dynamic IP / static IP” in the configuration at all - Asterisk can’t handle that as far as I know

:slight_smile: You should know further…

In the General SIP settings (these apply to both Chan-SIP and PJ-SIP) there are no settings for this.

In the Chan-SIP tab, there are different settings for the different types of configurations. The one that should take care of your situation is “dynamic IP”, which expects a host NAME from a service like DynDNS. Then, when you host IP changes, the system can still find you without having to resort to “shenanigans”.

IMPO, you should be using Chan-SIP for this connection. If you want to keep trying to use PJ-SIP, go ahead, but know that this problem set is well solved and understood in Chan-SIP. It only takes a couple of minutes to set it up and try it, so I recommend you see if the additional control on your trunk might be better served using a better (at this point) tool.

Oh well.

As I stated, I did try chan_sip as well, with no success at all. No registration, no inbound call, no outbound call.

And yes, I did try the DynDNS name instead of the IP address as well, with exactly the same non-success.

Anyway, that is not the point, as the “dynamic” IP changes once a week, during that time ist is “static” and alwys on, and still it does not work outbound. Inbound, everything is fine, so some sort or REGISTER dies work, otherwise, the Telekom could not route incoming calls to me.

The authentication for outbound calls is the problem, not the IP address.