Caller ID missing for internal SIP calls


I have been struggling with this problem for ages, and with my limited experience am out of ideas.

I have setup Asterisk/FreePBX running Kubuntu on basic PC. The aim is to make it a PBX for SIP devices (no POTS stuff).

At the moment all devices are on my LAN. I have a SNOM 300 SIP phone, a X-Lite softphone (Win XP) and Twinkle softphone (Kubuntu) all setup as extensions (5030, 5035, 5031).

They can all call each other no problem. But when the SNOM receives calls from the other extensions it only displays “device” as the caller ID. The softphones do aswell, but they also show the calling ext number below it aswell.

So with my setup I take it I am not passing the correct callerID to display as standard. How can I get the correct CLI to display ?

To get these SIP extensions to call at all I had to create the following to extensions_customer.conf (their context is still “from-internal”):

; Catch all four digit numbers, no leading zeroes
exten => _[12345789]XXX,1,NoOp("call for "${EXTEN})
exten => _[12345789]XXX,n,Dial(SIP/${EXTEN},60,tr)
exten => _[12345789]XXX,n,Congestion

I had to dig around the place to even find that. Am I missing something here? Is there a more standard, simple built-in way to handle basic SIP extensions ???

Anyway with this, only “device” shows up as the callerID on the SNOM. I should mention that on a previous 3rd party Asterisk setup (which I don’t have access to) the callerID is show the calling extension number on the SNOM.

I have tried many things I have found in this forum that seem (to me) related.
;exten => s,2,Macro(user_caller_id)
;exten => _[12345789]XXX,n,SIPAddHeader(Alert-Info: ${ALERT_INFO})
;exten => _[12345789]XXX,n,Macro(macro-user-callerid)
;exten => _[12345789]XXX,n,Macro(outbound-callerid)
;exten => _[12345789]XXX,2,SipAddHeader(P-Asserted-Identity:sip:${CALLERIDNUM})
;exten => _[12345789]XXX,n,SipAddHeader(P-Asserted-Identity:)

I am a relative noob to this stuff, but what else for callerID or anything else do I need to add to from-internal-custom to handle internal SIP extensions ?


heeello … any ideas ?

I would have thought this would be a standard thing in FreePBX.

At least if FreePBX can’t handle it, and its a matter of hacking Asterisk config files, can someone confirm that ? Or is that too much as ask :wink:

Internal and External CID works just fine right out of the box. So something else is setup wrong on your setup.

fskrotzki, thank you for at least telling me that. cheers.

You should be using FreePBX to setup your extensions not manually editing the .conf files. Here’s a link on how to setup SIP and softphones:

It uses PBX in a Flash distribution which utilizes FreePBX

Yes, I understand that. I have been trying to just use FreePBX to no avail.

I have reinstalled FreePBX again over the top (2.4.0 btw). And Asterisk for that matter. Not touched a single config file.
All I did was add extensions, with ext num and secret via the FreePBX admin screen. Nothing else changed.
Now back to extensions not being able to call each other at all. Denied. They can do *65 to hear their own number ok.

If there are some more basic steps without going into config files to get extensions being able to call each other, I don’t see them ???

My SIP phones connect fine to a 3rd party Asterisk (i don’t own) but it just won’t out of the box with this.

The only indication of anything wrong is these FreePBX Notices:

Retrieve conf failed to copy file(s) from a module’s agi-bin dir: copy(/usr/share/asterisk/agi-bin/recordingcheck): failed to open stream: Permission denied
copy(/usr/share/asterisk/agi-bin/dialparties.agi): failed to open stream: Permission denied
copy(/usr/share/asterisk/agi-bin/list-item-remove.php): failed to open stream: Permission denied
copy(/usr/share/asterisk/agi-bin/checksound.agi): failed to open stream: Permission denied
copy(/usr/share/asterisk/agi-bin/user_login_out.agi): failed to open stream: Permission denied
copy(/usr/share/asterisk/agi-bin/enumlookup.agi): failed to open stream: Permission denied
copy(/usr/share/asterisk/agi-bin/fixlocalprefix): failed to open stream: Permission denied
copy(/usr/share/asterisk/agi-bin/directory): failed to open stream: Permission denied

frustration doesn’t come close …

Permission denied means that asterisk does not have permission to access or read the file. That also means that your setup/install really did not install properly.

I’m not a ubuntu user so almost of no help, but I’ll bet that if you go back and carefully review the install you’ll find there is a error and that is the issue with permissions not being set properly.

Yes, you were right fskrotzki. Permissions were the issue.
I should have updated here straight away, I almost forgotten exactly what I did now.
Perhaps it was making /usr/share/asterisk/agi-bin writable by user “asterisk”, so that the freepbx install script could add files there.
I can’t remember :frowning:

I recall it seemed more like an Asterisk installation issue not setting the permissions correctly in the first place.

The issue with your OS install is that the files were placed in a slightly different path then normal. The install scripts are set for changing permissions for /var/lib/asterisk/agi-bin but you need them changed on your OS for /usr/share/asterisk/agi-bin. The installer does not know that so that is why it didn’t complete properly.

Perhaps the FreePBX install scripts could be a little more platform friendly and pull the correct Asterisk directory from /etc/amportal.conf


Dunno if that’s an option, but seems kinda logical to me :slight_smile:


It generates that file and places the info into it while it installs, so I’m guessing that it needs to know it is different somehow before it is started to handle it.

ubuntu seems to be one of the few (only?) that has this problem.

Well again, I have to say, I don’t really see why FreePBX can’t (and shouldn’t) handle this. Asterisk is a dependency package. No matter what OS/platform, as long as it can find Asterisk config (which on Linux is pretty std no ?) and know Asterisk’s structure, this should be straight forward no ?

eg. In /etc/asterisk/asterisk.conf
astagidir => /usr/share/asterisk/agi-bin

I presume that is put there by Asterisk.

Sure if FreePBX is somehow taking the approach that Asterisk might not be installed before hand so it has to hardcode directories, then I guess it has no choice. But making sure Asterisk is installed first seems like a pretty acceptable pre-req.