Boa tarde a todos.<div>Eu estou implanto liga pra mim, mas o problema é que ele tem que ligar para dois telefones fixo comum, eu ja tenho funcionado um script que liga para o ramal e depois para o fixo, mas o problema que quando coloco os dois pra fixo num rola, alguém pode me ajudar.</div>
<div><br></div><div><div><html></div><div><head></div><div><title>Liguq pra mim</title></div><div></head></div><div><body></div><div><?</div><div>#Click-To-Call script brought to you by VoipJots.com</div>
<div><br></div><div><br></div><div>#------------------------------------------------------------------------------------------</div><div>#edit the below variable values to reflect your system/information</div><div>#------------------------------------------------------------------------------------------</div>
<div><br></div><div>#specify the name/ip address of your asterisk box</div><div>#if your are hosting this page on your asterisk box, then you can use</div><div>#127.0.0.1 as the host IP. Otherwise, you will need to edit the following</div>
<div>#line in manager.conf, under the Admin user section:</div><div>#permit=<a href="http://127.0.0.1/255.255.255.0">127.0.0.1/255.255.255.0</a></div><div>#change to:</div><div>#permit=<a href="http://127.0.0.1/255.255.255.0,xxx.xxx.xxx.xxx">127.0.0.1/255.255.255.0,xxx.xxx.xxx.xxx</a> ;(the ip address of the server this page is running on)</div>
<div>$strHost = "127.0.0.1";</div><div><br></div><div>#specify the username you want to login with (these users are defined in /etc/asterisk/manager.conf)</div><div>#this user is the default AAH AMP user; you shouldn't need to change, if you're using AAH.</div>
<div>$strUser = "admin";</div><div><br></div><div>#specify the password for the above user</div><div>$strSecret = "elastix456";</div><div><br></div><div>#specify the channel (extension) you want to receive the call requests with</div>
<div>#e.g. SIP/XXX, IAX2/XXXX, ZAP/XXXX, etc</div><div>$strChannel = "SIP/42003";</div><div><br></div><div>#specify the context to make the outgoing call from. By default, AAH uses from-internal</div><div>#Using from-internal will make you outgoing dialing rules apply</div>
<div>$strContext = "a2billing";</div><div><br></div><div>#specify the amount of time you want to try calling the specified channel before hangin up</div><div>$strWaitTime = "30";</div><div><br></div><div>
#specify the priority you wish to place on making this call</div><div>$strPriority = "1";</div><div><br></div><div>#specify the maximum amount of retries</div><div>$strMaxRetry = "2";</div><div><br></div>
<div>#--------------------------------------------------------------------------------------------</div><div>#Shouldn't need to edit anything below this point to make this script work</div><div>#--------------------------------------------------------------------------------------------</div>
<div>#get the phone number from the posted form</div><div>$strExten = $_POST['txtphonenumber'];</div><div><br></div><div>#specify the caller id for the call</div><div><br></div><div>$strCallerId = "<$strExten>";</div>
<div><br></div><div>$length = strlen($strExten);</div><div><br></div><div>if ($length == 11 && is_numeric($strExten))</div><div>{</div><div>$oSocket = fsockopen($strHost, 5038, $errnum, $errdesc) or die("Connection to host failed");</div>
<div>fputs($oSocket, "Action: login\r\n");</div><div>fputs($oSocket, "Events: off\r\n");</div><div>fputs($oSocket, "Username: $strUser\r\n");</div><div>fputs($oSocket, "Secret: $strSecret\r\n\r\n");</div>
<div>fputs($oSocket, "Action: originate\r\n");</div><div>fputs($oSocket, "Channel: $strChannel\r\n");</div><div>fputs($oSocket, "WaitTime: $strWaitTime\r\n");</div><div>fputs($oSocket, "CallerId: $strCallerId\r\n");</div>
<div>fputs($oSocket, "Exten: $strExten\r\n");</div><div>fputs($oSocket, "Context: $strContext\r\n");</div><div>fputs($oSocket, "Priority: $strPriority\r\n\r\n");</div><div>fputs($oSocket, "Action: Logoff\r\n\r\n");</div>
<div>fclose($oSocket);</div><div>?></div><div><p></div><div><table width="300" border="1" bordercolor="#630000" cellpadding="3" cellspacing="0"></div><div><span class="Apple-tab-span" style="white-space:pre">        </span><tr><td></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span><font size="2" face="verdana,georgia" color="#630000">Estamos atualmente tentando ligar para você. Por favor espere o seu telefone!<br>Se o seu telefone não toca depois de 2 minutos, pedimos desculpas, pois seu telefone deve estar ocupado ou ja estamos em outra ligação.<br><a href="<? echo $_SERVER['PHP_SELF'] ?>">Try Again</a></font></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></td></tr></div><div></table></div><div></p></div><div><?</div><div>}</div><div>else</div><div>{</div><div>?></div><div><p></div>
<div><table width="300" border="1" bordercolor="#630000" cellpadding="3" cellspacing="0"></div><div><span class="Apple-tab-span" style="white-space:pre">        </span><tr><td></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span><font size="2" face="verdana,arial,georgia" color="#630000">Entre com o seu numero de telefone (0XX-XXXX-XXXX), e espere que em alguns segundos estaremos te ligando!</font></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span><form action="<? echo $_SERVER['PHP_SELF'] ?>" method="post"></div><div><span class="Apple-tab-span" style="white-space:pre">                </span><input type="text" size="20" maxlength="11" name="txtphonenumber"><br></div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span><input type="submit" value="Call Us!"></div><div><span class="Apple-tab-span" style="white-space:pre">        </span></form></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></td></tr></div><div></table></div><div></p></div><div><?</div><div>}</div><div>?></div><div></body></div><div></html></div>
</div><div><br></div>