Java 发起人无法与达迪沟通

Java 发起人无法与达迪沟通,java,asterisk,asteriskami,Java,Asterisk,Asteriskami,我有一个java/asterisk应用程序,它扫描联系人数据库,按顺序调用他们,并将他们连接到提供一些交互的扩展。 我已经做了一些测试,现在它可以与SIP(通过IP电话和skype在本地)一起正常工作。 上周,我收到了我的电话板并对其进行了配置(使用Dahdi)。通过IP电话直接进行测试。工作完美。所以我设置了我的程序来使用我卡上的FXO模块。现在它不起作用了 调用是使用OriginateAction生成的。代码如下: public class OriginateCall { private M

我有一个java/asterisk应用程序,它扫描联系人数据库,按顺序调用他们,并将他们连接到提供一些交互的扩展。 我已经做了一些测试,现在它可以与SIP(通过IP电话和skype在本地)一起正常工作。 上周,我收到了我的电话板并对其进行了配置(使用Dahdi)。通过IP电话直接进行测试。工作完美。所以我设置了我的程序来使用我卡上的FXO模块。现在它不起作用了

调用是使用OriginateAction生成的。代码如下:

public class OriginateCall {
private ManagerConnection managerConnection;

public void run() throws 
        IOException,AuthenticationFailedException,TimeoutException, ClassNotFoundException, SQLException {
    //Prepare the call
    OriginateAction originateAction;
    originateAction=new OriginateAction();
    originateAction.setChannel(Constants.PHONE_NUMBER_PREFIX+phoneNumber+Constants.PHONE_NUMBER_SUFFIX);
    originateAction.setExten(Constants.SCRIPT_EXTENSION);
    originateAction.setContext(Constants.DIALPLAN_CONTEXT);
    originateAction.setPriority(new Integer(1));
    System.out.println(originateAction);
    //connect to Asterisk and login
    ManagerConnectionFactory factory = new ManagerConnectionFactory(Constants.ASTERISK_URL,
            Constants.ASTERISK_USERNAME, Constants.ASTERISK_PASSWORD);
    managerConnection = factory.createManagerConnection();
    managerConnection.login();

    //send the originate action and wait for a maximum of 30 seconds to get a response
    ManagerResponse managerResponse;
    try {
        managerResponse = managerConnection.sendAction(originateAction, Constants.TIMEOUT);
        System.out.println(managerResponse);
    }
    catch (TimeoutException e){
        System.out.println("No answer");

    }

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

}

}
如您所见,我创建了一些调试输出。我在控制台上看到的是:

org.asteriskjava.manager.action.OriginateAction[action='Originate',application='null',callerid='null',data='null',actioncompleteeventclass='class org.asteriskjava.manager.event.OriginateResponseEvent',callingpres='null',async='null',variables='{contactId=4, rights=1111, messageId=18, attempts=1, callLogId=95, newShareLogId=19, fromShareLogId=0}',actionid='null',codecs='null',priority='1',context='gomobile',exten='700',account='null',channel='DAHDI/G0/00212*********',timeout='null',systemHashcode=1290874036]
Feb 17, 2014 5:42:00 PM org.asteriskjava.manager.internal.ManagerConnectionImpl connect
INFO: Connecting to localhost:5038
Feb 17, 2014 5:42:00 PM org.asteriskjava.manager.internal.ManagerConnectionImpl setProtocolIdentifier
INFO: Connected via Asterisk Call Manager/1.3
Feb 17, 2014 5:42:00 PM org.asteriskjava.manager.internal.ManagerConnectionImpl setProtocolIdentifier
WARNING: Unsupported protocol version 'Asterisk Call Manager/1.3'. Use at your own risk.
Feb 17, 2014 5:42:00 PM org.asteriskjava.manager.internal.ManagerConnectionImpl doLogin
INFO: Successfully logged in
Feb 17, 2014 5:42:00 PM org.asteriskjava.manager.internal.EventBuilderImpl buildEvent
INFO: No event class registered for event type 'fullybooted', attributes: {status=Fully Booted, event=FullyBooted, privilege=system,all}. Please report at http://jira.reucon.org/browse/AJ
Feb 17, 2014 5:42:02 PM org.asteriskjava.manager.internal.ManagerConnectionImpl doLogin
INFO: Determined Asterisk version: Asterisk 1.6
org.asteriskjava.manager.response.ManagerResponse: actionId='null'; message='Originate successfully queued'; response='Success'; uniqueId='null'; systemHashcode=977552923
Feb 17, 2014 5:42:06 PM org.asteriskjava.manager.internal.EventBuilderImpl buildEvent
INFO: No event class registered for event type 'dahdichannel', attributes: {dahdichannel=2, dahdispan=1, uniqueid=1392658922.12, sequencenumber=133, file=chan_dahdi.c, event=DAHDIChannel, privilege=call,all, line=2250, func=dahdi_ami_channel_event, channel=DAHDI/2-1}. Please report at http://jira.reucon.org/browse/AJ
Feb 17, 2014 5:42:06 PM org.asteriskjava.manager.internal.ManagerConnectionImpl disconnect
INFO: Closing socket.
Feb 17, 2014 5:42:06 PM org.asteriskjava.manager.internal.ManagerReaderImpl run
INFO: Terminating reader thread: No more lines available: Scanner closed
信息。我在OriginateAction对象(DAHDI/G0/0021xxxxxxxxx)中看到的频道与我在dialplan分机中使用的频道完全相同,从IP电话呼叫时,该频道工作正常

以下是asterisk cli上的输出:

 == Manager 'manager' logged on from 127.0.0.1
    -- Executing [700@gomobile:1] WaitForSilence("DAHDI/2-1", "5000") in new stack
    -- Waiting 1 time(s) for 5000 ms silence with 0 timeout
  == Manager 'manager' logged off from 127.0.0.1
    -- Exiting with 5000ms silence >= 5000ms required
    -- Executing [700@gomobile:2] AGI("DAHDI/2-1", "agi://localhost/message.agi") in new stack
    -- Playing '/home/gomobile/Documents/Gomobile/Sound files/Preliminary/Menu/hello' (escape_digits=) (sample_offset 0)
    -- Playing '/home/gomobile/Documents/Gomobile/Sound files/Preliminary/Menu/ziggi-speaking' (escape_digits=) (sample_offset 0)
    -- Playing '/home/gomobile/Documents/Gomobile/Sound files/Preliminary/Menu/listen-to-this-joke' (escape_digits=) (sample_offset 0)
    -- Playing '/home/gomobile/Documents/Gomobile/Sound files/Preliminary/Messages/20' (escape_digits=) (sample_offset 0)
    -- Playing 'silence/1' (escape_digits=) (sample_offset 0)
    -- AGI Script Executing Application: (Background) Options: (/home/gomobile/Documents/Gomobile/Sound files/Preliminary/Menu/tell-the-truth&/home/gomobile/Documents/Gomobile/Sound files/Preliminary/Menu/did-you-laugh&/home/gomobile/Documents/Gomobile/Sound files/Preliminary/Menu/if-you-like&/home/gomobile/Documents/Gomobile/Sound files/Preliminary/Menu/press-1&/home/gomobile/Documents/Gomobile/Sound files/Preliminary/Menu/like-share&/home/gomobile/Documents/Gomobile/Sound files/Preliminary/Menu/press-2&silence/2)
    -- <DAHDI/2-1> Playing '/home/gomobile/Documents/Gomobile/Sound files/Preliminary/Menu/tell-the-truth.gsm' (language 'en')
    -- <DAHDI/2-1> Playing '/home/gomobile/Documents/Gomobile/Sound files/Preliminary/Menu/did-you-laugh.gsm' (language 'en')
    -- <DAHDI/2-1> Playing '/home/gomobile/Documents/Gomobile/Sound files/Preliminary/Menu/if-you-like.gsm' (language 'en')
    -- <DAHDI/2-1> Playing '/home/gomobile/Documents/Gomobile/Sound files/Preliminary/Menu/press-1.gsm' (language 'en')
    -- <DAHDI/2-1> Playing '/home/gomobile/Documents/Gomobile/Sound files/Preliminary/Menu/like-share.gsm' (language 'en')
    -- <DAHDI/2-1> Playing '/home/gomobile/Documents/Gomobile/Sound files/Preliminary/Menu/press-2.gsm' (language 'en')
    -- <DAHDI/2-1> Playing 'silence/2.gsm' (language 'en')
    -- Playing 'silence/1' (escape_digits=) (sample_offset 0)
    -- Playing 'silence/1' (escape_digits=) (sample_offset 0)
    -- Playing '/home/gomobile/Documents/Gomobile/Sound files/Preliminary/Menu/good-bye' (escape_digits=) (sample_offset 0)
    -- Playing '/home/gomobile/Documents/Gomobile/Sound files/Preliminary/Menu/i-prepare-a-joke-and-call-you-back' (escape_digits=) (sample_offset 0)
    -- <DAHDI/2-1>AGI Script agi://localhost/message.agi completed, returning 4
  == Spawn extension (gomobile, 700, 2) exited non-zero on 'DAHDI/2-1'
    -- Executing [h@gomobile:1] NoOp("DAHDI/2-1", "hang up") in new stack
    -- Executing [h@gomobile:2] Set("DAHDI/2-1", "hangedUp=1") in new stack
    -- Executing [h@gomobile:3] AGI("DAHDI/2-1", "agi://localhost/cleanup.agi") in new stack
    -- <DAHDI/2-1>AGI Script agi://localhost/cleanup.agi completed, returning 0
    -- Hanging up on 'DAHDI/2-1'
    -- Hungup 'DAHDI/2-1'
==从127.0.0.1登录的管理器“管理器”
--执行[700@gomobile:1]新堆栈中的WaitForSilence(“DAHDI/2-1”、“5000”)
--等待1次5000毫秒静音,超时0
==从127.0.0.1注销的管理器“管理器”
--退出时需要5000毫秒的静音>=5000毫秒
--执行[700@gomobile:2]AGI(“DAHDI/2-1”agi://localhost/message.agi)在新堆栈中
--播放“/home/gomobile/Documents/gomobile/Sound files/premial/Menu/hello”(转义数字=)(示例偏移量0)
--播放“/home/gomobile/Documents/gomobile/Sound files/premial/Menu/ziggi speaking”(转义数字=)(示例偏移0)
--播放“/home/gomobile/Documents/gomobile/Sound files/premial/Menu/listen this job”(转义数字=)(示例偏移量0)
--播放“/home/gomobile/Documents/gomobile/Sound files/premial/Messages/20”(转义数字=)(示例偏移量0)
--正在播放“静音/1”(转义数字=)(示例偏移量0)
--AGI脚本执行应用程序:(后台)选项:(/home/gomobile/Documents/gomobile/Sound files/premial/Menu/实话实说&/home/gomobile/Documents/gomobile/Sound files/premial/Menu/你笑了吗&/home/gomobile/Documents/Sound files/premial/Menu/如果你喜欢&/home/gomobile/Sound/Sound/files/premial/Menu/press/1&/home/gomobile/Documents/gomobile/Sound/Sound/P重新开始/菜单/类似共享和/主页/gomobile/Documents/gomobile/Sound files/Premial/Menu/press-2&silence/2)
--播放“/home/gomobile/Documents/gomobile/Sound files/premial/Menu/tell the truth.gsm”(语言“en”)
--播放“/home/gomobile/Documents/gomobile/Sound files/premial/Menu/doy you laugh.gsm”(语言“en”)
--播放“/home/gomobile/Documents/gomobile/Sound files/premial/Menu/if you like.gsm”(语言“en”)
--播放“/home/gomobile/Documents/gomobile/Sound files/premial/Menu/press-1.gsm”(语言“en”)
--播放“/home/gomobile/Documents/gomobile/Sound files/premial/Menu/like share.gsm”(语言“en”)
--播放“/home/gomobile/Documents/gomobile/Sound files/premial/Menu/press-2.gsm”(语言“en”)
--播放“沉默/2.gsm”(语言“en”)
--正在播放“静音/1”(转义数字=)(示例偏移量0)
--正在播放“静音/1”(转义数字=)(示例偏移量0)
--播放“/home/gomobile/Documents/gomobile/Sound files/premial/Menu/good-bye”(转义数字=)(示例偏移量0)
--播放“/home/gomobile/Documents/gomobile/Sound files/premial/Menu/i-prepare-a-chake-and-call-you-back”(转义数字=)(示例偏移量0)
--AGI脚本agi://localhost/message.agi 已完成,返回4
==繁殖扩展(gomobile,700,2)在'DAHDI/2-1'上退出非零
--执行[h@gomobile:1]新堆栈中的NoOp(“DAHDI/2-1”,“挂起”)
--执行[h@gomobile:2]在新堆栈中设置(“DAHDI/2-1”,“hangedUp=1”)
--执行[h@gomobile:3]AGI(“DAHDI/2-1”agi://localhost/cleanup.agi)在新堆栈中
--AGI脚本agi://localhost/cleanup.agi 已完成,返回0
--挂断“DAHDI/2-1”
--Hungup'DAHDI/2-1'
这里有一个奇怪的地方:我从未在cli中看到所拨打的电话号码。 发生的事情是电话(我的电话)从不响。分机700开始播放(我终于明白这是正常的,因为FXO频道一交给Asterisk就被认为有人接听),但它只在服务器内播放。没有电话发生

有人能帮忙吗