asterisk-java-users Mailing List for Asterisk-Java Library (Page 133)
Brought to you by:
srt
You can subscribe to this list here.
| 2005 |
Jan
|
Feb
(8) |
Mar
(33) |
Apr
(36) |
May
(19) |
Jun
(21) |
Jul
(53) |
Aug
(30) |
Sep
(36) |
Oct
(34) |
Nov
(43) |
Dec
(72) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(123) |
Feb
(75) |
Mar
(86) |
Apr
(46) |
May
(41) |
Jun
(29) |
Jul
(76) |
Aug
(38) |
Sep
(39) |
Oct
(68) |
Nov
(16) |
Dec
(17) |
| 2007 |
Jan
(34) |
Feb
(18) |
Mar
(39) |
Apr
(30) |
May
(20) |
Jun
(10) |
Jul
(59) |
Aug
(54) |
Sep
(60) |
Oct
(22) |
Nov
(14) |
Dec
(10) |
| 2008 |
Jan
(34) |
Feb
(67) |
Mar
(65) |
Apr
(67) |
May
(60) |
Jun
(51) |
Jul
(88) |
Aug
(75) |
Sep
(47) |
Oct
(143) |
Nov
(54) |
Dec
(42) |
| 2009 |
Jan
(46) |
Feb
(80) |
Mar
(162) |
Apr
(159) |
May
(200) |
Jun
(34) |
Jul
(46) |
Aug
(59) |
Sep
(5) |
Oct
(35) |
Nov
(73) |
Dec
(30) |
| 2010 |
Jan
(23) |
Feb
(50) |
Mar
(8) |
Apr
(24) |
May
(19) |
Jun
(49) |
Jul
(56) |
Aug
(35) |
Sep
(26) |
Oct
(79) |
Nov
(39) |
Dec
(34) |
| 2011 |
Jan
(27) |
Feb
(22) |
Mar
(28) |
Apr
(12) |
May
(16) |
Jun
(19) |
Jul
(1) |
Aug
(64) |
Sep
(19) |
Oct
(11) |
Nov
(17) |
Dec
(12) |
| 2012 |
Jan
(6) |
Feb
(8) |
Mar
(15) |
Apr
(43) |
May
(41) |
Jun
(14) |
Jul
(32) |
Aug
(3) |
Sep
(4) |
Oct
(7) |
Nov
(11) |
Dec
(11) |
| 2013 |
Jan
(35) |
Feb
(11) |
Mar
(23) |
Apr
(25) |
May
(37) |
Jun
(47) |
Jul
(25) |
Aug
(21) |
Sep
|
Oct
(1) |
Nov
(9) |
Dec
|
| 2014 |
Jan
(26) |
Feb
(2) |
Mar
(18) |
Apr
(41) |
May
(7) |
Jun
(7) |
Jul
(24) |
Aug
(5) |
Sep
(6) |
Oct
(8) |
Nov
(9) |
Dec
(7) |
| 2015 |
Jan
(7) |
Feb
(15) |
Mar
(8) |
Apr
(12) |
May
(7) |
Jun
|
Jul
|
Aug
(5) |
Sep
(1) |
Oct
(3) |
Nov
(30) |
Dec
(3) |
| 2016 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
|
May
(9) |
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(8) |
Dec
(4) |
| 2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Aaron F. <aa...@la...> - 2007-05-24 15:29:23
|
Wow this looks very comprehensive. I will definitely use it as a starting
point. I have a stupid question though (I am new to Trixbox): In FreePBX,
how do I tie an extension to an IVR? I have a TestIVR menu that I created.
I don't see anywhere in the Extensions menu that I can call TestIVR when an
extension is dialed.
Thanks for your help on this. In the mean time I am going to play with the
code below to get familiar with it.
Aaron
> -----Original Message-----
> From: ast...@li...
> [mailto:ast...@li...] On
> Behalf Of Carlos G Mendioroz
> Sent: Thursday, May 24, 2007 5:01 AM
> To: ast...@li...
> Subject: Re: [Asterisk-java-users] Dialer
>
> Aaron,
> here's what I do for such context, in case it fits you.
> The originate can take a channel (your external dest) and an
> extension, which can be tied to (via extensions.conf) to an
> AGI script for your IVR.
>
> I use a function to make the originate:
>
> public String call(String dest, String dcontext,
> String ext, String context, int prio, int to,
> String vars) {
> OriginateAction originateAction;
> ManagerResponse originateResponse;
> Thread me = Thread.currentThread();
> String cid = "Failure";
> synchronized(instance) {
> originateAction = new OriginateAction();
> originateAction.setChannel("Local/" +
> cleanup(dest) + "@" + dcontext);
> originateAction.setContext(context);
> originateAction.setExten(ext);
> originateAction.setPriority(new Integer(prio));
> originateAction.setTimeout(new Long(to * 1000));
> originateAction.setVariable(vars);
> callId++;
> cid = "auto" + callId;
> originateAction.setCallerId(cid);
> originateAction.setActionId(cid);
> originateAction.setAsync(Boolean.TRUE);
>
> // send the originate action and wait for a
> maximum of 10 seconds for Asterisk
> // to send a reply
> try {
> originateResponse =
>
> managerConnection.sendAction(originateAction, to * 1000);
> } catch (IOException ioe) {
> log.warn ("Originate: " + ioe.getMessage());
> return "Failure";
> } catch (TimeoutException toe) {
> log.warn ("Originate: " + toe.getMessage());
> return "Failure";
> }
> if (!originateResponse.getResponse().equals("Success")) {
> log.warn ("Originate: " +
> originateResponse.getResponse());
> return "Failed";
> }
> callThreads.put(cid, me);
> callState.put(cid, "Congestion");
> } // synchro
> // Wait for call completion ?
> log.debug ("Call " + cid + " waiting");
> synchronized(me) {
> while (callThreads.get(cid) != null) {
> try {
> me.wait(5000);
> } catch (InterruptedException ie) {}
> }
> }
> String state = (String)callState.get(cid);
> callState.remove(cid);
> if (state == null) {
> state = "Failure";
> }
> log.debug ("Call " + cid + ": " + state);
> return state;
> }
>
> I use "Local" channel to reflect the call using whatever
> dialing rules you have. cleanup() is just a user destination
> phone cleaning like removing spaces and hiphens.
> Then, a daemon thread looks for progress and notifies the
> calling one of success or failure. The whole thing uses
> Hashtables to communicate:
>
> public void onManagerEvent(ManagerEvent event)
> {
> if (event.getClass().equals(OriginateSuccessEvent.class)) {
> String cid =
> ((OriginateSuccessEvent)event).getActionId();
> if (cid != null) {
> // Cool, keep waiting progress
> log.info ("Call " + cid + " originate ok");
> }
> } else if
> (event.getClass().equals(OriginateFailureEvent.class)) {
> String cid =
> ((OriginateFailureEvent)event).getActionId();
> if (cid != null) {
> // Oops, this one is not going to make it
> log.debug("Call " + cid + " originate failed");
> synchronized(instance) {
> Thread owner = (Thread)callThreads.get(cid);
> // cleanup
> if (owner != null) {
> synchronized(owner) {
> callThreads.remove(cid);
> String ostate =
> (String)callState.get(cid);
> if (ostate == null ||
> ostate.equals("Congestion"))
> callState.put(cid, "Failed");
> owner.notifyAll();
> }
> }
> }
> }
> } else if (event.getClass().equals(NewChannelEvent.class)) {
> String chan = ((NewChannelEvent)event).getChannel();
> if (!chan.substring(0,6).equals("Local/")) {
> // External calls, auto ?
> String cid =
> ((NewChannelEvent)event).getCallerIdName();
> if (cid != null && cid.startsWith("auto")) {
> if (callIds.get(chan) == null) {
>
> callIds.put(((NewChannelEvent)event).getUniqueId(), cid);
> callIds.put(cid,
> ((NewChannelEvent)event).getUniqueId());
> callChannels.put(chan,cid);
> callChannels.put(cid, chan);
> }
> // #4: Change of state
> String state =
> ((NewChannelEvent)event).getState();
> if (state.equals("Ringing")) {
> callState.put(cid, "NoAnswer");
> } else if (state.equals("Busy")) {
> callState.put(cid, "Busy");
> } else if (state.equals("Up")) {
> callState.put(cid, cid);
> }
> log.debug ("Call " + cid + " " + state);
> }
> }
> } else if (event.getClass().equals(NewStateEvent.class)) {
> String chan = ((NewStateEvent)event).getChannel();
> String uid = ((NewStateEvent)event).getUniqueId();
> if (!chan.substring(0,6).equals("Local/")) {
> // External calls, auto ?
> String cid = ((NewStateEvent)event).getCallerIdName();
> if ((cid != null && cid.startsWith("auto"))
> || callChannels.get(chan) != null
> || callIds.get(uid) != null ) {
> // Channels do change name in PRI...
> if (callChannels.get(chan) == null) {
> String ocid = (String)callIds.get(uid);
> if (ocid != null) {
> String ochan =
> (String)callChannels.get(ocid);
> if (ochan != null)
> callChannels.remove(ochan);
> callChannels.put(chan,ocid);
> callChannels.put(ocid,chan);
> }
> if (cid != null && cid.startsWith("auto")) {
>
> callIds.put(((NewStateEvent)event).getUniqueId(),
> cid);
> callIds.put(cid,
> ((NewStateEvent)event).getUniqueId());
> callChannels.put(chan,cid);
> callChannels.put(cid,chan);
> }
> }
> // ZAP changes caller id
> cid = (String)callChannels.get(chan);
> // #4: Change of state
> String state = ((NewStateEvent)event).getState();
> if (state.equals("Ringing")) {
> callState.put(cid, "NoAnswer");
> } else if (state.equals("Busy")) {
> callState.put(cid, "Busy");
> } else if (state.equals("Up")) {
> callState.put(cid, cid);
> }
> log.debug ("Call " + cid + " chan "+ chan
> + ": " + state);
> }
> }
> } else if (event.getClass().equals(RenameEvent.class)) {
> String cid =
> (String)callChannels.get(((RenameEvent)event).getNewname());
> if (cid != null) {
> // we keep cid, and change references...
> String oldid = (String)callIds.get(cid);
> if (oldid != null) callIds.remove(oldid);
> callIds.put(cid, ((RenameEvent)event).getUniqueId());
> callIds.put(((RenameEvent)event).getUniqueId(), cid);
> }
> } else if (event.getClass().equals(HangupEvent.class)) {
> String cid =
> (String)callIds.get(((HangupEvent)event).getUniqueId());
> if (cid != null) {
> // #4: Hangup (beware of change of Uid!)
> // Grr: It seems sometime Uids change
> (according to note) but I failed
> // to document the case, and it is a fact that
> channels do change
> // so I'm using now callIds{getUniqueID} instead of
> // callChannles{getChannel} to access my call.
> If Uids do change,
> // we'll have to track renames. -tron 30/3/07
> // Yep, Channels get renamed. Fixed . (3 hours later)
> String state = "Hangup:
> "+((HangupEvent)event).getCauseTxt();
> String id = (String)callIds.get(cid);
> String chan = (String)callChannels.get(cid);
> log.info ("Call " + cid + " " + state);
> Thread owner = (Thread)callThreads.get(cid);
> // cleanup
> callIds.remove(id);
> callIds.remove(cid);
> callChannels.remove(chan);
> callChannels.remove(cid);
> callThreads.remove(cid);
> if (owner != null) {
> synchronized(owner) {
> owner.notifyAll();
> }
> }
> }
> }
> }
>
> I just fire a bunch of threads for work. Let me know if you
> use it and spot any issues...
>
> -Carlos
>
> Aaron Freeman @ 24/05/2007 01:42 -0300 dixit:
> > OK as I played with it a bit more I sorta answered my own
> question. I
> > can dial an number by doing this in the setChannel( ... ) method:
> >
> > originateChannel.setChannel("ZIP/g0/18005551212");
> >
> > Now I am trying to figure out how to connect the call to an
> IVR when
> > they answer the phone ... I am guessing instead of
> setExten( ... ) I
> > will need setApplication( ... ) so I will try that in the morning.
> >
> > Thanks,
> >
> > Aaron
> >
> >> -----Original Message-----
> >> From: ast...@li...
> >> [mailto:ast...@li...]
> On Behalf
> >> Of Stefan Reuter
> >> Sent: Wednesday, May 23, 2007 7:29 PM
> >> To: ast...@li...
> >> Subject: Re: [Asterisk-java-users] Dialer
> >>
> >> Aaron Freeman wrote:
> >>> Is there an example of an application that dials out? Any
> >> links would
> >>> be great.
> >> The most simple example is in the tutorial - it just uses
> originate.
> >> "Hello Manager!" at
> >> http://asterisk-java.org/development/tutorial.html
> >>
> >> =Stefan
> >>
> >> --
> >> reuter network consulting
> >> Neusser Str. 110
> >> 50760 Koeln
> >> Germany
> >> Telefon: +49 221 1305699-0
> >> Telefax: +49 221 1305699-90
> >> E-Mail: ste...@re...
> >> Jabber: ste...@re...
> >>
> >> Steuernummern 215/5140/1791 USt-IdNr. DE220701760
> >>
> >>
> >
> >
> >
> ----------------------------------------------------------------------
> > --- This SF.net email is sponsored by DB2 Express Download
> DB2 Express
> > C - the FREE version of DB2 express and take control of
> your XML. No
> > limits. Just data. Click to get it now.
> > http://sourceforge.net/powerbar/db2/
> > _______________________________________________
> > Asterisk-java-users mailing list
> > Ast...@li...
> > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users
> >
>
> --
> Carlos G Mendioroz <tr...@ac...>
>
> --------------------------------------------------------------
> -----------
> This SF.net email is sponsored by DB2 Express Download DB2
> Express C - the FREE version of DB2 express and take control
> of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Asterisk-java-users mailing list
> Ast...@li...
> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users
>
|
|
From: Carlos G M. <tr...@ac...> - 2007-05-24 10:01:49
|
Aaron,
here's what I do for such context, in case it fits you.
The originate can take a channel (your external dest) and an extension,
which can be tied to (via extensions.conf) to an AGI script for your IVR.
I use a function to make the originate:
public String call(String dest, String dcontext,
String ext, String context, int prio, int to, String vars) {
OriginateAction originateAction;
ManagerResponse originateResponse;
Thread me = Thread.currentThread();
String cid = "Failure";
synchronized(instance) {
originateAction = new OriginateAction();
originateAction.setChannel("Local/" + cleanup(dest) + "@" +
dcontext);
originateAction.setContext(context);
originateAction.setExten(ext);
originateAction.setPriority(new Integer(prio));
originateAction.setTimeout(new Long(to * 1000));
originateAction.setVariable(vars);
callId++;
cid = "auto" + callId;
originateAction.setCallerId(cid);
originateAction.setActionId(cid);
originateAction.setAsync(Boolean.TRUE);
// send the originate action and wait for a maximum of 10
seconds for Asterisk
// to send a reply
try {
originateResponse =
managerConnection.sendAction(originateAction, to *
1000);
} catch (IOException ioe) {
log.warn ("Originate: " + ioe.getMessage());
return "Failure";
} catch (TimeoutException toe) {
log.warn ("Originate: " + toe.getMessage());
return "Failure";
}
if (!originateResponse.getResponse().equals("Success")) {
log.warn ("Originate: " + originateResponse.getResponse());
return "Failed";
}
callThreads.put(cid, me);
callState.put(cid, "Congestion");
} // synchro
// Wait for call completion ?
log.debug ("Call " + cid + " waiting");
synchronized(me) {
while (callThreads.get(cid) != null) {
try {
me.wait(5000);
} catch (InterruptedException ie) {}
}
}
String state = (String)callState.get(cid);
callState.remove(cid);
if (state == null) {
state = "Failure";
}
log.debug ("Call " + cid + ": " + state);
return state;
}
I use "Local" channel to reflect the call using whatever dialing rules
you have. cleanup() is just a user destination phone cleaning like
removing spaces and hiphens.
Then, a daemon thread looks for progress and notifies the calling one
of success or failure. The whole thing uses Hashtables to communicate:
public void onManagerEvent(ManagerEvent event)
{
if (event.getClass().equals(OriginateSuccessEvent.class)) {
String cid = ((OriginateSuccessEvent)event).getActionId();
if (cid != null) {
// Cool, keep waiting progress
log.info ("Call " + cid + " originate ok");
}
} else if (event.getClass().equals(OriginateFailureEvent.class)) {
String cid = ((OriginateFailureEvent)event).getActionId();
if (cid != null) {
// Oops, this one is not going to make it
log.debug("Call " + cid + " originate failed");
synchronized(instance) {
Thread owner = (Thread)callThreads.get(cid);
// cleanup
if (owner != null) {
synchronized(owner) {
callThreads.remove(cid);
String ostate = (String)callState.get(cid);
if (ostate == null || ostate.equals("Congestion"))
callState.put(cid, "Failed");
owner.notifyAll();
}
}
}
}
} else if (event.getClass().equals(NewChannelEvent.class)) {
String chan = ((NewChannelEvent)event).getChannel();
if (!chan.substring(0,6).equals("Local/")) {
// External calls, auto ?
String cid = ((NewChannelEvent)event).getCallerIdName();
if (cid != null && cid.startsWith("auto")) {
if (callIds.get(chan) == null) {
callIds.put(((NewChannelEvent)event).getUniqueId(), cid);
callIds.put(cid,
((NewChannelEvent)event).getUniqueId());
callChannels.put(chan,cid);
callChannels.put(cid, chan);
}
// #4: Change of state
String state = ((NewChannelEvent)event).getState();
if (state.equals("Ringing")) {
callState.put(cid, "NoAnswer");
} else if (state.equals("Busy")) {
callState.put(cid, "Busy");
} else if (state.equals("Up")) {
callState.put(cid, cid);
}
log.debug ("Call " + cid + " " + state);
}
}
} else if (event.getClass().equals(NewStateEvent.class)) {
String chan = ((NewStateEvent)event).getChannel();
String uid = ((NewStateEvent)event).getUniqueId();
if (!chan.substring(0,6).equals("Local/")) {
// External calls, auto ?
String cid = ((NewStateEvent)event).getCallerIdName();
if ((cid != null && cid.startsWith("auto"))
|| callChannels.get(chan) != null
|| callIds.get(uid) != null ) {
// Channels do change name in PRI...
if (callChannels.get(chan) == null) {
String ocid = (String)callIds.get(uid);
if (ocid != null) {
String ochan = (String)callChannels.get(ocid);
if (ochan != null) callChannels.remove(ochan);
callChannels.put(chan,ocid);
callChannels.put(ocid,chan);
}
if (cid != null && cid.startsWith("auto")) {
callIds.put(((NewStateEvent)event).getUniqueId(),
cid);
callIds.put(cid,
((NewStateEvent)event).getUniqueId());
callChannels.put(chan,cid);
callChannels.put(cid,chan);
}
}
// ZAP changes caller id
cid = (String)callChannels.get(chan);
// #4: Change of state
String state = ((NewStateEvent)event).getState();
if (state.equals("Ringing")) {
callState.put(cid, "NoAnswer");
} else if (state.equals("Busy")) {
callState.put(cid, "Busy");
} else if (state.equals("Up")) {
callState.put(cid, cid);
}
log.debug ("Call " + cid + " chan "+ chan + ": " +
state);
}
}
} else if (event.getClass().equals(RenameEvent.class)) {
String cid =
(String)callChannels.get(((RenameEvent)event).getNewname());
if (cid != null) {
// we keep cid, and change references...
String oldid = (String)callIds.get(cid);
if (oldid != null) callIds.remove(oldid);
callIds.put(cid, ((RenameEvent)event).getUniqueId());
callIds.put(((RenameEvent)event).getUniqueId(), cid);
}
} else if (event.getClass().equals(HangupEvent.class)) {
String cid =
(String)callIds.get(((HangupEvent)event).getUniqueId());
if (cid != null) {
// #4: Hangup (beware of change of Uid!)
// Grr: It seems sometime Uids change (according to note)
but I failed
// to document the case, and it is a fact that channels do
change
// so I'm using now callIds{getUniqueID} instead of
// callChannles{getChannel} to access my call. If Uids do
change,
// we'll have to track renames. -tron 30/3/07
// Yep, Channels get renamed. Fixed . (3 hours later)
String state = "Hangup:
"+((HangupEvent)event).getCauseTxt();
String id = (String)callIds.get(cid);
String chan = (String)callChannels.get(cid);
log.info ("Call " + cid + " " + state);
Thread owner = (Thread)callThreads.get(cid);
// cleanup
callIds.remove(id);
callIds.remove(cid);
callChannels.remove(chan);
callChannels.remove(cid);
callThreads.remove(cid);
if (owner != null) {
synchronized(owner) {
owner.notifyAll();
}
}
}
}
}
I just fire a bunch of threads for work. Let me know if you use it and
spot any issues...
-Carlos
Aaron Freeman @ 24/05/2007 01:42 -0300 dixit:
> OK as I played with it a bit more I sorta answered my own question. I can
> dial an number by doing this in the setChannel( ... ) method:
>
> originateChannel.setChannel("ZIP/g0/18005551212");
>
> Now I am trying to figure out how to connect the call to an IVR when they
> answer the phone ... I am guessing instead of setExten( ... ) I will need
> setApplication( ... ) so I will try that in the morning.
>
> Thanks,
>
> Aaron
>
>> -----Original Message-----
>> From: ast...@li...
>> [mailto:ast...@li...] On
>> Behalf Of Stefan Reuter
>> Sent: Wednesday, May 23, 2007 7:29 PM
>> To: ast...@li...
>> Subject: Re: [Asterisk-java-users] Dialer
>>
>> Aaron Freeman wrote:
>>> Is there an example of an application that dials out? Any
>> links would
>>> be great.
>> The most simple example is in the tutorial - it just uses originate.
>> "Hello Manager!" at http://asterisk-java.org/development/tutorial.html
>>
>> =Stefan
>>
>> --
>> reuter network consulting
>> Neusser Str. 110
>> 50760 Koeln
>> Germany
>> Telefon: +49 221 1305699-0
>> Telefax: +49 221 1305699-90
>> E-Mail: ste...@re...
>> Jabber: ste...@re...
>>
>> Steuernummern 215/5140/1791 USt-IdNr. DE220701760
>>
>>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Asterisk-java-users mailing list
> Ast...@li...
> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users
>
--
Carlos G Mendioroz <tr...@ac...>
|
|
From: Carlos G M. <tr...@hu...> - 2007-05-24 09:49:22
|
Aaron,
here's what I do for such context, in case it fits you.
The originate can take a channel (your external dest) and an extension,
which can be tied to (via extensions.conf) to an AGI script for your IVR.
I use a function to make the originate:
public String call(String dest, String dcontext,
String ext, String context, int prio, int to, String vars) {
OriginateAction originateAction;
ManagerResponse originateResponse;
Thread me = Thread.currentThread();
String cid = "Failure";
synchronized(instance) {
originateAction = new OriginateAction();
originateAction.setChannel("Local/" + cleanup(dest) + "@" +
dcontext);
originateAction.setContext(context);
originateAction.setExten(ext);
originateAction.setPriority(new Integer(prio));
originateAction.setTimeout(new Long(to * 1000));
originateAction.setVariable(vars);
callId++;
cid = "auto" + callId;
originateAction.setCallerId(cid);
originateAction.setActionId(cid);
originateAction.setAsync(Boolean.TRUE);
// send the originate action and wait for a maximum of 10
seconds for Asterisk
// to send a reply
try {
originateResponse =
managerConnection.sendAction(originateAction, to *
1000);
} catch (IOException ioe) {
log.warn ("Originate: " + ioe.getMessage());
return "Failure";
} catch (TimeoutException toe) {
log.warn ("Originate: " + toe.getMessage());
return "Failure";
}
if (!originateResponse.getResponse().equals("Success")) {
log.warn ("Originate: " + originateResponse.getResponse());
return "Failed";
}
callThreads.put(cid, me);
callState.put(cid, "Congestion");
} // synchro
// Wait for call completion ?
log.debug ("Call " + cid + " waiting");
synchronized(me) {
while (callThreads.get(cid) != null) {
try {
me.wait(5000);
} catch (InterruptedException ie) {}
}
}
String state = (String)callState.get(cid);
callState.remove(cid);
if (state == null) {
state = "Failure";
}
log.debug ("Call " + cid + ": " + state);
return state;
}
I use "Local" channel to reflect the call using whatever dialing rules
you have. cleanup() is just a user destination phone cleaning like
removing spaces and hiphens.
Then, a daemon thread looks for progress and notifies the calling one
of success or failure. The whole thing uses Hashtables to communicate:
public void onManagerEvent(ManagerEvent event)
{
if (event.getClass().equals(OriginateSuccessEvent.class)) {
String cid = ((OriginateSuccessEvent)event).getActionId();
if (cid != null) {
// Cool, keep waiting progress
log.info ("Call " + cid + " originate ok");
}
} else if (event.getClass().equals(OriginateFailureEvent.class)) {
String cid = ((OriginateFailureEvent)event).getActionId();
if (cid != null) {
// Oops, this one is not going to make it
log.debug("Call " + cid + " originate failed");
synchronized(instance) {
Thread owner = (Thread)callThreads.get(cid);
// cleanup
if (owner != null) {
synchronized(owner) {
callThreads.remove(cid);
String ostate = (String)callState.get(cid);
if (ostate == null || ostate.equals("Congestion"))
callState.put(cid, "Failed");
owner.notifyAll();
}
}
}
}
} else if (event.getClass().equals(NewChannelEvent.class)) {
String chan = ((NewChannelEvent)event).getChannel();
if (!chan.substring(0,6).equals("Local/")) {
// External calls, auto ?
String cid = ((NewChannelEvent)event).getCallerIdName();
if (cid != null && cid.startsWith("auto")) {
if (callIds.get(chan) == null) {
callIds.put(((NewChannelEvent)event).getUniqueId(), cid);
callIds.put(cid,
((NewChannelEvent)event).getUniqueId());
callChannels.put(chan,cid);
callChannels.put(cid, chan);
}
// #4: Change of state
String state = ((NewChannelEvent)event).getState();
if (state.equals("Ringing")) {
callState.put(cid, "NoAnswer");
} else if (state.equals("Busy")) {
callState.put(cid, "Busy");
} else if (state.equals("Up")) {
callState.put(cid, cid);
}
log.debug ("Call " + cid + " " + state);
}
}
} else if (event.getClass().equals(NewStateEvent.class)) {
String chan = ((NewStateEvent)event).getChannel();
String uid = ((NewStateEvent)event).getUniqueId();
if (!chan.substring(0,6).equals("Local/")) {
// External calls, auto ?
String cid = ((NewStateEvent)event).getCallerIdName();
if ((cid != null && cid.startsWith("auto"))
|| callChannels.get(chan) != null
|| callIds.get(uid) != null ) {
// Channels do change name in PRI...
if (callChannels.get(chan) == null) {
String ocid = (String)callIds.get(uid);
if (ocid != null) {
String ochan = (String)callChannels.get(ocid);
if (ochan != null) callChannels.remove(ochan);
callChannels.put(chan,ocid);
callChannels.put(ocid,chan);
}
if (cid != null && cid.startsWith("auto")) {
callIds.put(((NewStateEvent)event).getUniqueId(),
cid);
callIds.put(cid,
((NewStateEvent)event).getUniqueId());
callChannels.put(chan,cid);
callChannels.put(cid,chan);
}
}
// ZAP changes caller id
cid = (String)callChannels.get(chan);
// #4: Change of state
String state = ((NewStateEvent)event).getState();
if (state.equals("Ringing")) {
callState.put(cid, "NoAnswer");
} else if (state.equals("Busy")) {
callState.put(cid, "Busy");
} else if (state.equals("Up")) {
callState.put(cid, cid);
}
log.debug ("Call " + cid + " chan "+ chan + ": " +
state);
}
}
} else if (event.getClass().equals(RenameEvent.class)) {
String cid =
(String)callChannels.get(((RenameEvent)event).getNewname());
if (cid != null) {
// we keep cid, and change references...
String oldid = (String)callIds.get(cid);
if (oldid != null) callIds.remove(oldid);
callIds.put(cid, ((RenameEvent)event).getUniqueId());
callIds.put(((RenameEvent)event).getUniqueId(), cid);
}
} else if (event.getClass().equals(HangupEvent.class)) {
String cid =
(String)callIds.get(((HangupEvent)event).getUniqueId());
if (cid != null) {
// #4: Hangup (beware of change of Uid!)
// Grr: It seems sometime Uids change (according to note)
but I failed
// to document the case, and it is a fact that channels do
change
// so I'm using now callIds{getUniqueID} instead of
// callChannles{getChannel} to access my call. If Uids do
change,
// we'll have to track renames. -tron 30/3/07
// Yep, Channels get renamed. Fixed . (3 hours later)
String state = "Hangup:
"+((HangupEvent)event).getCauseTxt();
String id = (String)callIds.get(cid);
String chan = (String)callChannels.get(cid);
log.info ("Call " + cid + " " + state);
Thread owner = (Thread)callThreads.get(cid);
// cleanup
callIds.remove(id);
callIds.remove(cid);
callChannels.remove(chan);
callChannels.remove(cid);
callThreads.remove(cid);
if (owner != null) {
synchronized(owner) {
owner.notifyAll();
}
}
}
}
}
I just fire a bunch of threads for work. Let me know if you use it and
spot any issues...
-Carlos
Aaron Freeman @ 24/05/2007 01:42 -0300 dixit:
> OK as I played with it a bit more I sorta answered my own question. I can
> dial an number by doing this in the setChannel( ... ) method:
>
> originateChannel.setChannel("ZIP/g0/18005551212");
>
> Now I am trying to figure out how to connect the call to an IVR when they
> answer the phone ... I am guessing instead of setExten( ... ) I will need
> setApplication( ... ) so I will try that in the morning.
>
> Thanks,
>
> Aaron
>
>> -----Original Message-----
>> From: ast...@li...
>> [mailto:ast...@li...] On
>> Behalf Of Stefan Reuter
>> Sent: Wednesday, May 23, 2007 7:29 PM
>> To: ast...@li...
>> Subject: Re: [Asterisk-java-users] Dialer
>>
>> Aaron Freeman wrote:
>>> Is there an example of an application that dials out? Any
>> links would
>>> be great.
>> The most simple example is in the tutorial - it just uses originate.
>> "Hello Manager!" at http://asterisk-java.org/development/tutorial.html
>>
>> =Stefan
>>
>> --
>> reuter network consulting
>> Neusser Str. 110
>> 50760 Koeln
>> Germany
>> Telefon: +49 221 1305699-0
>> Telefax: +49 221 1305699-90
>> E-Mail: ste...@re...
>> Jabber: ste...@re...
>>
>> Steuernummern 215/5140/1791 USt-IdNr. DE220701760
>>
>>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Asterisk-java-users mailing list
> Ast...@li...
> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users
>
--
Carlos G Mendioroz <tr...@hu...> LW7 EQI Argentina
|
|
From: Aaron F. <aa...@la...> - 2007-05-24 04:40:46
|
OK as I played with it a bit more I sorta answered my own question. I can
dial an number by doing this in the setChannel( ... ) method:
originateChannel.setChannel("ZIP/g0/18005551212");
Now I am trying to figure out how to connect the call to an IVR when they
answer the phone ... I am guessing instead of setExten( ... ) I will need
setApplication( ... ) so I will try that in the morning.
Thanks,
Aaron
> -----Original Message-----
> From: ast...@li...
> [mailto:ast...@li...] On
> Behalf Of Stefan Reuter
> Sent: Wednesday, May 23, 2007 7:29 PM
> To: ast...@li...
> Subject: Re: [Asterisk-java-users] Dialer
>
> Aaron Freeman wrote:
> > Is there an example of an application that dials out? Any
> links would
> > be great.
>
> The most simple example is in the tutorial - it just uses originate.
> "Hello Manager!" at http://asterisk-java.org/development/tutorial.html
>
> =Stefan
>
> --
> reuter network consulting
> Neusser Str. 110
> 50760 Koeln
> Germany
> Telefon: +49 221 1305699-0
> Telefax: +49 221 1305699-90
> E-Mail: ste...@re...
> Jabber: ste...@re...
>
> Steuernummern 215/5140/1791 USt-IdNr. DE220701760
>
>
|
|
From: Aaron F. <aa...@la...> - 2007-05-24 02:37:01
|
Ok I missed that as I was keying on the FastAGI -- but I can use either mechanism. Instead of dialing an extension, how would I dial a phone number using OriginateAction? Thanks Aaron > -----Original Message----- > From: ast...@li... > [mailto:ast...@li...] On > Behalf Of Stefan Reuter > Sent: Wednesday, May 23, 2007 7:29 PM > To: ast...@li... > Subject: Re: [Asterisk-java-users] Dialer > > Aaron Freeman wrote: > > Is there an example of an application that dials out? Any > links would > > be great. > > The most simple example is in the tutorial - it just uses originate. > "Hello Manager!" at http://asterisk-java.org/development/tutorial.html > > =Stefan > > -- > reuter network consulting > Neusser Str. 110 > 50760 Koeln > Germany > Telefon: +49 221 1305699-0 > Telefax: +49 221 1305699-90 > E-Mail: ste...@re... > Jabber: ste...@re... > > Steuernummern 215/5140/1791 USt-IdNr. DE220701760 > > |
|
From: Stefan R. <ste...@re...> - 2007-05-24 00:28:56
|
Aaron Freeman wrote: > Is there an example of an application that dials out? Any links would = be > great. The most simple example is in the tutorial - it just uses originate. "Hello Manager!" at http://asterisk-java.org/development/tutorial.html =3DStefan --=20 reuter network consulting Neusser Str. 110 50760 Koeln Germany Telefon: +49 221 1305699-0 Telefax: +49 221 1305699-90 E-Mail: ste...@re... Jabber: ste...@re... Steuernummern 215/5140/1791 USt-IdNr. DE220701760 |
|
From: Aaron F. <aa...@la...> - 2007-05-24 00:10:07
|
Is there an example of an application that dials out? Any links would be great. Thanks, Aaron |
|
From: Raistlin M. <rai...@gm...> - 2007-05-12 12:25:47
|
Hi, I'm new to asterisk-java, I am planning to write an application for some kind of campaign, but unlike predictive dialers , this will dial list of numbers and play a predefined file and hangup, such as a reminder for customers who forgot to pay their bills. Can any one point a direction about if it could be done via asterisk-java (by AMI i guess) Regards, ilker |
|
From: Martin S. <ma...@be...> - 2007-05-11 19:05:53
|
Hi Hector & list, =20 You'll want to take a look at = http://asterisk-java.org/development/apidocs/org/asteriskjava/manager/act= ion/OriginateAction.html, and consider originating to an application. If = you aren't sure where to connect your Asterisk application (the = applications you're interested in are AGI/FastAGI/DeadAGI), or don't = know the channel, check out Stefan's blog article on local channels = (http://blogs.reucon.com/asterisk-java/2007/04/18/1176849060000.html). =20 Martin Smith, Systems Developer ma...@be... Bureau of Economic and Business Research University of Florida (352) 392-0171 Ext. 221=20 =20 ________________________________ From: ast...@li... = [mailto:ast...@li...] On Behalf Of = H=E9ctor Maldonado Sent: Friday, May 11, 2007 11:55 AM To: ast...@li... Subject: [Asterisk-java-users] How to call AGI script from Manager = Interface =09 =09 Hi all, =20 I developed a little application that interacts with Asterisk through = Manager API. I need to invoke an agi script (actually FastAGI) from my = app. =20 How could this be done? What Action could I use to invoke the script? =20 Many thanks in advance. =20 Hector Maldonado. =20 =20 |
|
From: <ham...@gm...> - 2007-05-11 15:55:11
|
Hi all, I developed a little application that interacts with Asterisk through Manager API. I need to invoke an agi script (actually FastAGI) from my app. How could this be done? What Action could I use to invoke the script? Many thanks in advance. Hector Maldonado. |
|
From: Brett S. <bs...@as...> - 2007-05-02 21:49:31
|
We have just starting shipping The Receptionist Console for Asterisk 1.0 which run on java 6 and makes use of A-J. I wouldn't however say that we use the api exhaustively, but we do use it vigorously :) We have experienced no problems with Java 6, but then given the changes we really didn't expect to. Regards, S. Brett Sutton Asterisk Integrated Telelphony http://www.asteriskit.com.au Stefan Reuter wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Karien Du Preez wrote: > >> Are any of you running A-J together with Java 6? Our clients are pushing >> us to upgrade, currently we are running 1.5 update 6. I don't forsee any >> problems with this upgrade but one never knows. >> > > Not in production but in or dev environment. We did not yet experience > any problems. > > =Stefan > > - -- > reuter network consulting > Neusser Str. 110 > 50760 Koeln > Germany > Telefon: +49 221 1305699-0 > Telefax: +49 221 1305699-90 > E-Mail: ste...@re... > Jabber: ste...@re... > > Steuernummern 215/5140/1791 USt-IdNr. DE220701760 > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.6 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFGOEe+cVCZDfrn+pMRAgALAJ436qTtsiah6tK+lJPl7icG7y+HtACfb+gG > O/J6CclP1l90qZ9kXDbJH0Y= > =f4LM > -----END PGP SIGNATURE----- > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > |
|
From: Stefan R. <ste...@re...> - 2007-05-02 08:11:56
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Karien Du Preez wrote: > Are any of you running A-J together with Java 6? Our clients are pushing > us to upgrade, currently we are running 1.5 update 6. I don't forsee any > problems with this upgrade but one never knows. Not in production but in or dev environment. We did not yet experience any problems. =Stefan - -- reuter network consulting Neusser Str. 110 50760 Koeln Germany Telefon: +49 221 1305699-0 Telefax: +49 221 1305699-90 E-Mail: ste...@re... Jabber: ste...@re... Steuernummern 215/5140/1791 USt-IdNr. DE220701760 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGOEe+cVCZDfrn+pMRAgALAJ436qTtsiah6tK+lJPl7icG7y+HtACfb+gG O/J6CclP1l90qZ9kXDbJH0Y= =f4LM -----END PGP SIGNATURE----- |
|
From: Karien Du P. <kar...@gm...> - 2007-05-02 06:03:32
|
Hi all. Are any of you running A-J together with Java 6? Our clients are pushing us to upgrade, currently we are running 1.5 update 6. I don't forsee any problems with this upgrade but one never knows. Regards. |
|
From: Stefan R. <ste...@re...> - 2007-04-25 10:25:30
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, you might want to have a look at the implementation of the originate* methods in AsteriskServerImpl in org.asteriskjava.live. If you come up with a good javadoc text later, I am happy to add it :) =Stefan - -- reuter network consulting Neusser Str. 110 50760 Koeln Germany Telefon: +49 221 1305699-0 Telefax: +49 221 1305699-90 E-Mail: ste...@re... Jabber: ste...@re... Steuernummern 215/5140/1791 USt-IdNr. DE220701760 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGLyyEcVCZDfrn+pMRAijNAJ4rXuPUZYzWiQxJpjSYPpex2oGu/gCePmT8 apYu6C9S/NEYSNk/vior9cU= =dbz/ -----END PGP SIGNATURE----- |
|
From: Karien Du P. <kar...@gm...> - 2007-04-25 10:12:10
|
Hi all. I noticed that the getReason() and setReason() within the org.asteriskjava.manager.event.OriginateResponseEvent has no javadoc or comments to it. I'm trying to determine the reason for call failure and thought that one will be able to use this reason code. I am however unable to find any documentation on this 'reason' property and whether one can indeed use this reason code as a means to determine call failure. Can anybody shed some light on this property's purpose and meaning? Sorry, this question is probably more appropriate on the ast...@li... mailing list. Regards, Jan. |
|
From: Stefan R. <ste...@re...> - 2007-04-24 06:01:13
|
Stefan Reuter wrote: > Karien Du Preez wrote: >> I know that A-J 0.3 is still in the progress of being updated to be >> compatible with 1.4.*, just wanted to point it out that the setter for= >> the duration event property of MeetMeLeaveEvent is missing. >=20 > Thanks for your feedback, I will add the property asap and provide a ne= w > SNAPSHOT. it's fixed in today's snapshot. =3DStefan --=20 reuter network consulting Neusser Str. 110 50760 Koeln Germany Telefon: +49 221 1305699-0 Telefax: +49 221 1305699-90 E-Mail: ste...@re... Jabber: ste...@re... Steuernummern 215/5140/1791 USt-IdNr. DE220701760 |
|
From: Karien Du P. <kar...@gm...> - 2007-04-24 05:06:33
|
Hi all. Asterisk Java determines the asterisk version right after a manager login, from my logging output I noticed the following: [INFO] org.asteriskjava.manager.internal.ManagerConnectionImpl.doLogin( ManagerConnectionImpl.java:577) - Determined Asterisk version: Asterisk 1.2 I'm running Asterisk 1.4.2 I don't know how much of a problem this is, just thought I should point it out. Regards. |
|
From: Stefan R. <ste...@re...> - 2007-04-23 10:40:34
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, Karien Du Preez wrote: > I know that A-J 0.3 is still in the progress of being updated to be > compatible with 1.4.*, just wanted to point it out that the setter for > the duration event property of MeetMeLeaveEvent is missing. Thanks for your feedback, I will add the property asap and provide a new SNAPSHOT. > PS: Stefan, sorry if this is not the appropriate place to report this. > Please point me to the appropriate place for future references. I am always glad to receive bug/issue reports. The mailing list is almost perfect for them. An even better place would be jira.reucon.org, our issue tracker, but thats optional :) =Stefan - -- reuter network consulting Neusser Str. 110 50760 Koeln Germany Telefon: +49 221 1305699-0 Telefax: +49 221 1305699-90 E-Mail: ste...@re... Jabber: ste...@re... Steuernummern 215/5140/1791 USt-IdNr. DE220701760 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGLI0WcVCZDfrn+pMRAunlAJ4zoeVne0Fh3ZW/XCdupfs55ktRawCcDekb 4zMegT49gGfy9X6dN15+GtI= =O+A4 -----END PGP SIGNATURE----- |
|
From: Karien Du P. <kar...@gm...> - 2007-04-23 10:14:10
|
Hi. This morning I upgraded to Asterisk 1.4.2. I have been running A-J 0.3 m1. I have a conference control application, when I tested I got the following errors: [ERROR] org.asteriskjava.manager.internal.EventBuilderImpl.setAttributes( EventBuilderImpl.java:351) - Unable to set property 'calleridnum' on class org.asteriskjava.manager.event.NewChannelEvent: no setter [ERROR] org.asteriskjava.manager.internal.EventBuilderImpl.setAttributes( EventBuilderImpl.java:351) - Unable to set property 'duration' on class org.asteriskjava.manager.event.MeetMeLeaveEvent: no setter This is weird as the m1 API states that it does have a setCalledIDNum method, there is no setDuration within MeetMeLeaveEvent however. I upgraded to the latest A-J snapshot (asterisk-java-0.3-20070419.224341-20) and the calleridnum is being set properly, but not the duration. I know that A-J 0.3 is still in the progress of being updated to be compatible with 1.4.*, just wanted to point it out that the setter for the duration event property of MeetMeLeaveEvent is missing. PS: Stefan, sorry if this is not the appropriate place to report this. Please point me to the appropriate place for future references. Regards. |
|
From: Markus F. <mar...@ts...> - 2007-04-23 09:40:08
|
Hello, Oh yes, i forgot that i can start the recording on every linked channel. = I will use the second channel to start the second monitor. Thanks -----Urspr=FCngliche Nachricht----- Von: ast...@li... = [mailto:ast...@li...] Im Auftrag = von Stefan Reuter Gesendet: Freitag, 20. April 2007 16:59 An: ast...@li... Betreff: Re: [Asterisk-java-users] Executing Dial Applications from the = Manager API Markus Floegel wrote: > But that=B4s not what i mean. I know the mixing support. > What i need are two (mixed) files with different start/stop times. > Each File should contain the voice of the caller and the receiver. >=20 > In my application two persons should be able to start/stop a separate = recording on the same channel. of the same call or the same channel? As a call usually has two channels you should be able to execute the MonitorAction separately on the two channels of the call. Disclaimer: I never did this so its just a guess that this should work. =3DStefan --=20 reuter network consulting Neusser Str. 110 50760 Koeln Germany Telefon: +49 221 1305699-0 Telefax: +49 221 1305699-90 E-Mail: ste...@re... Jabber: ste...@re... Steuernummern 215/5140/1791 USt-IdNr. DE220701760 |
|
From: Stefan R. <ste...@re...> - 2007-04-20 14:59:17
|
Markus Floegel wrote: > But that=B4s not what i mean. I know the mixing support. > What i need are two (mixed) files with different start/stop times. > Each File should contain the voice of the caller and the receiver. >=20 > In my application two persons should be able to start/stop a separate r= ecording on the same channel. of the same call or the same channel? As a call usually has two channels you should be able to execute the MonitorAction separately on the two channels of the call. Disclaimer: I never did this so its just a guess that this should work. =3DStefan --=20 reuter network consulting Neusser Str. 110 50760 Koeln Germany Telefon: +49 221 1305699-0 Telefax: +49 221 1305699-90 E-Mail: ste...@re... Jabber: ste...@re... Steuernummern 215/5140/1791 USt-IdNr. DE220701760 |
|
From: Markus F. <mar...@ts...> - 2007-04-20 14:40:58
|
Hello Stefan,
thanks for the answer.
But that=B4s not what i mean. I know the mixing support.
What i need are two (mixed) files with different start/stop times.
Each File should contain the voice of the caller and the receiver.
In my application two persons should be able to start/stop a separate =
recording on the same channel.
Markus
-----Urspr=FCngliche Nachricht-----
Von: ast...@li... =
[mailto:ast...@li...] Im Auftrag =
von Stefan Reuter
Gesendet: Freitag, 20. April 2007 16:25
An: ast...@li...
Betreff: Re: [Asterisk-java-users] Executing Dial Applications from the =
Manager API
Hi Markus,
Markus Floegel wrote:
> I want to execute the application "MixMonitor" from the ManagerAPI on =
a linked channel.
Afaik the Monitor action supports both mixing and not mixing:
Action: Monitor
Synopsis: Monitor a channel
Privilege: call,all
Description: The 'Monitor' action may be used to record the audio on a
specified channel. The following parameters may be used to control
this:
Channel - Required. Used to specify the channel to record.
File - Optional. Is the name of the file created in the
monitor spool directory. Defaults to the same name
as the channel (with slashes replaced with dashes).
Format - Optional. Is the audio recording format. Defaults
to "wav".
Mix - Optional. Boolean parameter as to whether to mix
the input and output channels together after the
recording is finished.
(from Asterisk 1.4)
=3DStefan
--=20
reuter network consulting
Neusser Str. 110
50760 Koeln
Germany
Telefon: +49 221 1305699-0
Telefax: +49 221 1305699-90
E-Mail: ste...@re...
Jabber: ste...@re...
Steuernummern 215/5140/1791 USt-IdNr. DE220701760
|
|
From: Stefan R. <ste...@re...> - 2007-04-20 14:25:44
|
Hi Markus,
Markus Floegel wrote:
> I want to execute the application "MixMonitor" from the ManagerAPI on a=
linked channel.
Afaik the Monitor action supports both mixing and not mixing:
Action: Monitor
Synopsis: Monitor a channel
Privilege: call,all
Description: The 'Monitor' action may be used to record the audio on a
specified channel. The following parameters may be used to control
this:
Channel - Required. Used to specify the channel to record.
File - Optional. Is the name of the file created in the
monitor spool directory. Defaults to the same name
as the channel (with slashes replaced with dashes).
Format - Optional. Is the audio recording format. Defaults
to "wav".
Mix - Optional. Boolean parameter as to whether to mix
the input and output channels together after the
recording is finished.
(from Asterisk 1.4)
=3DStefan
--=20
reuter network consulting
Neusser Str. 110
50760 Koeln
Germany
Telefon: +49 221 1305699-0
Telefax: +49 221 1305699-90
E-Mail: ste...@re...
Jabber: ste...@re...
Steuernummern 215/5140/1791 USt-IdNr. DE220701760
|
|
From: Markus F. <mar...@ts...> - 2007-04-20 13:51:55
|
Hello, I have the problem that i should record a call into two separate files.=20 Each record will start/stop to it=B4s own time. I did not find a way to do this, so i want to use the MonitorAction from = the API to record the first file and the MixMonitor to record the = second. The MonitorAction works fine, but how to use the MixMonitor from the = ManagerAPI? Is it possible to execute applications from the dialplan with the = ManagerAPI ? I want to execute the application "MixMonitor" from the ManagerAPI on a = linked channel. Markus Fl=F6gel |
|
From: Stefan R. <ste...@re...> - 2007-04-19 22:34:00
|
Dov Bigio wrote:
> Is it possible to add a SIPHeader (application AddSipHeader on Asterisk=
)
> when I make a call through asterisk-java, for example, using the
> OriginateAction?
> =20
> I want to make an application that Dials to a VoiceXML application,
> which would read parameters from the SIP header...
You can use a Local channel and run AddSipHeader in your dialplan.
This would look like:
Map<String, String> headers =3D new HashMap<String, String>();
headers.add("__HEADER1", "blah");
=2E..
originateToExtensionAsync("Local/123@default", "default", "456", 1,
10000L, null, parameters, null);
now you can use HEADER1 in your dialplan to configure extension 123 and
456 with AddSipHeader(${HEADER1}) and Dial() after that.
> (Or doesn't anyone have a better idea for sending parameters through a
> Dial...)
Depends on how your VoiceXML application is connected to Asterisk. If
its connected through SIP I think SIP headers are the best way to go.
=3DStefan
--=20
reuter network consulting
Neusser Str. 110
50760 Koeln
Germany
Telefon: +49 221 1305699-0
Telefax: +49 221 1305699-90
E-Mail: ste...@re...
Jabber: ste...@re...
Steuernummern 215/5140/1791 USt-IdNr. DE220701760
|