Summary:ASTERISK-06333: [patch] app_asyncgoto
Reporter:Sergey Basmanov (sb)Labels:
Date Opened:2006-02-16 08:26:54.000-0600Date Closed:2006-04-05 12:03:56
Versions:Frequency of
Environment:Attachments:( 0) app_asyncgoto.c
( 1) app_managerredirect.c
Description:This is a wrapper for 'ast_async_goto_by_name' function.
I'm using it to break bridged call and send called party to some context|exten|prio.

For example:
exten => s,1,AsyncGoto(${BRIDGEPEER},meetme-conf,${CURRENT_CONF},1)

And in features.conf:
send-to-conf => **,caller,Macro,async

Comments:By: Tilghman Lesher (tilghman) 2006-02-16 16:44:24.000-0600

And why won't Goto work in this situation?

By: Sergey Basmanov (sb) 2006-02-17 01:27:05.000-0600

Well, in this situation, Goto will work for me (calling party), but not for called party.
My idea is to break bridged call (app_dial) and send remote party to some extension.
For example:
exten => _10X,1,Set(CURRENT_CONF=${EXTEN})
exten => _10X,2,MeetMe(${EXTEN},pdX)
exten => _10X,3,Hangup

exten => 0,1,Playback(beep)
exten => 0,2,Read(DST)
exten => 0,3,Dial(Zap/${DST},30,g)
exten => 0,4,Goto(${CURRENT_CONF},1)

In this case I can exit meetme, dial number, talk, and if remote agrees - tranfer remote to ${CURRENT_CONF} and return back to conference.

this is a macro called by dynamic feature if remote agrees:
exten => s,1,AsyncGoto(${BRIDGEPEER},meetme-conf,${CURRENT_CONF},1)

or if remote is not agree to join conference:
exten => s,1,SoftHangup(${BRIDGEPEER})

I don't know any other way how to do this.

By: Tilghman Lesher (tilghman) 2006-02-17 08:32:58.000-0600

My initial thought is that this is the incorrect name.  A better name might be PeerGoto or PeerRedirect (to reflect that it isn't the current channel whose call path is being redirected).

By: Sergey Basmanov (sb) 2006-02-17 09:15:50.000-0600

Hmm.. Well, this app works with any active channel. Not only with peer channel or current channel..
It seems to me that AsyncGoto is more suitable. But I You think that PeerGoto is better - I will change it. A more interesting to me if this app will not break anything inside running * and can be safely used by other people.

By: Tilghman Lesher (tilghman) 2006-02-17 17:34:36.000-0600

ManagerRedirect would work, too.

By: Tilghman Lesher (tilghman) 2006-02-19 12:55:53.000-0600

I've made a few revisions to your app to make it a little more in line with the syntax of other apps.

By: Tilghman Lesher (tilghman) 2006-03-25 00:14:35.000-0600

ManagerRedirect committed to trunk

By: Sergey Basmanov (sb) 2006-04-05 07:15:04

Doesn't work with 1.2.x (including 1.2.6)
logger.c:     -- Executing ManagerRedirect("SIP/116-166a", "SIP/150-5aef|meetme-conf|500|1") in new stack
pbx.c: No such label '1' in extension '500' in context 'meetme-conf'
app_managerredirect.c: Attempting async goto (SIP/150-5aef) to (null)
app_managerredirect.c: ManagerRedirect failed for SIP/150-5aef

Probably we should use ast_exists_extension() instead of ast_findlabel_extension() ?

By: Tilghman Lesher (tilghman) 2006-04-05 11:28:57

I don't see how that's a failure.  Could you explain it to me?

By: Tilghman Lesher (tilghman) 2006-04-05 12:03:56

Fixed in trunk.