[Added search by sip proxy Adrian Georgescu **20080520234918] hunk ./cdrlib.phtml 169 + + if ($this->DATASOURCES[$this->cdr_source]['mediaTraceDataSource']) { + $this->mediaTraceDataSource=$this->DATASOURCES[$this->cdr_source]['mediaTraceDataSource']; + } hunk ./cdrlib_ser.phtml 94 - "call_id", + "call_id","sip_proxy", hunk ./cdrlib_ser.phtml 695 + $this->f->add_element(array("name"=>"sip_proxy", + "type"=>"text", + "size"=>"25", + "maxlength"=>"255", + "value"=>$sip_proxy + )); hunk ./cdrlib_ser.phtml 758 + Sip Proxy "; + + $this->f->show_element("sip_proxy",""); + print " hunk ./cdrlib_ser.phtml 1291 + if ($sip_proxy) { + $sip_proxy=urldecode($sip_proxy); + $where .= " and $this->SipProxyServerField = '".addslashes($sip_proxy)."'"; + $sip_proxy_encoded=urlencode($sip_proxy); + $this->url.="&sip_proxy=$sip_proxy_encoded"; + } + hunk ./cdrlib_ser.phtml 2355 + "; + if ($this->CDRS->mediaTraceDataSource) { + $media_trace_datasource = $this->CDRS->mediaTraceDataSource; + + $this->mediaTraceLink="SipProxyServer', 'Trace', + 'toolbar=0,status=0,menubar=0,scrollbars=1,resizable=1,width=1000,height=600')\">Click here to see the media information for this call  "; + + $CallInfoVerbose.= sprintf(" + + + %s + + ", $this->mediaTraceLink); + + } + + $CallInfoVerbose.= " hunk ./cdrlib_ser.phtml 3583 + var $table = 'media_sessions'; hunk ./cdrlib_ser.phtml 3586 - global $DATASOURCES, $auth; + global $DATASOURCES; + hunk ./cdrlib_ser.phtml 3626 - $this->table = $DATASOURCES[$this->cdr_source]['table']; + if ($DATASOURCES[$this->cdr_source]['table']) { + $this->table = $DATASOURCES[$this->cdr_source]['table']; + } + hunk ./cdrlib_ser.phtml 3631 - $this->purgeRecordsAfter = $DATASOURCES[$this->cdr_source]['purgeRecordsAfter']; hunk ./cdrlib_ser.phtml 3639 - $this->seen_ip=array(); - $this->trace=$this->getTraceFromThor($proxyIP,$callid,$fromtag,$totag); + $this->info=json_decode($this->getTraceFromThor($proxyIP,$callid,$fromtag,$totag)); hunk ./cdrlib_ser.phtml 3645 - $query=sprintf("select * from %s where call_id = '%s' and from_tag = '%s' order by id asc", + $query=sprintf("select info from %s where call_id = '%s' and from_tag = '%s' and to_tag= '%s'", hunk ./cdrlib_ser.phtml 3647 - $callid, - $fromtag + addslashes($callid), + addslashes($fromtag), + addslashes($totag) hunk ./cdrlib_ser.phtml 3651 - + hunk ./cdrlib_ser.phtml 3659 - $this->trace=$this->db->f('info'); + $this->info=json_decode($this->db->f('info')); hunk ./cdrlib_ser.phtml 3707 -

CDRTool Media Proxy trace

+

CDRTool Media information

hunk ./cdrlib_ser.phtml 3710 - - /* hunk ./cdrlib_ser.phtml 3711 - print_r($this->trace); + print_r($this->info); hunk ./cdrlib_ser.phtml 3713 - */ hunk ./media-trace.phtml 4 -if ($_REQUEST['public']) { - $db = new DB_CDRTool; - $key="callid-".trim($_REQUEST['callid']).trim($_REQUEST['fromtag']); - $query=sprintf("select * from memcache where `key` = '%s'",addslashes($key)); - sleep(1); - dprint($query); - if ($db->query($query)) { - if ($db->num_rows()) { - $authorize=0; - } else { - $authorize=1; - } - } else { - $authorize=1; - } -} else { - $authorize=1; -} +page_open(array( + "sess" => "CDRTool_Session", + "auth" => "CDRTool_Auth", + "perm" => "CDRTool_Perm") + ); hunk ./media-trace.phtml 10 -if ($authorize==1) { - page_open(array( - "sess" => "CDRTool_Session", - "auth" => "CDRTool_Auth", - "perm" => "CDRTool_Perm") - ); - -} else { - unset($auth); - unset($sess); - unset($perm); -} hunk ./media-trace.phtml 22 -if (!$authorize || in_array($cdr_source,$CDRTool['dataSourcesAllowed'])) { - - $sipTrace = new SIP_trace($cdr_source); - $sipTrace->show($proxyIP,$callid,$fromtag,$totag); - -} else { - printf ("Error: Invalid datasource '%s' for user '%s'" ,$cdr_source,$auth->auth["uname"]); -} +$mediaTrace = new Media_trace($cdr_source); +$mediaTrace->show($proxyIP,$callid,$fromtag,$totag); hunk ./media-trace.phtml 29 -if ($authorize=1) { - page_close(); -} +page_close();