[asterisk-users] Say who is using the PSTN?
Grant Emsley
grant.emsley at gmail.com
Thu Dec 28 00:25:00 MST 2006
I use an SPA3000 to connect to the PSTN (SIP/pstn). Since I only have one line,
if it is in use, and someone else tries to dial out, they get the
all-outgoing-lines-unavailable message played.
I'd like to find a way to instead tell them which extension is using the PSTN
line. I know that info is available in the manager API, but I have no idea how
to get access to it from either the dialplan or an AGI script.
The relevant portion of my dialplan looks like this:
[macro-dialtopstn]
exten => s,1,Dial(SIP/${ARG1}@pstn,120,WT)
exten => s,2,Goto(s-${DIALSTATUS},1)
exten => s-ANSWER,1,Hangup
exten => s-BUSY,1,Playtones(busy)
exten => s-CANCEL,1,Hangup
exten => s-NOANSWER,1,Play(number-not-answering)
exten => s-NOANSWER,2,Hangup
exten => s-CONGESTION,1,Playback(all-outgoing-lines-unavailable)
exten => s-CONGESTION,2,Hangup
exten => s-CHANUNAVAIL,1,Goto(s-CONGESTION,1)
Has anyone written anything like this, or have any suggestions on the easiest
way to do it? I've searched and haven't found anything like this so far.
Thanks,
Grant Emsley
More information about the asterisk-users
mailing list