You check for BUSY. Check for IN_USE instead. That's what I do here (on 1.4,
but I guess that 1.6 behaves similarly).

When an extension is in IN_USE state I have a decision tree after consulting
a database:


   - If the user wants waiting call - dial him/her/
   - If the user doesn;t want waiting call but wants voicemail answer - send
   to voicemail with B prefix.
   - If niether is wanted - play busy.

                      Regards, __Yehavi:

2009/5/15 sean darcy <[email protected]>

> I have two internal analogue extensions off a TDM400P. If the first is
> busy, I'd like to ring the second. So:
>
> [incoming]
> exten =>s,1,Answer()
> exten =>s,n,Dial(${mainline},60)
> exten =>s,n,ExecIf($["${DIALSTATUS}" = "BUSY"]?Dial(${secondline},30))
>
> But it doesn't work because * first tries Call Waiting on the main line.
> Here I dial out:
>
>     -- Starting simple switch on 'DAHDI/1-1'
>     -- Executing [...@internal:1] Answer("DAHDI/1-1", "") in new stack
>     -- Executing [...@internal:2] Set("DAHDI/1-1", "CALLERID="house"
> <2127873453>") in new stack
>     -- Executing [...@internal:3] Dial("DAHDI/1-1",
> .............................
>
> And now an incoming call:
>
>     -- Executing [...@incoming:1] Answer("IAX2/nhi-10929", "") in new stack
>     -- Executing [...@incoming:2] Dial("IAX2/nhi-10929", "DAHDI/1,60") in
> new stack
>     -- Called 1
>     -- IAX2/nhi-10929 requested special control 20, passing it to DAHDI/1-2
>     -- IAX2/nhi-10929 requested special control 20, passing it to DAHDI/1-2
>     -- IAX2/nhi-10929 requested special control 20, passing it to DAHDI/1-2
>     -- DAHDI/1-2 is ringing
>     -- IAX2/nhi-10929 requested special control 20, passing it to DAHDI/1-2
>     -- IAX2/nhi-10929 requested special control 20, passing it to DAHDI/1-2
>     -- CPE supports Call Waiting Caller*ID.  Sending 'Seandarcy/212 573
> 1432'
>
>
> Is there a way to check the status of a dahdi channel _before_ dialing it?
>
> exten =>s,n,ExecIf($["DAHDI/1${DIALSTATUS}" =
> "BUSY"]?Dial(${secondline},30)) ??
>
> What's special control 20  ??
>
> Any help appreciated.
>
> sean
>
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>
_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to