Asterisk Dynamic conferences macro

Many low-price class SIP phones are unable to mix a conference call :( . This macro is attempt to get pass that limitation using dialplan logic and appMeetMe.

Requirements:

appMeetMe needs a ZAPTEL TIMER, so you either must have Zaptel interface in Asterisk machine or, at least, ztdummy kernel module from zaptel package loaded (or zaprtc module from bristuff package).

It seemes that one can use either Asterisks blind transfer capability (#<number>), to transfer persons you want to a conference, or native SIP transfer witch also seems to set ${BLINDXFER} variable.


ONLY FOR systems with Zaptel FXS modules for analogue phones in it:

If you have analogue phones connected over Zaptel TDM400 card with FXS modules, you will have to make link between Zaptel channel name and extension number for analogue phone. This is done before first run the macro and when you add or remove FXS modules form Asterisk and it is done using Asterisk database by adding record from CLI:

database put TECHS/Zap <zaptel channel no.> <dialplan extension number>

Example: If your analogue phone is connected to Zap/1 and it responds when extension number 10 is dialed, you should enter:

database put TECHS/Zap 1 10

NOTE that this is ONLY needed for Zaptel FXS modules (all of them).


Limitations:

This macro currently supports making conferences from SIP phones/ATAs, Analogue phones (Zap interfaces) and mISDN interfaces (ISDN phones connected to the HFC chip based ISDN BRI cards in NT mode - for more information lookup chan_mISDN)

Support for other type of phones (SCCP, IAX etc.) can be easily added by analyzing contenst of the ${CHANNEL} variable during the call from/to SCCP, IAX or other device. Feel free to add it :) .


This was only tested with Asteisk 1.2.25


Operation and Usage:

Conference feature is activated by blind transfering your callee (CONFMEMBER) to the extension number defined for macro in dial plan (i.e. dialing #<conference extension> during the call). Conferences are created on fly and they are "tied" to the extension number of the person who made a transfer (CONFHOLDER) to the conference. Upon transfer, all the CONFMEMBERs will hear music on hold, until you - CONFHOLDER join conference. You should transfer all persons you want in conference before you join conference. Upon your joining, music on hold will stop and you should be able to talk to all participants. Conference is dynamicaly destroyed when the CONFHOLDER leaves it.

Step by step usage according to the example below:

1. From your phone dial the person you want in conference usual way. During convesation blind transfer it to the macro-3ptyconference extension number by dialing #900
2. Person you transfered should hear music on hold, and you should get another dial tone.
3. Repeat steps 1 and 2 for all persons you want in conference.
4. From your phone dial 900 or #900 to get yourself into conference. Music on hold should stop for all other participants and all of you should be able to talk to each other.




[macro-3ptyconference]
;
;
;
exten => s,1,NooP(${BLINDTRANSFER})
exten => s,n,Gotoif($["${BLINDTRANSFER}" != ""]?s-TRANSFERED|1:s-NOTTRANSFERED|1)
exten => s-TRANSFERED,1,Set(TECH=${CUT(BLINDTRANSFER,/,1)})
exten => s-TRANSFERED,n,Gotoif($["${TECH}" : "Zap"]?s-ZAPHOLDER|1:s-TRYSIP|1)
exten => s-ZAPHOLDER,1,Set(TECH=${CUT(BLINDTRANSFER,-,1)})
exten => s-ZAPHOLDER,n,Set(CONFHOLDER=${DB(TECHS/${TECH})})
exten => s-ZAPHOLDER,n,Goto(s-USERJOIN|1)
exten => s-TRYSIP,1,Gotoif($["${TECH}" : "SIP"]?s-SIPHOLDER|1:s-TRYmISDN|1)
exten => s-SIPHOLDER,1,Set(CONFHOLDER=${CUT(BLINDTRANSFER,/,2)})
exten => s-SIPHOLDER,n,Set(CONFHOLDER=${CUT(CONFHOLDER,-,1)})
exten => s-SIPHOLDER,n,Goto(s-USERJOIN|1)
exten => s-TRYmISDN,1,Gotoif($["${TECH}" : "mISDN"]?s-mISDNHOLDER|1:s-TRYELSE|1)
exten => s-mISDNHOLDER,1,Set(CONFHOLDER=${CUT(BLINDTRANSFER,/,3)})
exten => s-mISDNHOLDER,n,Set(CONFHOLDER=${CUT(CONFHOLDER,-,1)})
exten => s-mISDNHOLDER,n,Goto(s-USERJOIN|1)
exten => s-TRYELSE,1,Noop(SCCP, IAX channels and other technologies)
exten => s-TRYELSE,n,Noop(not supported at the moment)
exten => s-TRYELSE,n,Noop(Feel free to add support)
exten => s-TRYELSE,n,Goto(s-INVALID|1)
exten => s-NOTTRANSFERED,1,Noop(${CHANNEL})
exten => s-NOTTRANSFERED,n,Gotoif($["${CHANNEL}" != ""]?s-TRY2ZAP|1:s-INVALID|1)
exten => s-TRY2ZAP,1,Set(TECH=${CUT(CHANNEL,/,1)})
exten => s-TRY2ZAP,n,Gotoif($["${TECH}" : "Zap"]?s-ZAP2HOLDER|1:s-TRY2SIP|1)
exten => s-ZAP2HOLDER,1,Set(TECH=${CUT(CHANNEL,-,1)})
exten => s-ZAP2HOLDER,n,Set(CONFHOLDER=${DB(TECHS/${TECH})})
exten => s-ZAP2HOLDER,n,Goto(s-CHECKCONFEXIST|1)
exten => s-TRY2SIP,1,Gotoif($["${TECH}" : "SIP"]?s-SIP2HOLDER|1:s-TRY2mISDN|1)
exten => s-SIP2HOLDER,1,Set(CONFHOLDER=${CUT(CHANNEL,/,2)})
exten => s-SIP2HOLDER,n,Set(CONFHOLDER=${CUT(CONFHOLDER,-,1)})
exten => s-SIP2HOLDER,n,Goto(s-CHECKCONFEXIST|1)
exten => s-TRY2mISDN,1,Gotoif($["${TECH}" : "mISDN"]?s-mISDN2HOLDER|1:s-TRY2ELSE|1)
exten => s-mISDN2HOLDER,1,Set(CONFHOLDER=${CUT(CHANNEL,/,3)})
exten => s-mISDN2HOLDER,n,Cut(CONFHOLDER=${CUT(CONFHOLDER,-,1)})
exten => s-mISDN2HOLDER,n,Goto(s-CHECKCONFEXIST|1)
exten => s-TRY2ELSE,1,Noop(SCCP,IAX channels and other technologies not)
exten => s-TRY2ELSE,n,Noop(supported at the moment.)
exten => s-TRY2ELSE,n,Noop(Feel free to add support !)
exten => s-TRY2ELSE,n,Goto(s-INVALID|1)
exten => s-USERJOIN,1,Set(MUSICCLASS()=default)
exten => s-USERJOIN,n,MeetMe(${CONFHOLDER},qdwMx)
exten => s-CHECKCONFEXIST,1,MeetmeCount(${CONFHOLDER},CONFCOUNT)
exten => s-CHECKCONFEXIST,n,GotoIf($["${CONFCOUNT}" = ""]?s-INVALID|1:s-CONFNOTEMPTY|1)
exten => s-CONFNOTEMPTY,1,Gotoif($[${CONFCOUNT} > 0]?s-HOLDERJOIN|1:s-INVALID|1)
exten => s-HOLDERJOIN,1,Meetme(${CONFHOLDER},qdAMx)
exten => s-INVALID,1,Playtones(info)
exten => s-INVALID,n,Wait(10)
exten => s-INVALID,n,Hangup()
;
;
;
[extensions]
;
exten => 900,1,Macro(3tpyconference)
;
exten => #900,1,Macro(3ptyconference)
;

Many low-price class SIP phones are unable to mix a conference call :( . This macro is attempt to get pass that limitation using dialplan logic and appMeetMe.

Requirements:

appMeetMe needs a ZAPTEL TIMER, so you either must have Zaptel interface in Asterisk machine or, at least, ztdummy kernel module from zaptel package loaded (or zaprtc module from bristuff package).

It seemes that one can use either Asterisks blind transfer capability (#<number>), to transfer persons you want to a conference, or native SIP transfer witch also seems to set ${BLINDXFER} variable.


ONLY FOR systems with Zaptel FXS modules for analogue phones in it:

If you have analogue phones connected over Zaptel TDM400 card with FXS modules, you will have to make link between Zaptel channel name and extension number for analogue phone. This is done before first run the macro and when you add or remove FXS modules form Asterisk and it is done using Asterisk database by adding record from CLI:

database put TECHS/Zap <zaptel channel no.> <dialplan extension number>

Example: If your analogue phone is connected to Zap/1 and it responds when extension number 10 is dialed, you should enter:

database put TECHS/Zap 1 10

NOTE that this is ONLY needed for Zaptel FXS modules (all of them).


Limitations:

This macro currently supports making conferences from SIP phones/ATAs, Analogue phones (Zap interfaces) and mISDN interfaces (ISDN phones connected to the HFC chip based ISDN BRI cards in NT mode - for more information lookup chan_mISDN)

Support for other type of phones (SCCP, IAX etc.) can be easily added by analyzing contenst of the ${CHANNEL} variable during the call from/to SCCP, IAX or other device. Feel free to add it :) .


This was only tested with Asteisk 1.2.25


Operation and Usage:

Conference feature is activated by blind transfering your callee (CONFMEMBER) to the extension number defined for macro in dial plan (i.e. dialing #<conference extension> during the call). Conferences are created on fly and they are "tied" to the extension number of the person who made a transfer (CONFHOLDER) to the conference. Upon transfer, all the CONFMEMBERs will hear music on hold, until you - CONFHOLDER join conference. You should transfer all persons you want in conference before you join conference. Upon your joining, music on hold will stop and you should be able to talk to all participants. Conference is dynamicaly destroyed when the CONFHOLDER leaves it.

Step by step usage according to the example below:

1. From your phone dial the person you want in conference usual way. During convesation blind transfer it to the macro-3ptyconference extension number by dialing #900
2. Person you transfered should hear music on hold, and you should get another dial tone.
3. Repeat steps 1 and 2 for all persons you want in conference.
4. From your phone dial 900 or #900 to get yourself into conference. Music on hold should stop for all other participants and all of you should be able to talk to each other.




[macro-3ptyconference]
;
;
;
exten => s,1,NooP(${BLINDTRANSFER})
exten => s,n,Gotoif($["${BLINDTRANSFER}" != ""]?s-TRANSFERED|1:s-NOTTRANSFERED|1)
exten => s-TRANSFERED,1,Set(TECH=${CUT(BLINDTRANSFER,/,1)})
exten => s-TRANSFERED,n,Gotoif($["${TECH}" : "Zap"]?s-ZAPHOLDER|1:s-TRYSIP|1)
exten => s-ZAPHOLDER,1,Set(TECH=${CUT(BLINDTRANSFER,-,1)})
exten => s-ZAPHOLDER,n,Set(CONFHOLDER=${DB(TECHS/${TECH})})
exten => s-ZAPHOLDER,n,Goto(s-USERJOIN|1)
exten => s-TRYSIP,1,Gotoif($["${TECH}" : "SIP"]?s-SIPHOLDER|1:s-TRYmISDN|1)
exten => s-SIPHOLDER,1,Set(CONFHOLDER=${CUT(BLINDTRANSFER,/,2)})
exten => s-SIPHOLDER,n,Set(CONFHOLDER=${CUT(CONFHOLDER,-,1)})
exten => s-SIPHOLDER,n,Goto(s-USERJOIN|1)
exten => s-TRYmISDN,1,Gotoif($["${TECH}" : "mISDN"]?s-mISDNHOLDER|1:s-TRYELSE|1)
exten => s-mISDNHOLDER,1,Set(CONFHOLDER=${CUT(BLINDTRANSFER,/,3)})
exten => s-mISDNHOLDER,n,Set(CONFHOLDER=${CUT(CONFHOLDER,-,1)})
exten => s-mISDNHOLDER,n,Goto(s-USERJOIN|1)
exten => s-TRYELSE,1,Noop(SCCP, IAX channels and other technologies)
exten => s-TRYELSE,n,Noop(not supported at the moment)
exten => s-TRYELSE,n,Noop(Feel free to add support)
exten => s-TRYELSE,n,Goto(s-INVALID|1)
exten => s-NOTTRANSFERED,1,Noop(${CHANNEL})
exten => s-NOTTRANSFERED,n,Gotoif($["${CHANNEL}" != ""]?s-TRY2ZAP|1:s-INVALID|1)
exten => s-TRY2ZAP,1,Set(TECH=${CUT(CHANNEL,/,1)})
exten => s-TRY2ZAP,n,Gotoif($["${TECH}" : "Zap"]?s-ZAP2HOLDER|1:s-TRY2SIP|1)
exten => s-ZAP2HOLDER,1,Set(TECH=${CUT(CHANNEL,-,1)})
exten => s-ZAP2HOLDER,n,Set(CONFHOLDER=${DB(TECHS/${TECH})})
exten => s-ZAP2HOLDER,n,Goto(s-CHECKCONFEXIST|1)
exten => s-TRY2SIP,1,Gotoif($["${TECH}" : "SIP"]?s-SIP2HOLDER|1:s-TRY2mISDN|1)
exten => s-SIP2HOLDER,1,Set(CONFHOLDER=${CUT(CHANNEL,/,2)})
exten => s-SIP2HOLDER,n,Set(CONFHOLDER=${CUT(CONFHOLDER,-,1)})
exten => s-SIP2HOLDER,n,Goto(s-CHECKCONFEXIST|1)
exten => s-TRY2mISDN,1,Gotoif($["${TECH}" : "mISDN"]?s-mISDN2HOLDER|1:s-TRY2ELSE|1)
exten => s-mISDN2HOLDER,1,Set(CONFHOLDER=${CUT(CHANNEL,/,3)})
exten => s-mISDN2HOLDER,n,Cut(CONFHOLDER=${CUT(CONFHOLDER,-,1)})
exten => s-mISDN2HOLDER,n,Goto(s-CHECKCONFEXIST|1)
exten => s-TRY2ELSE,1,Noop(SCCP,IAX channels and other technologies not)
exten => s-TRY2ELSE,n,Noop(supported at the moment.)
exten => s-TRY2ELSE,n,Noop(Feel free to add support !)
exten => s-TRY2ELSE,n,Goto(s-INVALID|1)
exten => s-USERJOIN,1,Set(MUSICCLASS()=default)
exten => s-USERJOIN,n,MeetMe(${CONFHOLDER},qdwMx)
exten => s-CHECKCONFEXIST,1,MeetmeCount(${CONFHOLDER},CONFCOUNT)
exten => s-CHECKCONFEXIST,n,GotoIf($["${CONFCOUNT}" = ""]?s-INVALID|1:s-CONFNOTEMPTY|1)
exten => s-CONFNOTEMPTY,1,Gotoif($[${CONFCOUNT} > 0]?s-HOLDERJOIN|1:s-INVALID|1)
exten => s-HOLDERJOIN,1,Meetme(${CONFHOLDER},qdAMx)
exten => s-INVALID,1,Playtones(info)
exten => s-INVALID,n,Wait(10)
exten => s-INVALID,n,Hangup()
;
;
;
[extensions]
;
exten => 900,1,Macro(3tpyconference)
;
exten => #900,1,Macro(3ptyconference)
;

Created by: rakac, Last modification: Fri 07 of Dec, 2007 (15:29 UTC)
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+