0

I have configured the analog local phone with cisco adapter, so I can make any outbound call from SIP phone. But I can't achieve this by AMI which calls to outbound channel through trunk then plays prompt.
manager.conf:

[asteriskjava]
secret = asteriskjava  
deny = 0.0.0.0/0.0.0.0  
permit = 127.0.0.1/255.255.255.0  
read = all  
write = all  

extensions.conf:

[bulk]
exten => 8,1,Playback(thank-you-cooperation)
exten => h,1,Hangup  

source code:

public class HelloManager
 {
    private ManagerConnection managerConnection;

    public HelloManager() throws IOException
    {
      ManagerConnectionFactory factory = new ManagerConnectionFactory(
            "localhost", "asteriskjava", "asteriskjava");

      this.managerConnection = factory.createManagerConnection();
    }

    public void run() throws IOException, AuthenticationFailedException,
        TimeoutException
    {
      OriginateAction originateAction;
      ManagerResponse originateResponse;

      originateAction = new OriginateAction();
      originateAction.setChannel("SIP/405/7000000");
      originateAction.setContext("bulk");
      originateAction.setExten("8");
      originateAction.setPriority(new Integer(1));
      originateAction.setAsync(true);

      // connect to Asterisk and log in
      managerConnection.login();

      // send the originate action and wait for a maximum of 30 seconds for Asterisk
      // to send a reply
      originateResponse = managerConnection.sendAction(originateAction, 30000);

      // print out whether the originate succeeded or not
      System.out.println("---" + originateResponse.getResponse());

      // and finally log off and disconnect
      managerConnection.logoff();
    }
}  

Where 405 is the UserID of CISCO adapter for outgoing calls, 7000000 is a sample cell phone number.

Here is the logs:

== Manager 'asteriskjava' logged on from 127.0.0.1
    == Manager 'asteriskjava' logged off from 127.0.0.1
    == Using SIP RTP CoS mark 5
         > Channel SIP/405-0000000c was answered.
      -- Executing [8@bulk:1] Playback("SIP/405-0000000c", "thank-you-cooperation") in new stack
      -- <SIP/405-0000000c> Playing 'thank-you-cooperation.gsm' (language 'en')
      -- Auto fallthrough, channel 'SIP/405-0000000c' status is 'UNKNOWN'
      -- Executing [h@bulk:1] Hangup("SIP/405-0000000c", "") in new stack
    == Spawn extension (bulk, h, 1) exited non-zero on 'SIP/405-0000000c'  

I think SIP/405 is answering, executing Playback then hangs up, not redirecting to sample number.
Any suggestions?

EDIT: How can I configure my cisco adapter in order to redirect outgoing calls, not to answer and make the bridge?

LeXuS
  • 19
  • 2
  • 8

1 Answers1

0

You have configure ring, answer and busy recognition on your ATA.

Asterisk work as you requested as far as i can see from your trace.

If adapter not calling, you have check with your adapater settings. For example it can be calling in tone, why you line expect it is pulse.

Also can be incorrect adapter type for your task. For calling out via PSTN line you need FXO adapter,not FXS.

arheops
  • 15,544
  • 1
  • 21
  • 27
  • adapter is calling to cell phone, but before that it answers to asterisk call then tries to redirect. But asterisk manager getting response from adapter (that it is ANSWERING), then plays prompt. Now I want to ask if its possible to configure the adapter just redirects the call not to answer first. Model of CISCO is: SPA3102-NA – LeXuS Jan 27 '15 at 10:22
  • I not udnerstand when and where you triing redirect. 3102 is analog adapter. It will not do any redirection – arheops Jan 27 '15 at 14:15
  • Can SPA3102 send parameter to asterisk that other side is answered, failed or hanged up – LeXuS Jan 28 '15 at 06:45
  • Yes,if configured. If that not work, you have check param on FXO line in 3102 web. – arheops Jan 28 '15 at 14:24
  • Can you know me how to configure, or give me a link. I have seen some forums that it is impossible. But I believe nothing is impossible))). Thanks beforehand – LeXuS Jan 29 '15 at 10:29
  • Give link to what? It have nice and full manual on cisco site. If you not understand how that described, you have hire expert. – arheops Jan 29 '15 at 15:19
  • Thank you, I'm going to search on cisco site. – LeXuS Feb 02 '15 at 09:19