login | register
Sun 12 of Oct, 2008 [17:53 UTC]

voip-info.org

Discuss [4] History

Asterisk Dynamic conferences macro

Created by: rakac,Last modification on Fri 07 of Dec, 2007 [15:29 UTC]
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)
;


Comments

Comments Filter
222

333working version with Asterisk 1.4

by achauvin, Wednesday 07 of February, 2007 [17:44:24 UTC]
[macro-3ptyconference]
;
;
;
exten => s,1,NooP(${BLINDTRANSFER})
exten => s,2,Gotoif($["${BLINDTRANSFER}" != ""]?s-TRANSFERED|1:s-NOTTRANSFERED|1)

exten => s-TRANSFERED,1,Set(TECH=${CUT(BLINDTRANSFER,/,1)})
exten => s-TRANSFERED,2,Gotoif($["${TECH}" : "Zap"]?s-ZAPHOLDER|1:s-TRYSIP|1)

exten => s-ZAPHOLDER,1,Set(CONFHOLDER=${CUT(BLINDTRANSFER,/,2)})
exten => s-ZAPHOLDER,2,Set(CONFHOLDER=${CUT(CONFHOLDER,-,1)})
exten => s-ZAPHOLDER,3,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,2,Set(CONFHOLDER=${CUT(CONFHOLDER,-,1)})
exten => s-SIPHOLDER,3,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,2,Set(CONFHOLDER=${CUT(CONFHOLDER,-,1)})
exten => s-mISDNHOLDER,3,Goto(s-USERJOIN|1)

exten => s-TRYELSE,1,Noop(SCCP, IAX channels and other technologies)
exten => s-TRYELSE,2,Noop(not supported at the moment)
exten => s-TRYELSE,3,Noop(Feel free to add support)
exten => s-TRYELSE,4,Goto(s-INVALID|1)

exten => s-NOTTRANSFERED,1,Noop(${CHANNEL})
exten => s-NOTTRANSFERED,2,Gotoif($["${CHANNEL}" != ""]?s-TRY2ZAP|1:s-INVALID|1)

exten => s-TRY2ZAP,1,Set(TECH=${CUT(CHANNEL,/,1)})
exten => s-TRY2ZAP,2,Gotoif($["${TECH}" : "Zap"]?s-ZAP2HOLDER|1:s-TRY2SIP|1)

exten => s-ZAP2HOLDER,1,Set(CONFHOLDER=${CUT(CHANNEL,/,2)})
exten => s-ZAP2HOLDER,2,Set(CONFHOLDER=${CUT(CONFHOLDER,-,1)})
exten => s-ZAP2HOLDER,3,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,2,Set(CONFHOLDER=${CUT(CONFHOLDER,-,1)})
exten => s-SIP2HOLDER,3,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,2,Set(CONFHOLDER=${CUT(CONFHOLDER,-,1)})
exten => s-mISDN2HOLDER,3,Goto(s-CHECKCONFEXIST|1)

exten => s-TRY2ELSE,1,Noop(SCCP,IAX channels and other technologies not)
exten => s-TRY2ELSE,2,Noop(supported at the moment.)
exten => s-TRY2ELSE,3,Noop(Feel free to add support !)
exten => s-TRY2ELSE,4,Goto(s-INVALID|1)

exten => s-USERJOIN,1,MeetMe(${CONFHOLDER},qdwx)

exten => s-CHECKCONFEXIST,1,MeetmeCount(${CONFHOLDER},CONFCOUNT)
exten => s-CHECKCONFEXIST,2,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},qdAx)

exten => s-INVALID,1,Playtones(info)
exten => s-INVALID,2,Wait(10)
exten => s-INVALID,3,Hangup()

222

333Does not run under ast 1.2(.7.1)

by echelon, Friday 30 of June, 2006 [11:30:28 UTC]
Does not run under ast 1.2(.7.1)

because the way channels are named is different in newer asterisk versions
222

333Does not run under ast 1.2(.7.1)

by echelon, Friday 30 of June, 2006 [11:29:56 UTC]
Does not run under ast 1.2(.7.1)

because the way channels are named is different in newer asterisk versions
222

333Does not work correctly

by Kaveh_Shahbazian, Sunday 12 of February, 2006 [14:26:16 UTC]
Thanks for your efforts.
(Mybe my problem is lack of knowledge rather than a real problem. But anyway please consider and help)
Does anybody used this macro? I am trying to use it on a * 1.0.10 and it does not seems to work. when I see the flow of commands in a sip debug mode, the 'Cut' command does not do anything.
And after all is there a good solution for conferencing on Asterisk? I have only encountered some statements about this title here and it seems there is no real attention for call conferencing in asterisk.
Thanks