INSTALLATION
Installation Guide for PHP, Java & ASP.NET C#
ASP.NET C# c2call_asp.net_csharp.zip
Extract the c2call directory from the supplied zip file into the home directory on your website. Once you have done this, you can get the sample click to call form to work by inserting your Script Id in sample.html on line 14, then navigate to: http://example.com/sample.html
If you want to integrate the form elsewhere on your website: Copy and paste the following sections of code into the relevant areas.
Click to Call Webpage - Displays the form
in the <head> section
<SCRIPT LANGUAGE="JavaScript" SRC="/c2call/c2call.js"></SCRIPT>
in the <body> section
<!-- THE TEXT INPUT, CHECKBOX AND SUBMIT TAGS BELOW CAN BE PLACED ANYWHERE IN YOUR PAGE //-->
<!-- ALL 3 FIELDS MUST BE IN THE PAGE //-->
<input name="c2call_numtocall" type="text" id="c2call_numtocall" onKeyPress="return c2call_numbersonly(event,this);" onKeyDown="c2call_checkBackSpace(event,this);" maxlength="10" onPaste="c2call_checkString(this);">
<input name="c2call_savenum" type="checkbox" id="c2call_savenum" value="y"> <label for="c2call_savenum">Remember Me</label>
<input name="c2call_callMeSubmit" type="submit" id="c2call_callMeSubmit" onClick="return c2call_callMeNow();" value="Waiting.." disabled>
before the final </body> tag
<script language="JavaScript" type="text/JavaScript">
// TODO: replace '111111' with your script id.
c2call_runAction('111111');
</script>
When you signup for your Click to Call service, you will be assigned a Script ID. You need to replace the '11111' in the above section with the SCRIPT ID.
Installation Guide for Ruby on Rails
Extract the c2call directory into the root directory on your rails project. Once you have done this, you can get the sample click to call form to work by inserting your Script Id in sample.html.erb on line 14, then navigate to: http://example.com/main/sample
If you want to integrate the form elsewhere on your website: Copy and paste the following sections of code into the relevant areas.
Controller - posts data to our API
def c2call
# build url
url = URI.parse(params[:url_base] + params[:url_path])
ps = params
# add visitor ip to params
ps['visitor_ip'] = request.remote_ip
req = Net::HTTP::Post.new(url.path)
req.set_form_data(ps)
res = Net::HTTP.new(url.host, url.port).start {|http| http.request(req) }
case res
when Net::HTTPSuccess, Net::HTTPRedirection
# OK
@stuff = res.body
else
res.error!
end
end
View - to output and process the results from our API (c2call.html.erb)
<%= @stuff %>
View - the form
<%= javascript_include_tag 'click2call' %>
<script language="JavaScript" type="text/JavaScript">
// TODO: replace '111111' with your script id.
c2call_runAction('111111');
</script>
Your Number: <input name="c2call_numtocall" type="text" id="c2call_numtocall" onKeyPress="return c2call_numbersonly(event,this);" onKeyDown="c2call_checkBackSpace(event,this);" onPaste="c2call_checkString(this);">
<br/>
<input name="c2call_savenum" type="checkbox" id="c2call_savenum" value="y">
Check this and we will remember your number<br>
<input name="c2call_callMeSubmit" type="submit" id="c2call_callMeSubmit" onClick="c2call_callMeNow();" value="Waiting.." disabled><br>
Javascript
Change click2call.js on line 4 to point to the correct path for the c2call action.




