2011年10月31日 星期一

asterisk agi

#!/usr/bin/php -q

require_once('phpagi.php');
require_once('phpagi-asmanager.php');
error_reporting(E_ALL);
$agi = new AGI();
$agi->answer();
$agi->stream_file('welcome','#');
do
{
  $agi->stream_file("enter-some-digits","#");
  $result = $agi->get_data('beep', 3000, 20);
  $keys = $result['result'];
  if (trim($keys)!=""){
    $agi->stream_file("pls-wait-connect-call","#");
    $agi->say_digits($keys);
    $agi->exec_dial("DAHDI/1","$keys","60","m");
}
} while($keys != '111');
$id = $agi->get_data('beep', 4000, 6);
$id = $id['result'];
$agi->hangup();
?>

asterisk custom route

[from-pstn-custom]
exten => _X.,1,Set(DID=${EXTEN})
exten => s,n,Noop(Entering from-zaptel with DID == ${DID})
exten => s,n,Ringing()
exten => s,n,Set(DID=${IF($["${DID}"= ""]?s:${DID})})
exten => s,n,Noop(DID is now ${DID})
exten => s,n,GotoIf($["${CHANNEL:0:5}"="DAHDI"]?zapok:notzap)
exten => s,n(notzap),Goto(from-pstn,${DID},1)
exten => s,n,Macro(Hangupcall,dummy)
exten => s,n(zapok),Noop(Is a Zaptel Channel)
exten => s,n,Set(CHAN=${CHANNEL:6})
exten => s,n,Set(CHAN=${CUT(CHAN,-,1)})
exten => s,n,Goto(kido_call,s,1)

[kido_call_opt]
exten => 145,1,ExecIf($["${BLKVM_OVERRIDE}" != ""]?Noop(Deleting: ${BLKVM_OVERRIDE}: ${DB_DELETE(${BLKVM_OVERRIDE})}))
exten => 145,n,Set(__NODEST=)
exten => 145,n,Goto(from-did-direct,145,1)
exten => _XXXXXXXXXX,1,ExecIf($["${BLKVM_OVERRIDE}" != ""]?Noop(Deleting: ${BLKVM_OVERRIDE}: ${DB_DELETE(${BLKVM_OVERRIDE})}))
exten => _XXXXXXXXXX,n,Set(__NODEST=)
exten => _XXXXXXXXXX,n,Playback(pls-wait-connect-call)
exten => _XXXXXXXXXX,n,SayDigits(${EXTEN})

[kido_call]
include => kido_call_opt
exten => s,1,Set(MSG=)
exten => s,n,Answer()
exten => s,n,Set(LOOPCOUNT=0)
exten => s,n,Set(__DIR-CONTEXT=default)
exten => s,n,Set(_IVR_CONTEXT_${CONTEXT}=${IVR_CONTEXT})
exten => s,n,Set(_IVR_CONTEXT=${CONTEXT})
exten => s,n,GotoIf($["${CDR(disposition)}" = "ANSWERED"]?begin)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n(begin),Set(TIMEOUT(digit)=3)
exten => s,n,Set(TIMEOUT(response)=10)
exten => s,n,Set(__IVR_RETVM=)
exten => s,n,ExecIf($["${MSG}" != ""]?Background(${MSG}))
exten => s,n,WaitExten(,)
exten => hang,1,Playback(vm-goodbye)
exten => hang,n,Hangup
exten => i,1,Playback(invalid)
exten => i,n,Goto(loop,1)
exten => t,1,Goto(loop,1)
exten => loop,1,Set(LOOPCOUNT=$[${LOOPCOUNT} + 1])
exten => loop,n,GotoIf($[${LOOPCOUNT} > 2]?hang,1)
exten => loop,n,Goto(kido_call,s,begin)
exten => return,1,Set(MSG=)
exten => return,n,Set(_IVR_CONTEXT=${CONTEXT})
exten => return,n,Set(_IVR_CONTEXT_${CONTEXT}=${IVR_CONTEXT_${CONTEXT}})
exten => return,n,Goto(kido_call,s,begin)
exten => fax,1,Goto(${CUT(FAX_DEST,^,1)},${CUT(FAX_DEST,^,2)},${CUT(FAX_DEST,^,3)})

2011年10月19日 星期三

Elastix

FOP http://ip/panel
Recordings http://ip/recordings
change admin password here--> /var/www/html/recordings/includes/main.conf.php

/etc/asterisk/extensions_custom.conf
include => context
[context]
exten => app_number,1,Noop(Description)

自訂腳本放置於xxx_custom_xxx下
由DAHDI介面直接跑出去
1235,2,Dial(DAHDI/1/145,60,m)

2011年10月14日 星期五

enable domain user to install network printer

因為GPO在2003內沒有辦法管到windows 7的細項設定,所以要新增template去處理
http://blogs.msdn.com/b/7/archive/2011/07/11/allowing-standard-users-to-install-network-printers-on-windows-7-without-prompting-for-administrative-credentials.aspx
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers\PointAndPrint]
"InForest"=dword:00000000
"Restricted"=dword:00000000
"TrustedServers"=dword:00000000

2011年10月6日 星期四

caller id for askozia

from user is the filed for caller id. You have to confirmed the caller id through the voipbuster client
ie. 001281xxxxxxx

2011年10月5日 星期三

Virtuoso issue on exceed onDemand

Enable the Shadow Window checkbox and in the Window Name section enter WM_NAME=~Virtuoso
Shadow Window creates a buffer on the
Exceed Connection Server machine, allowing drawing
requests to be handled by the Exceed onDemand
Proxy instead of the Client. Applications such as
Cadence will benefit tremendously by this feature
because of the extensive drawing requests that it
makes, which impose heavy bandwidth demands and
impede performance. When used properly, bandwidth consumption and performance can be greatly
improved.