Vieri
2009-Feb-11 10:14 UTC
[asterisk-users] call forward all except the extension it is forwarded to
I would like to know if I can set Call Forwarding on an extension but allow direct calls from the extension it is forwarded to. Example: Extension 100 sets call forwarding (all) to extension 101. All calls to 100 are immediately forwarded to 101 as expected. However, if 101 tries to transfer a call to 100 or tries to call 100 directly, it sounds "busy" because it obviously goes into a loop where 101 tries to call itself. How do I set an "exception" so that 101 can actually call 100 even if the latter is forwarded to 101? I'm using * 1.4 and freepbx. Thanks Vieri
Philipp Kempgen
2009-Feb-11 10:37 UTC
[asterisk-users] call forward all except the extension it is forwarded to
Vieri schrieb:> I would like to know if I can set Call Forwarding on an extension but allow direct calls from the extension it is forwarded to. > > Example: > > Extension 100 sets call forwarding (all) to extension 101. > > All calls to 100 are immediately forwarded to 101 as expected. > > However, if 101 tries to transfer a call to 100 or tries to call 100 directly, it sounds "busy" because it obviously goes into a loop where 101 tries to call itself. > > How do I set an "exception" so that 101 can actually call 100 even if the latter is forwarded to 101? > > I'm using * 1.4Use the "if" statement. 100 => { if ("${CALLERID(num)}" = "101") { // call 100 Dial(SIP/100); } else { // forward to 101 Dial(Local/101); } }> and freepbx.Don't know about FreePBX. Ask on their mailing-list/forum/... Philipp Kempgen -- AMOOCON 2009, May 4-5, Rostock / Germany -> http://www.amoocon.de Asterisk: http://the-asterisk-book.com - http://das-asterisk-buch.de AMOOMA GmbH - Bachstr. 126 - 56566 Neuwied -> http://www.amooma.de Gesch?ftsf?hrer: Stefan Wintermeyer, Handelsregister: Neuwied B14998 --
Philipp Kempgen
2009-Feb-11 12:29 UTC
[asterisk-users] call forward all except the extension it is forwarded to
Philipp Kempgen schrieb:> Vieri schrieb: >> I would like to know if I can set Call Forwarding on an extension but allow direct calls from the extension it is forwarded to. >> >> Example: >> Extension 100 sets call forwarding (all) to extension 101. >> All calls to 100 are immediately forwarded to 101 as expected. >> However, if 101 tries to transfer a call to 100 or tries to call 100 directly, it sounds "busy" because it obviously goes into a loop where 101 tries to call itself. >> How do I set an "exception" so that 101 can actually call 100 even if the latter is forwarded to 101?> Use the "if" statement. > > 100 => { > if ("${CALLERID(num)}" = "101") { > // call 100 > Dial(SIP/100); > } > else { > // forward to 101 > Dial(Local/101); > } > }Or use Caller ID matching: 100/101 => { // caller is 101 Dial(SIP/100); } 100 => { // for other callers Dial(Local/101); } Philipp Kempgen -- AMOOCON 2009, May 4-5, Rostock / Germany -> http://www.amoocon.de Asterisk: http://the-asterisk-book.com - http://das-asterisk-buch.de AMOOMA GmbH - Bachstr. 126 - 56566 Neuwied -> http://www.amooma.de Gesch?ftsf?hrer: Stefan Wintermeyer, Handelsregister: Neuwied B14998 --
Vieri
2009-Feb-11 13:12 UTC
[asterisk-users] call forward all except the extension it is forwarded to
--- On Wed, 2/11/09, Philipp Kempgen <philipp.kempgen at amooma.de> wrote:> >> I would like to know if I can set Call Forwarding > on an extension but allow direct calls from the extension it > is forwarded to. > >> > >> Example: > >> Extension 100 sets call forwarding (all) to > extension 101. > >> All calls to 100 are immediately forwarded to 101 > as expected. > >> However, if 101 tries to transfer a call to 100 or > tries to call 100 directly, it sounds "busy" > because it obviously goes into a loop where 101 tries to > call itself. > >> How do I set an "exception" so that 101 > can actually call 100 even if the latter is forwarded to > 101? > > > Use the "if" statement. > > > > 100 => { > > if ("${CALLERID(num)}" = "101") { > > // call 100 > > Dial(SIP/100); > > } > > else { > > // forward to 101 > > Dial(Local/101); > > } > > } > > Or use Caller ID matching: > > 100/101 => { > // caller is 101 > Dial(SIP/100); > } > 100 => { > // for other callers > Dial(Local/101); > }I hacked the dialparties.agi script in freepbx and now it works for direct calls but fails for blind transfers, probably because I need to check another variable such as BLINDTRANSFER. Attended transfers seem to work. Thanks