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
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.
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.
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
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.
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.
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.