Hey,
I am trying to get my application to call an external number and then
once it has answered call an extension.
I am using
[Code]
//varaible channel is the extension that gets call in this case its
something like 0XXXXXXXX so my dail plan strips the 0 and calls the X's
System.out.println("");
System.out.println("Creating Call To: "+channel);
OriginateAction org = new OriginateAction();
org.setChannel("Local/"+channel);
org.setContext("default");
org.setExten(Settings.ASTERISKEXTENSION);
org.setPriority(1);
org.setCallingPres(true);
org.setVariables(variables);
ManagerResponse res;
try {
res = dmc.sendAction(org);
Thread.sleep(30000);
System.out.println("The resposnse was: "+res.getResponse
());
System.out.println("The message was: "+res.getMessage());
} catch (IOException e) {
e.printStackTrace();
} catch (TimeoutException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
[/Code]
When setting channel to a local extension the extension is called and
when I answer it calls the other extension which plays some sounds
for me (all good)
When i set it to an external number 0+external it hangs up. as far as
i can tell it places the call then hangs up straight away before it
can even ring.
Any ideas would be great
Thanks :)
Daniel
External Extension:
[Debug Information]
== Manager 'remote_admin' logged on from 192.168.0.10
-- Executing Dial("Local/033740377@default-e9db,2", "SIP/
33740377@myfone-sip|30") in new stack
-- Called 33740377@myfone-sip
-- SIP/myfone-sip-4ce6 answered Local/033740377@default-e9db,2
-- Executing Macro("Local/033740377@default-e9db,2",
"hangupcall") in new stack
-- Executing ResetCDR("Local/033740377@default-e9db,2", "w") in
new stack
-- Executing NoCDR("Local/033740377@default-e9db,2", "") in new
stack
-- Executing Wait("Local/033740377@default-e9db,2", "5") in new
stack
-- Executing Hangup("Local/033740377@default-e9db,2", "") in new
stack
== Manager 'remote_admin' logged off from 192.168.0.10
[/Debug Information]
For Internal extension:
[Normal Debug]
== Manager 'remote_admin' logged on from 192.168.0.10
-- Executing Dial("Local/300@default-805e,2", "IAX2/300|30") in
new stack
-- Called 300
-- Call accepted by 192.168.0.1 (format gsm)
-- Format for call is gsm
-- IAX2/300-4 is ringing
== Connect attempt from '127.0.0.1' unable to authenticate
-- IAX2/300-4 answered Local/300@default-805e,2
> Channel Local/300@default-805e,1 was answered.
== Manager 'remote_admin' logged off from 192.168.0.10
-- Executing AGI("Local/300@default-805e,1", "agi://192.168.0.7/
hello.agi") in new stack
-- Executing Macro("Local/300@default-805e,2", "hangupcall") in
new stack
-- Executing ResetCDR("Local/300@default-805e,2", "w") in new stack
-- Executing NoCDR("Local/300@default-805e,2", "") in new stack
-- Executing Wait("Local/300@default-805e,2", "5") in new stack
-- Playing 'you-have-these-options' (escape_digits=123) (timeout
5000)
-- Playing 'digits/2' (language 'en')
-- Executing Macro("IAX2/300-4", "hangupcall") in new stack
-- Executing ResetCDR("IAX2/300-4", "w") in new stack
-- Executing NoCDR("IAX2/300-4", "") in new stack
-- Executing Wait("IAX2/300-4", "5") in new stack
-- Hungup 'IAX2/300-4'
-- Executing Hangup("Local/300@default-805e,2", "") in new stack
[/Normal Debug]
|