Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Wed Apr 24, 2024 6:37 pm
Auto Dialer Software


All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Click to dial - how setup in A2B?
PostPosted: Mon Jul 27, 2009 10:53 am 
Offline

Joined: Wed Jun 11, 2008 10:19 am
Posts: 92
Location: Italy
Hello all,
I have found this script in php in the web.
Quote:
<html>
<head>
<title>Click2Dial</title>
</head>
<body>
<?php
#Based on the Click-To-Call script brought to you by VoipJots.com
#Modified by Rafael Cortes for Asterisk PBXS http://www.asteriskpbxs.com
#Slightly modified by NerdVittles.com for your calling pleasure.

#------------------------------------------------------------------------------------------
#edit the below variable values to reflect your system/information
#------------------------------------------------------------------------------------------

#specify the name/ip address of your asterisk box
#if your are hosting this page on your asterisk box, then you can use
#127.0.0.1 as the host IP. Otherwise, you will need to edit the following
#line in manager.conf, under the Admin user section:
#permit=127.0.0.1/255.255.255.0
#change to:
#permit=127.0.0.1/255.255.255.0,xxx.xxx.xxx.xxx ;(the ip address of the server this page is running on)
$strHost = "127.0.0.1";

#specify the username you want to login with (these users are defined in /etc/asterisk/manager.conf)
#this user is the default AAH AMP user; you shouldn't need to change, if you're using AAH.
$strUser = "admin";

#specify the password for the above user
$strSecret = "amp111";

#specify the channel (extension) you want to receive the call requests with
#e.g. SIP/XXX, IAX2/XXXX, ZAP/XXXX, local/1NXXNXXXXXX@from-internal, etc
#$strChannel = "local/1NXXNXXXXXX@from-internal";Use this for your cell phone Number;
$strChannel = "SIP/cardnumber";

#specify the context to make the outgoing call from. By default, AAH uses from-internal
#Using from-internal will make you outgoing dialing rules apply
$strContext = "a2billing";

#specify the amount of time you want to try calling the specified channel before hangin up
$strWaitTime = "30";

#specify the priority you wish to place on making this call
$strPriority = "1";

#specify the maximum amount of retries
$strMaxRetry = "2";

#--------------------------------------------------------------------------------------------
#Shouldn't need to edit anything below this point to make this script work
#--------------------------------------------------------------------------------------------
#get the phone number from the posted form
$strName = $_POST['txtname'];
$strExten = $_POST['txtphonenumber'];


$callNumber = $strExten;
#specify the caller id for the call
$strCallerId = "Web-".$strName . " <$callNumber>";

$length = strlen($strExten);

if ($length == 10 && is_numeric($strExten))
{
$oSocket = fsockopen($strHost, 5038, $errnum, $errdesc) or die("Connection to host failed");
fputs($oSocket, "Action: login\r\n");
fputs($oSocket, "Events: off\r\n");
fputs($oSocket, "Username: $strUser\r\n");
fputs($oSocket, "Secret: $strSecret\r\n\r\n");
fputs($oSocket, "Action: originate\r\n");
fputs($oSocket, "Channel: $strChannel\r\n");
fputs($oSocket, "WaitTime: $strWaitTime\r\n");
fputs($oSocket, "CallerId: $strCallerId\r\n");
fputs($oSocket, "Exten: $strExten\r\n");
fputs($oSocket, "Context: $strContext\r\n");
fputs($oSocket, "Priority: 1\r\n\r\n");
fputs($oSocket, "Action: Logoff\r\n\r\n");
sleep(3);
fclose($oSocket);
?>
<p>
<table width="300" border="1" bordercolor="#0f0f0f" cellpadding="3" cellspacing="0">
<tr><td>
<font size="2" face="verdana,georgia" color="#000000">We are processing your call, please wait about two minutes.
If you have not received our call within two minutes, verify that your name and number were entered correctly and
<a href="javascript:history.go(-1)">try again.</a>
</font>
</td></tr>
</table>
<p><h3><a href="javascript:history.go(-1)">Go Back</a></h3>
</p>


<?
}
else
{
?>
<p>
<table width="300" border="1" bordercolor="#0f0f0f" cellpadding="3" cellspacing="0">
<tr><td>
<font size="2" face="verdana,arial,georgia"
color="#000000">Enter your name and 10-digit number (e.g. 7875551234). If available, we will call you within the next two minutes.</font>
<form action="<? echo $_SERVER['PHP_SELF'] ?>" method="post">

Name:&nbsp;&nbsp;&nbsp; <input type="text" size="30" maxlength="12" name="txtname"><br><br>
Number: <input type="text" size="30" maxlength="10" name="txtphonenumber"><br><br>
<center><input type="submit"
value="Call Me Now"></center>
</form>
</td></tr>
</table>
</p>
<?
}
?>
</body>
</html>


When the call is processing A2B ask me the complete PIN number :furious:


Top
 Profile  
 
 Post subject: Re: Click to dial - how setup in A2B?
PostPosted: Mon Jul 27, 2009 3:52 pm 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
Are you trying to call to a DID?

Joe


Top
 Profile  
 
 Post subject: Re: Click to dial - how setup in A2B?
PostPosted: Wed Jul 29, 2009 3:28 pm 
Offline

Joined: Tue Mar 17, 2009 4:00 pm
Posts: 153
Location: Where the sun shines
I did that a while ago... worked no issues.... so its doable with a2b

the callerid string should be identical to the one associated with the customer account you want to bill:
strchannel : SIP/myasterisktrunkname/$srcnumber
strcallerid: "Web Call <".$src_number.">";

hope this helps
j.


Top
 Profile  
 
 Post subject: Re: Click to dial - how setup in A2B?
PostPosted: Wed Aug 05, 2009 11:21 pm 
Offline

Joined: Wed Jun 11, 2008 10:19 am
Posts: 92
Location: Italy
jroper wrote:
Are you trying to call to a DID?

Joe


Yes, but not works
My target is to call a did A2B!!! :)
it's working only for call friend sip/iax.
Maybe problem with context?


Top
 Profile  
 
 Post subject: Re: Click to dial - how setup in A2B?
PostPosted: Wed Dec 30, 2009 11:44 pm 
Offline

Joined: Wed Jun 11, 2008 10:19 am
Posts: 92
Location: Italy
Hi all, I have solved 50%

The problem was in agi-conf, but now i have another problem,
in agi-conf24 if i write intro_prompt = prepaid-callback-intro
the calls will be initiated as well, but I can't hear anything. Seems to be, that the calls are not "connected" properly...
While if intro_prompt is blank works just fine.

I have tried to create a context:

[a2billing2]
exten => _X.,1,DeadAGI(a2billing.php|24)
exten => _X.,n,Background(prepaid-callback-intro)
exten => _X.,n,Hangup

but I don't hear the sound (prepaid-callback-intro) :furious:

Any help is appreciate :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 
Predictive Dialer


All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 25 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group