I have tried 127.0.0.1 and got the same delay,
my webserver logs are showing 127.0.0.1 from the curl command, and the ip i connected from from the iphone app.
This is the code, i havent made too many changes to it.
#!/usr/bin/perl
# 1 for LDAP, 2 for MySQL, 0 to use a file
my $authMethod = 0;
# Asterisk server IP or hostname
my $server_ip = '127.0.0.1';
# Username in the manager.conf file which is allowed to connect.. you have enabled it right! 
my $clickUser = 'AsteriskC2D';
# the password associated with the above username
my $ClickPassword = '****';
# LDAP server configuration bits
###########################################################################
# LDAP server used to authenticate the users expecting to click and dial
my $LDAPServer = 'ldap.example.com';
# prefix for the usernames eg uid=rho,cn=users,dc=00
my $UID ='uid';
# where in the LDAP to look for the users to authenticate
my $LDAPSearch = 'ou=people,dc=example,dc=com';
###########################################################################
# MySQL authentication support
# Trixbox support
###########################################################################
# Use MySQL for authentication, mainly for TrixBox Support
# mysql Server usually localhost
my $MySQLserver = 'localhost';
# username
my $dbusername = 'asteriskuser';
# Password
my $dbpasswd = 'amp109';
# database name
my $database = 'asterisk';
# tablename
my $table = 'sip';
# query for
my $dbquery = 'select data from sip where keyword=\'secret\' and id=';
###########################################################################
# file based authentication configuration
###########################################################################
my $authFile = '/etc/AsteriskC2D.users';
###########################################################################
# contexts in extensions.conf to start matching to dialing strings etc.
my $context = 'Dialplan1';
#The callerID to put on the phone you are Dialing FROM!!!..
#This puts the name ClickDial and the number your dialing!
my $CIDName = 'ClickDial';
# Enable logging?
my $LOGGING = 1;
# where to log?
my $LOGFILE = '/tmp/click.log';
if ($LOGGING) {open (LOG,">>$LOGFILE");}
Thanks
Nick