login | register
Fri 22 of Aug, 2008 [00:31 UTC]

voip-info.org

Discuss [7] History

Asterisk n-way call HOWTO

Created by: serg_b,Last modification on Fri 16 of Mar, 2007 [03:14 UTC] by JustRumours
Here I will attempt to describe how to make n-way calls from 2-way calls.
First, You need trunk version of Asterisk.
All work done by two applications: MeetMe and ChannelRedirect. You need Zaptel driver to have MeetMe working.

Question: For Asterisk 1.4 do wee need to replace 'ChannelRedirect' as used below with 'ManagerRedirect' as in bug/patch 6508?

Here is dialplan example:

[default]
exten => _XXX,1,Set(DYNAMIC_FEATURES=nway-start)
exten => _XXX,n,Dial(SIP/${EXTEN})

[dynamic-nway]
exten => _XXX,1,Answer
exten => _XXX,n,Set(CONFNO=${EXTEN})
exten => _XXX,n,Set(MEETME_EXIT_CONTEXT=dynamic-nway-invite)
exten => _XXX,n,Set(DYNAMIC_FEATURES=)
exten => _XXX,n,MeetMe(${CONFNO},pdMX)
exten => _XXX,n,Hangup

[dynamic-nway-invite]
exten => 0,1,Read(DEST,dial,,i)
exten => 0,n,Set(DYNAMIC_FEATURES=nway-inv#nway-noinv)
exten => 0,n,Dial(Local/${DEST}@dynamic-nway-dest,,g)
exten => 0,n,Set(DYNAMIC_FEATURES=)
exten => 0,n,Goto(dynamic-nway,${CONFNO},1)
exten => i,1,Goto(dynamic-nway,${CONFNO},1)

[dynamic-nway-dest]
exten => _XXX,1,Dial(SIP/${EXTEN})

[macro-nway-start]
exten => s,1,Set(CONFNO=${FindFreeConf()})
exten => s,n,ChannelRedirect(${BRIDGEPEER},dynamic-nway,${CONFNO},1)
exten => s,n,Read(DEST,dial,,i)
exten => s,n,Set(DYNAMIC_FEATURES=nway-inv#nway-noinv)
exten => s,n,Dial(Local/${DEST}@dynamic-nway-dest,,g)
exten => s,n,Set(DYNAMIC_FEATURES=)
exten => s,n,Goto(dynamic-nway,${CONFNO},1)

[macro-nway-ok]
exten => s,1,ChannelRedirect(${BRIDGEPEER},dynamic-nway,${CONFNO},1)

[macro-nway-notok]
exten => s,1,SoftHangup(${BRIDGEPEER})

Note, You need to provide FindFreeConf() function (or any other way) to get free Conference number.

And, to make all this work, here is features.conf:

[applicationmap]
nway-start => *0,caller,Macro,nway-start
nway-inv => **,caller,Macro,nway-ok
nway-noinv => *#,caller,Macro,nway-notok

How this works:

When You speak with other party, press *0 (macro nway-start is executed). Called party is immediately transferred to free conference, and You get dialtone to enter number of party You want to invite. After call established and You talk to third user, You can press ** to invite him to conference and *# to hangup call and return to conference. From conference any user can invite anyone else by pressing 0 (all other steps are same as for *0)

See also



Comments

Comments Filter
222

333res_features.c :1478 ast_bridge_call : Bridge failed on channels

by bahbouh, Wednesday 01 of August, 2007 [07:26:00 UTC]
Can any one help me?
When i try to add a person in the established call,
the first person redirected in the confernce room (OK) i dial the number of the second personne i talk with him (OK) when i try to accept him(**)
i have a hangup and the 2 other party can talk in the confĂ©rence room
the same think was reproduced when i refused to invite him!
this error was genereted when i passed a normal call first and try to invite other party :"
res_features.c:1478 ast_bridge_call: Bridge failed on channels SIP/XXXXXXXXXXXXXXX and AsyncGoto/SIP/XXXXXXXXXXXXXXX <ZOMBIE>
"
if confernece established and one of the party try to invite some one there is no probleme!!!

Help please
222

333Macro not intended for use in applicationmap?

by ioncube, Wednesday 25 of July, 2007 [17:13:20 UTC]
This is a neat feature, but I noticed an "IMPORTANT NOTE" in features.conf of 1.4 that says:

"The applicationmap is not intended to be used for all Asterisk applications ... It does *not* make sense to use any application which has any concept of dialplan flow. Examples of this would be things like Macro ..."

However Macro is used in nway-start and the other features entries, so is this reliable? It seems to contradict the advice in features.conf, or do I misunderstand (which is entirely possible!)?
222

333app_channelredirect.c:112 asyncgoto_exec: ChannelRedirect failed

by k.keshav, Wednesday 27 of June, 2007 [16:04:13 UTC]
After pressing *0, and dialling the second party number, my first call is getting disconnect and on CLI i m getting error...

Executing s@macro-nway-start:1 Set("SIP/1001-09458580", "CONFNO=210511") in new stack
   — Executing s@macro-nway-start:2 ChannelRedirect("SIP/1001-09458580", "SIP/kesh-0945c4e8|dynamic-nway|210511|1") in new stack
Jun 27 21:05:11 WARNING4671: app_channelredirect.c:112 asyncgoto_exec: ChannelRedirect failed for SIP/kesh-0945c4e8
 == Spawn extension (macro-nway-start, s, 2) exited non-zero on 'SIP/1001-09458580' in macro 'nway-start'
   — Executing s@macro-nway-start:3 Read("SIP/1001-09458580", "DEST|dial||i") in new stack
   — User entered '1002'

222

333little addition

by serg_b, Thursday 22 of June, 2006 [15:18:51 UTC]
Here is little changed dialplan:
[dynamic-nway]
exten => _XXX,1,Answer
exten => _XXX,n,Set(CONFNO=${EXTEN})
exten => _XXX,n,Set(MEETME_EXIT_CONTEXT=dynamic-nway-invite)
exten => _XXX,n,Set(DYNAMIC_FEATURES=)
exten => _XXX,n,AGI(conf.agi,adduser)
exten => _XXX,n,MeetMe(${CONFNO},pdMX)
exten => h,1,DeadAGI(conf.agi,deluser)

and change:
[macro-nway-start]
exten => s,1,AGI(conf.agi,findfree)
exten => s,n,Set(CONFNO=${FREE_CONF})
...

conf.agi script written in perl and requires Asterisk::AGI
it's very simple script, so don't expect too much from it
http://files.9i.ru/asterisk/conf.agi
You only need to adjust starting number (look in script).
222

333n-way with 1.2.9.1

by serg_b, Thursday 22 of June, 2006 [11:27:26 UTC]
Well, I have similar application, that I made at first time for stable. Trunk version of this app is more safe.
For 1.2.9.1 You can get it here: http://files.9i.ru/asterisk/app_asyncgoto.c
It's name AsyncGoto instead of ChannelRedirect.
Save it to apps/
To compile it, edit apps/Makefile and add app_asyncgoto.so to APPS=
PS: I'm not sure it will not crash Your asterisk. So, use at Your own risk.
Oh, You will need also different version of app_read to provide dialtone.
You can get it here: http://files.9i.ru/asterisk/app_read.c

222

333Possible to do n-way call with Asterisk 1.2.9.1?

by puzzled, Thursday 22 of June, 2006 [11:02:42 UTC]
Nice HOWTO but it works with trunk only. Is there any way you could provide a similar HOWTO that shows how to make this work with Asterisk 1.2.9.1? The ChannelRedirect application is not available in 1.2.9.1. Hopefully there is another way.
222

333Why SVN trunk?

by gcleaves, Thursday 22 of June, 2006 [09:51:15 UTC]
This looks great. Just curious, why is SVN trunk needed for this little app? Is is ChannelRedirect? Or some part of application map?