Changeset 12904
- Timestamp:
- 06/30/09 06:53:30 (7 months ago)
- Files:
-
- vtigercrm/branches/5.1/include/js/asterisk.js (modified) (1 diff)
- vtigercrm/branches/5.1/include/utils/utils.php (modified) (3 diffs)
- vtigercrm/branches/5.1/packages/5.1.0/mandatory/PBXManager.zip (modified) (previous)
- vtigercrm/branches/5.1/pkg/vtiger/modules/PBXManager/cron/AsteriskClient.php (modified) (2 diffs)
- vtigercrm/branches/5.1/pkg/vtiger/modules/PBXManager/manifest.xml (modified) (1 diff)
- vtigercrm/branches/5.1/pkg/vtiger/modules/PBXManager/modules/PBXManager/AsteriskUtils.php (added)
- vtigercrm/branches/5.1/pkg/vtiger/modules/PBXManager/modules/PBXManager/ListView.php (modified) (1 diff)
- vtigercrm/branches/5.1/pkg/vtiger/modules/PBXManager/modules/PBXManager/StartCall.php (added)
- vtigercrm/branches/5.1/pkg/vtiger/modules/PBXManager/modules/PBXManager/TraceIncomingCall.php (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
vtigercrm/branches/5.1/include/js/asterisk.js
r12794 r12904 8 8 function _defAsteriskTimer(){ 9 9 var asteriskTimer = null; 10 var ASTERISK_POLLTIME = 3000; //vtigercrm polls the asterisk server for incoming calls after every 3 seconds for now10 var ASTERISK_POLLTIME = 5000; //vtigercrm polls the asterisk server for incoming calls after every 3 seconds for now 11 11 var ASTERISK_INCOMING_DIV_TIMEOUT = 15; //the incoming call div is present for this number of seconds 12 12 function AsteriskCallback() { vtigercrm/branches/5.1/include/utils/utils.php
r12890 r12904 4164 4164 4165 4165 //information found 4166 $callerInfo = getCallerInfo( getStrippedNumber($from));4166 $callerInfo = getCallerInfo($from); 4167 4167 4168 4168 if($callerInfo != false){ 4169 $callerName = $callerInfo[name];4170 $module = $callerInfo[ module];4169 $callerName = decode_html($callerInfo['name']); 4170 $module = $callerInfo['module']; 4171 4171 $callerModule = " (<a href='index.php?module=$module&action=index'>$module</a>)"; 4172 4172 $callerID = $callerInfo[id]; … … 4196 4196 } 4197 4197 $caller = "Unknown Number (Unknown)"; //declare caller as unknown in beginning 4198 4199 $name['Contacts'] = array('name'=>"concat(firstname,' ',lastname)", 'table'=>'vtiger_contactdetails', 'field'=>"phone,mobile,fax", 'id'=>'contactid'); 4200 $name['Accounts'] = array('name'=>"accountname", 'table'=>"vtiger_account", 'field'=>"phone, otherphone, fax", 'id'=>'accountid'); 4201 $name['Leads'] = array('name'=>"concat(firstname,' ',lastname)", 'table'=>"vtiger_leaddetails inner join vtiger_leadaddress on vtiger_leaddetails.leadid = vtiger_leadaddress.leadaddressid", 'field'=>"phone,mobile,fax", 'id'=>'leadid'); 4202 4203 foreach ($name as $module => $info) { 4204 $phones = explode(",",$info[field]); 4205 4206 $sql = "select *,".$info[name]." as name from ".$info[table]." inner join vtiger_crmentity on ".$info['id']."=crmid where deleted=0"; 4207 $result = $adb->query($sql); 4208 4209 $id = searchPhoneNumber($number, $phones, $result, 1); 4210 4211 if($id !== false){ 4212 $callerName = $adb->query_result($result, $id, "name"); 4213 $callerID = $adb->query_result($result,$id,$info['id']); 4198 $name['Contacts'] = "select contactid as id,concat(firstname,' ',lastname) as name from vtiger_contactdetails inner join vtiger_crmentity on crmid=contactid where deleted=0 and (phone = ? or mobile = ? or fax = ?)";//array('name'=>"concat(firstname,' ',lastname)", 'table'=>'vtiger_contactdetails', 'field'=>"phone,mobile,fax", 'id'=>'contactid'); 4199 $name['Accounts'] = "select accountid as id, accountname as name from vtiger_account inner join vtiger_crmentity on crmid=accountid where deleted =0 and (phone = ? or otherphone = ? or fax = ?)";//array('name'=>"accountname", 'table'=>"vtiger_account", 'field'=>"phone, otherphone, fax", 'id'=>'accountid'); 4200 $name['Leads'] = "select leadid as id,concat(firstname,' ',lastname) as name from vtiger_leaddetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_leaddetails.leadid inner join vtiger_leadaddress on vtiger_leaddetails.leadid = vtiger_leadaddress.leadaddressid where vtiger_crmentity.deleted =0 and (vtiger_leadaddress.phone = ? or vtiger_leadaddress.mobile = ? or vtiger_leadaddress.fax = ?)";//array('name'=>"concat(firstname,' ',lastname)", 'table'=>"vtiger_leaddetails inner join vtiger_leadaddress on vtiger_leaddetails.leadid = vtiger_leadaddress.leadaddressid", 'field'=>"phone,mobile,fax", 'id'=>'leadid'); 4201 foreach ($name as $module => $query) { 4202 $result = $adb->pquery($query,array($number,$number,$number)); 4203 if($adb->num_rows($result) > 0 ){ 4204 $callerName = $adb->query_result($result, 0, "name"); 4205 $callerID = $adb->query_result($result,0,'id'); 4214 4206 $data = array("name"=>$callerName, "module"=>$module, "id"=>$callerID); 4215 4207 return $data; … … 4360 4352 $callerName = "Unknown"; 4361 4353 }else{ 4362 $callerName = "<a href='index.php?module=".$callerName[module]."&action=DetailView&record=".$callerName[id]."'>". $callerName[name]."</a>";4354 $callerName = "<a href='index.php?module=".$callerName[module]."&action=DetailView&record=".$callerName[id]."'>".decode_html($callerName[name])."</a>"; 4363 4355 } 4364 4356 } vtigercrm/branches/5.1/pkg/vtiger/modules/PBXManager/cron/AsteriskClient.php
r12877 r12904 59 59 while (true) { 60 60 //check for incoming calls and insert in the database 61 sleep( 1);61 sleep(2); 62 62 $incoming = handleIncomingCalls($asterisk, $adb, $version); 63 63 } … … 120 120 $adb->pquery($sql, $params); 121 121 122 addToCallHistory($extension, $caller Number, $extension, "incoming", $adb);122 addToCallHistory($extension, $callerType.":".$callerNumber, $extension, "incoming", $adb); 123 123 break; //break the while loop 124 124 } vtigercrm/branches/5.1/pkg/vtiger/modules/PBXManager/manifest.xml
r12794 r12904 246 246 <status>enabled</status> 247 247 </action> 248 <action>249 <name><![CDATA[index]]></name>250 <status>enabled</status>251 </action>252 <action>253 <name><![CDATA[Popup]]></name>254 <status>enabled</status>255 </action>256 248 </actions> 257 249 </module> vtigercrm/branches/5.1/pkg/vtiger/modules/PBXManager/modules/PBXManager/ListView.php
r12877 r12904 130 130 // Navigation 131 131 $start = $_SESSION['lvs'][$currentModule]['start']; 132 $navigation_array = getNavigationValues($start, $recordCount, $list_max_entries_per_page);133 132 $navigationOutput = getTableHeaderSimpleNavigation($navigation_array, $url_string, $currentModule, 'index', $viewid); 134 133 $smarty->assign("NAVIGATION", $navigationOutput);
