提交 076789dd authored 作者: Ken Rice's avatar Ken Rice

add working auto refreshing conference monitor, add originate form and make it…

add working auto refreshing conference monitor, add originate form and make it work, add a few buttons for future use

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk/scripts/contrib@12519 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 506dff43
...@@ -3,32 +3,60 @@ ...@@ -3,32 +3,60 @@
<mx:Script> <mx:Script>
<![CDATA[ <![CDATA[
import flash.utils.Timer;
import flash.events.TimerEvent;
import mx.controls.dataGridClasses.DataGridColumn; import mx.controls.dataGridClasses.DataGridColumn;
import mx.events.DataGridEvent; import mx.events.DataGridEvent;
import mx.controls.Alert; import mx.controls.Alert;
import mx.rpc.events.FaultEvent; import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent; import mx.rpc.events.ResultEvent;
import mx.collections.ArrayCollection; import mx.collections.ArrayCollection;
import mx.managers.PopUpManager;
import mx.core.IFlexDisplayObject;
private var confTimer:Timer;
private function initConfTab():void{
freeswitch.getConferenceList();
freeswitch.getConferenceUsers(confPicker.selectedItem );
confTimerLabel.text="Init...";
confTimer = new Timer(10000, 0);
confTimer.addEventListener(TimerEvent.TIMER, onConfRefresh);
confTimer.start();
confTimerLabel.text = confTimer.running.toString();
}
private function onConfRefresh(evt:TimerEvent):void {
confTimerLabel.text="Refreshing";
freeswitch.getConferenceUsers(confPicker.selectedItem);
confTimerLabel.text="Refreshed";
confTimerSecCount.text = confTimer.currentCount.toString();
}
/** private function confAutoRefreshControl():void {
* This function is called when an item was edited in the data grid. if (confAutoRefreshCheckBox.selected) {
* Calls the saveData() method on the PHP server confTimer.start();
*/ confTimerLabel.text="running";
/* confTimerLabel.text = confTimer.running.toString();
private function save(event:DataGridEvent):void { confTimerSecCount.text = confTimer.currentCount.toString();
var dataGrid:DataGrid = event.target as DataGrid; } else {
var dsColumnIndex:Number = event.columnIndex; confTimer.stop();
var col:DataGridColumn = dataGrid.columns[dsColumnIndex]; confTimerLabel.text="stopped";
var newValue:String = dataGrid.itemEditorInstance[col.editorDataField]; confTimerLabel.text = confTimer.running.toString();
var dsFieldName:String = event.dataField; confTimerSecCount.text = confTimer.currentCount.toString();
var author:VOAuthor = event.itemRenderer.data as VOAuthor; }
if (newValue == author[dsFieldName])
return;
//get the new value for the first name or last name
author[dsFieldName] = newValue;
myRemote.saveData(author);
} }
*/
private function confTimerChangeTime():void {
confTimer.delay = confAutoRefreshTimeSlider.value * 1000;
}
public function doOriginate():void {
var origWindow:IFlexDisplayObject =
PopUpManager.createPopUp(this, originateForm, false);
}
]]> ]]>
</mx:Script> </mx:Script>
...@@ -36,12 +64,10 @@ ...@@ -36,12 +64,10 @@
<mx:RemoteObject id="freeswitch" destination="freeswitch" source="freeswitch" <mx:RemoteObject id="freeswitch" destination="freeswitch" source="freeswitch"
endpoint="http://192.168.1.140/feeder/gateway.php" showBusyCursor="true"/> endpoint="http://192.168.1.140/feeder/gateway.php" showBusyCursor="true"/>
<mx:TabNavigator width="100%" height="100%"> <mx:TabNavigator width="100%" height="100%">
<mx:Canvas label="Channels" width="100%" height="100%"> <mx:Canvas label="Channels" width="100%" height="100%" show="freeswitch.getChannels();">
<mx:VBox top="0" left="0" width="100%" height="100%"> <mx:VBox top="0" left="0" width="100%" height="100%">
<mx:Button label="Get data" click="{freeswitch.getChannels()}" /> <mx:Button label="Get data" click="freeswitch.getChannels();" />
<!-- <mx:DataGrid id="myGrid" dataProvider="{myRemote.getChannels.lastResult}" editable="true" itemEditEnd="save(event)"> -->
<mx:DataGrid id="channelsGrid" dataProvider="{freeswitch.getChannels.lastResult}" width="100%" height="100%"> <mx:DataGrid id="channelsGrid" dataProvider="{freeswitch.getChannels.lastResult}" width="100%" height="100%">
<mx:columns> <mx:columns>
<mx:DataGridColumn dataField="uuid" editable="false"/> <mx:DataGridColumn dataField="uuid" editable="false"/>
...@@ -55,11 +81,15 @@ ...@@ -55,11 +81,15 @@
</mx:DataGrid> </mx:DataGrid>
</mx:VBox> </mx:VBox>
</mx:Canvas> </mx:Canvas>
<mx:Canvas label="Calls" width="100%" height="100%"> <mx:Canvas label="Calls" width="100%" height="100%" show="freeswitch.getCalls();">
<mx:VBox top="0" left="0" width="100%" height="100%">
<mx:Button label="Get data" click="{freeswitch.getCalls()}" /> <mx:Button label="Refresh" click="freeswitch.getCalls();" />
<mx:Button label="Originate" click="doOriginate();" x="79"/>
<mx:Button label="Kill UUID" click="{freeswitch.getCalls()}" x="166"/>
<mx:Button label="Status" click="{freeswitch.getCalls()}" x="251"/>
<mx:Button label="Status" click="{freeswitch.getCalls()}" x="322"/>
<!-- <mx:DataGrid id="myGrid" dataProvider="{myRemote.getCalls.lastResult}" editable="true" itemEditEnd="save(event)"> --> <!-- <mx:DataGrid id="myGrid" dataProvider="{myRemote.getCalls.lastResult}" editable="true" itemEditEnd="save(event)"> -->
<mx:DataGrid id="callsGrid" dataProvider="{freeswitch.getCalls.lastResult}" width="100%" height="100%"> <mx:DataGrid id="callsGrid" dataProvider="{freeswitch.getCalls.lastResult}" top="30" bottom="0" left="0" right="0">
<mx:columns> <mx:columns>
<mx:DataGridColumn dataField="created"/> <mx:DataGridColumn dataField="created"/>
<mx:DataGridColumn dataField="caller_uuid"/> <mx:DataGridColumn dataField="caller_uuid"/>
...@@ -69,37 +99,42 @@ ...@@ -69,37 +99,42 @@
<mx:DataGridColumn dataField="caller_dest_num"/> <mx:DataGridColumn dataField="caller_dest_num"/>
</mx:columns> </mx:columns>
</mx:DataGrid> </mx:DataGrid>
</mx:VBox>
</mx:Canvas> </mx:Canvas>
<mx:Canvas label="Conference" width="100%" height="100%"> <mx:Canvas label="Conference" width="100%" height="100%" show="initConfTab();">
<mx:ComboBox id="confPicker" horizontalCenter="0" top="10" dataProvider="{freeswitch.getConferenceList.lastResult}"></mx:ComboBox> <mx:ComboBox id="confPicker" horizontalCenter="0" top="10" dataProvider="{freeswitch.getConferenceList.lastResult}"
<!-- <mx:DataGrid id="myGrid" dataProvider="{myRemote.getCalls.lastResult}" editable="true" itemEditEnd="save(event)"> --> change="{freeswitch.getConferenceUsers(confPicker.selectedItem)}"></mx:ComboBox>
<mx:DataGrid id="conferenceGrid" dataProvider="{freeswitch.getConferenceUsers.lastResult}" width="100%" top="43" bottom="115"> <mx:DataGrid id="conferenceGrid" dataProvider="{freeswitch.getConferenceUsers.lastResult}" width="100%" top="43" bottom="145">
<mx:columns> <mx:columns>
<mx:DataGridColumn headerText="id" dataField="0"/> <mx:DataGridColumn dataField="id"/>
<mx:DataGridColumn headerText="clid_name" dataField="3"/> <mx:DataGridColumn dataField="caller_name"/>
<mx:DataGridColumn headerText="clid_num" dataField="4"/> <mx:DataGridColumn dataField="caller_number" />
<mx:DataGridColumn headerText="flags" dataField="5"/> <mx:DataGridColumn dataField="channel" />
<mx:DataGridColumn headerText="channel" dataField="1"/> <mx:DataGridColumn dataField="uuid"/>
<mx:DataGridColumn headerText="uuid" dataField="2"/> <mx:DataGridColumn dataField="volume"/>
<mx:DataGridColumn headerText="volume" dataField="7"/> <mx:DataGridColumn dataField="gain"/>
<mx:DataGridColumn headerText="mic_gain" dataField="6"/> <mx:DataGridColumn dataField="noise"/>
<mx:DataGridColumn headerText="noise_floor" dataField="8"/> <mx:DataGridColumn dataField="flags"/>
</mx:columns> </mx:columns>
</mx:DataGrid> </mx:DataGrid>
<mx:Button label="Play File" click="{freeswitch.getConferenceList()}" horizontalCenter="-167" bottom="85"/> <mx:Button label="Play File" click="{freeswitch.getConferenceList()}" horizontalCenter="-138" bottom="85"/>
<mx:Button label="Speak" click="{freeswitch.getConferenceUsers(confPicker.selectedItem)}" horizontalCenter="-90" bottom="85"/> <mx:Button label="Speak" click="{freeswitch.getConferenceUsers(confPicker.selectedItem)}" horizontalCenter="-61" bottom="85"/>
<mx:Button label="Kick" click="{freeswitch.getCalls()}" horizontalCenter="-13" bottom="85"/> <mx:Button label="Kick" horizontalCenter="2" bottom="85"/>
<mx:Button label="DTMF" click="{freeswitch.getCalls()}" horizontalCenter="74" bottom="85"/> <mx:Button label="DTMF" click="{freeswitch.getCalls()}" horizontalCenter="64" bottom="85"/>
<mx:Button label="Transfer" click="{freeswitch.getCalls()}" horizontalCenter="165" bottom="85"/> <mx:Button label="Transfer" click="{freeswitch.getCalls()}" horizontalCenter="137" bottom="85"/>
<mx:Button label="Mute" click="{freeswitch.getCalls()}" horizontalCenter="-177" bottom="55"/> <mx:Button label="Mute" click="{freeswitch.getCalls()}" horizontalCenter="-136" bottom="55"/>
<mx:Button label="Unmute" click="{freeswitch.getCalls()}" horizontalCenter="-85" bottom="55"/> <mx:Button label="Unmute" click="{freeswitch.getCalls()}" horizontalCenter="-65" bottom="55"/>
<mx:Button label="Volume" click="{freeswitch.getCalls()}" horizontalCenter="-3" bottom="55"/> <mx:Button label="Volume" click="{freeswitch.getCalls()}" horizontalCenter="13" bottom="55"/>
<mx:Button label="Gain" click="{freeswitch.getCalls()}" horizontalCenter="71" bottom="55"/> <mx:Button label="Gain" click="{freeswitch.getCalls()}" horizontalCenter="81" bottom="55"/>
<mx:Button label="Dial" click="{freeswitch.getCalls()}" horizontalCenter="152" bottom="55"/> <mx:Button label="Dial" click="{freeswitch.getCalls()}" horizontalCenter="138" bottom="55"/>
<mx:Button label="Lock" click="{freeswitch.getCalls()}" horizontalCenter="-53" bottom="25"/> <mx:Button label="Lock" click="{freeswitch.getCalls()}" horizontalCenter="-36" bottom="25"/>
<mx:Button label="Unlock" click="{freeswitch.getCalls()}" horizontalCenter="36" bottom="25"/> <mx:Button label="Unlock" click="{freeswitch.getCalls()}" horizontalCenter="30" bottom="25"/>
<mx:CheckBox id="confAutoRefreshCheckBox" label="AutoRefresh" right="204" top="10" selected="true" click="confAutoRefreshControl();"/>
<mx:HSlider id="confAutoRefreshTimeSlider" right="37" top="10" width="162" minimum="5" maximum="120" snapInterval="5" value="15"/>
<mx:Label id="confTimerLabel" text="STOPPED" right="339" top="12"/>
<mx:Label width="23" id="lblRefreshInterval" text="{confAutoRefreshTimeSlider.value.toString()}" right="10" top="12"/>
<mx:Label id="confTimerSecCount" text="Label" right="433" top="12"/>
<mx:TextInput bottom="115" width="406" horizontalCenter="-1"/>
</mx:Canvas> </mx:Canvas>
</mx:TabNavigator> </mx:TabNavigator>
......
<?xml version="1.0"?>
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="doInit();" height="306" title="Originate">
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
import mx.controls.Alert;
import mx.rpc.events.ResultEvent;
private function doInit():void {
PopUpManager.centerPopUp(this);
}
private function doCall():void {
parentApplication.freeswitch.originate(call_url.text, exten.text, dialplan.text, context.text, cid_name.text, cid_number.text, timeout.text);
PopUpManager.removePopUp(this);
}
]]>
</mx:Script>
<mx:Form width="100%">
<mx:FormItem label="Call URL" width="100%">
<mx:TextInput id="call_url" width="100%"/>
</mx:FormItem>
<mx:FormItem label="Extension" width="100%">
<mx:TextInput id="exten" width="100%"/>
</mx:FormItem>
<mx:FormItem label="DialPlan" width="100%">
<mx:TextInput id="dialplan" width="100%" text="XML"/>
</mx:FormItem>
<mx:FormItem label="Context" width="100%">
<mx:TextInput id="context" width="100%" text="default"/>
</mx:FormItem>
<mx:FormItem label="CallerID Name" width="100%">
<mx:TextInput id="cid_name" width="100%" text="FS_AMF_PHP"/>
</mx:FormItem>
<mx:FormItem label="CallerID Number" width="100%">
<mx:TextInput id="cid_number" width="100%" text="default"/>
</mx:FormItem>
<mx:FormItem label="Timeout" width="100%">
<mx:TextInput id="timeout" width="100%" text="30"/>
</mx:FormItem>
</mx:Form>
<mx:HBox horizontalAlign="center" width="314">
<mx:Button click="doCall();" label="Place Call"/>
<mx:Button click="PopUpManager.removePopUp(this);" label="Cancel"/>
</mx:HBox>
</mx:TitleWindow>
\ No newline at end of file
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论