Ok. I wrote something that links to our central database to lookup a number when someone calls in. in the CID lookup i’m using
query=[CIDNUM] , which works perfectly, and returns the CIDNUMBER as the CIDNAME if there is a null result. ( basically
if(num_results == 0) return $_REQUEST[‘query’];
Is there any ways i can get it to show the CIDNAME set by the server before it does the lookup if there’s a null result? maybe another feild name i can send in the query like query=[CIDNUM]&original=[CIDNAME] ???
Basically, it’s set on the incoming route to Prepend a department Identifier Before the CID name when someone calls in dependant on DID used…. But obviously my CID lookup script it now amending that to the Original CID number, without prepending it with our Prefix… I was going to use the QUEUES script to Prepend it instead of the Incoming route, However the Queues section doesn’t allow Special Characters (like a : ) in the prepend, where as CID modifiers do……
Or would it be easier for me to re-write the dialplan to do the Lookup first, Then the apply the Modifier?? If so, which dialplan do i change? 😀
I’m betting that there is already a built in variable i can use for the query, but can’t find the documentation on it!!
It may just be coincidental that all incoming calls thus far have been coming on on switchboard (which has no identifier)…. In which case, i’ve asked a stupid question!!
It’s further complicated, by some numbers being stored in our Grandstream handsets local phonebooks Also.
If it is doing the Lookup, and then running through the modifier afterwards, then I am asking a stupid question, looking for an issue that isn’t there and apologize for wasting your time :D…… Although on a side note… I would appreciate a list of any Variables we can send to the lookup query if there are any other than [CIDNUM] 🙂
No, is not an stupid question, is an issue on inbound routes. The Lookup is executed after the CID Modifier.
We will fix it ASAP.
Thank you. In the meantime I’ve added an Identifier followed by an _ in the queue modifier so we can differentiate between departments (as some phones are multi-department)… Once there is a fix in place i will revert to the old way of doing it ( as having DEPT: CIDNAME is much more pleasing to the eye than DEPT_CIDNAME for people like me with mild OCD 😀 )