How to play prompt for 2 legs at same time

Get help with installing, upgrading and running Asterisk.

Moderators: muppetmaster, Moderator, Support

How to play prompt for 2 legs at same time

Postby dalciotito2 » Mon Feb 12, 2007 7:02 am

Hi,
I have make a new aplication like bellow:
1 - Answer a Call,
2 - Dial to an extension
3 - When the extension answers, system has to play 2 different prompt files to both "legs" (inbound and outbound) at same time
4 - When the play app finishes on both "legs", system has to connect each other to start the conversation

I already made a dial plan using A(x) and L() options but, i've checked that asterisk plays to "outbound leg" only when the prompt for "inbound leg" finishes.

Does anyone know how to play the prompt for 2 legs at same time??

Thanks for your help
dalciotito2
Newsterisk
 
Posts: 3
Joined: Mon Feb 12, 2007 6:45 am

Postby IronHelix » Fri Feb 16, 2007 11:32 am

this sounds like an issue with the Dial() app that would have to be fixed in code...
IronHelix
Salt of the Asterisk
 
Posts: 1654
Joined: Thu Dec 21, 2006 10:56 pm

Postby valley » Fri Feb 16, 2007 1:09 pm

IronHelix wrote:this sounds like an issue with the Dial() app that would have to be fixed in code...


Not likely. dalciotito2 need to post your dialplan to understand what exactly you are trying to accomplish. Or is this an AGI script? From your description, Dial() is just doing what it's supposed to do.
valley
Astmaster
 
Posts: 543
Joined: Mon Jan 22, 2007 4:29 pm

Postby dalciotito2 » Wed Feb 21, 2007 11:26 am

Tnx for your reply.

I've made two dialplan.

exten=>900,1,Answer()
exten=>900,n,Set(LIMIT_PLAYAUDIO_CALLER=yes)
exten=>900,n,Set(LIMIT_PLAYAUDIO_CALLEE=yes)
exten=>900,n,Set(toNumber=destination)
exten=>900,n,Set(LIMIT_CONNECT_FILE=hello-world)
exten=>900,n,Dial(SIP/${toNumber},60,TtmL(10000000000000))
exten=>900,n,Hangup

exten=>901,1,Answer()
exten=>901,n,Set(LIMIT_CONNECT_FILE=hello-world_caller)
exten=>901,n,Dial(SIP/tito,60,TtmL(10000000000000)A(hello-world_called))
exten=>901,n,Hangup


The 900 extension, answer a call execute a dial() app to "${toNumber}" var. When destination answer, asterisk plays the "hello-world" prompt for Called party, when it finishes, plays the same prompt for caller party.

The 901 extension, asterisk plays different prompts for each party. But, even this way, Asterisk plays the prompt for Called party, when it finishes, plays the other prompt for caller party.

I need to play these prompts for both - called and caller - at same time. I mean, start the prompt at same time. When both prompt finishes, asterisk bridges the call.

Tnx again
dalciotito2
Newsterisk
 
Posts: 3
Joined: Mon Feb 12, 2007 6:45 am

Postby valley » Wed Feb 21, 2007 12:16 pm

Haven't thought through entirely, but reads like that call file is your friend. (Maybe in AGI also - not sure, but call file seems more manageable to me for such purposes.) Search for asterisk dialout in voipinfo for a quick idea, but read more docs about call file can't hurt.
valley
Astmaster
 
Posts: 543
Joined: Mon Jan 22, 2007 4:29 pm

Postby dalciotito2 » Thu Feb 22, 2007 2:56 pm

There is no way to do this using AGI, is there?
In my point of view, there is no APP or function to bridge 2 channels using AGI.
Please, let me know if i'm wrong.
Btw, i have test using Management API Originate command, and still can't play prompt on 2 legs at same time.
Again, let me know if the question is not clear.
dalciotito2
Newsterisk
 
Posts: 3
Joined: Mon Feb 12, 2007 6:45 am

Postby valley » Thu Feb 22, 2007 11:00 pm

I hadn't thought through implications of the requirement that the messages are to be played AFTER the other party picks up - manually. Played with A() and L() flags a bit. It's true that A() always gets played first. But can't say how it SHOULD behave. Maybe you can simply modify Dial source to make it work in your preference. But that LIMIT_CONNECT_FILE can only be played to caller then callee does seem to be a bug - at least a limitation.
valley
Astmaster
 
Posts: 543
Joined: Mon Jan 22, 2007 4:29 pm

G-friend

Postby valley » Sat Mar 03, 2007 1:16 am

Eureka! Now, G is your friend!

show application dial wrote: G(context^exten^pri) - If the call is answered, transfer the calling party to
the specified priority and the called party to the specified priority+1.
Optionally, an extension, or extension and context may be specified.
Otherwise, the current extension is used. You cannot use any additional
action post answer options in conjunction with this option.


With your newly found G-friend, you can manipulate the two legs whatever way you want. I haven't tested conversation, but confirmed that you can play different files at the same time. (This is different from "announcements" during which parties could not hear one another.)
valley
Astmaster
 
Posts: 543
Joined: Mon Jan 22, 2007 4:29 pm

Postby baconbuttie » Sat Mar 03, 2007 1:40 am

valley,

do the two legs of the call stay bridged after the G context has finished ?
baconbuttie
Moves Like Spencer
 
Posts: 2657
Joined: Tue May 16, 2006 6:32 am
Location: Forest of Dean, Gloucestershire, UK.

Postby valley » Sat Mar 03, 2007 4:58 pm

Bridging was not my intention. If not, conceptually, you can still bring the two calls into one conference. This would effectively bridge them.
valley
Astmaster
 
Posts: 543
Joined: Mon Jan 22, 2007 4:29 pm


Return to Asterisk Support

Who is online

Users browsing this forum: No registered users and 1 guest