Thread: RE: [Asterisk-java-users] originate call without picking up the fone?!
Brought to you by:
srt
From: Jason W. <jas...@be...> - 2006-02-13 20:43:24
|
Perhaps a little explanation will help you here as I think you might have a slight misunderstanding of what is happening. When you 'originate' a call using the asterisk manager, you are sending an 'originate action' request to the asterisk server, when answered, control is passed to the server, falling through the extensions that you have in the context that you specified in the originate action... at this point you can parse events that asterisk sends out to your manager instance, or read responses that your manager get's in response to other actions (there are also 'event generating actions'). you have to parse the channel variable in the event to know which channel the event is for in your event handler code. It sounds like you want to originate call_A using originateAciton in Manager, and then, if answered and not busy, use dial() in entensions to connect to the end user, so when they pickup, they're already connected. I have a multi-threaded app which picks up calls from a database of scheduled calls and originates them. up to three numbers are used, so my app remains in contol, and releases it when I know that the call has been answered and accepted. I know it has been accepted because I set a channel variable accepted=yes in the extension and then read it with a manageraction. you have to know the channel to read it's variables... in my case i didn't know from the origination since I'm using IAX and the channel i requested doesn't equal the actual channel used... so in the first priority for the extension, I set a global named by the phone number I sent in the originate action, and the value is the channel... then I can use the channel and go from there. hope this helps. -----Original Message----- From: ast...@li... [mailto:ast...@li...]On Behalf Of Arnd Vehling Sent: Monday, February 13, 2006 3:31 PM To: Ast...@li... Subject: [Asterisk-java-users] originate call without picking up the fone?! Hi There, we are developing a dialer application using the java lib to interface with the asterisk manager protocol. It works fine so far. The only problem we have is that if we use the "originate" command the user is required to pick up the fone _before_ asterisk will originate the call to the desired destination. What we would like to do is to place the call, check if the other end is available (ringing event) and only then let the user pickup the fone. Otherwise we would only display a text message "Destination 'Busy' etc. Does anyone know if/how this is possible? cheers, Arnd ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ Asterisk-java-users mailing list Ast...@li... https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |
From: Jason W. <jas...@be...> - 2006-02-14 15:39:14
|
In my testing, when I send an originate action, asterisk returns a response=error immediately when the line is busy and a response=success as soon as it starts riging. I think, from what you're saying, that your best solution is to originate the first call, and if response=success, you can originate a second call, and then put them both into a conference room on answer. (put them into a conference room using extensions, not java actions) also, the consise list of java actions is listed at: http://asterisk-java.sourceforge.net/apidocs/index.html Check out my earlier post about using Ethereal to view what communication is happening at the TCP/IP level.... John, I did a couple of things to make sure I was making the most of events... You might find it useful to try the following... 1. Use a program like Ethereal to sniff packets being recieved by your server running Manager. This way you see exactly what you're getting. You can filter to only show packets from the asterisk machine, and then you can do a test of the situation that you want to capture and see if asterisk is telling you what you need. 2. Look into 'user defined events' http://www.voip-info.org/wiki/view/Asterisk+cmd+UserEvent 3. grep on the entire asterisk directory for the currently generated events, I'm sure what your looking for would be in in channel.c if it exists, or trust the list at http://www.voip-info.org/wiki/view/asterisk+manager+events 4. if you look at the source for asterisk, you'll see that it's not hard to add events right in the source code and recompile if it's mission critical. 5. as well, Stefan did a great job of laying out Asterisk-java, so you could download the source and add a class for your handler if you create one. Hope this helps. Jason -----Original Message----- From: ast...@li... [mailto:ast...@li...]On Behalf Of Arnd Vehling Sent: Tuesday, February 14, 2006 9:06 AM To: ast...@li... Subject: Re: [Asterisk-java-users] originate call without picking up the fone?! Hell Jason, thx for the reply! > Perhaps a little explanation will help you here as I think you might have a > slight misunderstanding of what is happening. > > When you 'originate' a call using the asterisk manager, you are sending an > 'originate action' request to the asterisk server, we are using the asterisk java 2.0 API and the "OriginateAction" Class to establish the call. I have to admit i am not the programmer but posting here on his behalf so i dont understand all the jave API centric concepts fully. Simple Question: Is is possible to solve the problem with existing java-classes or do we need to get down to protocol level and issue actions ourselves?! > It sounds like you want to originate call_A using originateAciton in > Manager, and then, if answered and not busy, use dial() in entensions to > connect to the end user, so when they pickup, they're already connected. We want either this or connect to the enduser when the "other side" is "ringing" and not "busy". We only want the user to pickup the fone if the other side is available or picking up. cheers, Arnd ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ Asterisk-java-users mailing list Ast...@li... https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |
From: Arnd V. <av...@ne...> - 2006-02-14 15:48:21
|
Hi Jason, Jason Wolfe wrote: > In my testing, when I send an originate action, asterisk returns a > response=error immediately when the line is busy AFAIK the call isnt initiated before the fone rings and the user picks up the fone?! At least not when using the java API class OriginateAction?! > and a response=success as > soon as it starts riging. I think, from what you're saying, that your best > solution is to originate the first call, and if response=success, you can > originate a second call, and then put them both into a conference room on > answer. (put them into a conference room using extensions, not java actions) I already thought about initiating a call connecting to an App like conference or parkinglot. > Check out my earlier post about using Ethereal to view what communication is > happening at the TCP/IP level.... I always use "ngrep" for this and instructed my buddy whos the java programmer to use it too. Thx for the advise though. best regards, Arnd |
From: Jason W. <jas...@be...> - 2006-02-14 16:40:32
|
OriginateAction has a precise definition and an exact function. I don't know how you are defining 'initiated', but I want to be helpful so I am trying to clarify. Ringing is a line 'state', 'user picks up the phone' (called answered) is another, completely different state. sending an originate action (a data structure) has nothing to do with the line state. For your program to know the line state after an originate action is parsed by asterisk you will need to parse an event objects that contains the line state. You may be able to send a 'status' action that will cause a status event, and parse this event to find the channel state and do something with that info. I hope you are finding this helpful. -----Original Message----- From: ast...@li... [mailto:ast...@li...]On Behalf Of Arnd Vehling Sent: Tuesday, February 14, 2006 11:01 AM To: ast...@li... Subject: Re: [Asterisk-java-users] originate call without picking up the fone?! Hi Jason, Jason Wolfe wrote: > In my testing, when I send an originate action, asterisk returns a > response=error immediately when the line is busy AFAIK the call isnt initiated before the fone rings and the user picks up the fone?! At least not when using the java API class OriginateAction?! > and a response=success as > soon as it starts riging. I think, from what you're saying, that your best > solution is to originate the first call, and if response=success, you can > originate a second call, and then put them both into a conference room on > answer. (put them into a conference room using extensions, not java actions) I already thought about initiating a call connecting to an App like conference or parkinglot. > Check out my earlier post about using Ethereal to view what communication is > happening at the TCP/IP level.... I always use "ngrep" for this and instructed my buddy whos the java programmer to use it too. Thx for the advise though. best regards, Arnd ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ Asterisk-java-users mailing list Ast...@li... https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |
From: Arnd V. <av...@ne...> - 2006-02-14 13:53:27
|
Hell Jason, thx for the reply! > Perhaps a little explanation will help you here as I think you might have a > slight misunderstanding of what is happening. > > When you 'originate' a call using the asterisk manager, you are sending an > 'originate action' request to the asterisk server, we are using the asterisk java 2.0 API and the "OriginateAction" Class to establish the call. I have to admit i am not the programmer but posting here on his behalf so i dont understand all the jave API centric concepts fully. Simple Question: Is is possible to solve the problem with existing java-classes or do we need to get down to protocol level and issue actions ourselves?! > It sounds like you want to originate call_A using originateAciton in > Manager, and then, if answered and not busy, use dial() in entensions to > connect to the end user, so when they pickup, they're already connected. We want either this or connect to the enduser when the "other side" is "ringing" and not "busy". We only want the user to pickup the fone if the other side is available or picking up. cheers, Arnd |
From: Brett S. <bs...@no...> - 2006-02-16 11:03:08
|
I've noted that the parameters to setPriority differ for a couple of classes. BaseAGIScript.setPriority(String) OriginateAction.setPriority(Integer) Regards, Brett. |