Got a simple group call system (asterisk+php)

Source: Internet
Author: User
Made a simple group call system (asterisk+php)

In the first place, import numbers from Excel into the database, and then read the numbers from the database to generate call files and make calls.

?

?? ? ? ? ? ? ? ? ? ? ? ? ? ? ???? ??

?

?? The source code is as follows: (note: The operation of Excel read file is not written up)

 Setoutputencoding (' Utf-8 '); $conn = mysql_connect (' localhost ', ' root ', ' 888888 ') or Die ("database connection Failed"); mysql_query ("Set Names ' Utf-8 ');//Set the encoded output mysql_select_db (' asterisk ');        Select Database $data->read (' Xls/tel.xls '); for ($i = 2; $i <= $data->sheets[0][' numrows '); $i + +) {$sql = "INSERT into tel VALUES (null, '". $data-&             gt;sheets[0][' cells '] [$i][1]. "', 0"; $query =mysql_query ($sql); if ($query) {}}}else{echo "
 
  
   
 

  
 ";}  } //................................................................................................................. end//..... Reading a number from a database generates a. Call to a file .................... ....... ..... ................. ......... if (Isset ( $_post[' Liji_tel '))//Call now. You have to complete the process call here. Delete the number of the call {$con = mysql_connect (' localhost ', ' root ', ' 888888 ') or Die ("database connection Failed"); mysql_query ("Set names ' Utf-8 '");// Set the encoded output mysql_select_db (' asterisk '); Select the data $result =mysql_query ("SELECT * FROM Tel where s_id=0");     while ($rows =mysql_fetch_row ($result)) {$filename = "$rows [1].call";     fopen ($filename, "w+"); $somecontent _8001= "channel:sip/$rows [1]". " /n "."  CallerID:
 
  
   
 "." /n "." Maxretries:2 "." /n "." Context:default "." /n "." Retrytime:10 "." /n "." Waittime:10 "." /n "." Extension: _x. "." /n "." Setvar:id= $rows [0] "."         /n ";     if (is_writable ($filename)) {if (! $handle = fopen ($filename, ' a ')) {exit;} if (fwrite ($handle, $somecontent _8001) = = = FALSE) {exit;}         Fclose ($handle); $KK = "mv". $filename. "/var/spool/asterisk/outgoing/";  System ($KK, $restult);}}  echo " 
    
     
  
 
   "; }//..............end ..... ..... ..... ..... ....... .................. ..... ..... ..... ..... ..... .............. .......... ...........? > 
    Call Group Call (text):
  
 
?
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.