2 Replies Latest reply on May 17, 2009 8:01 AM by PaulKD

    HTTP get

    matstone98 Level 1

      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:




      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.

        • 1. Re: HTTP get
          BKBK Adobe Community Professional & MVP

          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#">


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

          • 2. Re: HTTP get

            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>
            not ok


            ..assuming the CallerID field is an indexed.