返回列表 發帖

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.

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.

YH

TOP

返回列表