Asterisk dialplan applications: Difference between revisions

From 탱이의 잡동사니
Jump to navigation Jump to search
Line 30: Line 30:
   same => n,Hangup()
   same => n,Hangup()
</pre>
</pre>
== ADSIProg ==
지정한 ADSI 스크립트를 phone 으로 로드한다.
<pre>
ADSIProg([script])
</pre>
* script : adsi script to use. If not given uses the default script asterisk.adsi
=== See also ===
* https://wiki.asterisk.org/wiki/display/AST/Asterisk+14+Application_ADSIProg


== RemoveQueueMeber ==
== RemoveQueueMeber ==

Revision as of 14:22, 2 November 2016

Overview

Asterisk dialplan application 내용 정리

AddQueueMember

Queue 에 멤버를 추가한다(dynamically).

AddQueueMember(queuename,[interface,[penalty,[options,[membername,[stateinterface]]]]])
  • queuename : 멤버를 추가하고자 하는 Queue name.
  • interface : 추가하고자 하는 멤버의 interface
  • penalty : 추가하고자 하는 멤버의 penalty.
  • membername : 추가하고자 하는 멤버의 name.
  • stateinterface :

Channel variables

application 실행 이후, 실행 결과와 관련한 다음의 channel variable 을 설정한다.

  • AQMSTATUS : The status of the attempt to add a queue member as a text string.
ADDED : 추가됨.
MEMBERALREADY : 이미 멤버가 있음.
NOSUCHQUEUE : 큐를 찾을 수 없음.

Example

[QueueMemberFunctions]
exten => *54,1,Verbose(2,Logging In Queue Member)
  smae => n,Set(MemberChannel=${CHANNEL(channeltype)}/${CHANNEL(peername)})
  same => n,AddQueueMember(support,${MemberChannel})
  same => n,Verbose(1,${AQMSTATUS}) ; ADDED, MEMBERALREADY, NOSUCHQUEUE
  smae => n,Playback(agent-loginok)
  same => n,Hangup()

ADSIProg

지정한 ADSI 스크립트를 phone 으로 로드한다.

ADSIProg([script])
  • script : adsi script to use. If not given uses the default script asterisk.adsi

See also

RemoveQueueMeber

Queue 에서 멤버를 삭제한다(dynamically).

RemoveQueueMember(queuename,[interface])
  • queuename : Queue name.
  • interface : 삭제하고자 하는 멤버의 interface.

Channel variables

application 실행 이후, 실행 결과와 관련한 다음의 channel variable 을 설정한다.

  • RQMSTATUS - The status of the attempt to remove a queue member as a text string.
REMOVED : 삭제됨.
NOTINQUEUE : Queue 에 해당 멤버가 없음.
NOSUCHQUEUE : Queue 를 찾을 수 없음.
NOTDYNAMIC : Dynamic 멤버가 아님.

Example

exten => *56,1,Verbose(2,Logging Out Queue Member)
  same => n,Set(MemberChannel=${CHANNEL(channeltype)}/${CHANNEL(peername)})
  same => n,RemoveQueueMember(support,${MemberChannel})
  same => n,Verbose(1,${RQMSTATUS}) ; REMOVED, NOTINQUEUE, NOSUCHQUEUE, NOTDYNAMIC
  same => n,Playback(agent-loggedoff)
  same => n,Hangup()

PauseQueueMember

지정한 멤버를 pause 한다.

PauseQueueMember([queuename,interface,[options,[reason]]])
  • queuename :
  • interface :
  • options :
  • reason : Is used to add extra information to the appropriate queue_log entries and manager events.

Channel variables

명령어 실행 후, 다음의 Channel variable 이 설정된다.

  • PQMSTATUS - The status of the attempt to pause a queue member as a text string.
PAUSED : Pause 성공.
NOTFOUND : 지정한 Queue/Member를 찾을 수 없음.

Example

exten => *72,1,Verbose(2,Pause Queue Member)
  same => n,Set(MemberChannel=${CHANNEL(channeltype)}/${CHANNEL(peername)})
  same => n,PauseQueueMember(support,${MemberChannel})
  same => n,Verbose(1,${PQMSTATUS}); PAUSED, NOTFOUND
  same => n,Playback(dictate/paused)
  same => n,Hangup()

UnpauseQueueMember

지정한 멤버를 unpause 한다.

UnpauseQueueMember([queuename,interface,[options,[reason]]])
  • queuename :
  • interface :
  • options :
  • reason : Is used to add extra information to the appropriate queue_log entries and manager events.

Channel variables

명령어 실행 후, 다음의 Channel variable 이 설정된다.

  • UPQMSTATUS : The status of the attempt to unpause a queue member as a text string.
UNPAUSED : unpaused 됨.
NOTFOUND : 지정한 Queue/Member 를 찾을 수 없음.

Example

exten => *87,1,Verbose(2,Unpause Queue Member)
  same => n,Set(MemberChannel=${CHANNEL(channeltype)}/${CHANNEL(peername)})
  same => n,UnpauseQueueMember(support,${MemberChannel})
  same => n,Verbose(1,${UPQMSTATUS}); UNPAUSED, NOTFOUND
  same => n,Playback(agent-loginok)
  same => n,Hangup()

Queue

In addition to transferring the call, a call may be parked and then picked up by another user.

This application will return to the dialplan if the queue does not exist, or any of the join options cause the caller to not enter the queue.

This application does not automatically answer and should be preceeded by an application such as Answer(), Progress(), or Ringing().

Queue(queuename,[options,[URL,[announceoverride,[timeout,[AGI,[macro,[gosub,[rule,[position]]]]]]]]])
  • queuename
  • options
    • C - Mark all calls as "answered elsewhere" when cancelled.
    • c - Continue in the dialplan if the callee hangs up.
    • d - data-quality (modem) call (minimum delay).
    • F - When the caller hangs up, transfer the called member to the specified destination and start execution at that location.
      • context
      • exten
      • priority
    • F - When the caller hangs up, transfer the called member to the next priority of the current extension and start execution at that location.
    • h - Allow callee to hang up by pressing *.
    • H - Allow caller to hang up by pressing *.
    • n - No retries on the timeout; will exit this application and go to the next step.
    • i - Ignore call forward requests from queue members and do nothing when they are requested.
    • I - Asterisk will ignore any connected line update requests or any redirecting party update requests it may receive on this dial attempt.
    • r - Ring instead of playing MOH. Periodic Announcements are still made, if applicable.
    • R - Ring instead of playing MOH when a member channel is actually ringing.
    • t - Allow the called user to transfer the calling user.
    • T - Allow the calling user to transfer the call.
    • w - Allow the called user to write the conversation to disk via Monitor.
    • W - Allow the calling user to write the conversation to disk via Monitor.
    • k - Allow the called party to enable parking of the call by sending the DTMF sequence defined for call parking in features.conf.
    • K - Allow the calling party to enable parking of the call by sending the DTMF sequence defined for call parking in features.conf.
    • x - Allow the called user to write the conversation to disk via MixMonitor.
    • X - Allow the calling user to write the conversation to disk via MixMonitor.
  • URL - URL will be sent to the called party if the channel supports it.
  • announceoverride
  • timeout - Will cause the queue to fail out after a specified number of seconds, checked between each queues.conf timeout and retry cycle.
  • AGI - Will setup an AGI script to be executed on the calling party's channel once they are connected to a queue member.
  • macro - Will run a macro on the called party's channel (the queue member) once the parties are connected.
  • gosub - Will run a gosub on the called party's channel (the queue member) once the parties are connected.
  • rule - Will cause the queue's defaultrule to be overridden by the rule specified.
  • position - Attempt to enter the caller into the queue at the numerical position specified. 1 would attempt to enter the caller at the head of the queue, and 3 would attempt to place the caller third in the queue.

Channel variables

명령어 실행 후, 다음의 Channel variable 이 설정된다.

  • QUEUESTATUS - The status of the call as a text string.
TIMEOUT
FULL
JOINEMPTY
LEAVEEMPTY
JOINUNAVAIL
LEAVEUNAVAIL
CONTINUE

NoOp

Do Nothing (No Operation).

This application does nothing. However, it is useful for debugging purposes.

This method can be used to see the evaluations of variables or functions without having any effect.

Syntax

NoOp([text])
  • text - Any text provided can be viewed at the Asterisk CLI.

AMD

연결된 콜의 Answering machine(자동 응답기)여부를 분석한다.

AMD([initialSilence,[greeting,[afterGreetingSilence,[totalAnalysis Time,[miniumWordLength,[betweenWordSilence,[maximumNumberOfWords,[silenceThreshold,[maximumWordLength]]]]]]]]])
  • initialSilence - Is maximum initial silence duration before greeting. If this is exceeded set as MACHINE
  • greeting - is the maximum length of a greeting. If this is exceeded set as MACHINE
  • afterGreetingSilence - Is the silence after detecting a greeting. If this is exceeded set as HUMAN
  • totalAnalysis Time - Is the maximum time allowed for the algorithm to decide HUMAN or MACHINE
  • miniumWordLength - Is the minimum duration of Voice considered to be a word
  • betweenWordSilence - Is the minimum duration of silence after a word to consider the audio that follows to be a new word
  • maximumNumberOfWords - Is the maximum number of words in a greeting. If this is exceeded set as MACHINE
  • silenceThreshold - How long do we consider silence
  • maximumWordLength - Is the maximum duration of a word to accept. If exceeded set as MACHINE

Channel variables

분석된 내용은 아래의 channel variable 에 설정된다.

  • AMDSTATUS - 자동응답기 분석 결과
MACHINE - 자동응답기
HUMAN - 사람
NOTSURE - 분석 불가
HANGUP - 콜 종료됨.
  • AMDCAUSE - 분석된 결과에 대한 자세한 사유를 설명한다.
TOOLONG - Total Time.
INITIALSILENCE - Silence Duration - Initial Silence.
HUMAN - Silence Duration - afterGreetingSilence.
LONGGREETING - Voice Duration - Greeting.
MAXWORDLENGTH - Word Count - maximum number of words.

Park

Call 을 Parking 한다.

Park([parking_lot_name][,options])
  • parking_lot_name - Call 이 parking 되는 parking lot 을 지정한다. parking lot 은 다음의 순서에 의해 지정된다.
parking_lot_name 에 지정된 값
${PARKINGLOT} variable
CHANNEL(parkinglot) function(channel driver 에 의해 미리 지정되어 있을 수도 있다).
Default parking lot.
  • options - parked 되는 콜에 대해 여러가지 옵션을 설정한다.
r: Parking 되는 콜에 MOH(Music on hold) 대신 Ringing 을 보낸다.
R: Parking 되는 장소(번호)를 Random 하게 지정한다.
s: Parking 되는 장소(번호)에 silence announcement 를 보낸다
c([[context,]extension,]priority): 만약 Parking 된 콜이 timeout 된 경우, 여기에 지정된 dialplan 으로 옮겨진다.
t(duration): 지정된 parking lot 에 설정된 timeout 대신, 여기에 설정된 duration 값을 timeout 으로 사용한다.

ParkedCall

Parked 된 콜을 가져온다.

ParkedCall([parking_lot_name,[parking_space]])
  • parking_lot_name - Parked 된 콜을 가져올 Parking lot name 을 지정한다. parking lot 은 다음의 순서에 의해 지정된다.
parking_lot_name 에 지정된 값.
${PARKINGLOT} variable
CHANNEL(parkinglot) function(channel driver 에 의해 미리 지정되어 있을 수도 있다).
Default parking lot.
  • parking_space - 지정된 parking lot 의 space 번호. 만약 지정하지 않는 다면, 가장 첫번째 parked call 을 가져온다.

ParkAndAnnounce

Call 을 parking 하고, default parking 메시지 대신, 지정된 안내 메시지를 play 한다.

ParkAndAnnounce([parking_lot_name,[options,announce:[announce1[:...]],]]dial)
  • parking_lot_name - Call 이 parking 되는 parking lot 을 지정한다. parking lot 은 다음의 순서에 의해 지정된다.
parking_lot_name 에 지정된 값.
${PARKINGLOT} variable
CHANNEL(parkinglot) function(channel driver 에 의해 미리 지정되어 있을 수도 있다).
Default parking lot.
  • options - parked 되는 콜에 대해 여러가지 옵션을 설정한다.
r: Parking 되는 콜에 MOH(Music on hold) 대신 Ringing 을 보낸다.
R: Parking 되는 장소(번호)를 Random 하게 지정한다.
s: Parking 되는 장소(번호)에 silence announcement 를 보낸다
c([[context,]extension,]priority): 만약 Parking 된 콜이 timeout 된 경우, 여기에 지정된 dialplan 으로 옮겨진다.
t(duration): 지정된 parking lot 에 설정된 timeout 대신, 여기에 설정된 duration 값을 timeout 으로 사용한다.
  • announce_template - 콜론(:)으로 나뉘어진 파일들 목록이다. 기본 콜이 parking 될 때 나오는 default parking lot announce message(say_digits) 를 대체한다.
announce1[,announce1...]
  • dial - The app_dial style resource to call to make the announcement. Console/dsp calls the console.

Playback

녹음된 파일을 재생한다.

별도의 옵션이 지정되어 있지 않다면, 자동적으로 Answer 를 수행한 후, 파일을 재생한다. 만약 지정된 파일에 문제가 있다면 실패한다.

Playback(filename&[filename2[&...]],[options])
  • filenames
filename
filename2[,filename2...]
  • options : 각각의 옵션들은 콤마(,) 로 구분된다.
skip : 콜이 Answer 되지 않았다면 play 하지 않는다.
noanswer : Answer 를 하지않고, play 한다. noanswer 옵션을 사용할 경우, playback 이전에 반드시 Answer 가 되어있어야 한다.

Channel variables

명령 실행 후, 다음의 Channel variable 이 설정된다.

  • PLAYBACKSTATUS : playback 시도에 대한 결과값이 저장된다.
SUCCESS: 성공
FAILED: 실패

See also

SIPAddHeader

outbound call 에 SIP header 를 추가한다.

Non-standard header 를 추가할 시, X-header 를 사용해야 한다. i.e X-Asterisk-Accountcode:contents

SIPAddHeader(Header:Content)
  • Header: Header 이름.
  • Content: Header 내용.

See also

Monitor

Channel 을 모니터링한다.

주로 channel 을 모니터링 시작하고자 할 때 사용한다. 지정된 채널의 input/output voice packet 들이 StopMonitor 혹은 hangup 이 될 때 까지 파일에 저장된다. 기본값으로 파일들은 /var/spool/asterisk/monitor 디렉토리에 저장된다.

이미 monitoring 중이거나 저장 파일을 열 수 없을 때 1, 나머지 경우 0 을 리턴한다.

Monitor(file_format:[urlbase],[fname_base,[options]]])
  • file_format
file_format: optional, if not set, defaults to wav
  • fname_base: 설정할 경우, 설정한 filename 으로 파일이 생성된다.
  • options
m : when the recording ends mix the two leg files into one and delete the two leg files. If the variable MONITOR_EXEC is set, the application referenced in it will be executed instead of soxmix/sox and the raw leg files will NOT be deleted automatically. soxmix/sox or MONITOR_EXEC is handed 3 arguments, the two leg files and a target mixed file name which is the same as the leg file names only without the in/out designator. If MONITOR_EXEC_ARGS is set, the contents will be passed on as additional arguments to MONITOR_EXEC. Both MONITOR_EXEC and the Mix flag can be set from the administrator interface.
b : Don't begin recording unless a call is bridged to another channel.
i : Skip recording of input stream (disables m option).
o : Skip recording of output stream (disables m option).

See also

StopMonitor

Channel 의 모니터링을 중단한다.

만약 모니터링을 하지 않는 중이었어도 아무 영향을 주지 않는다.

StopMonitor()

See also

See also