Caller ID displaying as 'device' for internal calls

Hi all,
I’ve just installed freepbx 2.7.0.5 as a part of asteriskNOW, everything is working okay except internal call ID, no matter what i do (bar modifing the sip_additional.conf file) the caller ID will not show up correctly when calling internally. for example:

When editing an extension i set the Outbound CID to “John Smith” <100> but in sip_additional.conf i see:
callerid=device <100>

Am i setting this in the wrong place? no matter what i do it doesnt seem to make any difference to this value. whilst the internal caller ID isnt that critical it certainly doesnt look good for a brand new system

Thanks

Does anyone have any insight into this?

On further digging i have found that both the sip_additional.conf and the DB have Device <100> as the CID but if i change the sip_additional.conf file to have the correct information it works, but then when i make any changes via the gui it overwrites it. im starting to get inundated with requests to have this feature working. if anyone has any information that would be great.

Just leave the caller ID blank in the extension and it will do exactly what you want.

I just set that up for my extension and called myself, i could see ‘device’ was trying to call me.

The issue stems from the fact that historically asterisk would get the caller ID informaiton from sip.conf in the format of “name”

Now this is stored in a database, i can see the entry for my extension is:
device

Where it should say
"Name"

Infact when i change the data in the DB and reload freepbx i can call myself and have the correct caller ID shown. it would appear like the write function of the webgui is perhaps saving it incorrectly, the read function appears to work fine.

The callerID’s are stored in astdb under the heading ampuser/:

/AMPUSER/2476/cidname                             : Micke
/AMPUSER/2476/cidnum                              : 2476

Check your settings in the database with database show ampuser in an Asterisk CLI.

Your example above is correct.

I can assure you the dialplan is written correctly.

Why don’t you post an example of a peer from sip_additional.conf?

If I leave the CID alias blank in the extension and call another extension I get the same name and number as in the DB.

I am not sure what you are doing incorrectly, or maybe it’s different expectations.

Sip_additional.conf:

[735]
deny=0.0.0.0/0.0.0.0
secret=hidden
dtmfmode=rfc2833
canreinvite=no
context=from-internal
host=dynamic
type=friend
nat=yes
port=5060
qualify=yes
callgroup=
pickupgroup=
dial=SIP/735
accountcode=
mailbox=735@device
permit=0.0.0.0/0.0.0.0
callerid=device <735>
call-limit=50
faxdetect=no

From DB: viewed using webmin/mysql plugin
Search result for 735 in field ID of table sip
735 callerid device <735> 21

So i guess where is this going wrong??

I checked out that command show ampuser, and it all looks good eg:

/AMPUSER/780/cidname : Hayden Virtue
/AMPUSER/780/cidnum : 780

But when 780 calls anyone internally it comes up with ‘device’ which seems to correlate to the above DB table (sip) and the config file.

Even if i go a step further and edit sip_additional.conf with the correct CID; the phones then will start to display it correctly but as we all know this is over written by the GUI. is anyone able to point me in ANY direction on how to get this working? im going to attempt an upgrade to the latest freepbx 2nite to see if this makes a change at all

THe one bit of information you did not supply is the type of phones you are using.

snom 320 phones running firmware V6 and V7, strangely enough even SIP based software phones (not x-lite) have the same issue.

I strongly believe that the field is being written incorrectly, if i edit sip_addition.conf with the correct syntax it works, whilst i understand it gets it from the database, how does it piece it together? is it just a single field that it grabs? does it append the extension number to the extension name?

I believe the field isnot being written correctly from the GUI to the DB, but hard to prove without understanding how it is read/written.

The settings are correct, it should read callerid=device <735> in sip_additional.conf.

If you do a call trace in Asterisk CLI you will see that macro_callerid is called, that macro retrieves the correct callerid from astdb and sets uses it in the dialplan.

okay so understanding how it gets the details (sort of) why would it not be working in my instance?

If i edit the callerID field in the sip table the caller ID then starts to work, but if i edit the extension it overwrites it and re-break it.

What is entered in the GUI seems to be saved to the users table in the DB, but it would appear either
a) the macro isnt working or isnt pulling the data thru for the caller ID
b) the GUI is saving the info into the wrong table.

I didnt proceed with the upgrade to 2.8 last nite, i wanted to grab a copy of any custom edits int eh base .conf files (if any) to ensure it works after upgrade.

Do an Asterisk CLI trace (core set verbose 5) with a call and watch the output, callerid should be retrieved correctly or you have some error in your setup.

ill try to do this now, it might be hard at this time of the day, but ill see how i go, if i am understanding your instructions correctly.

This was a call from 711 to 735 i think i got it all, i cannot see any reference to ‘device’ or caller ID but it certainly showed up as ‘device’ calling me

== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Executing [735@from-internal:1] Dial(“SIP/711-00000c6d”, “SIP/735,20”) in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Called 735
– SIP/735-00000c6e is ringing
– SIP/735-00000c6e is ringing
== Spawn extension (from-internal, 735, 1) exited non-zero on ‘SIP/711-00000c6d’
– Executing [h@from-internal:1] Macro(“SIP/711-00000c6d”, “hangupcall”) in new stack
– Executing [s@macro-hangupcall:1] GotoIf(“SIP/711-00000c6d”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,4)
– Executing [s@macro-hangupcall:4] GotoIf(“SIP/711-00000c6d”, “1?skipblkvm”) in new stack
– Goto (macro-hangupcall,s,7)
– Executing [s@macro-hangupcall:7] GotoIf(“SIP/711-00000c6d”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing [s@macro-hangupcall:9] Hangup(“SIP/711-00000c6d”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 9) exited non-zero on ‘SIP/711-00000c6d’ in macro ‘hangupcall’
== Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/711-00000c6d’

Open a shell to your server, type asterisk -r, type logger rotate, dial an internal call, hangup your call, type exit. Go to /var/log/asterisk, there are a couple of files, full, full.0, full.1 etc, those are your log files, look in the file full, you can copy it to some location for easier debuggng.

That basically says the same thing as the CLI:
[Sep 8 15:12:46] VERBOSE[16060] config.c: == Parsing ‘/etc/asterisk/logger.conf’: [Sep 8 15:12:46] VERBOSE[16060] config.c: == Found
[Sep 8 15:12:46] VERBOSE[16060] logger.c: Asterisk Event Logger restarted
[Sep 8 15:12:46] VERBOSE[16060] logger.c: Asterisk Queue Logger restarted
[Sep 8 15:12:51] VERBOSE[4979] netsock.c: == Using SIP RTP TOS bits 184
[Sep 8 15:12:51] VERBOSE[4979] netsock.c: == Using SIP RTP CoS mark 5
[Sep 8 15:12:51] VERBOSE[16481] pbx.c: – Executing [735@from-internal:1] Dial(“SIP/735-00000c72”, “SIP/735,20”) in new stack
[Sep 8 15:12:51] VERBOSE[16481] netsock.c: == Using SIP RTP TOS bits 184
[Sep 8 15:12:51] VERBOSE[16481] netsock.c: == Using SIP RTP CoS mark 5
[Sep 8 15:12:51] VERBOSE[16481] app_dial.c: – Called 735
[Sep 8 15:12:51] VERBOSE[16481] app_dial.c: – SIP/735-00000c73 is ringing
[Sep 8 15:12:51] VERBOSE[16482] manager.c: == Manager ‘admin’ logged on from 127.0.0.1
[Sep 8 15:12:52] VERBOSE[16481] app_dial.c: – SIP/735-00000c73 is ringing
[Sep 8 15:12:53] VERBOSE[16481] app_dial.c: – SIP/735-00000c73 is ringing
[Sep 8 15:12:53] VERBOSE[16482] manager.c: == Manager ‘admin’ logged off from 127.0.0.1
[Sep 8 15:12:53] VERBOSE[16481] pbx.c: == Spawn extension (from-internal, 735, 1) exited non-zero on ‘SIP/735-00000c72’
[Sep 8 15:12:53] VERBOSE[16481] pbx.c: – Executing [h@from-internal:1] Macro(“SIP/735-00000c72”, “hangupcall”) in new stack
[Sep 8 15:12:53] VERBOSE[16481] pbx.c: – Executing [s@macro-hangupcall:1] GotoIf(“SIP/735-00000c72”, “1?skiprg”) in new stack
[Sep 8 15:12:53] VERBOSE[16481] pbx.c: – Goto (macro-hangupcall,s,4)
[Sep 8 15:12:53] VERBOSE[16481] pbx.c: – Executing [s@macro-hangupcall:4] GotoIf(“SIP/735-00000c72”, “1?skipblkvm”) in new stack
[Sep 8 15:12:53] VERBOSE[16481] pbx.c: – Goto (macro-hangupcall,s,7)
[Sep 8 15:12:53] VERBOSE[16481] pbx.c: – Executing [s@macro-hangupcall:7] GotoIf(“SIP/735-00000c72”, “1?theend”) in new stack
[Sep 8 15:12:53] VERBOSE[16481] pbx.c: – Goto (macro-hangupcall,s,9)
[Sep 8 15:12:53] VERBOSE[16481] pbx.c: – Executing [s@macro-hangupcall:9] Hangup(“SIP/735-00000c72”, “”) in new stack
[Sep 8 15:12:53] VERBOSE[16481] app_macro.c: == Spawn extension (macro-hangupcall, s, 9) exited non-zero on ‘SIP/735-00000c72’ in macro ‘hangupcall’
[Sep 8 15:12:53] VERBOSE[16481] pbx.c: == Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/735-00000c72’
[Sep 8 15:12:56] VERBOSE[16490] manager.c: == Manager ‘admin’ logged on from 127.0.0.1
[Sep 8 15:12:56] VERBOSE[16490] manager.c: == Manager ‘admin’ logged off from 127.0.0.1
[Sep 8 15:12:58] VERBOSE[16060] asterisk.c: – Remote UNIX connection disconnected

once again i see no reference to caller ID, ‘device’ or my name ‘james’ and once again it displayed on my phone as ‘davice’

What i have found, as perviously mentioned if i edit the sip table in teh DB the caller ID does function correctly

I will updte this, and got the same logs, proof of concept i guess.

This is with the field edited, and the CID showing:

[Sep 8 15:19:43] VERBOSE[4979] netsock.c: == Using SIP RTP TOS bits 184
[Sep 8 15:19:43] VERBOSE[4979] netsock.c: == Using SIP RTP CoS mark 5
[Sep 8 15:19:43] VERBOSE[17247] pbx.c: – Executing [735@from-internal:1] Dial(“SIP/735-00000c9f”, “SIP/735,20”) in new stack
[Sep 8 15:19:43] VERBOSE[17247] netsock.c: == Using SIP RTP TOS bits 184
[Sep 8 15:19:43] VERBOSE[17247] netsock.c: == Using SIP RTP CoS mark 5
[Sep 8 15:19:43] VERBOSE[17247] app_dial.c: – Called 735
[Sep 8 15:19:43] VERBOSE[17247] app_dial.c: – SIP/735-00000ca0 is ringing
[Sep 8 15:19:43] VERBOSE[17247] app_dial.c: – SIP/735-00000ca0 is ringing
[Sep 8 15:19:44] VERBOSE[17247] app_dial.c: – SIP/735-00000ca0 is ringing
[Sep 8 15:19:45] VERBOSE[17248] manager.c: == Manager ‘admin’ logged on from 127.0.0.1
[Sep 8 15:19:46] VERBOSE[17248] manager.c: == Manager ‘admin’ logged off from 127.0.0.1
[Sep 8 15:19:46] VERBOSE[17247] app_dial.c: – SIP/735-00000ca0 is ringing
[Sep 8 15:19:50] VERBOSE[17247] app_dial.c: – SIP/735-00000ca0 is ringing
[Sep 8 15:19:52] VERBOSE[17256] manager.c: == Manager ‘admin’ logged on from 127.0.0.1
[Sep 8 15:19:54] VERBOSE[17256] manager.c: == Manager ‘admin’ logged off from 127.0.0.1
[Sep 8 15:19:54] VERBOSE[17247] pbx.c: == Spawn extension (from-internal, 735, 1) exited non-zero on ‘SIP/735-00000c9f’
[Sep 8 15:19:54] VERBOSE[17247] pbx.c: – Executing [h@from-internal:1] Macro(“SIP/735-00000c9f”, “hangupcall”) in new stack
[Sep 8 15:19:54] VERBOSE[17247] pbx.c: – Executing [s@macro-hangupcall:1] GotoIf(“SIP/735-00000c9f”, “1?skiprg”) in new stack
[Sep 8 15:19:54] VERBOSE[17247] pbx.c: – Goto (macro-hangupcall,s,4)
[Sep 8 15:19:54] VERBOSE[17247] pbx.c: – Executing [s@macro-hangupcall:4] GotoIf(“SIP/735-00000c9f”, “1?skipblkvm”) in new stack
[Sep 8 15:19:54] VERBOSE[17247] pbx.c: – Goto (macro-hangupcall,s,7)
[Sep 8 15:19:54] VERBOSE[17247] pbx.c: – Executing [s@macro-hangupcall:7] GotoIf(“SIP/735-00000c9f”, “1?theend”) in new stack
[Sep 8 15:19:54] VERBOSE[17247] pbx.c: – Goto (macro-hangupcall,s,9)
[Sep 8 15:19:54] VERBOSE[17247] pbx.c: – Executing [s@macro-hangupcall:9] Hangup(“SIP/735-00000c9f”, “”) in new stack
[Sep 8 15:19:54] VERBOSE[17247] app_macro.c: == Spawn extension (macro-hangupcall, s, 9) exited non-zero on ‘SIP/735-00000c9f’ in macro ‘hangupcall’
[Sep 8 15:19:54] VERBOSE[17247] pbx.c: == Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/735-00000c9f’

It looks almost identical, perhaps as there is no reference to the caller ID in this trace. however, if i now edited the extension in the GUI it would default the field callerid back to device <735>; the caller ID would display as device and it would be all broken again. Which area of the DB does the field Caller ID from ‘extensions options’ of an extension save into the DB? as it is clear, atleast to me, that the caller ID is being looked up from this field of the database and perhaps there is more behind the scenes that i dont know/understand but that would be my lay interpretation of this issue.

Certainly the outbound CID is saving to the caller ID field of the users table, but this doesnt seem to have much to do with the caller ID of a phone. could it be possible its a typo in the php saving the field to the wrong table?

I must admit im about ready to let one of my developers modify config.php to save to the correct table but i do want to avoid doing this if possible.

wow okay, brainwave, its solved. piecing together that you said a macro would be called, which wasnt, and the comment about dial plans, on our old server we had a macro to call internally, this was loaded into extensions_custom.conf, which when the file is read sequentally, is read first, thus overriding the freepbx business, it relied on this field callerid to be set for caller ID but freepbx must piece it together on the fly.

perhaps an FYI for anyone thats trolling google for a solution to this issue.

1 Like

That was my next suggestion, check so that you don’t include something in the_custom files.

I am glad that it is solved.