• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

HTTP get

Explorer ,
May 11, 2009 May 11, 2009

Copy link to clipboard

Copied

At my workplace we have a trixbox phone system which has a module installed called CallerID lookup sources. We also have our CRM system which I

wrote in coldfusion.

The callerid module lets you set a lookup source as a webpage sending the telephone number using the GET method as shown below:

http://cfserver/cidlookup.cfm?cid=[number]

What I need to do is fill cidlookup.cfm with code that looks up the telephone no. in our database and then returns it, i believe on the Request-URI header?

I've plenty of CF experience but never really used the HTTP GET command (normally just use POST).

Can someone point me in the right direction as there is little or no documentation on this on internet searches/forums etc.

TOPICS
Advanced techniques

Views

524

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 17, 2009 May 17, 2009

Copy link to clipboard

Copied

The page could just get the (one) telephone number from the database and display it. Something like

<cfparam default="0" name="url.cid" type="integer">

<cfquery datasource="myDSN" name="getTelNo">
     select telephoneNumber
     from customer
     where callerID = <cfqueryparam cfsqltype="cf_sql_integer" value="#url.cid#">
</cfquery>

<cfif url.cid eq 0 or getTelNo.recordCount eq 0>
Bad caller ID.
<cfelse>
Telephone number: <cfoutput>#getTelNo.telephoneNumber#</cfoutput>
</cfif>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 17, 2009 May 17, 2009

Copy link to clipboard

Copied

LATEST

Just to add to BKBK's reply. I would not allow the zero url.cid thru my cfquery. You can then use boolean to check the recordcoun. e.g.

<cfif getTelNo.recordCount>

ok

<cfelse>

not ok

</cfif>

..assuming the CallerID field is an indexed.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation