2013-11-26 2 views
0

에서 수신자에 대한 사운드를 재생하기 위해 어떻게 자바 응용 프로그램에서 번호를 다이얼 들어 별표

exec("DIAL", "DAHDI/g0/" + callingPhoneNo + "," + currentTimeOut + ",mg,"); 

을 사용하고 있습니다. 그리고이 조각 사용하여 발신자 사운드를 재생 :

exec("background", "custom/incorrectPassword"); 

그러나이 어떻게 전화를 위로 피 호출자 후 호출 수신기의 소리를 재생할 수 있습니까?

답변

0

: voip-info A 옵션으로 가능합니다. 는

exec("DIAL", "DAHDI/g0/" + callingPhoneNo + "," + currentTimeOut + ",mg|A(custom/greet)"); 

명령을 사용하여이 경우에, 전화를 위로 따기 후 수신자에 대한 greet 파일을 재생할 수 있다는 것을 의미한다.

+0

동일한 문제가있어서 코드를 사용해 보았지만 제대로 작동하지 않습니다. 그것은 "스레드에서 예외"메인 "java.lang.IllegalStateException : 잘못된 스레드에서 명령을 보내려고"하지만 해당 답변을 표시하면 작동합니다. 나는 exec 명령을 사용할 수 없다고 생각하지만 확실하지 않습니다. 너 나 좀 도와 줄 수있어? –

0

또한 다이얼 응용 프로그램에서 특수 확장 (매크로)을 사용할 수 있습니다. 피 호출자가 전화를 받으면 실행됩니다. 당신도 매개 변수를 전달할 수 있습니다.

예 2 : 전화 매크로 http://www.voip-info.org/wiki/view/Asterisk+cmd+Dial

1

이 작업을 수행하는 3 개 가지 옵션이 있습니다. 정확히이 목적을 위해) 실제로 하나의 옵션이 필요하지만, 역사적으로 우리가 3

1가, 다이얼 명령 diallout에서 옵션 A는

A(x): 
     x - The file to play to the called party 
    Play an announcement to the called party, where <x> is the prompt 
    to be played 

2) 개인 정보 보호 모드 옵션 매개 변수.

p :이 옵션을 사용하면 심사 모드를 사용할 수 있습니다. 기본적으로 메모리가없는 모드 입니다.

P([x]): Enable privacy mode. Use <x> as the family/key in the AstDB 
    database if it is provided. The current extension is used if a database 
    family/key is not specified. 

개인 정보 보호 플레이 메시지 발신자를 기반으로

3

을 찾을 수없는 경우 이름을 물어) 응답 매크로 및 GOSUB. 그냥 다른과 가장 유연한 방법은 당신이 입력을 수집 할 수 있음을 이용하여 전화로 뭔가를// 하락 호출을 확인 등

M (매크로 [^ 인수 [^ ...]]) :

 macro - Name of the macro that should be executed. 

     arg - Macro arguments 

    Execute the specified <macro> for the *called* channel before 
    connecting to the calling channel. Arguments can be specified to the Macro 
    using '^' as a delimiter. The macro can set the variable ${MACRO_RESULT} 
    to specify the following actions after the macro is finished executing: 

     ${MACRO_RESULT}: If set, this action will be taken after 
     the macro finished executing. 

      ABORT: Hangup both legs of the call 

      CONGESTION: Behave as if line congestion was 
      encountered 

      BUSY: Behave as if a busy signal was encountered 

      CONTINUE: Hangup the called party and allow the 
      calling party to continue dialplan execution at the next priority 

      GOTO:[[<context>^]<exten>^]<priority>: Transfer the 
      call to the specified destination. 




U(x[^arg[^...]]): 

    x - Name of the subroutine to execute via Gosub 
    arg - Arguments for the Gosub routine 

Execute via Gosub the routine <x> for the *called* channel before 
connecting to the calling channel. Arguments can be specified to the Gosub 
using '^' as a delimiter. The Gosub routine can set the variable ${GO 
SUB_RESULT} to specify the following actions after the Gosub returns. 

    ${GOSUB_RESULT}: 
     ABORT: Hangup both legs of the call. 
     CONGESTION: Behave as if line congestion was 
     encountered. 
     BUSY: Behave as if a busy signal was encountered. 
     CONTINUE: Hangup the called party and allow the 
     calling party to continue dialplan execution at the next priority. 
     GOTO:[[<context>^]<exten>^]<priority>: Transfer the 
     call to the specified destination. 
관련 문제