標題: Using SPA3000 as PSTN gateway for asterisk [打印本頁] 作者: ckleea 時間: 2010-8-14 23:14 標題: Using SPA3000 as PSTN gateway for asterisk
My example to dial out via SPA3000
Connect your SPA3000 PSTN to an account of asterisk e.g. 6298
Set up the following script in extensions.conf
[macro-senddigits]
exten => s,1,Wait(2) ; wait 1 second
exten => s,n,SendDTMF(${hkno}) ; send the number
;dial-out via SPA3000
[CallingRule_pstn]
exten => _02XXXXXXXX,1,Set(GLOBAL(hkno)=${EXTEN:2})
exten => _02XXXXXXXX,n,Dial(SIP/6298,2,M(senddigits)tr)
So when you type 0291234567, asterisk will dial via extension 6298 and wait for 1 second before it sends out the telephone. In this way, you will have a caller ID as per your PSTN analog line.作者: 角色 時間: 2010-8-15 16:07
Thank ckleea for sharing the codes to us. The main contribution of codes is that it would wait for 1 seconds or more before makeing the rest of digits to be made. This is a very important issue for some ordinary PABXs which requires long time to get PSTN lines.
You may learn from this example to write macro and the SendDTMF function.