From 2217a967a373367d7a770b6779de231e5280819c Mon Sep 17 00:00:00 2001 From: Graham Brown Date: Mon, 11 Jul 2022 10:37:51 +0200 Subject: [PATCH 01/17] prepare 0.16.0 changelog --- CHANGELOG.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da81b13e..ab791295 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,14 @@ # ARI4Java Changelog ## [Unreleased] -[Unreleased]: https://github.com/ari4java/ari4java/compare/v0.14.0...HEAD +[Unreleased]: https://github.com/ari4java/ari4java/compare/v0.16.0...HEAD + +## [0.16.0] +[0.16.0]: https://github.com/ari4java/ari4java/compare/v0.15.0...v0.16.0 +### Added +- `AriVersion.ARI_4_1_4` +- `AriVersion.ARI_6_0_1` +- `AriVersion.ARI_7_0_1` ## [0.15.0] [0.15.0]: https://github.com/ari4java/ari4java/compare/v0.14.0...v0.15.0 From 40de287e490be94fe483732e2a9468418fe58619 Mon Sep 17 00:00:00 2001 From: Graham Brown Date: Sun, 7 Aug 2022 12:26:22 +0200 Subject: [PATCH 02/17] #188 Tweaks to Vagrant to use Docker provider for M1 Mac --- examples/Dockerfile | 32 ++++ examples/Vagrantfile | 25 ++- examples/vagrant/asterisk/extensions.conf | 2 +- examples/vagrant/asterisk/modules.conf | 3 - examples/vagrant/asterisk/pjsip_wizard.conf | 2 +- examples/vagrant/asterisk/rtp.conf | 162 ++++++++++++++++++ examples/vagrant/scripts/provision.sh | 109 +++++++----- .../vagrant/static-http/ari4java-phone.html | 2 +- 8 files changed, 284 insertions(+), 53 deletions(-) create mode 100644 examples/Dockerfile create mode 100644 examples/vagrant/asterisk/rtp.conf diff --git a/examples/Dockerfile b/examples/Dockerfile new file mode 100644 index 00000000..c06c503c --- /dev/null +++ b/examples/Dockerfile @@ -0,0 +1,32 @@ +# Docker image to use with Vagrant +# Aims to be as similar to normal Vagrant usage as possible +# Adds Puppet, SSH daemon, Systemd +# Adapted from https://github.com/BashtonLtd/docker-vagrant-images/blob/master/ubuntu1404/Dockerfile + +FROM ubuntu:focal +ENV container docker +RUN apt update && apt -y upgrade + +# Install system dependencies, you may not need all of these +RUN apt install -y --no-install-recommends ssh sudo libffi-dev systemd openssh-client nano + +# Add vagrant user and key for SSH +RUN useradd --create-home -s /bin/bash vagrant +RUN echo -n 'vagrant:vagrant' | chpasswd +RUN echo 'vagrant ALL = NOPASSWD: ALL' > /etc/sudoers.d/vagrant +RUN chmod 440 /etc/sudoers.d/vagrant +RUN mkdir -p /home/vagrant/.ssh +RUN chmod 700 /home/vagrant/.ssh +RUN echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ==" > /home/vagrant/.ssh/authorized_keys +RUN chmod 600 /home/vagrant/.ssh/authorized_keys +RUN chown -R vagrant:vagrant /home/vagrant/.ssh +RUN sed -i -e 's/Defaults.*requiretty/#&/' /etc/sudoers +RUN sed -i -e 's/\(UsePAM \)yes/\1 no/' /etc/ssh/sshd_config + +# Start SSH +RUN mkdir /var/run/sshd +EXPOSE 22 +RUN /usr/sbin/sshd + +# Start Systemd (systemctl) +CMD ["/lib/systemd/systemd"] diff --git a/examples/Vagrantfile b/examples/Vagrantfile index 9fee894f..90b410aa 100644 --- a/examples/Vagrantfile +++ b/examples/Vagrantfile @@ -4,18 +4,31 @@ # use NET_BRIDGE=on to create a bridge interface with dynamic ip from your network. # Used for testing from an external source like a cell phone with Zoiper or the like # Note: Wifi with WPA2-Enterprise does not work, the interface doesn't get an IP +# Note: for M1 Mac use the --provider docker flag, the NET_BRIDGE is not compatible with docker if not ENV["NET_BRIDGE"] then ENV["NET_BRIDGE"] = "off" end Vagrant.configure("2") do |config| config.vm.box = "ubuntu/focal64" - config.vm.provider "virtualbox" do |v| + config.vm.synced_folder "./vagrant", "/vagrant" + config.vm.provider "virtualbox" do |v, override| v.memory = 1024 v.cpus = 2 + override.vm.network "private_network", ip: "192.168.56.44" + if ENV["NET_BRIDGE"] == "on" then + override.vm.network "public_network", use_dhcp_assigned_default_route: false + end + override.vm.provision :shell, :path => "vagrant/scripts/provision.sh" end - config.vm.network "private_network", ip: "192.168.56.44" - if ENV["NET_BRIDGE"] == "on" then - config.vm.network "public_network", use_dhcp_assigned_default_route: false + config.vm.provider "docker" do |d, override| + override.vm.box = nil + d.build_dir = "." + override.ssh.insert_key = true + d.has_ssh = true + d.privileged = true + override.vm.network :forwarded_port, guest: 8089, host: 8089 + for i in 20000..20010 + override.vm.network :forwarded_port, guest: i, host: i, protocol: "udp" + end + override.vm.provision :shell, :path => "vagrant/scripts/provision.sh", :args => ["docker"] end - config.vm.synced_folder "./vagrant", "/vagrant" - config.vm.provision :shell, :path => "vagrant/scripts/provision.sh" end diff --git a/examples/vagrant/asterisk/extensions.conf b/examples/vagrant/asterisk/extensions.conf index 955dc57e..68d94d8c 100644 --- a/examples/vagrant/asterisk/extensions.conf +++ b/examples/vagrant/asterisk/extensions.conf @@ -3,7 +3,7 @@ static=yes writeprotect=yes [default] -; empty - we dont use the defailt context +; empty - we dont use the default context [from-internal] ; Extensions 100, 200 & 300 diff --git a/examples/vagrant/asterisk/modules.conf b/examples/vagrant/asterisk/modules.conf index f131e277..b2db62b1 100644 --- a/examples/vagrant/asterisk/modules.conf +++ b/examples/vagrant/asterisk/modules.conf @@ -43,7 +43,6 @@ load = codec_resample.so load = codec_ulaw.so load = codec_alaw.so load = codec_g722.so -load = codec_g729a.so load = codec_opus.so ; Formats @@ -52,8 +51,6 @@ load = format_gsm.so load = format_pcm.so load = format_wav_gsm.so load = format_wav.so -load = format_g729.so -load = res_format_attr_g729.so load = format_ogg_opus.so load = res_format_attr_opus.so load = format_mp3.so diff --git a/examples/vagrant/asterisk/pjsip_wizard.conf b/examples/vagrant/asterisk/pjsip_wizard.conf index 04726844..90ff45ae 100644 --- a/examples/vagrant/asterisk/pjsip_wizard.conf +++ b/examples/vagrant/asterisk/pjsip_wizard.conf @@ -35,7 +35,7 @@ endpoint/rtp_symmetric = yes endpoint/dtls_auto_generate_cert = yes endpoint/device_state_busy_at = 1 -; User Extensions using the templates definded above +; User Extensions using the templates defined above [100](web-phone-defaults) inbound_auth/username = 100 inbound_auth/password = abc123 diff --git a/examples/vagrant/asterisk/rtp.conf b/examples/vagrant/asterisk/rtp.conf new file mode 100644 index 00000000..c136ff36 --- /dev/null +++ b/examples/vagrant/asterisk/rtp.conf @@ -0,0 +1,162 @@ +; +; RTP Configuration +; +[general] +; +; RTP start and RTP end configure start and end addresses +; +; Defaults are rtpstart=5000 and rtpend=31000 +; +rtpstart=10000 +rtpend=10010 +; +; Whether to enable or disable UDP checksums on RTP traffic +; +;rtpchecksums=no +; +; The amount of time a DTMF digit with no 'end' marker should be +; allowed to continue (in 'samples', 1/8000 of a second) +; +;dtmftimeout=3000 +; rtcpinterval = 5000 ; Milliseconds between rtcp reports + ;(min 500, max 60000, default 5000) +; +; Enable strict RTP protection. This will drop RTP packets that do not come +; from the recognized source of the RTP stream. Strict RTP qualifies RTP +; packet stream sources before accepting them upon initial connection and +; when the connection is renegotiated (e.g., transfers and direct media). +; Initial connection and renegotiation starts a learning mode to qualify +; stream source addresses. Once Asterisk has recognized a stream it will +; allow other streams to qualify and replace the current stream for 5 +; seconds after starting learning mode. Once learning mode completes the +; current stream is locked in and cannot change until the next +; renegotiation. +; Valid options are "no" to disable strictrtp, "yes" to enable strictrtp, +; and "seqno", which does the same thing as strictrtp=yes, but only checks +; to make sure the sequence number is correct rather than checking the time +; interval as well. +; This option is enabled by default. +; strictrtp=yes +; +; Number of packets containing consecutive sequence values needed +; to change the RTP source socket address. This option only comes +; into play while using strictrtp=yes. Consider changing this value +; if rtp packets are dropped from one or both ends after a call is +; connected. This option is set to 4 by default. +; probation=8 +; +; Enable sRTP replay protection. Buggy SIP user agents (UAs) reset the +; sequence number (RTP-SEQ) on a re-INVITE, for example, with Session Timers +; or on Call Hold/Resume, but keep the synchronization source (RTP-SSRC). If +; the new RTP-SEQ is higher than the previous one, the call continues if the +; roll-over counter (sRTP-ROC) is zero (the call lasted less than 22 minutes). +; In all other cases, the call faces one-way audio or even no audio at all. +; "replay check failed (index too old)" gets printed continuously. This is a +; software bug. You have to report this to the creator of that UA. Until it is +; fixed, you could disable sRTP replay protection (see RFC 3711 section 3.3.2). +; This option is enabled by default. +; srtpreplayprotection=yes +; +; Whether to enable or disable ICE support. This option is enabled by default. +; icesupport=false +; +; Hostname or address for the STUN server used when determining the external +; IP address and port an RTP session can be reached at. The port number is +; optional. If omitted the default value of 3478 will be used. This option is +; disabled by default. Name resolution will occur at load time, and if DNS is +; used, name resolution will occur repeatedly after the TTL expires. +; +; e.g. stundaddr=mystun.server.com:3478 +; +; stunaddr= +; +; Some multihomed servers have IP interfaces that cannot reach the STUN +; server specified by stunaddr. Blacklist those interface subnets from +; trying to send a STUN packet to find the external IP address. +; Attempting to send the STUN packet needlessly delays processing incoming +; and outgoing SIP INVITEs because we will wait for a response that can +; never come until we give up on the response. +; * Multiple subnets may be listed. +; * Blacklisting applies to IPv4 only. STUN isn't needed for IPv6. +; * Blacklisting applies when binding RTP to specific IP addresses and not +; the wildcard 0.0.0.0 address. e.g., A PJSIP endpoint binding RTP to a +; specific address using the bind_rtp_to_media_address and media_address +; options. Or the PJSIP endpoint specifies an explicit transport that binds +; to a specific IP address. Blacklisting is done via ACL infrastructure +; so it's possible to whitelist as well. +; +; stun_acl = named_acl +; stun_deny = 0.0.0.0/0 +; stun_permit = 1.2.3.4/32 +; +; For historic reasons stun_blacklist is an alias for stun_deny. +; +; Whether to report the PJSIP version in a SOFTWARE attribute for all +; outgoing STUN packets. This option is enabled by default. +; +; stun_software_attribute=yes +; +; Hostname or address for the TURN server to be used as a relay. The port +; number is optional. If omitted the default value of 3478 will be used. +; This option is disabled by default. +; +; e.g. turnaddr=myturn.server.com:34780 +; +; turnaddr= +; +; Username used to authenticate with TURN relay server. +; turnusername= +; +; Password used to authenticate with TURN relay server. +; turnpassword= +; +; An ACL can be used to determine which discovered addresses to include for +; ICE, srflx and relay discovery. This is useful to optimize the ICE process +; where a system has multiple host address ranges and/or physical interfaces +; and certain of them are not expected to be used for RTP. For example, VPNs +; and local interconnections may not be suitable or necessary for ICE. Multiple +; subnets may be listed. If left unconfigured, all discovered host addresses +; are used. +; +; ice_acl = named_acl +; ice_deny = 0.0.0.0/0 +; ice_permit = 1.2.3.4/32 +; +; For historic reasons ice_blacklist is an alias for ice_deny. +; +; The MTU to use for DTLS packet fragmentation. This option is set to 1200 +; by default. The minimum MTU is 256. +; dtls_mtu = 1200 +; +[ice_host_candidates] +; +; When Asterisk is behind a static one-to-one NAT and ICE is in use, ICE will +; expose the server's internal IP address as one of the host candidates. +; Although using STUN (see the 'stunaddr' configuration option) will provide a +; publicly accessible IP, the internal IP will still be sent to the remote +; peer. To help hide the topology of your internal network, you can override +; the host candidates that Asterisk will send to the remote peer. +; +; IMPORTANT: Only use this functionality when your Asterisk server is behind a +; one-to-one NAT and you know what you're doing. If you do define anything +; here, you almost certainly will NOT want to specify 'stunaddr' or 'turnaddr' +; above. +; +; The format for these overrides is: +; +; => ,[include_local_address] +; +; The following will replace 192.168.1.10 with 1.2.3.4 during ICE +; negotiation: +; +;192.168.1.10 => 1.2.3.4 +; +; The following will include BOTH 192.168.1.10 and 1.2.3.4 during ICE +; negotiation instead of replacing 192.168.1.10. This can make it easier +; to serve both local and remote clients. +; +;192.168.1.10 => 1.2.3.4,include_local_address +; +; You can define an override for more than 1 interface if you have a multihomed +; server. Any local interface that is not matched will be passed through +; unaltered. Both IPv4 and IPv6 addresses are supported. diff --git a/examples/vagrant/scripts/provision.sh b/examples/vagrant/scripts/provision.sh index de377e1c..2d9901c2 100755 --- a/examples/vagrant/scripts/provision.sh +++ b/examples/vagrant/scripts/provision.sh @@ -1,44 +1,38 @@ #!/usr/bin/env bash -# Hostname -echo "Updating Hostname ..." -sed -i 's/^ubuntu-focal$/localpbx/g' /etc/hostname -sed -i 's/ubuntu-focal$/localpbx/g' /etc/hosts -systemctl restart systemd-logind.service -hostnamectl set-hostname localpbx +DOCKER=false +if [ "$1" == "docker" ]; then + DOCKER=true +fi + +if [ "$DOCKER" == "false" ]; then + # Hostname + echo "Updating Hostname ..." + sed -i 's/^ubuntu-focal$/localpbx/g' /etc/hostname + sed -i 's/ubuntu-focal$/localpbx/g' /etc/hosts + systemctl restart systemd-logind.service + hostnamectl set-hostname localpbx +fi # get the latest packages and upgrade them echo "Updating System ..." +export DEBIAN_FRONTEND=noninteractive apt update apt -y upgrade -# install some pre-requisites (mostly for Asterisk) -echo "Installing pre-requisites ..." +# install some pre-requisites +echo "Installing some pre-requisites ..." apt -y install \ + curl \ wget \ - unzip \ - subversion \ - build-essential \ - openssl \ - pkg-config \ - libssl-dev \ - libcurl4-openssl-dev \ - libgsm1-dev \ - libnewt-dev \ - libxml2-dev \ - libsqlite3-dev \ - uuid-dev \ - libjansson-dev \ - libncurses5-dev \ - libedit-dev \ - xmlstarlet \ - libsrtp2-dev \ - zlib1g-dev \ - mpg123 \ - subversion \ - tcl \ sox \ - lame + lame \ + mpg123 \ + libopusfile-dev \ + autoconf + +# set the timezone +ln -snf /usr/share/zoneinfo/$(curl https://ipapi.co/timezone) /etc/localtime # create user & folders for Asterisk echo "Creating asterisk user and required folders ..." @@ -46,23 +40,53 @@ adduser --system --group --no-create-home asterisk mkdir -p /var/{lib,log,spool}/asterisk # goto home folder, download and build Asterisk using the version specified in AST_VER -AST_VER=18.9.0 +AST_VER=18.13.0 echo "Download, compile & setup Asterisk $AST_VER ..." cd ~ wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-$AST_VER.tar.gz tar xvfz asterisk-$AST_VER.tar.gz +rm asterisk-$AST_VER.tar.gz cd asterisk-$AST_VER/ +echo "Installing Asterisk pre-requisites ..." +contrib/scripts/install_prereq install contrib/scripts/get_mp3_source.sh +if [ "$DOCKER" == "true" ]; then + echo "Getting Open Source OPUS Codec" + # although we're using a later Asterisk this is the latest opus but seems to work (from my limited testing) + wget github.com/traud/asterisk-opus/archive/asterisk-13.7.tar.gz + tar zvxf asterisk-13.7.tar.gz + rm asterisk-13.7.tar.gz + cp --verbose ./asterisk-opus*/include/asterisk/* ./include/asterisk + cp --verbose ./asterisk-opus*/codecs/* ./codecs + cp --verbose ./asterisk-opus*/res/* ./res + cp --verbose ./asterisk-opus*/formats/* ./formats + patch -p1 <./asterisk-opus*/asterisk.patch + ./bootstrap.sh +fi ./configure --with-pjproject-bundled --with-jansson-bundled -make menuselect.makeopts && menuselect/menuselect \ ---enable codec_opus \ ---enable codec_g729a \ ---enable EXTRA-SOUNDS-EN-G722 \ ---enable EXTRA-SOUNDS-EN-WAV \ ---enable format_mp3 \ ---disable chan_sip \ ---disable BUILD_NATIVE \ -menuselect.makeopts +make menuselect.makeopts +if [ "$DOCKER" == "true" ]; then + menuselect/menuselect \ + --enable CORE-SOUNDS-EN-SLN16 \ + --enable EXTRA-SOUNDS-EN-G722 \ + --enable EXTRA-SOUNDS-EN-WAV \ + --enable EXTRA-SOUNDS-EN-SLN16 \ + --enable format_mp3 \ + --disable chan_sip \ + --disable BUILD_NATIVE \ + menuselect.makeopts +else + menuselect/menuselect \ + --enable CORE-SOUNDS-EN-SLN16 \ + --enable EXTRA-SOUNDS-EN-G722 \ + --enable EXTRA-SOUNDS-EN-WAV \ + --enable EXTRA-SOUNDS-EN-SLN16 \ + --enable codec_opus \ + --enable format_mp3 \ + --disable chan_sip \ + --disable BUILD_NATIVE \ + menuselect.makeopts +fi make make install #make sure the asterisk user owns its folders @@ -70,7 +94,10 @@ chown -R asterisk:asterisk /var/{lib,log,spool}/asterisk # copy config & http content cp -f /vagrant/asterisk/* /etc/asterisk/ cp -f /vagrant/static-http/* /var/lib/asterisk/static-http/ - +if [ "$DOCKER" == "true" ]; then + sed -i 's/codec_opus/codec_opus_open_source/g' /etc/asterisk/modules.conf + sed -i 's/format_ogg_opus/format_ogg_opus_open_source/g' /etc/asterisk/modules.conf +fi # create keys for TLS echo "Creating TLS keys ..." mkdir -p /etc/asterisk/keys diff --git a/examples/vagrant/static-http/ari4java-phone.html b/examples/vagrant/static-http/ari4java-phone.html index a31910c2..ef5097d0 100644 --- a/examples/vagrant/static-http/ari4java-phone.html +++ b/examples/vagrant/static-http/ari4java-phone.html @@ -108,7 +108,7 @@

ARI4Java Phone

let audioOutput = new Audio(); audioOutput.setSinkId('default'); audioOutput.load(); - let server = '192.168.56.44'; + let server = window.location.hostname; let phone = undefined; let session = undefined; function login(exten) { From 30f6a46a71082735a6effa3d7ecd4a9d2e257cd9 Mon Sep 17 00:00:00 2001 From: Graham Brown Date: Mon, 8 Aug 2022 12:16:07 +0200 Subject: [PATCH 03/17] #188 Getting Vagrant Docker provider working --- examples/vagrant/asterisk/modules.conf | 10 ++++++++-- examples/vagrant/asterisk/pjsip.conf | 11 +++++++++++ examples/vagrant/asterisk/pjsip_wizard.conf | 13 ++++++++----- examples/vagrant/scripts/provision.sh | 8 ++++++-- 4 files changed, 33 insertions(+), 9 deletions(-) diff --git a/examples/vagrant/asterisk/modules.conf b/examples/vagrant/asterisk/modules.conf index b2db62b1..be4c2cc2 100644 --- a/examples/vagrant/asterisk/modules.conf +++ b/examples/vagrant/asterisk/modules.conf @@ -53,7 +53,10 @@ load = format_wav_gsm.so load = format_wav.so load = format_ogg_opus.so load = res_format_attr_opus.so +load = format_ogg_vorbis.so load = format_mp3.so +load = format_vp8.so +load = format_h264.so ; Functions @@ -71,10 +74,12 @@ load = func_md5.so load = func_sha1.so load = func_channel.so load = func_timeout.so +load = func_hangupcause.so ; Core/PBX load = pbx_config.so +load = pbx_spool.so ; Resources @@ -90,9 +95,9 @@ load = res_pjsip_diversion.so load = res_pjsip_dlg_options.so load = res_pjsip_dtmf_info.so load = res_pjsip_empty_info.so -load = res_pjsip_endpoint_identifier_anonymous.so -load = res_pjsip_endpoint_identifier_ip.so load = res_pjsip_endpoint_identifier_user.so +load = res_pjsip_endpoint_identifier_ip.so +load = res_pjsip_endpoint_identifier_anonymous.so load = res_pjsip_exten_state.so load = res_pjsip_header_funcs.so load = res_pjsip_history.so @@ -132,6 +137,7 @@ load = res_sorcery_config.so load = res_sorcery_memory.so load = res_sorcery_realtime.so load = res_timing_timerfd.so +load = res_timing_pthread.so load = res_http_media_cache.so load = res_http_websocket.so load = res_crypto.so diff --git a/examples/vagrant/asterisk/pjsip.conf b/examples/vagrant/asterisk/pjsip.conf index 9e33284f..6ffee21f 100644 --- a/examples/vagrant/asterisk/pjsip.conf +++ b/examples/vagrant/asterisk/pjsip.conf @@ -5,8 +5,19 @@ type = transport protocol = udp bind = 0.0.0.0 +domain = ari4java.local [transport-wss] type=transport protocol=wss bind=0.0.0.0 +domain = ari4java.local +websocket_write_timeout = 5000 + +[192.168.44.56] +type = domain-alias +domain = ari4java.local + +[localhost] +type = domain-alias +domain = ari4java.local diff --git a/examples/vagrant/asterisk/pjsip_wizard.conf b/examples/vagrant/asterisk/pjsip_wizard.conf index 90ff45ae..fcdc248c 100644 --- a/examples/vagrant/asterisk/pjsip_wizard.conf +++ b/examples/vagrant/asterisk/pjsip_wizard.conf @@ -7,12 +7,12 @@ sends_registrations = no accepts_auth = yes sends_auth = no endpoint/allow_subscribe = yes -endpoint/allow = !all,g722,g729,alaw +endpoint/disallow = all +endpoint/allow = g722,ulaw endpoint/direct_media = no endpoint/force_rport = yes endpoint/disable_direct_media_on_nat = yes endpoint/direct_media_method = invite -endpoint/ice_support = yes endpoint/moh_suggest = default endpoint/send_rpid = yes endpoint/rewrite_contact = yes @@ -29,11 +29,14 @@ aor/support_path = yes ; Default Template for web phones [web-phone-defaults](!,phone-defaults) transport = transport-wss -endpoint/allow = !all,opus,g722,alaw +endpoint/disallow=all +endpoint/allow = opus,ulaw endpoint/webrtc = yes endpoint/rtp_symmetric = yes -endpoint/dtls_auto_generate_cert = yes -endpoint/device_state_busy_at = 1 +;endpoint/dtls_auto_generate_cert = yes +endpoint/dtls_ca_file = /etc/asterisk/keys/ca.crt +endpoint/dtls_cert_file = /etc/asterisk/keys/asterisk.crt +endpoint/dtls_private_key = /etc/asterisk/keys/asterisk.key ; User Extensions using the templates defined above [100](web-phone-defaults) diff --git a/examples/vagrant/scripts/provision.sh b/examples/vagrant/scripts/provision.sh index 2d9901c2..f04741cd 100755 --- a/examples/vagrant/scripts/provision.sh +++ b/examples/vagrant/scripts/provision.sh @@ -40,7 +40,7 @@ adduser --system --group --no-create-home asterisk mkdir -p /var/{lib,log,spool}/asterisk # goto home folder, download and build Asterisk using the version specified in AST_VER -AST_VER=18.13.0 +AST_VER=16.27.0 echo "Download, compile & setup Asterisk $AST_VER ..." cd ~ wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-$AST_VER.tar.gz @@ -104,7 +104,11 @@ mkdir -p /etc/asterisk/keys openssl genrsa -des3 -out /etc/asterisk/keys/ca.key -passout pass:asterisk 4096 > /dev/null openssl req -batch -new -x509 -days 3650 -subj "/O=ARI4Java/CN=ARI4Java CA" -key /etc/asterisk/keys/ca.key -passin pass:asterisk -out /etc/asterisk/keys/ca.crt > /dev/null openssl genrsa -out /etc/asterisk/keys/asterisk.key 2048 > /dev/null -openssl req -batch -new -subj "/O=ARI4Java/CN=192.168.56.44" -key /etc/asterisk/keys/asterisk.key -out /etc/asterisk/keys/asterisk.csr > /dev/null +SUBJECT="/O=ARI4Java/CN=192.168.56.44" +if [ "$DOCKER" == "true" ]; then + SUBJECT="/O=ARI4Java/CN=localhost" +fi +openssl req -batch -new -subj "$SUBJECT" -key /etc/asterisk/keys/asterisk.key -out /etc/asterisk/keys/asterisk.csr > /dev/null openssl x509 -req -days 3650 -in /etc/asterisk/keys/asterisk.csr -CA /etc/asterisk/keys/ca.crt -CAkey /etc/asterisk/keys/ca.key -passin pass:asterisk -set_serial 01 -out /etc/asterisk/keys/asterisk.crt > /dev/null chown -R asterisk:asterisk /etc/asterisk/keys From c5db8bbbce14aa499a08ae24f878032bf0669881 Mon Sep 17 00:00:00 2001 From: Graham Brown Date: Sat, 13 Aug 2022 13:40:25 +0200 Subject: [PATCH 04/17] Implement connection pooling and change examples to use some async executions --- .../loway/oss/ari4java/examples/Weasels.java | 45 +++- .../examples/comprehensive/Asterisk.java | 102 +++++--- .../ari4java/tools/WsClientAutoReconnect.java | 12 - .../oss/ari4java/tools/http/HTTPLogger.java | 2 +- .../ari4java/tools/http/NettyHttpClient.java | 227 ++++++++++++------ .../tools/http/NettyHttpClientHandler.java | 18 +- .../tools/http/NettyWSClientHandler.java | 41 ++-- .../tools/http/NettyHttpClientTest.java | 166 +++++++------ 8 files changed, 382 insertions(+), 231 deletions(-) delete mode 100755 src/main/java/ch/loway/oss/ari4java/tools/WsClientAutoReconnect.java diff --git a/examples/src/main/java/ch/loway/oss/ari4java/examples/Weasels.java b/examples/src/main/java/ch/loway/oss/ari4java/examples/Weasels.java index 59de5638..8a19e75f 100755 --- a/examples/src/main/java/ch/loway/oss/ari4java/examples/Weasels.java +++ b/examples/src/main/java/ch/loway/oss/ari4java/examples/Weasels.java @@ -3,11 +3,9 @@ import ch.loway.oss.ari4java.ARI; import ch.loway.oss.ari4java.AriVersion; import ch.loway.oss.ari4java.generated.AriWSHelper; -import ch.loway.oss.ari4java.generated.models.AsteriskInfo; -import ch.loway.oss.ari4java.generated.models.Message; -import ch.loway.oss.ari4java.generated.models.PlaybackFinished; -import ch.loway.oss.ari4java.generated.models.StasisStart; +import ch.loway.oss.ari4java.generated.models.*; import ch.loway.oss.ari4java.tools.ARIException; +import ch.loway.oss.ari4java.tools.AriCallback; import ch.loway.oss.ari4java.tools.RestException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -80,12 +78,12 @@ public void onFailure(RestException e) { @Override protected void onStasisStart(StasisStart message) { - handleStart(message); + handleStart(message, threadPool); } @Override protected void onPlaybackFinished(PlaybackFinished message) { - handlePlaybackFinished(message); + handlePlaybackFinished(message, threadPool); } }); @@ -96,24 +94,49 @@ protected void onPlaybackFinished(PlaybackFinished message) { System.exit(0); } - private void handleStart(StasisStart start) { + private void handleStart(StasisStart start, final ExecutorService threadPool) { logger.info("Stasis Start Channel: {}", start.getChannel().getId()); ARI.sleep(300); // a slight pause before we start the playback ... try { - ari.channels().play(start.getChannel().getId(), "sound:weasels-eaten-phonesys").execute(); + ari.channels().play(start.getChannel().getId(), "sound:weasels-eaten-phonesys") + .execute(new AriCallback() { + @Override + public void onSuccess(Playback playback) { + logger.debug("Playback success: {}", playback.getId()); + } + + @Override + public void onFailure(RestException e) { + logger.error("Playback Error: {}", e.getMessage(), e); + threadPool.shutdown(); + } + }); } catch (Throwable e) { logger.error("Error: {}", e.getMessage(), e); + threadPool.shutdown(); } } - private void handlePlaybackFinished(PlaybackFinished playback) { - logger.info("PlaybackFinished - {}", playback.getPlayback().getTarget_uri()); + private void handlePlaybackFinished(PlaybackFinished playback, final ExecutorService threadPool) { + logger.info("PlaybackFinished - {} {}", playback.getPlayback().getId(), playback.getPlayback().getTarget_uri()); if (playback.getPlayback().getTarget_uri().indexOf("channel:") == 0) { try { String chanId = playback.getPlayback().getTarget_uri().split(":")[1]; logger.info("Hangup Channel: {}", chanId); ARI.sleep(300); // a slight pause before we hangup ... - ari.channels().hangup(chanId).execute(); + ari.channels().hangup(chanId).execute(new AriCallback() { + @Override + public void onSuccess(Void a) { + logger.debug("Hangup success"); + threadPool.shutdown(); + } + + @Override + public void onFailure(RestException e) { + logger.error("Hangup Error: {}", e.getMessage(), e); + threadPool.shutdown(); + } + }); } catch (Throwable e) { logger.error("Error: {}", e.getMessage(), e); } diff --git a/examples/src/main/java/ch/loway/oss/ari4java/examples/comprehensive/Asterisk.java b/examples/src/main/java/ch/loway/oss/ari4java/examples/comprehensive/Asterisk.java index 504048a0..0d671698 100644 --- a/examples/src/main/java/ch/loway/oss/ari4java/examples/comprehensive/Asterisk.java +++ b/examples/src/main/java/ch/loway/oss/ari4java/examples/comprehensive/Asterisk.java @@ -4,6 +4,7 @@ import ch.loway.oss.ari4java.AriVersion; import ch.loway.oss.ari4java.generated.AriWSHelper; import ch.loway.oss.ari4java.generated.models.*; +import ch.loway.oss.ari4java.tools.AriCallback; import ch.loway.oss.ari4java.tools.RestException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -43,10 +44,19 @@ public boolean start() { logger.info("Starting ARI..."); try { ari = ARI.build(address, ARI_APP_NAME, user, pass, version); - AsteriskInfo info = ari.asterisk().getInfo().execute(); + ari.asterisk().getInfo().execute(new AriCallback() { + @Override + public void onSuccess(AsteriskInfo info) { + logger.info("Asterisk {}", info.getSystem().getVersion()); + } + + @Override + public void onFailure(RestException e) { + logger.error("Error getting Asterisk version: {}", e.getMessage(), e); + } + }); threadPool = Executors.newFixedThreadPool(5); ari.events().eventWebsocket(ARI_APP_NAME).execute(new Handler()); - logger.info("Connected to Asterisk {}", info.getSystem().getVersion()); return true; } catch (Throwable t) { logger.error("Error: {}", t.getMessage(), t); @@ -123,7 +133,17 @@ private void hangupChannel(String channelId) { if (channelId != null) { if (lookups.containsKey(channelId)) { try { - ari.channels().hangup(channelId).execute(); + ari.channels().hangup(channelId).execute(new AriCallback() { + @Override + public void onSuccess(Void result) { + logger.debug("hanging up channel"); + } + + @Override + public void onFailure(RestException e) { + logger.error("Error hanging up channel", e); + } + }); } catch (RestException e) { logger.error("Error hanging up channel", e); } @@ -139,10 +159,23 @@ private void hangupChannel(String channelId) { * @throws RestException raised by ARI interactions */ private void createBridgeAndAddChannel1(State state) throws RestException { - Bridge bridge = ari.bridges().create().execute(); - logger.debug("Bridge created id: {}", bridge.getId()); - state.bridge = bridge.getId(); - addChannelToBridge(state.bridge, state.channel1); + ari.bridges().create().execute(new AriCallback() { + @Override + public void onSuccess(Bridge bridge) { + logger.debug("Bridge created id: {}", bridge.getId()); + state.bridge = bridge.getId(); + try { + addChannelToBridge(state.bridge, state.channel1); + } catch (RestException e) { + logger.error("Error adding channel to bridge: {}", e.getMessage(), e); + } + } + + @Override + public void onFailure(RestException e) { + logger.error("Error creating bridge: {}", e.getMessage(), e); + } + }); } /** @@ -151,7 +184,17 @@ private void createBridgeAndAddChannel1(State state) throws RestException { * @throws RestException raised by ARI interactions */ private void addChannelToBridge(String bridgeId, String channelId) throws RestException { - ari.bridges().addChannel(bridgeId, channelId).execute(); + ari.bridges().addChannel(bridgeId, channelId).execute(new AriCallback() { + @Override + public void onSuccess(Void result) { + logger.debug("Channel {}, added to Bridge {}", channelId, bridgeId); + } + + @Override + public void onFailure(RestException e) { + logger.debug("Error adding Channel {} to Bridge {}: {}", channelId, bridgeId, e.getMessage(), e); + } + }); } /** @@ -231,7 +274,7 @@ public void onSuccess(Message message) { @Override protected void onStasisStart(StasisStart message) { // StasisStart is created by both the Stasis dialplan app and a call to the channels API in ARI, - // so we check an argument set in the create channel code and ignore + // so we check an argument set in the createChannel code and ignore logger.debug("onStasisStart, chan id: {}, name: {}", message.getChannel().getId(), message.getChannel().getName()); if (message.getArgs() != null && !message.getArgs().isEmpty() && "me".equals(message.getArgs().get(0))) { logger.debug("started by me, not processing..."); @@ -260,18 +303,6 @@ protected void onStasisStart(StasisStart message) { } catch (RestException e) { logger.error("Error creating bridge", e); hangupChannel(state.channel1); - return; - } - // create the 2nd channel to the desired endpoint - try { - state.channel2 = createChannel(state.to, "Inbound " + state.from); - logger.debug("channel2: {}", state.channel2); - synchronized (lookups) { - lookups.put(state.channel2, state.id); - } - } catch (RestException e) { - logger.error("Error creating channel", e); - hangupChannel(state.channel1); } } @@ -301,17 +332,6 @@ protected void onChannelStateChange(ChannelStateChange message) { } catch (RestException e) { logger.error("Error creating bridge", e); hangupChannel(state.channel1); - return; - } - try { - state.channel2 = createChannel(state.to, state.from); - synchronized (lookups) { - lookups.put(state.channel2, state.id); - } - logger.debug("channel2: {}", state.channel2); - } catch (RestException e) { - logger.error("Error creating channel2", e); - hangupChannel(state.channel1); } } else if ("Ringing".equals(message.getChannel().getState()) && message.getChannel().getId().equals(state.channel2)) { // the channel state has changed to Ringing and is channel2 in the State object ... @@ -340,6 +360,24 @@ protected void onChannelStateChange(ChannelStateChange message) { } } + @Override + protected void onChannelEnteredBridge(ChannelEnteredBridge message) { + logger.debug("onChannelEnteredBridge {} {}", message.getBridge().getId(), message.getChannel().getId()); + State state = lookupState(message.getChannel().getId()); + if (message.getChannel().getId().equals(state.channel1)) { + try { + state.channel2 = createChannel(state.to, state.from); + synchronized (lookups) { + lookups.put(state.channel2, state.id); + } + logger.debug("channel2: {}", state.channel2); + } catch (RestException e) { + logger.error("Error creating channel2", e); + hangupChannel(state.channel1); + } + } + } + @Override protected void onChannelLeftBridge(ChannelLeftBridge message) { logger.debug("onChannelLeftBridge {} {}", message.getBridge().getId(), message.getChannel().getId()); diff --git a/src/main/java/ch/loway/oss/ari4java/tools/WsClientAutoReconnect.java b/src/main/java/ch/loway/oss/ari4java/tools/WsClientAutoReconnect.java deleted file mode 100755 index 1489bad7..00000000 --- a/src/main/java/ch/loway/oss/ari4java/tools/WsClientAutoReconnect.java +++ /dev/null @@ -1,12 +0,0 @@ -package ch.loway.oss.ari4java.tools; - -/** - * Interface to pluggable WebSocket reconnect implementation - * - * @author grahambrown11 - * - */ -public interface WsClientAutoReconnect { - void reconnectWs(Throwable cause); - void pong(); -} diff --git a/src/main/java/ch/loway/oss/ari4java/tools/http/HTTPLogger.java b/src/main/java/ch/loway/oss/ari4java/tools/http/HTTPLogger.java index 2210ad31..f17ee670 100755 --- a/src/main/java/ch/loway/oss/ari4java/tools/http/HTTPLogger.java +++ b/src/main/java/ch/loway/oss/ari4java/tools/http/HTTPLogger.java @@ -15,7 +15,7 @@ private HTTPLogger() { throw new IllegalStateException("Utility class"); } - private static Logger logger = LoggerFactory.getLogger(HTTPLogger.class); + private static final Logger logger = LoggerFactory.getLogger(HTTPLogger.class); private static final int MAX_LEN = 1000; diff --git a/src/main/java/ch/loway/oss/ari4java/tools/http/NettyHttpClient.java b/src/main/java/ch/loway/oss/ari4java/tools/http/NettyHttpClient.java index 55048fa1..81a2273d 100755 --- a/src/main/java/ch/loway/oss/ari4java/tools/http/NettyHttpClient.java +++ b/src/main/java/ch/loway/oss/ari4java/tools/http/NettyHttpClient.java @@ -8,16 +8,26 @@ import io.netty.buffer.Unpooled; import io.netty.channel.*; import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.channel.pool.ChannelPool; +import io.netty.channel.pool.ChannelPoolHandler; +import io.netty.channel.pool.FixedChannelPool; import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.handler.codec.base64.Base64; import io.netty.handler.codec.http.*; import io.netty.handler.codec.http.websocketx.*; +import io.netty.handler.logging.ByteBufFormat; +import io.netty.handler.logging.LogLevel; +import io.netty.handler.logging.LoggingHandler; import io.netty.handler.ssl.SslContext; import io.netty.handler.ssl.SslContextBuilder; import io.netty.handler.ssl.util.InsecureTrustManagerFactory; import io.netty.handler.timeout.ReadTimeoutHandler; +import io.netty.util.NettyRuntime; +import io.netty.util.concurrent.Future; +import io.netty.util.concurrent.FutureListener; import io.netty.util.concurrent.ScheduledFuture; +import io.netty.util.internal.SystemPropertyUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -37,7 +47,7 @@ * * @author mwalton */ -public class NettyHttpClient implements HttpClient, WsClient, WsClientAutoReconnect { +public class NettyHttpClient implements HttpClient, WsClient { public static final int CONNECTION_TIMEOUT_SEC = 10; public static final int READ_TIMEOUT_SEC = 30; @@ -50,7 +60,7 @@ public class NettyHttpClient implements HttpClient, WsClient, WsClientAutoReconn private static final String HTTP_AGGREGATOR = "http-aggregator"; private static final String HTTP_HANDLER = "http-handler"; - private Logger logger = LoggerFactory.getLogger(NettyHttpClient.class); + private final Logger logger = LoggerFactory.getLogger(NettyHttpClient.class); protected Bootstrap httpBootstrap; protected URI baseUri; @@ -58,7 +68,7 @@ public class NettyHttpClient implements HttpClient, WsClient, WsClientAutoReconn private EventLoopGroup shutDownGroup; protected String auth; - private HttpResponseHandler wsCallback; + protected HttpResponseHandler wsCallback; private String wsEventsUrl; private List wsEventsParamQuery; private WsClientConnection wsClientConnection; @@ -76,10 +86,16 @@ public class NettyHttpClient implements HttpClient, WsClient, WsClientAutoReconn private static boolean autoReconnect = true; protected int pingPeriod = 5; protected TimeUnit pingTimeUnit = TimeUnit.MINUTES; + protected ChannelPool pool; + private int threadCount; public NettyHttpClient() { - group = new NioEventLoopGroup(); - shutDownGroup = new NioEventLoopGroup(); + // use at least 3 threads + threadCount = Math.max(3, SystemPropertyUtil.getInt( + "io.netty.eventLoopThreads", NettyRuntime.availableProcessors() * 2)); + logger.debug("Starting NioEventLoopGroup with {} threads", threadCount); + group = new NioEventLoopGroup(threadCount); + shutDownGroup = new NioEventLoopGroup(1); } public void initialize(String baseUrl, String username, String password) throws URISyntaxException { @@ -108,23 +124,38 @@ protected void initHttpBootstrap() { READ_TIMEOUT_SEC, MAX_HTTP_REQUEST); httpBootstrap = new Bootstrap(); + httpBootstrap.remoteAddress(baseUri.getHost(), getPort()); + httpBootstrap.group(group); bootstrapOptions(httpBootstrap); - httpBootstrap.handler(new ChannelInitializer() { + pool = new FixedChannelPool(httpBootstrap, new ChannelPoolHandler() { @Override - public void initChannel(SocketChannel ch) throws Exception { + public void channelCreated(Channel ch) throws Exception { + logger.trace("Channel Pool connection created: {}", ch); ChannelPipeline pipeline = ch.pipeline(); + pipeline.addFirst("logger", new LoggingHandler(HTTPLogger.class, LogLevel.TRACE, ByteBufFormat.SIMPLE)); addSSLIfRequired(pipeline, baseUri); pipeline.addLast("read-timeout", new ReadTimeoutHandler(READ_TIMEOUT_SEC)); pipeline.addLast(HTTP_CODEC, new HttpClientCodec()); pipeline.addLast(HTTP_AGGREGATOR, new HttpObjectAggregator(MAX_HTTP_REQUEST)); pipeline.addLast(HTTP_HANDLER, new NettyHttpClientHandler()); + logger.debug("pipeline names: {}", pipeline.names()); + ch.closeFuture().addListener(future -> logger.debug("Channel closed, {}", ch)); } - }); + + @Override + public void channelAcquired(Channel ch) { + logger.trace("Channel Pool connection acquired: {}", ch); + } + + @Override + public void channelReleased(Channel ch) { + logger.trace("Channel Pool connection released: {}", ch); + } + }, threadCount); } } private void bootstrapOptions(Bootstrap bootStrap) { - bootStrap.group(group); bootStrap.channel(NioSocketChannel.class); bootStrap.option(ChannelOption.TCP_NODELAY, true); bootStrap.option(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT); @@ -153,9 +184,12 @@ private int getPort() { return port; } - protected ChannelFuture httpConnect() { - logger.debug("HTTP Connect uri: {}", baseUri); - return httpBootstrap.connect(baseUri.getHost(), getPort()); + protected Future poolAcquire() { + return pool.acquire(); + } + + protected void poolRelease(Channel ch) { + pool.release(ch); } @Override @@ -184,10 +218,16 @@ public void destroy() { } } if (group != null && !group.isShuttingDown()) { - logger.debug("group shutdownGracefully"); + logger.debug("wsGroup shutdownGracefully"); + group.shutdownGracefully(0, 1, TimeUnit.SECONDS).syncUninterruptibly(); + group = null; + logger.debug("wsGroup shutdown complete"); + } + if (group != null && !group.isShuttingDown()) { + logger.debug("httpGroup shutdownGracefully"); group.shutdownGracefully(0, 1, TimeUnit.SECONDS).syncUninterruptibly(); group = null; - logger.debug("group shutdown complete"); + logger.debug("httpGroup shutdown complete"); } }); shutDownGroup.shutdownGracefully(0, 5, TimeUnit.SECONDS).syncUninterruptibly(); @@ -248,7 +288,7 @@ private HttpRequest buildRequest(String path, String method, List par request.content().clear().writeBytes(bbuf); } request.headers().set(HttpHeaderNames.HOST, baseUri.getHost()); - request.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.CLOSE); + request.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE); request.headers().set(HttpHeaderNames.AUTHORIZATION, this.auth); HTTPLogger.traceRequest(request, body); return request; @@ -257,9 +297,9 @@ private HttpRequest buildRequest(String path, String method, List par private RestException makeException(HttpResponseStatus status, String response, List errors) { if (status == null && response == null) { - return new RestException("Client Shutdown"); + return new RestException("No HTTP Status and Response, timeout or client shutdown"); } else if (status == null) { - return new RestException("Client Shutdown: " + response); + return new RestException("Error: " + response); } if (errors != null) { @@ -278,7 +318,7 @@ private RestException makeException(HttpResponseStatus status, String response, public String httpActionSync(String uri, String method, List parametersQuery, String body, List errors) throws RestException { NettyHttpClientHandler handler = httpActionSyncHandler(uri, method, parametersQuery, body, errors); - return handler.getResponseText(); + return handler != null ? handler.getResponseText() : null; } // Synchronous HTTP action @@ -286,7 +326,7 @@ public String httpActionSync(String uri, String method, List paramete public byte[] httpActionSyncAsBytes(String uri, String method, List parametersQuery, String body, List errors) throws RestException { NettyHttpClientHandler handler = httpActionSyncHandler(uri, method, parametersQuery, body, errors, true); - return handler.getResponseBytes(); + return handler != null ? handler.getResponseBytes() : null; } private NettyHttpClientHandler httpActionSyncHandler(String uri, String method, List parametersQuery, @@ -298,33 +338,42 @@ private NettyHttpClientHandler httpActionSyncHandler(String uri, String method, String body, List errors, boolean binary) throws RestException { HttpRequest request = buildRequest(uri, method, parametersQuery, body); logger.debug("Sync Action - {} to {}", request.method(), request.uri()); - Channel ch = httpConnect().addListener((ChannelFutureListener) future -> { - if (future.isSuccess()) { - logger.debug("HTTP connected"); - replaceAggregator(binary, future.channel()); - } else if (future.cause() != null) { - logger.error("HTTP Connection Error - {}", future.cause().getMessage(), future.cause()); + Channel ch = poolAcquire().syncUninterruptibly().getNow(); + try { + replaceAggregator(binary, ch); + NettyHttpClientHandler handler = (NettyHttpClientHandler) ch.pipeline().get(HTTP_HANDLER); + if (handler == null) return null; + handler.reset(); + ch.writeAndFlush(request); + logger.debug("Wait for response..."); + handler.waitForResponse(READ_TIMEOUT_SEC); + if (handler.getException() != null) { + logger.debug("got an error: {}", handler.getException().toString()); + throw new RestException(handler.getException()); + } else if (httpResponseOkay(handler.getResponseStatus())) { + logger.debug("got OK response"); + return handler; } else { - logger.error("HTTP Connection Error - Unknown"); + logger.debug("...done waiting"); + throw makeException(handler.getResponseStatus(), handler.getResponseText(), errors); } - }).syncUninterruptibly().channel(); - NettyHttpClientHandler handler = (NettyHttpClientHandler) ch.pipeline().get(HTTP_HANDLER); - ch.writeAndFlush(request); - ch.closeFuture().syncUninterruptibly(); - if (handler.getException() != null) { - throw new RestException(handler.getException()); - } else if (httpResponseOkay(handler.getResponseStatus())) { - return handler; - } else { - throw makeException(handler.getResponseStatus(), handler.getResponseText(), errors); + } finally { + poolRelease(ch); } } private void replaceAggregator(boolean binary, Channel ch) { - if (binary) { - logger.debug("Is Binary, replace http-aggregator ..."); - ch.pipeline().replace( - HTTP_AGGREGATOR, HTTP_AGGREGATOR, new HttpObjectAggregator(MAX_HTTP_BIN_REQUEST)); + HttpObjectAggregator aggregator = (HttpObjectAggregator) ch.pipeline().get(HTTP_AGGREGATOR); + if (aggregator != null) { + if (binary && aggregator.maxContentLength() != MAX_HTTP_BIN_REQUEST) { + logger.debug("Replace http-aggregator with larger content length..."); + ch.pipeline().replace( + HTTP_AGGREGATOR, HTTP_AGGREGATOR, new HttpObjectAggregator(MAX_HTTP_BIN_REQUEST)); + } else if (!binary && aggregator.maxContentLength() != MAX_HTTP_REQUEST) { + logger.debug("Replace http-aggregator with smaller content length..."); + ch.pipeline().replace( + HTTP_AGGREGATOR, HTTP_AGGREGATOR, new HttpObjectAggregator(MAX_HTTP_REQUEST)); + } } } @@ -337,40 +386,52 @@ public void httpActionAsync(String uri, String method, List parameter final HttpRequest request = buildRequest(uri, method, parametersQuery, body); logger.debug("Async Action - {} to {}", request.method(), request.uri()); // Get future channel - ChannelFuture cf = httpConnect(); - cf.addListener((ChannelFutureListener) future1 -> { + Future cf = poolAcquire(); + cf.addListener((FutureListener) future1 -> { if (future1.isSuccess()) { - logger.debug("HTTP connected"); - Channel ch = future1.channel(); + Channel ch = future1.getNow(); + logger.debug("Channel, {}", ch); + group.execute(responseHandler::onChReadyToWrite); replaceAggregator(binary, ch); - responseHandler.onChReadyToWrite(); - ch.writeAndFlush(request); - ch.closeFuture().addListener((ChannelFutureListener) future2 -> { - responseHandler.onResponseReceived(); - if (future2.isSuccess()) { - NettyHttpClientHandler handler = (NettyHttpClientHandler) future2.channel().pipeline().get(HTTP_HANDLER); - if (handler.getException() != null) { - responseHandler.onFailure(new RestException(handler.getException())); - } else if (httpResponseOkay(handler.getResponseStatus())) { - if (binary) { - responseHandler.onSuccess(handler.getResponseBytes()); + final NettyHttpClientHandler handler = (NettyHttpClientHandler) ch.pipeline().get(HTTP_HANDLER); + handler.reset(); + ch.writeAndFlush(request).addListener(future2 -> + group.execute(() -> { + try { + logger.debug("Wait for response..."); + handler.waitForResponse(READ_TIMEOUT_SEC); + if (handler.getException() != null) { + logger.debug("got an error: {}", handler.getException().toString()); + onFailure(responseHandler, new RestException(handler.getException())); + } else if (httpResponseOkay(handler.getResponseStatus())) { + logger.debug("got OK response"); + if (binary) { + responseHandler.onSuccess(handler.getResponseBytes()); + } else { + responseHandler.onSuccess(handler.getResponseText()); + } } else { - responseHandler.onSuccess(handler.getResponseText()); + logger.debug("...done waiting"); + onFailure(responseHandler, makeException(handler.getResponseStatus(), handler.getResponseText(), errors)); } - } else { - responseHandler.onFailure(makeException(handler.getResponseStatus(), handler.getResponseText(), errors)); + } finally { + poolRelease(ch); } - } else { - responseHandler.onFailure(future2.cause()); - } - }); + }) + ); } else { - responseHandler.onFailure(future1.cause()); + onFailure(responseHandler, future1.cause()); } }); } // WsClient implementation - connect to WebSocket server + private void onFailure(HttpResponseHandler responseHandler, Throwable cause) { + if (!group.isShuttingDown()) { + group.execute(() -> responseHandler.onFailure(cause)); + } + } + @Override public WsClientConnection connect(final HttpResponseHandler callback, final String url, final List lParamQuery) throws RestException { if (isWsConnected()) { @@ -381,7 +442,7 @@ public WsClientConnection connect(final HttpResponseHandler callback, final Stri logger.debug("WS Connect uri: {}", handshake.uri()); this.wsEventsUrl = url; this.wsEventsParamQuery = lParamQuery; - this.wsHandler = new NettyWSClientHandler(handshake, callback, this); + this.wsHandler = new NettyWSClientHandler(handshake, this); this.wsCallback = callback; return connect(new Bootstrap(), callback); } catch (Exception e) { @@ -390,12 +451,14 @@ public WsClientConnection connect(final HttpResponseHandler callback, final Stri } protected WsClientConnection connect(Bootstrap wsBootStrap, final HttpResponseHandler callback) { + wsBootStrap.group(group); bootstrapOptions(wsBootStrap); wsBootStrap.handler(new ChannelInitializer() { @Override public void initChannel(SocketChannel ch) throws Exception { ChannelPipeline pipeline = ch.pipeline(); addSSLIfRequired(pipeline, baseUri); + pipeline.addFirst("logger", new LoggingHandler(HTTPLogger.class, LogLevel.TRACE, ByteBufFormat.SIMPLE)); pipeline.addLast(HTTP_CODEC, new HttpClientCodec()); pipeline.addLast(HTTP_AGGREGATOR, new HttpObjectAggregator(MAX_HTTP_REQUEST)); pipeline.addLast("ws-handler", wsHandler); @@ -419,7 +482,9 @@ public void operationComplete(ChannelFuture future) throws Exception { // start a ping and reset reconnect counter startPing(); reconnectCount = 0; - callback.onChReadyToWrite(); + if (!group.isShuttingDown()) { + group.execute(callback::onChReadyToWrite); + } } else { if (future.cause() != null) { logger.error("WS Upgrade Error - {}", future.cause().getMessage(), future.cause()); @@ -537,8 +602,11 @@ private boolean httpResponseOkay(HttpResponseStatus status) { || HttpResponseStatus.CREATED.equals(status); } - @Override public void reconnectWs(Throwable cause) { + // send the disconnect callback + if (!group.isShuttingDown()) { + group.execute(() -> wsCallback.onDisconnect()); + } // cancel the ping timer if (wsPingTimer != null) { wsPingTimer.cancel(true); @@ -547,7 +615,9 @@ public void reconnectWs(Throwable cause) { if (!autoReconnect || (maxReconnectCount > -1 && reconnectCount >= maxReconnectCount)) { logger.warn("Cannot connect: {} - executing failure callback", cause.getMessage()); - wsCallback.onFailure(cause); + if (!group.isShuttingDown()) { + group.execute(() -> wsCallback.onFailure(cause)); + } return; } @@ -565,14 +635,31 @@ public void reconnectWs(Throwable cause) { // then connect again connect(wsCallback, wsEventsUrl, wsEventsParamQuery); } catch (RestException e) { - wsCallback.onFailure(e); + group.execute(() -> wsCallback.onFailure(e)); } }, timeout, TimeUnit.SECONDS); } } - @Override - public void pong() { + public void onWSResponseReceived() { + if (!group.isShuttingDown()) { + group.execute(() -> wsCallback.onResponseReceived()); + } + } + + public void onWSSuccess(String text) { + if (!group.isShuttingDown()) { + group.execute(() -> wsCallback.onSuccess(text)); + } + } + + public void onWSFailure(Throwable cause) { + if (!group.isShuttingDown()) { + group.execute(() -> wsCallback.onFailure(cause)); + } + } + + public void onWSPong() { lastPong = System.currentTimeMillis(); } diff --git a/src/main/java/ch/loway/oss/ari4java/tools/http/NettyHttpClientHandler.java b/src/main/java/ch/loway/oss/ari4java/tools/http/NettyHttpClientHandler.java index b6a6b866..474e7b6a 100755 --- a/src/main/java/ch/loway/oss/ari4java/tools/http/NettyHttpClientHandler.java +++ b/src/main/java/ch/loway/oss/ari4java/tools/http/NettyHttpClientHandler.java @@ -13,6 +13,8 @@ import org.slf4j.LoggerFactory; import java.util.Arrays; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; /** * HttpClientHandler handles the asynchronous response from the remote @@ -26,10 +28,12 @@ public class NettyHttpClientHandler extends SimpleChannelInboundHandler protected byte[] responseBytes; protected HttpResponseStatus responseStatus; private Throwable exception; + private CountDownLatch latch = new CountDownLatch(1); - private Logger logger = LoggerFactory.getLogger(NettyHttpClientHandler.class); + private final Logger logger = LoggerFactory.getLogger(NettyHttpClientHandler.class); public void reset() { + latch = new CountDownLatch(1); responseBytes = null; responseStatus = null; } @@ -48,9 +52,11 @@ protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Except response.headers().getInt(HttpHeaderNames.CONTENT_LENGTH), responseBytes.length); } } else if (msg != null) { + latch.countDown(); logger.warn("Unexpected: {}", msg); throw new RestException("Unknown object: " + msg.getClass().getSimpleName() + ", expecting FullHttpResponse"); } + latch.countDown(); } public String getResponseText() { @@ -76,7 +82,7 @@ public Throwable getException() { } @Override - public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { + public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { this.exception = cause; if (!(cause instanceof ReadTimeoutException)) { logger.error("Not a read timeout", cause); @@ -85,5 +91,13 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws E ctx.close(); } + public void waitForResponse(int timeout) { + try { + latch.await(timeout, TimeUnit.SECONDS); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } + } + } diff --git a/src/main/java/ch/loway/oss/ari4java/tools/http/NettyWSClientHandler.java b/src/main/java/ch/loway/oss/ari4java/tools/http/NettyWSClientHandler.java index 608a9a94..ec0d18fb 100755 --- a/src/main/java/ch/loway/oss/ari4java/tools/http/NettyWSClientHandler.java +++ b/src/main/java/ch/loway/oss/ari4java/tools/http/NettyWSClientHandler.java @@ -24,19 +24,13 @@ public class NettyWSClientHandler extends NettyHttpClientHandler { final WebSocketClientHandshaker handshaker; private ChannelPromise handshakeFuture; - final HttpResponseHandler wsCallback; - private WsClientAutoReconnect wsClient = null; + private NettyHttpClient client = null; private boolean shuttingDown = false; - private Logger logger = LoggerFactory.getLogger(NettyWSClientHandler.class); + private final Logger logger = LoggerFactory.getLogger(NettyWSClientHandler.class); - public NettyWSClientHandler(WebSocketClientHandshaker handshaker, HttpResponseHandler wsCallback, WsClientAutoReconnect wsClient) { - this(handshaker, wsCallback); - this.wsClient = wsClient; - } - - public NettyWSClientHandler(WebSocketClientHandshaker handshaker, HttpResponseHandler wsCallback) { + public NettyWSClientHandler(WebSocketClientHandshaker handshaker, NettyHttpClient client) { this.handshaker = handshaker; - this.wsCallback = wsCallback; + this.client = client; } public ChannelFuture handshakeFuture() { @@ -44,21 +38,20 @@ public ChannelFuture handshakeFuture() { } @Override - public void handlerAdded(ChannelHandlerContext ctx) throws Exception { + public void handlerAdded(ChannelHandlerContext ctx) { handshakeFuture = ctx.newPromise(); } @Override - public void channelActive(ChannelHandlerContext ctx) throws Exception { + public void channelActive(ChannelHandlerContext ctx) { handshaker.handshake(ctx.channel()); } @Override - public void channelInactive(ChannelHandlerContext ctx) throws Exception { - if (!shuttingDown && this.wsClient != null) { + public void channelInactive(ChannelHandlerContext ctx) { + if (!shuttingDown) { logger.debug("WS channel inactive - {}", ctx); - wsCallback.onDisconnect(); - wsClient.reconnectWs(new RestException("WS channel inactive")); + client.reconnectWs(new RestException("WS channel inactive")); } } @@ -84,25 +77,21 @@ protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Except } // call this so we can set the last received time - wsCallback.onResponseReceived(); + client.onWSResponseReceived(); if (msg instanceof TextWebSocketFrame) { TextWebSocketFrame textFrame = (TextWebSocketFrame) msg; String text = textFrame.content().toString(ARIEncoder.ENCODING); HTTPLogger.traceWebSocketFrame(text); responseBytes = text.getBytes(ARIEncoder.ENCODING); - wsCallback.onSuccess(text); + client.onWSSuccess(text); } else if (msg instanceof CloseWebSocketFrame) { ch.close(); if (!shuttingDown) { - if (this.wsClient != null) { - wsClient.reconnectWs(new RestException("CloseWebSocketFrame received")); - } else { - wsCallback.onDisconnect(); - } + client.reconnectWs(new RestException("CloseWebSocketFrame received")); } } else if (msg instanceof PongWebSocketFrame) { - wsClient.pong(); + client.onWSPong(); } else { HTTPLogger.traceWebSocketFrame(msg.toString()); String error = "Not expecting: " + msg.getClass().getSimpleName(); @@ -112,7 +101,7 @@ protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Except } @Override - public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { + public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { if (!shuttingDown) return; logger.error("exceptionCaught: {}", cause.getMessage(), cause); @@ -121,7 +110,7 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws E } ctx.fireExceptionCaught(cause); ctx.close(); - wsCallback.onFailure(cause); + client.onWSFailure(cause); } public boolean isShuttingDown() { diff --git a/src/test/java/ch/loway/oss/ari4java/tools/http/NettyHttpClientTest.java b/src/test/java/ch/loway/oss/ari4java/tools/http/NettyHttpClientTest.java index 9f589082..312d8fb7 100755 --- a/src/test/java/ch/loway/oss/ari4java/tools/http/NettyHttpClientTest.java +++ b/src/test/java/ch/loway/oss/ari4java/tools/http/NettyHttpClientTest.java @@ -11,8 +11,10 @@ import io.netty.channel.embedded.EmbeddedChannel; import io.netty.handler.codec.http.*; import io.netty.handler.codec.http.websocketx.WebSocketVersion; +import io.netty.util.concurrent.Future; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; import java.net.URI; import java.net.URISyntaxException; @@ -20,7 +22,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.*; @@ -29,20 +34,36 @@ public class NettyHttpClientTest { private NettyHttpClient client; private ChannelFuture cf; + private Future fc; + private final ExecutorService executor = Executors.newSingleThreadExecutor(); - private void setupTestClient(boolean init) throws URISyntaxException { + private void setupTestClient(boolean init, Channel ch) throws URISyntaxException { client = new NettyHttpClient() { protected void initHttpBootstrap() { // for testing skip the bootstrapping } - protected ChannelFuture httpConnect() { - return cf; + @Override + protected Future poolAcquire() { + return fc; + } + + @Override + protected void poolRelease(Channel ch) { + // for testing skip } }; if (init) { client.initialize("http://localhost:8088/", "user", "p@ss"); } + if (ch instanceof EmbeddedChannel) { + fc = ch.eventLoop().newSucceededFuture(ch); + } else { + //noinspection unchecked + fc = (Future) mock(Future.class); + when(fc.syncUninterruptibly()).thenReturn(fc); + when(fc.getNow()).thenReturn(ch); + } } @AfterEach @@ -54,21 +75,21 @@ public void tearDown() { @Test public void testInitializeBadURL() throws URISyntaxException { - setupTestClient(false); + setupTestClient(false, null); assertThrows(URISyntaxException.class, () -> client.initialize(":", "", "")); } @Test public void testInitializeInvalidURL() throws URISyntaxException { - setupTestClient(false); + setupTestClient(false, null); assertThrows(IllegalArgumentException.class, () -> client.initialize("ws://localhost:8088/", "", "")); } @Test public void testBuildURL() throws Exception { - setupTestClient(true); + setupTestClient(true, null); List queryParams = new ArrayList<>(); queryParams.add(HttpParam.build("a", "b/c")); queryParams.add(HttpParam.build("d", "e")); @@ -84,36 +105,13 @@ public void testInitialize() throws Exception { assertNotNull(client.baseUri); } - @Test - public void testHttpConnect() { - Bootstrap bootstrap = mock(Bootstrap.class); - NettyHttpClient client = new NettyHttpClient() { - { - initHttpBootstrap(); - } - @Override - protected void initHttpBootstrap() { - httpBootstrap = bootstrap; - try { - baseUri = new URI("http://localhost:8088/"); - } catch (URISyntaxException e) { - // oh well - } - } - }; - when(bootstrap.connect(eq("localhost"), eq(8088))).thenReturn(mock(ChannelFuture.class)); - ChannelFuture future = client.httpConnect(); - assertNotNull(future, "Expected ChannelFuture"); - verify(bootstrap, times(1)).connect(anyString(), anyInt()); - client.destroy(); - } - @Test public void testWsConnect() throws Exception { Bootstrap bootstrap = mock(Bootstrap.class); NettyWSClientHandler testHandler = mock(NettyWSClientHandler.class); + ChannelFuture handshakeFuture = mock(ChannelFuture.class); + when(testHandler.handshakeFuture()).thenReturn(handshakeFuture); EmbeddedChannel channel = createTestChannel("ws-handler", testHandler); - FullHttpRequest req = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/events"); HttpHeaders headers = req.headers(); headers.set(HttpHeaderNames.UPGRADE, HttpHeaderValues.WEBSOCKET); @@ -122,11 +120,12 @@ public void testWsConnect() throws Exception { cf = channel.closeFuture(); when(bootstrap.connect(eq("localhost"), eq(443))).thenReturn(cf); ((DefaultChannelPromise) cf).setSuccess(null); - + HttpResponseHandler testWsCallback = mock(HttpResponseHandler.class); + when(testWsCallback.getLastResponseTime()).thenReturn(0L); class TestNettyHttpClient extends NettyHttpClient { @Override public WsClientConnection connect(final HttpResponseHandler callback, final String url, - final List lParamQuery) throws RestException { + final List lParamQuery) { try { baseUri = new URI("https://localhost/"); this.auth = "123"; @@ -136,38 +135,43 @@ public WsClientConnection connect(final HttpResponseHandler callback, final Stri } pingPeriod = 1; pingTimeUnit = TimeUnit.SECONDS; + wsHandler = testHandler; + wsCallback = testWsCallback; return connect(bootstrap, callback); } -// public void testWsFutureOperationComplete(ChannelFuture future) throws Exception { -// this.wsHandler = testHandler; -// wsFuture.operationComplete(future); -// } } TestNettyHttpClient client = new TestNettyHttpClient(); WsClient.WsClientConnection connection = client.connect(mock(HttpResponseHandler.class), "/events", null); assertNotNull(connection, "Expected WsClientConnection"); channel.writeInbound(req); - Thread.sleep(10000); + ArgumentCaptor captor = ArgumentCaptor.forClass(ChannelFutureListener.class); + verify(handshakeFuture).addListener(captor.capture()); + captor.getValue().operationComplete(channel.newSucceededFuture()); + client.onWSPong(); + Thread.sleep(2500); + System.out.println(channel.inboundMessages().toString()); + channel.readOutbound(); client.destroy(); } - private void setupSync(NettyHttpClientHandler h) { - cf = mock(ChannelFuture.class); - when(cf.addListener(any())).thenReturn(cf); - when(cf.syncUninterruptibly()).thenReturn(cf); + @Test + public void testHttpActionSync() throws Exception { Channel ch = mock(Channel.class); - when(ch.closeFuture()).thenReturn(cf); - when(cf.channel()).thenReturn(ch); ChannelPipeline p = mock(ChannelPipeline.class); - when(p.get("http-handler")).thenReturn(h); when(ch.pipeline()).thenReturn(p); - } + setupTestClient(true, ch); + NettyHttpClientHandler h = new NettyHttpClientHandler() { + @Override + public void reset() { + // dont reset for this test + } - @Test - public void testHttpActionSync() throws Exception { - setupTestClient(true); - NettyHttpClientHandler h = new NettyHttpClientHandler(); - setupSync(h); + @Override + public void waitForResponse(int timeout) { + // dont wait for test + } + }; + when(p.get("http-handler")).thenReturn(h); h.responseStatus = HttpResponseStatus.OK; h.responseBytes = "testing".getBytes(ARIEncoder.ENCODING); String res = client.httpActionSync("", "GET", null, null, null); @@ -189,11 +193,25 @@ private EmbeddedChannel createTestChannel(String name, ChannelHandler handler) { return channel; } + private void delayedWriteInbound(EmbeddedChannel channel, HttpResponseStatus status, String data) { + delayedWriteInbound(channel, status, data, 200); + } + + private void delayedWriteInbound(EmbeddedChannel channel, HttpResponseStatus status, String data, long sleep) { + executor.submit(() -> { + try { + Thread.sleep(sleep); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } + channel.writeInbound(new DefaultFullHttpResponse( + HttpVersion.HTTP_1_1, status, Unpooled.copiedBuffer(data, ARIEncoder.ENCODING))); + }); + } + private AsteriskPingGetRequest pingSetup(EmbeddedChannel channel) { - channel.writeInbound(new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK, - Unpooled.copiedBuffer( - "{\"ping\":\"pong\",\"timestamp\":\"2020-01-01T00:00:00.000+0000\",\"asterisk_id\":\"test_asterisk\"}", - ARIEncoder.ENCODING))); + delayedWriteInbound(channel, HttpResponseStatus.OK, + "{\"ping\":\"pong\",\"timestamp\":\"2020-01-01T00:00:00.000+0000\",\"asterisk_id\":\"test_asterisk\"}", 500); AsteriskPingGetRequest_impl_ari_6_0_0 req = new AsteriskPingGetRequest_impl_ari_6_0_0(); req.setHttpClient(client); return req; @@ -210,8 +228,8 @@ private void pingValidate(EmbeddedChannel channel, AsteriskPing res) { @Test public void testHttpActionSyncPing() throws Exception { - setupTestClient(true); EmbeddedChannel channel = createTestChannel(); + setupTestClient(true, channel); AsteriskPingGetRequest req = pingSetup(channel); AsteriskPing res = req.execute(); pingValidate(channel, res); @@ -219,15 +237,15 @@ public void testHttpActionSyncPing() throws Exception { @Test public void testHttpActionAsyncPing() throws Exception { - setupTestClient(true); EmbeddedChannel channel = createTestChannel(); + setupTestClient(true, channel); AsteriskPingGetRequest req = pingSetup(channel); - final boolean[] callback = {false}; + final AtomicBoolean callback = new AtomicBoolean(false); req.execute(new AriCallback() { @Override public void onSuccess(AsteriskPing res) { pingValidate(channel, res); - callback[0] = true; + callback.set(true); } @Override @@ -235,19 +253,19 @@ public void onFailure(RestException e) { fail(e.toString()); } }); + Thread.sleep(550); channel.runPendingTasks(); - assertTrue(callback[0], "No onSuccess Callback"); + assertTrue(callback.get(), "No onSuccess Callback"); } @Test public void testHttpActionException() throws Exception { - setupTestClient(true); EmbeddedChannel channel = createTestChannel(); + setupTestClient(true, channel); ApplicationsGetRequest_impl_ari_6_0_0 req = new ApplicationsGetRequest_impl_ari_6_0_0("test"); req.setHttpClient(client); // when the response is JSON error then return the error from the server - channel.writeInbound(new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.NOT_FOUND, - Unpooled.copiedBuffer("{\"message\":\"a test error\"}", ARIEncoder.ENCODING))); + delayedWriteInbound(channel, HttpResponseStatus.NOT_FOUND, "{\"message\":\"a test error\"}"); boolean exception = false; try { req.execute(); @@ -257,8 +275,7 @@ public void testHttpActionException() throws Exception { } assertTrue(exception, "Expecting an exception"); // when the response is not JSON and there is an error definition from the API then return API definition - channel.writeInbound(new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.NOT_FOUND, - Unpooled.copiedBuffer("Not found", ARIEncoder.ENCODING))); + delayedWriteInbound(channel, HttpResponseStatus.NOT_FOUND, "Not found"); exception = false; try { req.execute(); @@ -271,10 +288,9 @@ public void testHttpActionException() throws Exception { @Test public void testBodyFieldSerialisation() throws Exception { - setupTestClient(true); EmbeddedChannel channel = createTestChannel(); - channel.writeInbound(new DefaultFullHttpResponse( - HttpVersion.HTTP_1_1, HttpResponseStatus.OK, Unpooled.copiedBuffer("[]", ARIEncoder.ENCODING))); + setupTestClient(true, channel); + delayedWriteInbound(channel, HttpResponseStatus.OK, "[]"); AsteriskUpdateObjectPutRequest_impl_ari_6_0_0 req = new AsteriskUpdateObjectPutRequest_impl_ari_6_0_0( "cc", "ot", "id"); req.setHttpClient(client); @@ -284,11 +300,9 @@ public void testBodyFieldSerialisation() throws Exception { @Test public void testBodyVariableSerialisation() throws Exception { - setupTestClient(true); EmbeddedChannel channel = createTestChannel(); - channel.writeInbound(new DefaultFullHttpResponse( - HttpVersion.HTTP_1_1, HttpResponseStatus.OK, Unpooled.copiedBuffer("{}", ARIEncoder.ENCODING))); - + setupTestClient(true, channel); + delayedWriteInbound(channel, HttpResponseStatus.OK, "{}"); EndpointsSendMessagePutRequest_impl_ari_6_0_0 req = new EndpointsSendMessagePutRequest_impl_ari_6_0_0("to", "from"); req.setHttpClient(client); req.addVariables("key1", "val1").addVariables("key2", "val2").execute(); @@ -297,11 +311,9 @@ public void testBodyVariableSerialisation() throws Exception { @Test public void testBodyObjectSerialisation() throws Exception { - setupTestClient(true); - EmbeddedChannel channel = createTestChannel(); - channel.writeInbound(new DefaultFullHttpResponse( - HttpVersion.HTTP_1_1, HttpResponseStatus.OK, Unpooled.copiedBuffer("{}", ARIEncoder.ENCODING))); - + final EmbeddedChannel channel = createTestChannel(); + setupTestClient(true, channel); + delayedWriteInbound(channel, HttpResponseStatus.OK, "{}"); Map map = new HashMap<>(); map.put("key1", "val1"); map.put("key2", "val2"); From cb7f02bc82282c24819bfe3291f43a70cbde20d6 Mon Sep 17 00:00:00 2001 From: Graham Brown Date: Sat, 13 Aug 2022 22:43:16 +0200 Subject: [PATCH 05/17] add entries to CL --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab791295..9b2faee6 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ ## [Unreleased] [Unreleased]: https://github.com/ari4java/ari4java/compare/v0.16.0...HEAD +### Added +- Connection Pooling using Netty's FixedChannelPool +- Examples have a Docker provider for Vagrant (in order to work around VirtualBox compatibility on Apple Silicon) + +### Changed +- Cannot wait for connection close due to using connection keep-alive (aka pooling) +- Some methods in the Examples use the async approach ## [0.16.0] [0.16.0]: https://github.com/ari4java/ari4java/compare/v0.15.0...v0.16.0 From 7df86e5d6497e815a353c2b850b468b3afba8ea1 Mon Sep 17 00:00:00 2001 From: Graham Brown Date: Wed, 17 May 2023 21:56:31 +0200 Subject: [PATCH 06/17] update action versions --- .github/workflows/ari-apis.yml | 6 +++--- .github/workflows/ari-versions.yml | 6 +++--- .github/workflows/gradle.yml | 9 +++++---- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ari-apis.yml b/.github/workflows/ari-apis.yml index d7244a43..4bf86abc 100755 --- a/.github/workflows/ari-apis.yml +++ b/.github/workflows/ari-apis.yml @@ -7,10 +7,10 @@ on: jobs: getApis: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Execute getApis run: | @@ -20,7 +20,7 @@ jobs: - name: Create Pull Request id: cpr - uses: peter-evans/create-pull-request@v3 + uses: peter-evans/create-pull-request@v5 with: commit-message: ARI API Updates branch: apis diff --git a/.github/workflows/ari-versions.yml b/.github/workflows/ari-versions.yml index b68b61bf..7a487ab4 100755 --- a/.github/workflows/ari-versions.yml +++ b/.github/workflows/ari-versions.yml @@ -7,13 +7,13 @@ on: jobs: getApis: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout Project - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Checkout Wiki - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: ${{github.repository}}.wiki path: codegen/tmp/wiki diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 5bcb9318..f9cb19ed 100755 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -12,11 +12,11 @@ on: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 - - uses: actions/cache@v1 + - uses: actions/checkout@v3 + - uses: actions/cache@v3 with: path: ~/.gradle/caches key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} @@ -25,7 +25,8 @@ jobs: - name: Set up JDK 1.8 uses: actions/setup-java@v1 with: - java-version: 1.8 + distribution: 'zulu' + java-version: '8' - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Build with Gradle From 7cbbc75b87089cef93fac2ad621c88956e901ce1 Mon Sep 17 00:00:00 2001 From: Graham Brown Date: Wed, 17 May 2023 22:06:13 +0200 Subject: [PATCH 07/17] add 5060 udp forward for SIP --- examples/Vagrantfile | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/Vagrantfile b/examples/Vagrantfile index 90b410aa..498c70ed 100644 --- a/examples/Vagrantfile +++ b/examples/Vagrantfile @@ -26,6 +26,7 @@ Vagrant.configure("2") do |config| d.has_ssh = true d.privileged = true override.vm.network :forwarded_port, guest: 8089, host: 8089 + override.vm.network :forwarded_port, guest: 5060, host: 5060, protocol: "udp" for i in 20000..20010 override.vm.network :forwarded_port, guest: i, host: i, protocol: "udp" end From a6ce0361c7ec8cc83055d7bed2bbffb802fd2714 Mon Sep 17 00:00:00 2001 From: "stijn.vandenbussche" Date: Tue, 7 May 2024 17:06:46 +0200 Subject: [PATCH 08/17] reconnectCount should only be -1 when a shutdown is triggered. Otherwise, in some seldom situations, an array index out of bounds exception can be thrown when trying to reconnect upon first connection (can happen when both java-app and asterisk is booting at same time) --- .../java/ch/loway/oss/ari4java/tools/http/NettyHttpClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/ch/loway/oss/ari4java/tools/http/NettyHttpClient.java b/src/main/java/ch/loway/oss/ari4java/tools/http/NettyHttpClient.java index 55048fa1..9072e253 100755 --- a/src/main/java/ch/loway/oss/ari4java/tools/http/NettyHttpClient.java +++ b/src/main/java/ch/loway/oss/ari4java/tools/http/NettyHttpClient.java @@ -62,7 +62,7 @@ public class NettyHttpClient implements HttpClient, WsClient, WsClientAutoReconn private String wsEventsUrl; private List wsEventsParamQuery; private WsClientConnection wsClientConnection; - private int reconnectCount = -1; + private int reconnectCount = 0; private int maxReconnectCount = 10; // -1 = infinite reconnect attempts private ChannelFuture wsChannelFuture; private ScheduledFuture wsPingTimer = null; From 7b12ad3e07f560db843334b126926b3d4b918273 Mon Sep 17 00:00:00 2001 From: "stijn.vandenbussche" Date: Wed, 15 May 2024 15:20:54 +0200 Subject: [PATCH 09/17] reconnectCount should never be -1 to prevent indexOutofboundExceptions --- .../ch/loway/oss/ari4java/tools/http/NettyHttpClient.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/ch/loway/oss/ari4java/tools/http/NettyHttpClient.java b/src/main/java/ch/loway/oss/ari4java/tools/http/NettyHttpClient.java index 9072e253..4a3deeb5 100755 --- a/src/main/java/ch/loway/oss/ari4java/tools/http/NettyHttpClient.java +++ b/src/main/java/ch/loway/oss/ari4java/tools/http/NettyHttpClient.java @@ -502,16 +502,15 @@ private WsClientConnection createWsClientConnection() { @Override public void disconnect() throws RestException { - wsHandler.setShuttingDown(true); Channel ch = wsChannelFuture.channel(); if (ch != null) { // if connected send CloseWebSocketFrame as NettyWSClientHandler will close the connection when the server responds to it - if (reconnectCount == 0) { + // only when not shutdown yet, so we don't try to send another close frame + if (!wsHandler.isShuttingDown()) { logger.debug("Send CloseWebSocketFrame ..."); - // set to -1 so we don't try send another close frame - reconnectCount = -1; ch.writeAndFlush(new CloseWebSocketFrame()); } + wsHandler.setShuttingDown(true); // if the server is no longer there then close any way ch.close(); } From 3ffe6b89b06c843d73b152c3ab38afbc2d0da2c5 Mon Sep 17 00:00:00 2001 From: grahambrown11 <771817+grahambrown11@users.noreply.github.com> Date: Sat, 14 Sep 2024 10:10:01 +0000 Subject: [PATCH 10/17] ARI API Updates --- .../codegen-data/ari_10_0_0/applications.json | 223 ++ .../codegen-data/ari_10_0_0/asterisk.json | 725 ++++++ .../codegen-data/ari_10_0_0/bridges.json | 774 ++++++ .../codegen-data/ari_10_0_0/channels.json | 2203 +++++++++++++++++ .../codegen-data/ari_10_0_0/deviceStates.json | 154 ++ .../codegen-data/ari_10_0_0/endpoints.json | 397 +++ .../codegen-data/ari_10_0_0/events.json | 930 +++++++ .../codegen-data/ari_10_0_0/mailboxes.json | 137 + .../codegen-data/ari_10_0_0/playbacks.json | 165 ++ .../codegen-data/ari_10_0_0/recordings.json | 413 +++ .../codegen-data/ari_10_0_0/sounds.json | 99 + .../codegen-data/ari_6_0_0/channels.json | 5 + .../codegen-data/ari_6_0_1/channels.json | 5 + .../codegen-data/ari_8_0_0/channels.json | 5 + .../codegen-data/ari_9_0_0/channels.json | 5 + 15 files changed, 6240 insertions(+) create mode 100644 codegen/src/main/resources/codegen-data/ari_10_0_0/applications.json create mode 100644 codegen/src/main/resources/codegen-data/ari_10_0_0/asterisk.json create mode 100644 codegen/src/main/resources/codegen-data/ari_10_0_0/bridges.json create mode 100644 codegen/src/main/resources/codegen-data/ari_10_0_0/channels.json create mode 100644 codegen/src/main/resources/codegen-data/ari_10_0_0/deviceStates.json create mode 100644 codegen/src/main/resources/codegen-data/ari_10_0_0/endpoints.json create mode 100644 codegen/src/main/resources/codegen-data/ari_10_0_0/events.json create mode 100644 codegen/src/main/resources/codegen-data/ari_10_0_0/mailboxes.json create mode 100644 codegen/src/main/resources/codegen-data/ari_10_0_0/playbacks.json create mode 100644 codegen/src/main/resources/codegen-data/ari_10_0_0/recordings.json create mode 100644 codegen/src/main/resources/codegen-data/ari_10_0_0/sounds.json diff --git a/codegen/src/main/resources/codegen-data/ari_10_0_0/applications.json b/codegen/src/main/resources/codegen-data/ari_10_0_0/applications.json new file mode 100644 index 00000000..09c5cd5c --- /dev/null +++ b/codegen/src/main/resources/codegen-data/ari_10_0_0/applications.json @@ -0,0 +1,223 @@ +{ + "_copyright": "Copyright (C) 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "2.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/applications.{format}", + "apis": [ + { + "path": "/applications", + "description": "Stasis applications", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all applications.", + "nickname": "list", + "responseClass": "List[Application]" + } + ] + }, + { + "path": "/applications/{applicationName}", + "description": "Stasis application", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get details of an application.", + "nickname": "get", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Application does not exist." + } + ] + } + ] + }, + { + "path": "/applications/{applicationName}/subscription", + "description": "Stasis application", + "operations": [ + { + "httpMethod": "POST", + "summary": "Subscribe an application to a event source.", + "notes": "Returns the state of the application after the subscriptions have changed", + "nickname": "subscribe", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "eventSource", + "description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}[/{resource}], deviceState:{deviceName}", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing parameter." + }, + { + "code": 404, + "reason": "Application does not exist." + }, + { + "code": 422, + "reason": "Event source does not exist." + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unsubscribe an application from an event source.", + "notes": "Returns the state of the application after the subscriptions have changed", + "nickname": "unsubscribe", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "eventSource", + "description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}[/{resource}], deviceState:{deviceName}", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing parameter; event source scheme not recognized." + }, + { + "code": 404, + "reason": "Application does not exist." + }, + { + "code": 409, + "reason": "Application not subscribed to event source." + }, + { + "code": 422, + "reason": "Event source does not exist." + } + ] + } + ] + }, + { + "path": "/applications/{applicationName}/eventFilter", + "description": "Stasis application", + "operations": [ + { + "httpMethod": "PUT", + "summary": "Filter application events types.", + "notes": "Allowed and/or disallowed event type filtering can be done. The body (parameter) should specify a JSON key/value object that describes the type of event filtering needed. One, or both of the following keys can be designated:

\"allowed\" - Specifies an allowed list of event types
\"disallowed\" - Specifies a disallowed list of event types

Further, each of those key's value should be a JSON array that holds zero, or more JSON key/value objects. Each of these objects must contain the following key with an associated value:

\"type\" - The type name of the event to filter

The value must be the string name (case sensitive) of the event type that needs filtering. For example:

{ \"allowed\": [ { \"type\": \"StasisStart\" }, { \"type\": \"StasisEnd\" } ] }

As this specifies only an allowed list, then only those two event type messages are sent to the application. No other event messages are sent.

The following rules apply:

* If the body is empty, both the allowed and disallowed filters are set empty.
* If both list types are given then both are set to their respective values (note, specifying an empty array for a given type sets that type to empty).
* If only one list type is given then only that type is set. The other type is not updated.
* An empty \"allowed\" list means all events are allowed.
* An empty \"disallowed\" list means no events are disallowed.
* Disallowed events take precedence over allowed events if the event type is specified in both lists.", + "nickname": "filter", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "filter", + "description": "Specify which event types to allow/disallow", + "paramType": "body", + "required": false, + "dataType": "object", + "allowMultiple": false + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Bad request." + }, + { + "code": 404, + "reason": "Application does not exist." + } + ] + } + ] + } + ], + "models": { + "Application": { + "id": "Application", + "description": "Details of a Stasis application", + "properties": { + "name": { + "type": "string", + "description": "Name of this application", + "required": true + }, + "channel_ids": { + "type": "List[string]", + "description": "Id's for channels subscribed to.", + "required": true + }, + "bridge_ids": { + "type": "List[string]", + "description": "Id's for bridges subscribed to.", + "required": true + }, + "endpoint_ids": { + "type": "List[string]", + "description": "{tech}/{resource} for endpoints subscribed to.", + "required": true + }, + "device_names": { + "type": "List[string]", + "description": "Names of the devices subscribed to.", + "required": true + }, + "events_allowed": { + "type": "List[object]", + "description": "Event types sent to the application.", + "required": true + }, + "events_disallowed": { + "type": "List[object]", + "description": "Event types not sent to the application.", + "required": true + } + } + } + } +} diff --git a/codegen/src/main/resources/codegen-data/ari_10_0_0/asterisk.json b/codegen/src/main/resources/codegen-data/ari_10_0_0/asterisk.json new file mode 100644 index 00000000..841e6cd8 --- /dev/null +++ b/codegen/src/main/resources/codegen-data/ari_10_0_0/asterisk.json @@ -0,0 +1,725 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "2.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/asterisk.{format}", + "apis": [ + { + "path": "/asterisk/config/dynamic/{configClass}/{objectType}/{id}", + "description": "Asterisk dynamic configuration", + "operations": [ + { + "httpMethod": "GET", + "summary": "Retrieve a dynamic configuration object.", + "nickname": "getObject", + "responseClass": "List[ConfigTuple]", + "parameters": [ + { + "name": "configClass", + "description": "The configuration class containing dynamic configuration objects.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "objectType", + "description": "The type of configuration object to retrieve.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "id", + "description": "The unique identifier of the object to retrieve.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "{configClass|objectType|id} not found" + } + ] + }, + { + "httpMethod": "PUT", + "summary": "Create or update a dynamic configuration object.", + "nickname": "updateObject", + "responseClass": "List[ConfigTuple]", + "parameters": [ + { + "name": "configClass", + "description": "The configuration class containing dynamic configuration objects.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "objectType", + "description": "The type of configuration object to create or update.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "id", + "description": "The unique identifier of the object to create or update.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "fields", + "description": "The body object should have a value that is a list of ConfigTuples, which provide the fields to update. Ex. [ { \"attribute\": \"directmedia\", \"value\": \"false\" } ]", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Bad request body" + }, + { + "code": 403, + "reason": "Could not create or update object" + }, + { + "code": 404, + "reason": "{configClass|objectType} not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Delete a dynamic configuration object.", + "nickname": "deleteObject", + "responseClass": "void", + "parameters": [ + { + "name": "configClass", + "description": "The configuration class containing dynamic configuration objects.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "objectType", + "description": "The type of configuration object to delete.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "id", + "description": "The unique identifier of the object to delete.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 403, + "reason": "Could not delete object" + }, + { + "code": 404, + "reason": "{configClass|objectType|id} not found" + } + ] + } + ] + }, + { + "path": "/asterisk/info", + "description": "Asterisk system information (similar to core show settings)", + "operations": [ + { + "httpMethod": "GET", + "summary": "Gets Asterisk system information.", + "nickname": "getInfo", + "responseClass": "AsteriskInfo", + "parameters": [ + { + "name": "only", + "description": "Filter information returned", + "paramType": "query", + "required": false, + "allowMultiple": true, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "build", + "system", + "config", + "status" + ] + } + } + ] + } + ] + }, + { + "path": "/asterisk/ping", + "description": "Asterisk ping", + "operations": [ + { + "httpMethod": "GET", + "summary": "Response pong message.", + "nickname": "ping", + "responseClass": "AsteriskPing" + } + ] + }, + { + "path": "/asterisk/modules", + "description": "Asterisk modules", + "operations": [ + { + "httpMethod": "GET", + "summary": "List Asterisk modules.", + "nickname": "listModules", + "responseClass": "List[Module]" + } + ] + }, + { + "path": "/asterisk/modules/{moduleName}", + "description": "Asterisk module", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get Asterisk module information.", + "nickname": "getModule", + "responseClass": "Module", + "parameters": [ + { + "name": "moduleName", + "description": "Module's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Module could not be found in running modules." + }, + { + "code": 409, + "reason": "Module information could not be retrieved." + } + ] + }, + { + "httpMethod": "POST", + "summary": "Load an Asterisk module.", + "nickname": "loadModule", + "responseClass": "void", + "parameters": [ + { + "name": "moduleName", + "description": "Module's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 409, + "reason": "Module could not be loaded." + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unload an Asterisk module.", + "nickname": "unloadModule", + "responseClass": "void", + "parameters": [ + { + "name": "moduleName", + "description": "Module's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Module not found in running modules." + }, + { + "code": 409, + "reason": "Module could not be unloaded." + } + ] + }, + { + "httpMethod": "PUT", + "summary": "Reload an Asterisk module.", + "nickname": "reloadModule", + "responseClass": "void", + "parameters": [ + { + "name": "moduleName", + "description": "Module's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Module not found in running modules." + }, + { + "code": 409, + "reason": "Module could not be reloaded." + } + ] + } + ] + }, + { + "path": "/asterisk/logging", + "description": "Asterisk log channels", + "operations": [ + { + "httpMethod": "GET", + "summary": "Gets Asterisk log channel information.", + "nickname": "listLogChannels", + "responseClass": "List[LogChannel]" + } + ] + }, + { + "path": "/asterisk/logging/{logChannelName}", + "description": "Asterisk log channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Adds a log channel.", + "nickname": "addLog", + "responseClass": "void", + "parameters": [ + { + "name": "logChannelName", + "description": "The log channel to add", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "configuration", + "description": "levels of the log channel", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Bad request body" + }, + { + "code": 409, + "reason": "Log channel could not be created." + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Deletes a log channel.", + "nickname": "deleteLog", + "responseClass": "void", + "parameters": [ + { + "name": "logChannelName", + "description": "Log channels name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Log channel does not exist." + } + ] + } + ] + }, + { + "path": "/asterisk/logging/{logChannelName}/rotate", + "description": "Asterisk log channel", + "operations": [ + { + "httpMethod": "PUT", + "summary": "Rotates a log channel.", + "nickname": "rotateLog", + "responseClass": "void", + "parameters": [ + { + "name": "logChannelName", + "description": "Log channel's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Log channel does not exist." + } + ] + } + ] + }, + { + "path": "/asterisk/variable", + "description": "Global variables", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get the value of a global variable.", + "nickname": "getGlobalVar", + "responseClass": "Variable", + "parameters": [ + { + "name": "variable", + "description": "The variable to get", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + } + ] + }, + { + "httpMethod": "POST", + "summary": "Set the value of a global variable.", + "nickname": "setGlobalVar", + "responseClass": "void", + "parameters": [ + { + "name": "variable", + "description": "The variable to set", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "value", + "description": "The value to set the variable to", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + } + ] + } + ] + } + ], + "models": { + "BuildInfo": { + "id": "BuildInfo", + "description": "Info about how Asterisk was built", + "properties": { + "os": { + "required": true, + "type": "string", + "description": "OS Asterisk was built on." + }, + "kernel": { + "required": true, + "type": "string", + "description": "Kernel version Asterisk was built on." + }, + "options": { + "required": true, + "type": "string", + "description": "Compile time options, or empty string if default." + }, + "machine": { + "required": true, + "type": "string", + "description": "Machine architecture (x86_64, i686, ppc, etc.)" + }, + "date": { + "required": true, + "type": "string", + "description": "Date and time when Asterisk was built." + }, + "user": { + "required": true, + "type": "string", + "description": "Username that build Asterisk" + } + } + }, + "SystemInfo": { + "id": "SystemInfo", + "description": "Info about Asterisk", + "properties": { + "version": { + "required": true, + "type": "string", + "description": "Asterisk version." + }, + "entity_id": { + "required": true, + "type": "string", + "description": "" + } + } + }, + "SetId": { + "id": "SetId", + "description": "Effective user/group id", + "properties": { + "user": { + "required": true, + "type": "string", + "description": "Effective user id." + }, + "group": { + "required": true, + "type": "string", + "description": "Effective group id." + } + } + }, + "ConfigInfo": { + "id": "ConfigInfo", + "description": "Info about Asterisk configuration", + "properties": { + "name": { + "required": true, + "type": "string", + "description": "Asterisk system name." + }, + "default_language": { + "required": true, + "type": "string", + "description": "Default language for media playback." + }, + "max_channels": { + "required": false, + "type": "int", + "description": "Maximum number of simultaneous channels." + }, + "max_open_files": { + "required": false, + "type": "int", + "description": "Maximum number of open file handles (files, sockets)." + }, + "max_load": { + "required": false, + "type": "double", + "description": "Maximum load avg on system." + }, + "setid": { + "required": true, + "type": "SetId", + "description": "Effective user/group id for running Asterisk." + } + } + }, + "StatusInfo": { + "id": "StatusInfo", + "description": "Info about Asterisk status", + "properties": { + "startup_time": { + "required": true, + "type": "Date", + "description": "Time when Asterisk was started." + }, + "last_reload_time": { + "required": true, + "type": "Date", + "description": "Time when Asterisk was last reloaded." + } + } + }, + "AsteriskInfo": { + "id": "AsteriskInfo", + "description": "Asterisk system information", + "properties": { + "build": { + "required": false, + "type": "BuildInfo", + "description": "Info about how Asterisk was built" + }, + "system": { + "required": false, + "type": "SystemInfo", + "description": "Info about the system running Asterisk" + }, + "config": { + "required": false, + "type": "ConfigInfo", + "description": "Info about Asterisk configuration" + }, + "status": { + "required": false, + "type": "StatusInfo", + "description": "Info about Asterisk status" + } + } + }, + "AsteriskPing": { + "id": "AsteriskPing", + "description": "Asterisk ping information", + "properties": { + "asterisk_id": { + "required": true, + "type": "string", + "description": "Asterisk id info" + }, + "ping": { + "required": true, + "type": "string", + "description": "Always string value is pong" + }, + "timestamp": { + "required": true, + "type": "string", + "description": "The timestamp string of request received time" + } + } + }, + "Module": { + "id": "Module", + "description": "Details of an Asterisk module", + "properties": { + "name": { + "type": "string", + "description": "The name of this module", + "required": true + }, + "description": { + "type": "string", + "description": "The description of this module", + "required": true + }, + "use_count": { + "type": "int", + "description": "The number of times this module is being used", + "required": true + }, + "status": { + "type": "string", + "description": "The running status of this module", + "required": true + }, + "support_level": { + "type": "string", + "description": "The support state of this module", + "required": true + } + } + }, + "LogChannel": { + "id": "LogChannel", + "description": "Details of an Asterisk log channel", + "properties": { + "channel": { + "type": "string", + "description": "The log channel path", + "required": true + }, + "type": { + "type": "string", + "description": "Types of logs for the log channel", + "required": true + }, + "status": { + "type": "string", + "description": "Whether or not a log type is enabled", + "required": true + }, + "configuration": { + "type": "string", + "description": "The various log levels", + "required": true + } + } + }, + "Variable": { + "id": "Variable", + "description": "The value of a channel variable", + "properties": { + "value": { + "required": true, + "type": "string", + "description": "The value of the variable requested" + } + } + }, + "ConfigTuple": { + "id": "ConfigTuple", + "description": "A key/value pair that makes up part of a configuration object.", + "properties": { + "attribute": { + "required": true, + "type": "string", + "description": "A configuration object attribute." + }, + "value": { + "required": true, + "type": "string", + "description": "The value for the attribute." + } + } + } + } +} diff --git a/codegen/src/main/resources/codegen-data/ari_10_0_0/bridges.json b/codegen/src/main/resources/codegen-data/ari_10_0_0/bridges.json new file mode 100644 index 00000000..636d2540 --- /dev/null +++ b/codegen/src/main/resources/codegen-data/ari_10_0_0/bridges.json @@ -0,0 +1,774 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "2.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/bridges.{format}", + "requiresModules": [ + "res_stasis_recording", + "res_stasis_playback" + ], + "apis": [ + { + "path": "/bridges", + "description": "Active bridges", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all active bridges in Asterisk.", + "nickname": "list", + "responseClass": "List[Bridge]" + }, + { + "httpMethod": "POST", + "summary": "Create a new bridge.", + "notes": "This bridge persists until it has been shut down, or Asterisk has been shut down.", + "nickname": "create", + "responseClass": "Bridge", + "parameters": [ + { + "name": "type", + "description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu, video_single, sdp_label).", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "bridgeId", + "description": "Unique ID to give to the bridge being created.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Name to give to the bridge being created.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}", + "description": "Individual bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Create a new bridge or updates an existing one.", + "notes": "This bridge persists until it has been shut down, or Asterisk has been shut down.", + "nickname": "createWithId", + "responseClass": "Bridge", + "parameters": [ + { + "name": "type", + "description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu, video_single, sdp_label) to set.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "bridgeId", + "description": "Unique ID to give to the bridge being created.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Set the name of the bridge.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ] + }, + { + "httpMethod": "GET", + "summary": "Get bridge details.", + "nickname": "get", + "responseClass": "Bridge", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Shut down a bridge.", + "notes": "If any channels are in this bridge, they will be removed and resume whatever they were doing beforehand.", + "nickname": "destroy", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/addChannel", + "description": "Add a channel to a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Add a channel to a bridge.", + "nickname": "addChannel", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "channel", + "description": "Ids of channels to add to bridge", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + }, + { + "name": "role", + "description": "Channel's role in the bridge", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "absorbDTMF", + "description": "Absorb DTMF coming from this channel, preventing it to pass through to the bridge", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean", + "defaultValue": false + }, + { + "name": "mute", + "description": "Mute audio from this channel, preventing it to pass through to the bridge", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean", + "defaultValue": false + }, + { + "name": "inhibitConnectedLineUpdates", + "description": "Do not present the identity of the newly connected channel to other bridge members", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean", + "defaultValue": false + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Channel not found" + }, + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application; Channel currently recording" + }, + { + "code": 422, + "reason": "Channel not in Stasis application" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/removeChannel", + "description": "Remove a channel from a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Remove a channel from a bridge.", + "nickname": "removeChannel", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "channel", + "description": "Ids of channels to remove from bridge", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Channel not found" + }, + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + }, + { + "code": 422, + "reason": "Channel not in this bridge" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/videoSource/{channelId}", + "description": "Set a channel as the video source in a multi-party bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Set a channel as the video source in a multi-party mixing bridge. This operation has no effect on bridges with two or fewer participants.", + "nickname": "setVideoSource", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge or Channel not found" + }, + { + "code": 409, + "reason": "Channel not in Stasis application" + }, + { + "code": 422, + "reason": "Channel not in this Bridge" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/videoSource", + "description": "Removes any explicit video source", + "operations": [ + { + "httpMethod": "DELETE", + "summary": "Removes any explicit video source in a multi-party mixing bridge. This operation has no effect on bridges with two or fewer participants. When no explicit video source is set, talk detection will be used to determine the active video stream.", + "nickname": "clearVideoSource", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/moh", + "description": "Play music on hold to a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Play music on hold to a bridge or change the MOH class that is playing.", + "nickname": "startMoh", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "mohClass", + "description": "Channel's id", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop playing music on hold to a bridge.", + "notes": "This will only stop music on hold being played via POST bridges/{bridgeId}/moh.", + "nickname": "stopMoh", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/play", + "description": "Play media to the participants of a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start playback of media on a bridge.", + "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "play", + "responseClass": "Playback", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media URIs to play.", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of milliseconds to skip before playing. Only applies to the first URI if multiple media URIs are specified.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "playbackId", + "description": "Playback Id.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/play/{playbackId}", + "description": "Play media to a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start playback of media on a bridge.", + "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "playWithId", + "responseClass": "Playback", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "playbackId", + "description": "Playback ID.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media URIs to play.", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of milliseconds to skip before playing. Only applies to the first URI if multiple media URIs are specified.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in a Stasis application" + } + ] + + } + ] + }, + { + "path": "/bridges/{bridgeId}/record", + "description": "Record audio on a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start a recording.", + "notes": "This records the mixed audio from all channels participating in this bridge.", + "nickname": "record", + "responseClass": "LiveRecording", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Recording's filename", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "format", + "description": "Format to encode audio in", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "maxDurationSeconds", + "description": "Maximum duration of the recording, in seconds. 0 for no limit.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "maxSilenceSeconds", + "description": "Maximum duration of silence, in seconds. 0 for no limit.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "ifExists", + "description": "Action to take if a recording with the same name already exists.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "fail", + "allowableValues": { + "valueType": "LIST", + "values": [ + "fail", + "overwrite", + "append" + ] + } + }, + { + "name": "beep", + "description": "Play beep when recording begins", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean", + "defaultValue": false + }, + { + "name": "terminateOn", + "description": "DTMF input to terminate recording.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "any", + "*", + "#" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge is not in a Stasis application; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail" + }, + { + "code": 422, + "reason": "The format specified is unknown on this system" + } + ] + } + ] + } + ], + "models": { + "Bridge": { + "id": "Bridge", + "description": "The merging of media from one or more channels.\n\nEveryone on the bridge receives the same audio.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for this bridge", + "required": true + }, + "technology": { + "type": "string", + "description": "Name of the current bridging technology", + "required": true + }, + "bridge_type": { + "type": "string", + "description": "Type of bridge technology", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "mixing", + "holding" + ] + } + }, + "bridge_class": { + "type": "string", + "description": "Bridging class", + "required": true + }, + "creator": { + "type": "string", + "description": "Entity that created the bridge", + "required": true + }, + "name": { + "type": "string", + "description": "Name the creator gave the bridge", + "required": true + }, + "channels": { + "type": "List[string]", + "description": "Ids of channels participating in this bridge", + "required": true + }, + "video_mode": { + "type": "string", + "description": "The video mode the bridge is using. One of 'none', 'talker', 'sfu', or 'single'.", + "required": false + }, + "video_source_id": { + "type": "string", + "description": "The ID of the channel that is the source of video in this bridge, if one exists.", + "required": false + }, + "creationtime": { + "required": true, + "type": "Date", + "description": "Timestamp when bridge was created" + } + } + } + } +} diff --git a/codegen/src/main/resources/codegen-data/ari_10_0_0/channels.json b/codegen/src/main/resources/codegen-data/ari_10_0_0/channels.json new file mode 100644 index 00000000..ab4a0421 --- /dev/null +++ b/codegen/src/main/resources/codegen-data/ari_10_0_0/channels.json @@ -0,0 +1,2203 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "2.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/channels.{format}", + "requiresModules": [ + "res_stasis_answer", + "res_stasis_playback", + "res_stasis_recording", + "res_stasis_snoop" + ], + "apis": [ + { + "path": "/channels", + "description": "Active channels", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all active channels in Asterisk.", + "nickname": "list", + "responseClass": "List[Channel]" + }, + { + "httpMethod": "POST", + "summary": "Create a new channel (originate).", + "notes": "The new channel is created immediately and a snapshot of it returned. If a Stasis application is provided it will be automatically subscribed to the originated channel for further events and updates.", + "nickname": "originate", + "responseClass": "Channel", + "parameters": [ + { + "name": "endpoint", + "description": "Endpoint to call.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "extension", + "description": "The extension to dial after the endpoint answers. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "context", + "description": "The context to dial after the endpoint answers. If omitted, uses 'default'. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "priority", + "description": "The priority to dial after the endpoint answers. If omitted, uses 1. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "long" + }, + { + "name": "label", + "description": "The label to dial after the endpoint answers. Will supersede 'priority' if provided. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "app", + "description": "The application that is subscribed to the originated channel. When the channel is answered, it will be passed to this Stasis application. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application provided by 'app'. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "callerId", + "description": "CallerID to use when dialing the endpoint or extension.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "timeout", + "description": "Timeout (in seconds) before giving up dialing, or -1 for no timeout.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 30 + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds variable key/value pairs to set on the channel on creation. Other keys in the body object are interpreted as query parameters. Ex. { \"endpoint\": \"SIP/Alice\", \"variables\": { \"CALLERID(name)\": \"Alice\" } }", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + }, + { + "name": "channelId", + "description": "The unique id to assign the channel on creation.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "otherChannelId", + "description": "The unique id to assign the second channel when using local channels.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "originator", + "description": "The unique id of the channel which is originating this one.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "formats", + "description": "The format name capability list to use if originator is not specified. Ex. \"ulaw,slin16\". Format names can be found with \"core show codecs\".", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for originating a channel." + }, + { + "code": 409, + "reason": "Channel with given unique ID already exists." + } + ] + } + ] + }, + { + "path": "/channels/create", + "description": "Create a channel and place it in a Stasis app, but do not dial the channel yet.", + "operations": [ + { + "httpMethod": "POST", + "summary": "Create channel.", + "nickname": "create", + "responseClass": "Channel", + "parameters": [ + { + "name": "endpoint", + "description": "Endpoint for channel communication", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "app", + "description": "Stasis Application to place channel into", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application provided by 'app'. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "channelId", + "description": "The unique id to assign the channel on creation.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "otherChannelId", + "description": "The unique id to assign the second channel when using local channels.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "originator", + "description": "Unique ID of the calling channel", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "formats", + "description": "The format name capability list to use if originator is not specified. Ex. \"ulaw,slin16\". Format names can be found with \"core show codecs\".", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds variable key/value pairs to set on the channel on creation. Other keys in the body object are interpreted as query parameters. Ex. { \"endpoint\": \"SIP/Alice\", \"variables\": { \"CALLERID(name)\": \"Alice\" } }", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + } + ], + "errorResponses": [ + { + "code": 409, + "reason": "Channel with given unique ID already exists." + } + ] + } + ] + }, + { + "path": "/channels/{channelId}", + "description": "Active channel", + "operations": [ + { + "httpMethod": "GET", + "summary": "Channel details.", + "nickname": "get", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + } + ] + }, + { + "httpMethod": "POST", + "summary": "Create a new channel (originate with id).", + "notes": "The new channel is created immediately and a snapshot of it returned. If a Stasis application is provided it will be automatically subscribed to the originated channel for further events and updates.", + "nickname": "originateWithId", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "The unique id to assign the channel on creation.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "endpoint", + "description": "Endpoint to call.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "extension", + "description": "The extension to dial after the endpoint answers. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "context", + "description": "The context to dial after the endpoint answers. If omitted, uses 'default'. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "priority", + "description": "The priority to dial after the endpoint answers. If omitted, uses 1. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "long" + }, + { + "name": "label", + "description": "The label to dial after the endpoint answers. Will supersede 'priority' if provided. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "app", + "description": "The application that is subscribed to the originated channel. When the channel is answered, it will be passed to this Stasis application. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application provided by 'app'. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "callerId", + "description": "CallerID to use when dialing the endpoint or extension.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "timeout", + "description": "Timeout (in seconds) before giving up dialing, or -1 for no timeout.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 30 + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds variable key/value pairs to set on the channel on creation. Other keys in the body object are interpreted as query parameters. Ex. { \"endpoint\": \"SIP/Alice\", \"variables\": { \"CALLERID(name)\": \"Alice\" } }", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + }, + { + "name": "otherChannelId", + "description": "The unique id to assign the second channel when using local channels.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "originator", + "description": "The unique id of the channel which is originating this one.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "formats", + "description": "The format name capability list to use if originator is not specified. Ex. \"ulaw,slin16\". Format names can be found with \"core show codecs\".", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for originating a channel." + }, + { + "code": 409, + "reason": "Channel with given unique ID already exists." + } + ] + + }, + { + "httpMethod": "DELETE", + "summary": "Delete (i.e. hangup) a channel.", + "nickname": "hangup", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "reason_code", + "description": "The reason code for hanging up the channel for detail use. Mutually exclusive with 'reason'. See detail hangup codes at here. https://docs.asterisk.org/Configuration/Miscellaneous/Hangup-Cause-Mappings/", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "reason", + "description": "Reason for hanging up the channel for simple use. Mutually exclusive with 'reason_code'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "normal", + "busy", + "congestion", + "no_answer", + "timeout", + "rejected", + "unallocated", + "normal_unspecified", + "number_incomplete", + "codec_mismatch", + "interworking", + "failure", + "answered_elsewhere" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid reason for hangup provided" + }, + { + "code": 404, + "reason": "Channel not found" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/continue", + "description": "Exit application; continue execution in the dialplan", + "operations": [ + { + "httpMethod": "POST", + "summary": "Exit application; continue execution in the dialplan.", + "nickname": "continueInDialplan", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "context", + "description": "The context to continue to.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "extension", + "description": "The extension to continue to.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "priority", + "description": "The priority to continue to.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "label", + "description": "The label to continue to - will supersede 'priority' if both are provided.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/move", + "description": "Move the channel from one Stasis application to another.", + "operations": [ + { + "httpMethod": "POST", + "summary": "Move the channel from one Stasis application to another.", + "nickname": "move", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "app", + "description": "The channel will be passed to this Stasis application.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application provided by 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": "404", + "reason": "Channel not found" + }, + { + "code": "409", + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/redirect", + "description": "Inform the channel that it should redirect itself to a different location. Note that this will almost certainly cause the channel to exit the application.", + "operations": [ + { + "httpMethod": "POST", + "summary": "Redirect the channel to a different location.", + "nickname": "redirect", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "endpoint", + "description": "The endpoint to redirect the channel to", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Endpoint parameter not provided" + }, + { + "code": 404, + "reason": "Channel or endpoint not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 422, + "reason": "Endpoint is not the same type as the channel" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/answer", + "description": "Answer a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Answer a channel.", + "nickname": "answer", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/ring", + "description": "Send a ringing indication to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Indicate ringing to a channel.", + "nickname": "ring", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop ringing indication on a channel if locally generated.", + "nickname": "ringStop", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/dtmf", + "description": "Send DTMF to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Send provided DTMF to a given channel.", + "nickname": "sendDTMF", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "dtmf", + "description": "DTMF To send.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "before", + "description": "Amount of time to wait before DTMF digits (specified in milliseconds) start.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0 + }, + { + "name": "between", + "description": "Amount of time in between DTMF digits (specified in milliseconds).", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 100 + }, + { + "name": "duration", + "description": "Length of each DTMF digit (specified in milliseconds).", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 100 + }, + { + "name": "after", + "description": "Amount of time to wait after DTMF digits (specified in milliseconds) end.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0 + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "DTMF is required" + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/mute", + "description": "Mute a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Mute a channel.", + "nickname": "mute", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "direction", + "description": "Direction in which to mute audio", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "both", + "allowableValues": { + "valueType": "LIST", + "values": [ + "both", + "in", + "out" + ] + } + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unmute a channel.", + "nickname": "unmute", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "direction", + "description": "Direction in which to unmute audio", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "both", + "allowableValues": { + "valueType": "LIST", + "values": [ + "both", + "in", + "out" + ] + } + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/hold", + "description": "Put a channel on hold", + "operations": [ + { + "httpMethod": "POST", + "summary": "Hold a channel.", + "nickname": "hold", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Remove a channel from hold.", + "nickname": "unhold", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/moh", + "description": "Play music on hold to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Play music on hold to a channel.", + "notes": "Using media operations such as /play on a channel playing MOH in this manner will suspend MOH without resuming automatically. If continuing music on hold is desired, the stasis application must reinitiate music on hold.", + "nickname": "startMoh", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "mohClass", + "description": "Music on hold class to use", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop playing music on hold to a channel.", + "nickname": "stopMoh", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/silence", + "description": "Play silence to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Play silence to a channel.", + "notes": "Using media operations such as /play on a channel playing silence in this manner will suspend silence without resuming automatically.", + "nickname": "startSilence", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop playing silence to a channel.", + "nickname": "stopSilence", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/play", + "description": "Play media to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start playback of media.", + "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "play", + "responseClass": "Playback", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media URIs to play.", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of milliseconds to skip before playing. Only applies to the first URI if multiple media URIs are specified.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000 + }, + { + "name": "playbackId", + "description": "Playback ID.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/play/{playbackId}", + "description": "Play media to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start playback of media and specify the playbackId.", + "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "playWithId", + "responseClass": "Playback", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "playbackId", + "description": "Playback ID.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media URIs to play.", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of milliseconds to skip before playing. Only applies to the first URI if multiple media URIs are specified.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000 + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/record", + "description": "Record audio from a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start a recording.", + "notes": "Record audio from a channel. Note that this will not capture audio sent to the channel. The bridge itself has a record feature if that's what you want.", + "nickname": "record", + "responseClass": "LiveRecording", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Recording's filename", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "format", + "description": "Format to encode audio in", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "maxDurationSeconds", + "description": "Maximum duration of the recording, in seconds. 0 for no limit", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "maxSilenceSeconds", + "description": "Maximum duration of silence, in seconds. 0 for no limit", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "ifExists", + "description": "Action to take if a recording with the same name already exists.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "fail", + "allowableValues": { + "valueType": "LIST", + "values": [ + "fail", + "overwrite", + "append" + ] + } + }, + { + "name": "beep", + "description": "Play beep when recording begins", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean", + "defaultValue": false + }, + { + "name": "terminateOn", + "description": "DTMF input to terminate recording", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "any", + "*", + "#" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel is not in a Stasis application; the channel is currently bridged with other hcannels; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail" + }, + { + "code": 422, + "reason": "The format specified is unknown on this system" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/variable", + "description": "Variables on a channel", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get the value of a channel variable or function.", + "nickname": "getChannelVar", + "responseClass": "Variable", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variable", + "description": "The channel variable or function to get", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + }, + { + "code": 404, + "reason": "Channel or variable not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "POST", + "summary": "Set the value of a channel variable or function.", + "nickname": "setChannelVar", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variable", + "description": "The channel variable or function to set", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "value", + "description": "The value to set the variable to", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/snoop", + "description": "Snoop (spy/whisper) on a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start snooping.", + "notes": "Snoop (spy/whisper) on a specific channel.", + "nickname": "snoopChannel", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "spy", + "description": "Direction of audio to spy on", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "whisper", + "description": "Direction of audio to whisper into", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "app", + "description": "Application the snooping channel is placed into", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "snoopId", + "description": "Unique ID to assign to snooping channel", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Channel not found" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/snoop/{snoopId}", + "description": "Snoop (spy/whisper) on a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start snooping.", + "notes": "Snoop (spy/whisper) on a specific channel.", + "nickname": "snoopChannelWithId", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "snoopId", + "description": "Unique ID to assign to snooping channel", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "spy", + "description": "Direction of audio to spy on", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "whisper", + "description": "Direction of audio to whisper into", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "app", + "description": "Application the snooping channel is placed into", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Channel not found" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/dial", + "description": "Dial a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Dial a created channel.", + "nickname": "dial", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "caller", + "description": "Channel ID of caller", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "timeout", + "description": "Dial timeout", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel cannot be found." + }, + { + "code": 409, + "reason": "Channel cannot be dialed." + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/rtp_statistics", + "description": "Get RTP statistics information for RTP on a channel", + "operations": [ + { + "httpMethod": "GET", + "summary": "RTP stats on a channel.", + "nickname": "rtpstatistics", + "responseClass": "RTPstat", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel cannot be found." + } + ] + } + ] + }, + { + "path": "/channels/externalMedia", + "description": "Create a channel to an External Media source/sink.", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start an External Media session.", + "notes": "Create a channel to an External Media source/sink.", + "nickname": "externalMedia", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "The unique id to assign the channel on creation.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "app", + "description": "Stasis Application to place channel into", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds variable key/value pairs to set on the channel on creation. Other keys in the body object are interpreted as query parameters. Ex. { \"endpoint\": \"SIP/Alice\", \"variables\": { \"CALLERID(name)\": \"Alice\" } }", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + }, + { + "name": "external_host", + "description": "Hostname/ip:port of external host", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "encapsulation", + "description": "Payload encapsulation protocol", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "rtp", + "allowableValues": { + "valueType": "LIST", + "values": [ + "rtp", + "audiosocket" + ] + } + }, + { + "name": "transport", + "description": "Transport protocol", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "udp", + "allowableValues": { + "valueType": "LIST", + "values": [ + "udp", + "tcp" + ] + } + }, + { + "name": "connection_type", + "description": "Connection type (client/server)", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "client", + "allowableValues": { + "valueType": "LIST", + "values": [ + "client" + ] + } + }, + { + "name": "format", + "description": "Format to encode audio in", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "direction", + "description": "External media direction", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "both", + "allowableValues": { + "valueType": "LIST", + "values": [ + "both" + ] + } + }, + { + "name": "data", + "description": "An arbitrary data field", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 409, + "reason": "Channel is not in a Stasis application; Channel is already bridged" + } + ] + } + ] + } + ], + "models": { + "Dialed": { + "id": "Dialed", + "description": "Dialed channel information.", + "properties": {} + }, + "DialplanCEP": { + "id": "DialplanCEP", + "description": "Dialplan location (context/extension/priority)", + "properties": { + "context": { + "required": true, + "type": "string", + "description": "Context in the dialplan" + }, + "exten": { + "required": true, + "type": "string", + "description": "Extension in the dialplan" + }, + "priority": { + "required": true, + "type": "long", + "description": "Priority in the dialplan" + }, + "app_name": { + "required": true, + "type": "string", + "description": "Name of current dialplan application" + }, + "app_data": { + "required": true, + "type": "string", + "description": "Parameter of current dialplan application" + } + } + }, + "CallerID": { + "id": "CallerID", + "description": "Caller identification", + "properties": { + "name": { + "required": true, + "type": "string" + }, + "number": { + "required": true, + "type": "string" + } + } + }, + "RTPstat": { + "id": "RTPstat", + "description": "A statistics of a RTP.", + "properties": { + "txcount": { + "required": true, + "type": "int", + "description": "Number of packets transmitted." + }, + "rxcount": { + "required": true, + "type": "int", + "description": "Number of packets received." + }, + "txjitter": { + "required": false, + "type": "double", + "description": "Jitter on transmitted packets." + }, + "rxjitter": { + "required": false, + "type": "double", + "description": "Jitter on received packets." + }, + "remote_maxjitter": { + "required": false, + "type": "double", + "description": "Maximum jitter on remote side." + }, + "remote_minjitter": { + "required": false, + "type": "double", + "description": "Minimum jitter on remote side." + }, + "remote_normdevjitter": { + "required": false, + "type": "double", + "description": "Average jitter on remote side." + }, + "remote_stdevjitter": { + "required": false, + "type": "double", + "description": "Standard deviation jitter on remote side." + }, + "local_maxjitter": { + "required": false, + "type": "double", + "description": "Maximum jitter on local side." + }, + "local_minjitter": { + "required": false, + "type": "double", + "description": "Minimum jitter on local side." + }, + "local_normdevjitter": { + "required": false, + "type": "double", + "description": "Average jitter on local side." + }, + "local_stdevjitter": { + "required": false, + "type": "double", + "description": "Standard deviation jitter on local side." + }, + "txploss": { + "required": true, + "type": "int", + "description": "Number of transmitted packets lost." + }, + "rxploss": { + "required": true, + "type": "int", + "description": "Number of received packets lost." + }, + "remote_maxrxploss": { + "required": false, + "type": "double", + "description": "Maximum number of packets lost on remote side." + }, + "remote_minrxploss": { + "required": false, + "type": "double", + "description": "Minimum number of packets lost on remote side." + }, + "remote_normdevrxploss": { + "required": false, + "type": "double", + "description": "Average number of packets lost on remote side." + }, + "remote_stdevrxploss": { + "required": false, + "type": "double", + "description": "Standard deviation packets lost on remote side." + }, + "local_maxrxploss": { + "required": false, + "type": "double", + "description": "Maximum number of packets lost on local side." + }, + "local_minrxploss": { + "required": false, + "type": "double", + "description": "Minimum number of packets lost on local side." + }, + "local_normdevrxploss": { + "required": false, + "type": "double", + "description": "Average number of packets lost on local side." + }, + "local_stdevrxploss": { + "required": false, + "type": "double", + "description": "Standard deviation packets lost on local side." + }, + "rtt": { + "required": false, + "type": "double", + "description": "Total round trip time." + }, + "maxrtt": { + "required": false, + "type": "double", + "description": "Maximum round trip time." + }, + "minrtt": { + "required": false, + "type": "double", + "description": "Minimum round trip time." + }, + "normdevrtt": { + "required": false, + "type": "double", + "description": "Average round trip time." + }, + "stdevrtt": { + "required": false, + "type": "double", + "description": "Standard deviation round trip time." + }, + "local_ssrc": { + "required": true, + "type": "int", + "description": "Our SSRC." + }, + "remote_ssrc": { + "required": true, + "type": "int", + "description": "Their SSRC." + }, + "txoctetcount": { + "required": true, + "type": "int", + "description": "Number of octets transmitted." + }, + "rxoctetcount": { + "required": true, + "type": "int", + "description": "Number of octets received." + }, + "channel_uniqueid": { + "required": true, + "type": "string", + "description": "The Asterisk channel's unique ID that owns this instance." + } + } + }, + "Channel": { + "id": "Channel", + "description": "A specific communication connection between Asterisk and an Endpoint.", + "properties": { + "id": { + "required": true, + "type": "string", + "description": "Unique identifier of the channel.\n\nThis is the same as the Uniqueid field in AMI." + }, + "protocol_id": { + "required": true, + "type": "string", + "description": "Protocol id from underlying channel driver (i.e. Call-ID for chan_pjsip; will be empty if not applicable or not implemented by driver)." + }, + "name": { + "required": true, + "type": "string", + "description": "Name of the channel (i.e. SIP/foo-0000a7e3)" + }, + "state": { + "required": true, + "type": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "Down", + "Rsrved", + "OffHook", + "Dialing", + "Ring", + "Ringing", + "Up", + "Busy", + "Dialing Offhook", + "Pre-ring", + "Unknown" + ] + } + }, + "caller": { + "required": true, + "type": "CallerID" + }, + "connected": { + "required": true, + "type": "CallerID" + }, + "accountcode": { + "required": true, + "type": "string" + }, + "dialplan": { + "required": true, + "type": "DialplanCEP", + "description": "Current location in the dialplan" + }, + "creationtime": { + "required": true, + "type": "Date", + "description": "Timestamp when channel was created" + }, + "language": { + "required": true, + "type": "string", + "description": "The default spoken language" + }, + "channelvars": { + "required": false, + "type": "object", + "description": "Channel variables" + }, + "caller_rdnis": { + "type": "string", + "description": "The Caller ID RDNIS" + }, + "tenantid": { + "required": false, + "type": "string", + "description": "The Tenant ID for the channel" + } + } + } + } +} diff --git a/codegen/src/main/resources/codegen-data/ari_10_0_0/deviceStates.json b/codegen/src/main/resources/codegen-data/ari_10_0_0/deviceStates.json new file mode 100644 index 00000000..bd389355 --- /dev/null +++ b/codegen/src/main/resources/codegen-data/ari_10_0_0/deviceStates.json @@ -0,0 +1,154 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "Kevin Harwell ", + "_svn_revision": "$Revision$", + "apiVersion": "2.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/deviceStates.{format}", + "requiresModules": [ + "res_stasis_device_state" + ], + "apis": [ + { + "path": "/deviceStates", + "description": "Device states", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all ARI controlled device states.", + "nickname": "list", + "responseClass": "List[DeviceState]" + } + ] + }, + { + "path": "/deviceStates/{deviceName}", + "description": "Device state", + "operations": [ + { + "httpMethod": "GET", + "summary": "Retrieve the current state of a device.", + "nickname": "get", + "responseClass": "DeviceState", + "parameters": [ + { + "name": "deviceName", + "description": "Name of the device", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ] + }, + { + "httpMethod": "PUT", + "summary": "Change the state of a device controlled by ARI. (Note - implicitly creates the device state).", + "nickname": "update", + "responseClass": "void", + "parameters": [ + { + "name": "deviceName", + "description": "Name of the device", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "deviceState", + "description": "Device state value", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "NOT_INUSE", + "INUSE", + "BUSY", + "INVALID", + "UNAVAILABLE", + "RINGING", + "RINGINUSE", + "ONHOLD" + ] + } + + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Device name is missing" + }, + { + "code": 409, + "reason": "Uncontrolled device specified" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Destroy a device-state controlled by ARI.", + "nickname": "delete", + "responseClass": "void", + "parameters": [ + { + "name": "deviceName", + "description": "Name of the device", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Device name is missing" + }, + { + "code": 409, + "reason": "Uncontrolled device specified" + } + ] + } + ] + } + ], + "models": { + "DeviceState": { + "id": "DeviceState", + "description": "Represents the state of a device.", + "properties": { + "name": { + "type": "string", + "description": "Name of the device.", + "required": true + }, + "state": { + "type": "string", + "description": "Device's state", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "UNKNOWN", + "NOT_INUSE", + "INUSE", + "BUSY", + "INVALID", + "UNAVAILABLE", + "RINGING", + "RINGINUSE", + "ONHOLD" + ] + } + } + } + } + } +} diff --git a/codegen/src/main/resources/codegen-data/ari_10_0_0/endpoints.json b/codegen/src/main/resources/codegen-data/ari_10_0_0/endpoints.json new file mode 100644 index 00000000..3f3f98ce --- /dev/null +++ b/codegen/src/main/resources/codegen-data/ari_10_0_0/endpoints.json @@ -0,0 +1,397 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "2.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/endpoints.{format}", + "apis": [ + { + "path": "/endpoints", + "description": "Asterisk endpoints", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all endpoints.", + "nickname": "list", + "responseClass": "List[Endpoint]" + } + ] + }, + { + "path": "/endpoints/sendMessage", + "description": "Send a message to some technology URI or endpoint.", + "operations": [ + { + "httpMethod": "PUT", + "summary": "Send a message to some technology URI or endpoint.", + "nickname": "sendMessage", + "responseClass": "void", + "parameters": [ + { + "name": "to", + "description": "The endpoint resource or technology specific URI to send the message to. Valid resources are pjsip, and xmpp.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "from", + "description": "The endpoint resource or technology specific identity to send this message from. Valid resources are pjsip, and xmpp.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "body", + "description": "The body of the message", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variables", + "descriptioni": "The \"variables\" key in the body object holds technology specific key/value pairs to append to the message. These can be interpreted and used by the various resource types; for example, pjsip and sip resource types will add the key/value pairs as SIP headers,", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for sending a message." + }, + { + "code": 404, + "reason": "Endpoint not found" + } + ] + } + ] + }, + { + "path": "/endpoints/refer", + "description": "Refer an endpoint or technology URI to some technology URI or endpoint.", + "operations": [ + { + "httpMethod": "POST", + "summary": "Refer an endpoint or technology URI to some technology URI or endpoint.", + "nickname": "refer", + "responseClass": "void", + "parameters": [ + { + "name": "to", + "description": "The endpoint resource or technology specific URI that should be referred to somewhere. Valid resource is pjsip.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "from", + "description": "The endpoint resource or technology specific identity to refer from.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "refer_to", + "description": "The endpoint resource or technology specific URI to refer to.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "to_self", + "description": "If true and \"refer_to\" refers to an Asterisk endpoint, the \"refer_to\" value is set to point to this Asterisk endpoint - so the referee is referred to Asterisk. Otherwise, use the contact URI associated with the endpoint.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean", + "defaultValue": false + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds technology specific key/value pairs to append to the message. These can be interpreted and used by the various resource types; for example, the pjsip resource type will add the key/value pairs as SIP headers. The \"display_name\" key is used by the PJSIP technology. Its value will be prepended as a display name to the Refer-To URI.", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for referring." + }, + { + "code": 404, + "reason": "Endpoint not found" + } + ] + } + ] + }, + { + "path": "/endpoints/{tech}", + "description": "Asterisk endpoints", + "operations": [ + { + "httpMethod": "GET", + "summary": "List available endoints for a given endpoint technology.", + "nickname": "listByTech", + "responseClass": "List[Endpoint]", + "parameters": [ + { + "name": "tech", + "description": "Technology of the endpoints (pjsip,iax2,...)", + "paramType": "path", + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Endpoints not found" + } + ] + } + ] + }, + { + "path": "/endpoints/{tech}/{resource}", + "description": "Single endpoint", + "operations": [ + { + "httpMethod": "GET", + "summary": "Details for an endpoint.", + "nickname": "get", + "responseClass": "Endpoint", + "parameters": [ + { + "name": "tech", + "description": "Technology of the endpoint", + "paramType": "path", + "dataType": "string" + }, + { + "name": "resource", + "description": "ID of the endpoint", + "paramType": "path", + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for sending a message." + }, + { + "code": 404, + "reason": "Endpoints not found" + } + ] + } + ] + }, + { + "path": "/endpoints/{tech}/{resource}/sendMessage", + "description": "Send a message to some endpoint in a technology.", + "operations": [ + { + "httpMethod": "PUT", + "summary": "Send a message to some endpoint in a technology.", + "nickname": "sendMessageToEndpoint", + "responseClass": "void", + "parameters": [ + { + "name": "tech", + "description": "Technology of the endpoint", + "paramType": "path", + "dataType": "string" + }, + { + "name": "resource", + "description": "ID of the endpoint", + "paramType": "path", + "dataType": "string" + }, + { + "name": "from", + "description": "The endpoint resource or technology specific identity to send this message from. Valid resources are pjsip and xmpp.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "body", + "description": "The body of the message", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variables", + "descriptioni": "The \"variables\" key in the body object holds technology specific key/value pairs to append to the message. These can be interpreted and used by the various resource types; for example, pjsip and sip resource types will add the key/value pairs as SIP headers,", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for sending a message." + }, + { + "code": 404, + "reason": "Endpoint not found" + } + ] + } + ] + }, + { + "path": "/endpoints/{tech}/{resource}/refer", + "description": "Refer an endpoint in a technology to some technology URI or endpoint..", + "operations": [ + { + "httpMethod": "POST", + "summary": "Refer an endpoint or technology URI to some technology URI or endpoint.", + "nickname": "referToEndpoint", + "responseClass": "void", + "parameters": [ + { + "name": "tech", + "description": "Technology of the endpoint", + "paramType": "path", + "dataType": "string" + }, + { + "name": "resource", + "description": "ID of the endpoint", + "paramType": "path", + "dataType": "string" + }, + { + "name": "from", + "description": "The endpoint resource or technology specific identity to refer from.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "refer_to", + "description": "The endpoint resource or technology specific URI to refer to.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "to_self", + "description": "If true and \"refer_to\" refers to an Asterisk endpoint, the \"refer_to\" value is set to point to this Asterisk endpoint - so the referee is referred to Asterisk. Otherwise, use the contact URI associated with the endpoint.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean", + "defaultValue": false + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds technology specific key/value pairs to append to the message. These can be interpreted and used by the various resource types; for example, the pjsip resource type will add the key/value pairs as SIP headers,", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for referring." + }, + { + "code": 404, + "reason": "Endpoint not found" + } + ] + } + ] + } + ], + "models": { + "Endpoint": { + "id": "Endpoint", + "description": "An external device that may offer/accept calls to/from Asterisk.\n\nUnlike most resources, which have a single unique identifier, an endpoint is uniquely identified by the technology/resource pair.", + "properties": { + "technology": { + "type": "string", + "description": "Technology of the endpoint", + "required": true + }, + "resource": { + "type": "string", + "description": "Identifier of the endpoint, specific to the given technology.", + "required": true + }, + "state": { + "type": "string", + "description": "Endpoint's state", + "required": false, + "allowableValues": { + "valueType": "LIST", + "values": [ + "unknown", + "offline", + "online" + ] + } + }, + "channel_ids": { + "type": "List[string]", + "description": "Id's of channels associated with this endpoint", + "required": true + } + } + }, + "TextMessage": { + "id": "TextMessage", + "description": "A text message.", + "properties": { + "from": { + "type": "string", + "description": "A technology specific URI specifying the source of the message. For pjsip technology, any SIP URI can be specified. For xmpp, the URI must correspond to the client connection being used to send the message.", + "required": true + }, + "to": { + "type": "string", + "description": "A technology specific URI specifying the destination of the message. Valid technologies include pjsip, and xmp. The destination of a message should be an endpoint.", + "required": true + }, + "body": { + "type": "string", + "description": "The text of the message.", + "required": true + }, + "variables": { + "type": "object", + "description": "Technology specific key/value pairs (JSON object) associated with the message.", + "required": false + } + } + } + } +} diff --git a/codegen/src/main/resources/codegen-data/ari_10_0_0/events.json b/codegen/src/main/resources/codegen-data/ari_10_0_0/events.json new file mode 100644 index 00000000..2bd1eeab --- /dev/null +++ b/codegen/src/main/resources/codegen-data/ari_10_0_0/events.json @@ -0,0 +1,930 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "2.0.0", + "swaggerVersion": "1.2", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/events.{format}", + "requiresModules": [ + "res_http_websocket" + ], + "apis": [ + { + "path": "/events", + "description": "Events from Asterisk to applications", + "operations": [ + { + "httpMethod": "GET", + "upgrade": "websocket", + "websocketProtocol": "ari", + "summary": "WebSocket connection for events.", + "nickname": "eventWebsocket", + "responseClass": "Message", + "parameters": [ + { + "name": "app", + "description": "Applications to subscribe to.", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + }, + { + "name": "subscribeAll", + "description": "Subscribe to all Asterisk events. If provided, the applications listed will be subscribed to all events, effectively disabling the application specific subscriptions. Default is 'false'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean" + } + ] + } + ] + }, + { + "path": "/events/user/{eventName}", + "description": "Stasis application user events", + "operations": [ + { + "httpMethod": "POST", + "summary": "Generate a user event.", + "nickname": "userEvent", + "responseClass": "void", + "parameters": [ + { + "name": "eventName", + "description": "Event name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "application", + "description": "The name of the application that will receive this event", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "source", + "description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}, deviceState:{deviceName}", + "paramType": "query", + "required": false, + "allowMultiple": true, + "dataType": "string" + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds custom key/value pairs to add to the user event. Ex. { \"variables\": { \"key\": \"value\" } }", + "paramType": "body", + "required": false, + "allowMultiple": false, + "dataType": "containers" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Application does not exist." + }, + { + "code": 422, + "reason": "Event source not found." + }, + { + "code": 400, + "reason": "Invalid even tsource URI or userevent data." + } + ] + } + ] + } + ], + "models": { + "Message": { + "id": "Message", + "description": "Base type for errors and events", + "discriminator": "type", + "properties": { + "type": { + "type": "string", + "required": true, + "description": "Indicates the type of this message." + }, + "asterisk_id": { + "type": "string", + "required": false, + "description": "The unique ID for the Asterisk instance that raised this event." + } + }, + "subTypes": [ + "MissingParams", + "Event" + ] + }, + "MissingParams": { + "id": "MissingParams", + "description": "Error event sent when required params are missing.", + "properties": { + "params": { + "required": true, + "type": "List[string]", + "description": "A list of the missing parameters" + } + } + }, + "Event": { + "id": "Event", + "description": "Base type for asynchronous events from Asterisk.", + "properties": { + "application": { + "type": "string", + "description": "Name of the application receiving the event.", + "required": true + }, + "timestamp": { + "type": "Date", + "description": "Time at which this event was created.", + "required": true + } + }, + "subTypes": [ + "DeviceStateChanged", + "PlaybackStarted", + "PlaybackContinuing", + "PlaybackFinished", + "RecordingStarted", + "RecordingFinished", + "RecordingFailed", + "ApplicationMoveFailed", + "ApplicationReplaced", + "BridgeCreated", + "BridgeDestroyed", + "BridgeMerged", + "BridgeBlindTransfer", + "BridgeAttendedTransfer", + "BridgeVideoSourceChanged", + "ChannelCreated", + "ChannelDestroyed", + "ChannelEnteredBridge", + "ChannelLeftBridge", + "ChannelStateChange", + "ChannelDtmfReceived", + "ChannelDialplan", + "ChannelCallerId", + "ChannelUserevent", + "ChannelHangupRequest", + "ChannelVarset", + "ChannelToneDetected", + "ChannelTalkingStarted", + "ChannelTalkingFinished", + "ChannelHold", + "ChannelUnhold", + "ContactStatusChange", + "EndpointStateChange", + "Dial", + "StasisEnd", + "StasisStart", + "TextMessageReceived", + "ChannelConnectedLine", + "PeerStatusChange" + ] + }, + "ContactInfo": { + "id": "ContactInfo", + "description": "Detailed information about a contact on an endpoint.", + "properties": { + "uri": { + "type": "string", + "description": "The location of the contact.", + "required": true + }, + "contact_status": { + "type": "string", + "description": "The current status of the contact.", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "Unreachable", + "Reachable", + "Unknown", + "NonQualified", + "Removed" + ] + } + }, + "aor": { + "type": "string", + "description": "The Address of Record this contact belongs to.", + "required": true + }, + "roundtrip_usec": { + "type": "string", + "description": "Current round trip time, in microseconds, for the contact.", + "required": false + } + } + }, + "Peer": { + "id": "Peer", + "description": "Detailed information about a remote peer that communicates with Asterisk.", + "properties": { + "peer_status": { + "type": "string", + "description": "The current state of the peer. Note that the values of the status are dependent on the underlying peer technology.", + "required": true + }, + "cause": { + "type": "string", + "description": "An optional reason associated with the change in peer_status.", + "required": false + }, + "address": { + "type": "string", + "description": "The IP address of the peer.", + "required": false + }, + "port": { + "type": "string", + "description": "The port of the peer.", + "required": false + }, + "time": { + "type": "string", + "description": "The last known time the peer was contacted.", + "required": false + } + } + }, + "DeviceStateChanged": { + "id": "DeviceStateChanged", + "description": "Notification that a device state has changed.", + "properties": { + "device_state": { + "type": "DeviceState", + "description": "Device state object", + "required": true + } + } + }, + "PlaybackStarted": { + "id": "PlaybackStarted", + "description": "Event showing the start of a media playback operation.", + "properties": { + "playback": { + "type": "Playback", + "description": "Playback control object", + "required": true + } + } + }, + "PlaybackContinuing": { + "id": "PlaybackContinuing", + "description": "Event showing the continuation of a media playback operation from one media URI to the next in the list.", + "properties": { + "playback": { + "type": "Playback", + "description": "Playback control object", + "required": true + } + } + }, + "PlaybackFinished": { + "id": "PlaybackFinished", + "description": "Event showing the completion of a media playback operation.", + "properties": { + "playback": { + "type": "Playback", + "description": "Playback control object", + "required": true + } + } + }, + "RecordingStarted": { + "id": "RecordingStarted", + "description": "Event showing the start of a recording operation.", + "properties": { + "recording": { + "type": "LiveRecording", + "description": "Recording control object", + "required": true + } + } + }, + "RecordingFinished": { + "id": "RecordingFinished", + "description": "Event showing the completion of a recording operation.", + "properties": { + "recording": { + "type": "LiveRecording", + "description": "Recording control object", + "required": true + } + } + }, + "RecordingFailed": { + "id": "RecordingFailed", + "description": "Event showing failure of a recording operation.", + "properties": { + "recording": { + "type": "LiveRecording", + "description": "Recording control object", + "required": true + } + } + }, + "ApplicationMoveFailed": { + "id": "ApplicationMoveFailed", + "description": "Notification that trying to move a channel to another Stasis application failed.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + }, + "destination": { + "required": true, + "type": "string" + }, + "args": { + "required": true, + "type": "List[string]", + "description": "Arguments to the application" + } + } + }, + "ApplicationReplaced": { + "id": "ApplicationReplaced", + "description": "Notification that another WebSocket has taken over for an application.\n\nAn application may only be subscribed to by a single WebSocket at a time. If multiple WebSockets attempt to subscribe to the same application, the newer WebSocket wins, and the older one receives this event.", + "properties": {} + }, + "BridgeCreated": { + "id": "BridgeCreated", + "description": "Notification that a bridge has been created.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + } + } + }, + "BridgeDestroyed": { + "id": "BridgeDestroyed", + "description": "Notification that a bridge has been destroyed.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + } + } + }, + "BridgeMerged": { + "id": "BridgeMerged", + "description": "Notification that one bridge has merged into another.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "bridge_from": { + "required": true, + "type": "Bridge" + } + } + }, + "BridgeVideoSourceChanged": { + "id": "BridgeVideoSourceChanged", + "description": "Notification that the source of video in a bridge has changed.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "old_video_source_id": { + "required": false, + "type": "string" + } + } + }, + "BridgeBlindTransfer": { + "id": "BridgeBlindTransfer", + "description": "Notification that a blind transfer has occurred.", + "properties": { + "channel": { + "description": "The channel performing the blind transfer", + "required": true, + "type": "Channel" + }, + "replace_channel": { + "description": "The channel that is replacing transferer when the transferee(s) can not be transferred directly", + "required": false, + "type": "Channel" + }, + "transferee": { + "description": "The channel that is being transferred", + "required": false, + "type": "Channel" + }, + "exten": { + "description": "The extension transferred to", + "required": true, + "type": "string" + }, + "context": { + "description": "The context transferred to", + "required": true, + "type": "string" + }, + "result": { + "description": "The result of the transfer attempt", + "required": true, + "type": "string" + }, + "is_external": { + "description": "Whether the transfer was externally initiated or not", + "required": true, + "type": "boolean" + }, + "bridge": { + "description": "The bridge being transferred", + "type": "Bridge" + } + } + }, + "BridgeAttendedTransfer": { + "id": "BridgeAttendedTransfer", + "description": "Notification that an attended transfer has occurred.", + "properties": { + "transferer_first_leg": { + "description": "First leg of the transferer", + "required": true, + "type": "Channel" + }, + "transferer_second_leg": { + "description": "Second leg of the transferer", + "required": true, + "type": "Channel" + }, + "replace_channel": { + "description": "The channel that is replacing transferer_first_leg in the swap", + "required": false, + "type": "Channel" + }, + "transferee": { + "description": "The channel that is being transferred", + "required": false, + "type": "Channel" + }, + "transfer_target": { + "description": "The channel that is being transferred to", + "required": false, + "type": "Channel" + }, + "result": { + "description": "The result of the transfer attempt", + "required": true, + "type": "string" + }, + "is_external": { + "description": "Whether the transfer was externally initiated or not", + "required": true, + "type": "boolean" + }, + "transferer_first_leg_bridge": { + "description": "Bridge the transferer first leg is in", + "type": "Bridge" + }, + "transferer_second_leg_bridge": { + "description": "Bridge the transferer second leg is in", + "type": "Bridge" + }, + "destination_type": { + "description": "How the transfer was accomplished", + "required": true, + "type": "string" + }, + "destination_bridge": { + "description": "Bridge that survived the merge result", + "type": "string" + }, + "destination_application": { + "description": "Application that has been transferred into", + "type": "string" + }, + "destination_link_first_leg": { + "description": "First leg of a link transfer result", + "type": "Channel" + }, + "destination_link_second_leg": { + "description": "Second leg of a link transfer result", + "type": "Channel" + }, + "destination_threeway_channel": { + "description": "Transferer channel that survived the threeway result", + "type": "Channel" + }, + "destination_threeway_bridge": { + "description": "Bridge that survived the threeway result", + "type": "Bridge" + } + } + }, + "ChannelCreated": { + "id": "ChannelCreated", + "description": "Notification that a channel has been created.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelDestroyed": { + "id": "ChannelDestroyed", + "description": "Notification that a channel has been destroyed.", + "properties": { + "cause": { + "required": true, + "description": "Integer representation of the cause of the hangup", + "type": "int" + }, + "cause_txt": { + "required": true, + "description": "Text representation of the cause of the hangup", + "type": "string" + }, + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelEnteredBridge": { + "id": "ChannelEnteredBridge", + "description": "Notification that a channel has entered a bridge.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "channel": { + "type": "Channel" + } + } + }, + "ChannelLeftBridge": { + "id": "ChannelLeftBridge", + "description": "Notification that a channel has left a bridge.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelStateChange": { + "id": "ChannelStateChange", + "description": "Notification of a channel's state change.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelDtmfReceived": { + "id": "ChannelDtmfReceived", + "description": "DTMF received on a channel.\n\nThis event is sent when the DTMF ends. There is no notification about the start of DTMF", + "properties": { + "digit": { + "required": true, + "type": "string", + "description": "DTMF digit received (0-9, A-E, # or *)" + }, + "duration_ms": { + "required": true, + "type": "int", + "description": "Number of milliseconds DTMF was received" + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which DTMF was received" + } + } + }, + "ChannelDialplan": { + "id": "ChannelDialplan", + "description": "Channel changed location in the dialplan.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel that changed dialplan location." + }, + "dialplan_app": { + "required": true, + "type": "string", + "description": "The application about to be executed." + }, + "dialplan_app_data": { + "required": true, + "type": "string", + "description": "The data to be passed to the application." + } + } + }, + "ChannelCallerId": { + "id": "ChannelCallerId", + "description": "Channel changed Caller ID.", + "properties": { + "caller_presentation": { + "required": true, + "type": "int", + "description": "The integer representation of the Caller Presentation value." + }, + "caller_presentation_txt": { + "required": true, + "type": "string", + "description": "The text representation of the Caller Presentation value." + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel that changed Caller ID." + } + } + }, + "ChannelUserevent": { + "id": "ChannelUserevent", + "description": "User-generated event with additional user-defined fields in the object.", + "properties": { + "eventname": { + "required": true, + "type": "string", + "description": "The name of the user event." + }, + "channel": { + "required": false, + "type": "Channel", + "description": "A channel that is signaled with the user event." + }, + "bridge": { + "required": false, + "type": "Bridge", + "description": "A bridge that is signaled with the user event." + }, + "endpoint": { + "required": false, + "type": "Endpoint", + "description": "A endpoint that is signaled with the user event." + }, + "userevent": { + "required": true, + "type": "object", + "description": "Custom Userevent data" + } + } + }, + "ChannelHangupRequest": { + "id": "ChannelHangupRequest", + "description": "A hangup was requested on the channel.", + "properties": { + "cause": { + "type": "int", + "description": "Integer representation of the cause of the hangup." + }, + "soft": { + "type": "boolean", + "description": "Whether the hangup request was a soft hangup request." + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which the hangup was requested." + } + } + }, + "ChannelVarset": { + "id": "ChannelVarset", + "description": "Channel variable changed.", + "properties": { + "variable": { + "required": true, + "type": "string", + "description": "The variable that changed." + }, + "value": { + "required": true, + "type": "string", + "description": "The new value of the variable." + }, + "channel": { + "required": false, + "type": "Channel", + "description": "The channel on which the variable was set.\n\nIf missing, the variable is a global variable." + } + } + }, + "ChannelHold": { + "id": "ChannelHold", + "description": "A channel initiated a media hold.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel that initiated the hold event." + }, + "musicclass": { + "required": false, + "type": "string", + "description": "The music on hold class that the initiator requested." + } + } + }, + "ChannelUnhold": { + "id": "ChannelUnhold", + "description": "A channel initiated a media unhold.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel that initiated the unhold event." + } + } + }, + "ChannelToneDetected": { + "id": "ChannelToneDetected", + "description": "Tone was detected on the channel.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel the tone was detected on." + } + } + }, + "ChannelTalkingStarted": { + "id": "ChannelTalkingStarted", + "description": "Talking was detected on the channel.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which talking started." + } + } + }, + "ChannelTalkingFinished": { + "id": "ChannelTalkingFinished", + "description": "Talking is no longer detected on the channel.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which talking completed." + }, + "duration": { + "required": true, + "type": "int", + "description": "The length of time, in milliseconds, that talking was detected on the channel" + } + } + }, + "ContactStatusChange": { + "id": "ContactStatusChange", + "description": "The state of a contact on an endpoint has changed.", + "properties": { + "endpoint": { + "required": true, + "type": "Endpoint" + }, + "contact_info": { + "required": true, + "type": "ContactInfo" + } + } + }, + "PeerStatusChange": { + "id": "PeerStatusChange", + "description": "The state of a peer associated with an endpoint has changed.", + "properties": { + "endpoint": { + "required": true, + "type": "Endpoint" + }, + "peer": { + "required": true, + "type": "Peer" + } + } + }, + "EndpointStateChange": { + "id": "EndpointStateChange", + "description": "Endpoint state changed.", + "properties": { + "endpoint": { + "required": true, + "type": "Endpoint" + } + } + }, + "Dial": { + "id": "Dial", + "description": "Dialing state has changed.", + "properties": { + "caller": { + "required": false, + "type": "Channel", + "description": "The calling channel." + }, + "peer": { + "required": true, + "type": "Channel", + "description": "The dialed channel." + }, + "forward": { + "required": false, + "type": "string", + "description": "Forwarding target requested by the original dialed channel." + }, + "forwarded": { + "required": false, + "type": "Channel", + "description": "Channel that the caller has been forwarded to." + }, + "dialstring": { + "required": false, + "type": "string", + "description": "The dial string for calling the peer channel." + }, + "dialstatus": { + "required": true, + "type": "string", + "description": "Current status of the dialing attempt to the peer." + } + } + }, + "StasisEnd": { + "id": "StasisEnd", + "description": "Notification that a channel has left a Stasis application.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "StasisStart": { + "id": "StasisStart", + "description": "Notification that a channel has entered a Stasis application.", + "properties": { + "args": { + "required": true, + "type": "List[string]", + "description": "Arguments to the application" + }, + "channel": { + "required": true, + "type": "Channel" + }, + "replace_channel": { + "required": false, + "type": "Channel" + } + } + }, + "TextMessageReceived": { + "id": "TextMessageReceived", + "description": "A text message was received from an endpoint.", + "properties": { + "message": { + "required": true, + "type": "TextMessage" + }, + "endpoint": { + "required": false, + "type": "Endpoint" + } + } + }, + "ChannelConnectedLine": { + "id": "ChannelConnectedLine", + "description": "Channel changed Connected Line.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel whose connected line has changed." + } + } + } + } +} diff --git a/codegen/src/main/resources/codegen-data/ari_10_0_0/mailboxes.json b/codegen/src/main/resources/codegen-data/ari_10_0_0/mailboxes.json new file mode 100644 index 00000000..8f5941b8 --- /dev/null +++ b/codegen/src/main/resources/codegen-data/ari_10_0_0/mailboxes.json @@ -0,0 +1,137 @@ +{ + "_copyright": "Copyright (C) 2013, Digium, Inc.", + "_author": "Jonathan Rose ", + "_svn_revision": "$Revision$", + "apiVersion": "2.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/mailboxes.{format}", + "requiresModules": [ + "res_stasis_mailbox" + ], + "apis": [ + { + "path": "/mailboxes", + "description": "Mailboxes", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all mailboxes.", + "nickname": "list", + "responseClass": "List[Mailbox]" + } + ] + }, + { + "path": "/mailboxes/{mailboxName}", + "description": "Mailbox state", + "operations": [ + { + "httpMethod": "GET", + "summary": "Retrieve the current state of a mailbox.", + "nickname": "get", + "responseClass": "Mailbox", + "parameters": [ + { + "name": "mailboxName", + "description": "Name of the mailbox", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Mailbox not found" + } + ] + }, + { + "httpMethod": "PUT", + "summary": "Change the state of a mailbox. (Note - implicitly creates the mailbox).", + "nickname": "update", + "responseClass": "void", + "parameters": [ + { + "name": "mailboxName", + "description": "Name of the mailbox", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "oldMessages", + "description": "Count of old messages in the mailbox", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "newMessages", + "description": "Count of new messages in the mailbox", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "int" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Mailbox not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Destroy a mailbox.", + "nickname": "delete", + "responseClass": "void", + "parameters": [ + { + "name": "mailboxName", + "description": "Name of the mailbox", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Mailbox not found" + } + ] + } + ] + } + ], + "models": { + "Mailbox": { + "id": "Mailbox", + "description": "Represents the state of a mailbox.", + "properties": { + "name": { + "type": "string", + "description": "Name of the mailbox.", + "required": true + }, + "old_messages": { + "type": "int", + "description": "Count of old messages in the mailbox.", + "required": true + }, + "new_messages": { + "type": "int", + "description": "Count of new messages in the mailbox.", + "required": true + } + } + } + } +} diff --git a/codegen/src/main/resources/codegen-data/ari_10_0_0/playbacks.json b/codegen/src/main/resources/codegen-data/ari_10_0_0/playbacks.json new file mode 100644 index 00000000..793986fc --- /dev/null +++ b/codegen/src/main/resources/codegen-data/ari_10_0_0/playbacks.json @@ -0,0 +1,165 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "2.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/playbacks.{format}", + "requiresModules": [ + "res_stasis_playback" + ], + "apis": [ + { + "path": "/playbacks/{playbackId}", + "description": "Control object for a playback operation.", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get a playback's details.", + "nickname": "get", + "responseClass": "Playback", + "parameters": [ + { + "name": "playbackId", + "description": "Playback's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "The playback cannot be found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop a playback.", + "nickname": "stop", + "responseClass": "void", + "parameters": [ + { + "name": "playbackId", + "description": "Playback's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "The playback cannot be found" + } + ] + } + ] + }, + { + "path": "/playbacks/{playbackId}/control", + "description": "Control object for a playback operation.", + "operations": [ + { + "httpMethod": "POST", + "summary": "Control a playback.", + "nickname": "control", + "responseClass": "void", + "parameters": [ + { + "name": "playbackId", + "description": "Playback's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "operation", + "description": "Operation to perform on the playback.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "restart", + "pause", + "unpause", + "reverse", + "forward" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "The provided operation parameter was invalid" + }, + { + "code": 404, + "reason": "The playback cannot be found" + }, + { + "code": 409, + "reason": "The operation cannot be performed in the playback's current state" + } +] + } + ] + } + ], + "models": { + "Playback": { + "id": "Playback", + "description": "Object representing the playback of media to a channel", + "properties": { + "id": { + "type": "string", + "description": "ID for this playback operation", + "required": true + }, + "media_uri": { + "type": "string", + "description": "The URI for the media currently being played back.", + "required": true + }, + "next_media_uri": { + "type": "string", + "description": "If a list of URIs is being played, the next media URI to be played back.", + "required": false + }, + "target_uri": { + "type": "string", + "description": "URI for the channel or bridge to play the media on", + "required": true + }, + "language": { + "type": "string", + "description": "For media types that support multiple languages, the language requested for playback." + }, + "state": { + "type": "string", + "description": "Current state of the playback operation.", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "queued", + "playing", + "continuing", + "done", + "failed" + ] + } + } + } + } + } +} diff --git a/codegen/src/main/resources/codegen-data/ari_10_0_0/recordings.json b/codegen/src/main/resources/codegen-data/ari_10_0_0/recordings.json new file mode 100644 index 00000000..6ffd6d8e --- /dev/null +++ b/codegen/src/main/resources/codegen-data/ari_10_0_0/recordings.json @@ -0,0 +1,413 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "2.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/recordings.{format}", + "requiresModules": [ + "res_stasis_recording" + ], + "apis": [ + { + "path": "/recordings/stored", + "description": "Recordings", + "operations": [ + { + "httpMethod": "GET", + "summary": "List recordings that are complete.", + "nickname": "listStored", + "responseClass": "List[StoredRecording]" + } + ] + }, + { + "path": "/recordings/stored/{recordingName}", + "description": "Individual recording", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get a stored recording's details.", + "nickname": "getStored", + "responseClass": "StoredRecording", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Delete a stored recording.", + "nickname": "deleteStored", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "path": "/recordings/stored/{recordingName}/file", + "description": "The actual file associated with the stored recording", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get the file associated with the stored recording.", + "nickname": "getStoredFile", + "responseClass": "binary", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 403, + "reason": "The recording file could not be opened" + }, + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "path": "/recordings/stored/{recordingName}/copy", + "description": "Copy an individual recording", + "operations": [ + { + "httpMethod": "POST", + "summary": "Copy a stored recording.", + "nickname": "copyStored", + "responseClass": "StoredRecording", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording to copy", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "destinationRecordingName", + "description": "The destination name of the recording", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "A recording with the same name already exists on the system" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}", + "description": "A recording that is in progress", + "operations": [ + { + "httpMethod": "GET", + "summary": "List live recordings.", + "nickname": "getLive", + "responseClass": "LiveRecording", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop a live recording and discard it.", + "nickname": "cancel", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}/stop", + "operations": [ + { + "httpMethod": "POST", + "summary": "Stop a live recording and store it.", + "nickname": "stop", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}/pause", + "operations": [ + { + "httpMethod": "POST", + "summary": "Pause a live recording.", + "notes": "Pausing a recording suspends silence detection, which will be restarted when the recording is unpaused. Paused time is not included in the accounting for maxDurationSeconds.", + "nickname": "pause", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unpause a live recording.", + "nickname": "unpause", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}/mute", + "operations": [ + { + "httpMethod": "POST", + "summary": "Mute a live recording.", + "notes": "Muting a recording suspends silence detection, which will be restarted when the recording is unmuted.", + "nickname": "mute", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unmute a live recording.", + "nickname": "unmute", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + } + ] + } + ], + "models": { + "StoredRecording": { + "id": "StoredRecording", + "description": "A past recording that may be played back.", + "properties": { + "name": { + "required": true, + "type": "string" + }, + "format": { + "required": true, + "type": "string" + } + } + }, + "LiveRecording": { + "id": "LiveRecording", + "description": "A recording that is in progress", + "properties": { + "name": { + "required": true, + "type": "string", + "description": "Base name for the recording" + }, + "format": { + "required": true, + "type": "string", + "description": "Recording format (wav, gsm, etc.)" + }, + "target_uri": { + "required": true, + "type": "string", + "description": "URI for the channel or bridge being recorded" + }, + "state": { + "required": true, + "type": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "queued", + "recording", + "paused", + "done", + "failed", + "canceled" + ] + } + }, + "duration": { + "required": false, + "type": "int", + "description": "Duration in seconds of the recording" + }, + "talking_duration": { + "required": false, + "type": "int", + "description": "Duration of talking, in seconds, detected in the recording. This is only available if the recording was initiated with a non-zero maxSilenceSeconds." + }, + "silence_duration": { + "required": false, + "type": "int", + "description": "Duration of silence, in seconds, detected in the recording. This is only available if the recording was initiated with a non-zero maxSilenceSeconds." + }, + "cause": { + "required": false, + "type": "string", + "description": "Cause for recording failure if failed" + } + } + } + } +} diff --git a/codegen/src/main/resources/codegen-data/ari_10_0_0/sounds.json b/codegen/src/main/resources/codegen-data/ari_10_0_0/sounds.json new file mode 100644 index 00000000..8fbe1c57 --- /dev/null +++ b/codegen/src/main/resources/codegen-data/ari_10_0_0/sounds.json @@ -0,0 +1,99 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "2.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/sounds.{format}", + "apis": [ + { + "path": "/sounds", + "description": "Sounds", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all sounds.", + "nickname": "list", + "responseClass": "List[Sound]", + "parameters": [ + { + "name": "lang", + "description": "Lookup sound for a specific language.", + "paramType": "query", + "dataType": "string", + "required": false + }, + { + "name": "format", + "description": "Lookup sound in a specific format.", + "paramType": "query", + "dataType": "string", + "required": false, + "__note": "core show translation can show translation paths between formats, along with relative costs. so this could be just installed format, or we could follow that for transcoded formats." + } + ] + } + ] + }, + { + "path": "/sounds/{soundId}", + "description": "Individual sound", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get a sound's details.", + "nickname": "get", + "responseClass": "Sound", + "parameters": [ + { + "name": "soundId", + "description": "Sound's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ] + } + ] + } + ], + "models": { + "FormatLangPair": { + "id": "FormatLangPair", + "description": "Identifies the format and language of a sound file", + "properties": { + "language": { + "required": true, + "type": "string" + }, + "format": { + "required": true, + "type": "string" + } + } + }, + "Sound": { + "id": "Sound", + "description": "A media file that may be played back.", + "properties": { + "id": { + "required": true, + "description": "Sound's identifier.", + "type": "string" + }, + "text": { + "required": false, + "description": "Text description of the sound, usually the words spoken.", + "type": "string" + }, + "formats": { + "required": true, + "description": "The formats and languages in which this sound is available.", + "type": "List[FormatLangPair]" + } + } + } + } +} diff --git a/codegen/src/main/resources/codegen-data/ari_6_0_0/channels.json b/codegen/src/main/resources/codegen-data/ari_6_0_0/channels.json index 04d15773..8d878a13 100644 --- a/codegen/src/main/resources/codegen-data/ari_6_0_0/channels.json +++ b/codegen/src/main/resources/codegen-data/ari_6_0_0/channels.json @@ -2182,6 +2182,11 @@ "required": false, "type": "object", "description": "Channel variables" + }, + "tenantid": { + "required": false, + "type": "string", + "description": "The Tenant ID for the channel" } } } diff --git a/codegen/src/main/resources/codegen-data/ari_6_0_1/channels.json b/codegen/src/main/resources/codegen-data/ari_6_0_1/channels.json index 1b49329f..2a1d0a0c 100644 --- a/codegen/src/main/resources/codegen-data/ari_6_0_1/channels.json +++ b/codegen/src/main/resources/codegen-data/ari_6_0_1/channels.json @@ -2191,6 +2191,11 @@ "caller_rdnis": { "type": "string", "description": "The Caller ID RDNIS" + }, + "tenantid": { + "required": false, + "type": "string", + "description": "The Tenant ID for the channel" } } } diff --git a/codegen/src/main/resources/codegen-data/ari_8_0_0/channels.json b/codegen/src/main/resources/codegen-data/ari_8_0_0/channels.json index 1b49329f..2a1d0a0c 100644 --- a/codegen/src/main/resources/codegen-data/ari_8_0_0/channels.json +++ b/codegen/src/main/resources/codegen-data/ari_8_0_0/channels.json @@ -2191,6 +2191,11 @@ "caller_rdnis": { "type": "string", "description": "The Caller ID RDNIS" + }, + "tenantid": { + "required": false, + "type": "string", + "description": "The Tenant ID for the channel" } } } diff --git a/codegen/src/main/resources/codegen-data/ari_9_0_0/channels.json b/codegen/src/main/resources/codegen-data/ari_9_0_0/channels.json index 3f8e173a..ab4a0421 100644 --- a/codegen/src/main/resources/codegen-data/ari_9_0_0/channels.json +++ b/codegen/src/main/resources/codegen-data/ari_9_0_0/channels.json @@ -2191,6 +2191,11 @@ "caller_rdnis": { "type": "string", "description": "The Caller ID RDNIS" + }, + "tenantid": { + "required": false, + "type": "string", + "description": "The Tenant ID for the channel" } } } From 551a31538aa3281b66ec5f9dee2e21a734dcd475 Mon Sep 17 00:00:00 2001 From: grahambrown11 <771817+grahambrown11@users.noreply.github.com> Date: Mon, 10 Nov 2025 14:05:23 +0000 Subject: [PATCH 11/17] ARI API Updates --- .../codegen-data/ari_10_0_0/applications.json | 19 + .../codegen-data/ari_10_0_0/asterisk.json | 52 + .../codegen-data/ari_10_0_0/bridges.json | 94 +- .../codegen-data/ari_10_0_0/channels.json | 214 +- .../codegen-data/ari_10_0_0/deviceStates.json | 15 + .../codegen-data/ari_10_0_0/endpoints.json | 26 + .../codegen-data/ari_10_0_0/events.json | 256 +- .../codegen-data/ari_10_0_0/mailboxes.json | 15 + .../codegen-data/ari_10_0_0/playbacks.json | 12 + .../codegen-data/ari_10_0_0/recordings.json | 39 + .../codegen-data/ari_10_0_0/sounds.json | 9 + .../codegen-data/ari_11_0_0/applications.json | 242 ++ .../codegen-data/ari_11_0_0/asterisk.json | 777 ++++++ .../codegen-data/ari_11_0_0/bridges.json | 864 ++++++ .../codegen-data/ari_11_0_0/channels.json | 2399 +++++++++++++++++ .../codegen-data/ari_11_0_0/deviceStates.json | 169 ++ .../codegen-data/ari_11_0_0/endpoints.json | 423 +++ .../codegen-data/ari_11_0_0/events.json | 1184 ++++++++ .../codegen-data/ari_11_0_0/mailboxes.json | 152 ++ .../codegen-data/ari_11_0_0/playbacks.json | 177 ++ .../codegen-data/ari_11_0_0/recordings.json | 452 ++++ .../codegen-data/ari_11_0_0/sounds.json | 108 + .../codegen-data/ari_6_0_0/channels.json | 2 +- .../codegen-data/ari_8_0_0/applications.json | 19 + .../codegen-data/ari_8_0_0/asterisk.json | 52 + .../codegen-data/ari_8_0_0/bridges.json | 94 +- .../codegen-data/ari_8_0_0/channels.json | 214 +- .../codegen-data/ari_8_0_0/deviceStates.json | 15 + .../codegen-data/ari_8_0_0/endpoints.json | 26 + .../codegen-data/ari_8_0_0/events.json | 256 +- .../codegen-data/ari_8_0_0/mailboxes.json | 15 + .../codegen-data/ari_8_0_0/playbacks.json | 12 + .../codegen-data/ari_8_0_0/recordings.json | 39 + .../codegen-data/ari_8_0_0/sounds.json | 9 + .../codegen-data/ari_9_0_0/applications.json | 19 + .../codegen-data/ari_9_0_0/asterisk.json | 52 + .../codegen-data/ari_9_0_0/bridges.json | 61 +- .../codegen-data/ari_9_0_0/channels.json | 214 +- .../codegen-data/ari_9_0_0/deviceStates.json | 15 + .../codegen-data/ari_9_0_0/endpoints.json | 26 + .../codegen-data/ari_9_0_0/events.json | 248 +- .../codegen-data/ari_9_0_0/mailboxes.json | 15 + .../codegen-data/ari_9_0_0/playbacks.json | 12 + .../codegen-data/ari_9_0_0/recordings.json | 39 + .../codegen-data/ari_9_0_0/sounds.json | 9 + 45 files changed, 9125 insertions(+), 36 deletions(-) create mode 100644 codegen/src/main/resources/codegen-data/ari_11_0_0/applications.json create mode 100644 codegen/src/main/resources/codegen-data/ari_11_0_0/asterisk.json create mode 100644 codegen/src/main/resources/codegen-data/ari_11_0_0/bridges.json create mode 100644 codegen/src/main/resources/codegen-data/ari_11_0_0/channels.json create mode 100644 codegen/src/main/resources/codegen-data/ari_11_0_0/deviceStates.json create mode 100644 codegen/src/main/resources/codegen-data/ari_11_0_0/endpoints.json create mode 100644 codegen/src/main/resources/codegen-data/ari_11_0_0/events.json create mode 100644 codegen/src/main/resources/codegen-data/ari_11_0_0/mailboxes.json create mode 100644 codegen/src/main/resources/codegen-data/ari_11_0_0/playbacks.json create mode 100644 codegen/src/main/resources/codegen-data/ari_11_0_0/recordings.json create mode 100644 codegen/src/main/resources/codegen-data/ari_11_0_0/sounds.json diff --git a/codegen/src/main/resources/codegen-data/ari_10_0_0/applications.json b/codegen/src/main/resources/codegen-data/ari_10_0_0/applications.json index 09c5cd5c..8ad9f36d 100644 --- a/codegen/src/main/resources/codegen-data/ari_10_0_0/applications.json +++ b/codegen/src/main/resources/codegen-data/ari_10_0_0/applications.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/applications.{format}", + "since": [ + "13.0.0" + ], "apis": [ { "path": "/applications", @@ -13,6 +16,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "13.0.0" + ], "summary": "List all applications.", "nickname": "list", "responseClass": "List[Application]" @@ -25,6 +31,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "13.0.0" + ], "summary": "Get details of an application.", "nickname": "get", "responseClass": "Application", @@ -53,6 +62,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "13.0.0" + ], "summary": "Subscribe an application to a event source.", "notes": "Returns the state of the application after the subscriptions have changed", "nickname": "subscribe", @@ -92,6 +104,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "13.0.0" + ], "summary": "Unsubscribe an application from an event source.", "notes": "Returns the state of the application after the subscriptions have changed", "nickname": "unsubscribe", @@ -141,6 +156,10 @@ "operations": [ { "httpMethod": "PUT", + "since": [ + "13.26.0", + "16.3.0" + ], "summary": "Filter application events types.", "notes": "Allowed and/or disallowed event type filtering can be done. The body (parameter) should specify a JSON key/value object that describes the type of event filtering needed. One, or both of the following keys can be designated:

\"allowed\" - Specifies an allowed list of event types
\"disallowed\" - Specifies a disallowed list of event types

Further, each of those key's value should be a JSON array that holds zero, or more JSON key/value objects. Each of these objects must contain the following key with an associated value:

\"type\" - The type name of the event to filter

The value must be the string name (case sensitive) of the event type that needs filtering. For example:

{ \"allowed\": [ { \"type\": \"StasisStart\" }, { \"type\": \"StasisEnd\" } ] }

As this specifies only an allowed list, then only those two event type messages are sent to the application. No other event messages are sent.

The following rules apply:

* If the body is empty, both the allowed and disallowed filters are set empty.
* If both list types are given then both are set to their respective values (note, specifying an empty array for a given type sets that type to empty).
* If only one list type is given then only that type is set. The other type is not updated.
* An empty \"allowed\" list means all events are allowed.
* An empty \"disallowed\" list means no events are disallowed.
* Disallowed events take precedence over allowed events if the event type is specified in both lists.", "nickname": "filter", diff --git a/codegen/src/main/resources/codegen-data/ari_10_0_0/asterisk.json b/codegen/src/main/resources/codegen-data/ari_10_0_0/asterisk.json index 841e6cd8..83fef8b7 100644 --- a/codegen/src/main/resources/codegen-data/ari_10_0_0/asterisk.json +++ b/codegen/src/main/resources/codegen-data/ari_10_0_0/asterisk.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/asterisk.{format}", + "since": [ + "12.0.0" + ], "apis": [ { "path": "/asterisk/config/dynamic/{configClass}/{objectType}/{id}", @@ -13,6 +16,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "13.5.0" + ], "summary": "Retrieve a dynamic configuration object.", "nickname": "getObject", "responseClass": "List[ConfigTuple]", @@ -51,6 +57,9 @@ }, { "httpMethod": "PUT", + "since": [ + "13.5.0" + ], "summary": "Create or update a dynamic configuration object.", "nickname": "updateObject", "responseClass": "List[ConfigTuple]", @@ -105,6 +114,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "13.5.0" + ], "summary": "Delete a dynamic configuration object.", "nickname": "deleteObject", "responseClass": "void", @@ -153,6 +165,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Gets Asterisk system information.", "nickname": "getInfo", "responseClass": "AsteriskInfo", @@ -184,6 +199,10 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "13.25.0", + "16.2.0" + ], "summary": "Response pong message.", "nickname": "ping", "responseClass": "AsteriskPing" @@ -196,6 +215,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "13.5.0" + ], "summary": "List Asterisk modules.", "nickname": "listModules", "responseClass": "List[Module]" @@ -208,6 +230,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "13.5.0" + ], "summary": "Get Asterisk module information.", "nickname": "getModule", "responseClass": "Module", @@ -234,6 +259,9 @@ }, { "httpMethod": "POST", + "since": [ + "13.5.0" + ], "summary": "Load an Asterisk module.", "nickname": "loadModule", "responseClass": "void", @@ -256,6 +284,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "13.5.0" + ], "summary": "Unload an Asterisk module.", "nickname": "unloadModule", "responseClass": "void", @@ -282,6 +313,9 @@ }, { "httpMethod": "PUT", + "since": [ + "13.5.0" + ], "summary": "Reload an Asterisk module.", "nickname": "reloadModule", "responseClass": "void", @@ -314,6 +348,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "13.6.0" + ], "summary": "Gets Asterisk log channel information.", "nickname": "listLogChannels", "responseClass": "List[LogChannel]" @@ -326,6 +363,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "13.6.0" + ], "summary": "Adds a log channel.", "nickname": "addLog", "responseClass": "void", @@ -360,6 +400,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "13.6.0" + ], "summary": "Deletes a log channel.", "nickname": "deleteLog", "responseClass": "void", @@ -388,6 +431,9 @@ "operations": [ { "httpMethod": "PUT", + "since": [ + "13.6.0" + ], "summary": "Rotates a log channel.", "nickname": "rotateLog", "responseClass": "void", @@ -416,6 +462,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Get the value of a global variable.", "nickname": "getGlobalVar", "responseClass": "Variable", @@ -438,6 +487,9 @@ }, { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Set the value of a global variable.", "nickname": "setGlobalVar", "responseClass": "void", diff --git a/codegen/src/main/resources/codegen-data/ari_10_0_0/bridges.json b/codegen/src/main/resources/codegen-data/ari_10_0_0/bridges.json index 636d2540..ae5ee56f 100644 --- a/codegen/src/main/resources/codegen-data/ari_10_0_0/bridges.json +++ b/codegen/src/main/resources/codegen-data/ari_10_0_0/bridges.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/bridges.{format}", + "since": [ + "12.0.0" + ], "requiresModules": [ "res_stasis_recording", "res_stasis_playback" @@ -17,12 +20,18 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "List all active bridges in Asterisk.", "nickname": "list", "responseClass": "List[Bridge]" }, { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Create a new bridge.", "notes": "This bridge persists until it has been shut down, or Asterisk has been shut down.", "nickname": "create", @@ -52,6 +61,12 @@ "allowMultiple": false, "dataType": "string" } + ], + "errorResponses": [ + { + "code": 409, + "reason": "Bridge with the same bridgeId already exists" + } ] } ] @@ -62,7 +77,10 @@ "operations": [ { "httpMethod": "POST", - "summary": "Create a new bridge or updates an existing one.", + "since": [ + "12.2.0" + ], + "summary": "Create a new bridge.", "notes": "This bridge persists until it has been shut down, or Asterisk has been shut down.", "nickname": "createWithId", "responseClass": "Bridge", @@ -91,10 +109,19 @@ "allowMultiple": false, "dataType": "string" } + ], + "errorResponses": [ + { + "code": 409, + "reason": "Bridge with the same bridgeId already exists" + } ] }, { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Get bridge details.", "nickname": "get", "responseClass": "Bridge", @@ -117,6 +144,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Shut down a bridge.", "notes": "If any channels are in this bridge, they will be removed and resume whatever they were doing beforehand.", "nickname": "destroy", @@ -146,6 +176,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Add a channel to a bridge.", "nickname": "addChannel", "responseClass": "void", @@ -229,6 +262,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Remove a channel from a bridge.", "nickname": "removeChannel", "responseClass": "void", @@ -277,6 +313,10 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "13.13.0", + "14.2.0" + ], "summary": "Set a channel as the video source in a multi-party mixing bridge. This operation has no effect on bridges with two or fewer participants.", "nickname": "setVideoSource", "responseClass": "void", @@ -321,6 +361,10 @@ "operations": [ { "httpMethod": "DELETE", + "since": [ + "13.13.0", + "14.2.0" + ], "summary": "Removes any explicit video source in a multi-party mixing bridge. This operation has no effect on bridges with two or fewer participants. When no explicit video source is set, talk detection will be used to determine the active video stream.", "nickname": "clearVideoSource", "responseClass": "void", @@ -349,6 +393,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Play music on hold to a bridge or change the MOH class that is playing.", "nickname": "startMoh", "responseClass": "void", @@ -383,6 +430,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Stop playing music on hold to a bridge.", "notes": "This will only stop music on hold being played via POST bridges/{bridgeId}/moh.", "nickname": "stopMoh", @@ -416,6 +466,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Start playback of media on a bridge.", "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", "nickname": "play", @@ -437,6 +490,14 @@ "allowMultiple": true, "dataType": "string" }, + { + "name": "announcer_format", + "description": "Format of the 'Anouncer' channel attached to the bridge. Defaults to the format of the channel in the bridge with the highest sampe rate.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, { "name": "lang", "description": "For sounds, selects language for sound.", @@ -457,7 +518,6 @@ "valueType": "RANGE", "min": 0 } - }, { "name": "skipms", @@ -489,6 +549,10 @@ { "code": 409, "reason": "Bridge not in a Stasis application" + }, + { + "code": 422, + "reason": "The format specified is unknown on this system" } ] } @@ -500,6 +564,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.3.0" + ], "summary": "Start playback of media on a bridge.", "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", "nickname": "playWithId", @@ -529,6 +596,14 @@ "allowMultiple": true, "dataType": "string" }, + { + "name": "announcer_format", + "description": "Format of the 'Anouncer' channel attached to the bridge. Defaults to the format of the channel in the bridge with the highest sampe rate.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, { "name": "lang", "description": "For sounds, selects language for sound.", @@ -572,6 +647,10 @@ { "code": 409, "reason": "Bridge not in a Stasis application" + }, + { + "code": 422, + "reason": "The format specified is unknown on this system" } ] @@ -584,6 +663,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Start a recording.", "notes": "This records the mixed audio from all channels participating in this bridge.", "nickname": "record", @@ -613,6 +695,14 @@ "allowMultiple": false, "dataType": "string" }, + { + "name": "recorder_format", + "description": "Format of the 'Recorder' channel attached to the bridge. Defaults to the same format as the 'format' parameter.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, { "name": "maxDurationSeconds", "description": "Maximum duration of the recording, in seconds. 0 for no limit.", diff --git a/codegen/src/main/resources/codegen-data/ari_10_0_0/channels.json b/codegen/src/main/resources/codegen-data/ari_10_0_0/channels.json index ab4a0421..a50b8720 100644 --- a/codegen/src/main/resources/codegen-data/ari_10_0_0/channels.json +++ b/codegen/src/main/resources/codegen-data/ari_10_0_0/channels.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/channels.{format}", + "since": [ + "12.0.0" + ], "requiresModules": [ "res_stasis_answer", "res_stasis_playback", @@ -19,12 +22,18 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "List all active channels in Asterisk.", "nickname": "list", "responseClass": "List[Channel]" }, { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Create a new channel (originate).", "notes": "The new channel is created immediately and a snapshot of it returned. If a Stasis application is provided it will be automatically subscribed to the originated channel for further events and updates.", "nickname": "originate", @@ -163,6 +172,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "14.0.0" + ], "summary": "Create channel.", "nickname": "create", "responseClass": "Channel", @@ -247,6 +259,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Channel details.", "nickname": "get", "responseClass": "Channel", @@ -269,6 +284,9 @@ }, { "httpMethod": "POST", + "since": [ + "12.2.0" + ], "summary": "Create a new channel (originate with id).", "notes": "The new channel is created immediately and a snapshot of it returned. If a Stasis application is provided it will be automatically subscribed to the originated channel for further events and updates.", "nickname": "originateWithId", @@ -402,6 +420,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Delete (i.e. hangup) a channel.", "nickname": "hangup", "responseClass": "void", @@ -468,6 +489,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Exit application; continue execution in the dialplan.", "nickname": "continueInDialplan", "responseClass": "void", @@ -536,6 +560,10 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "13.26.0", + "16.3.0" + ], "summary": "Move the channel from one Stasis application to another.", "nickname": "move", "responseClass": "void", @@ -584,6 +612,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "13.3.0" + ], "summary": "Redirect the channel to a different location.", "nickname": "redirect", "responseClass": "void", @@ -636,6 +667,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Answer a channel.", "nickname": "answer", "responseClass": "void", @@ -672,6 +706,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Indicate ringing to a channel.", "nickname": "ring", "responseClass": "void", @@ -702,6 +739,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Stop ringing indication on a channel if locally generated.", "nickname": "ringStop", "responseClass": "void", @@ -732,12 +772,56 @@ } ] }, + { + "path": "/channels/{channelId}/progress", + "description": "Indicate progress on a channel", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "22.6.0", + "21.11.0", + "20.16.0" + ], + "summary": "Indicate progress on a channel.", + "nickname": "progress", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] + }, { "path": "/channels/{channelId}/dtmf", "description": "Send DTMF to a channel", "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Send provided DTMF to a given channel.", "nickname": "sendDTMF", "responseClass": "void", @@ -822,6 +906,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Mute a channel.", "nickname": "mute", "responseClass": "void", @@ -869,6 +956,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Unmute a channel.", "nickname": "unmute", "responseClass": "void", @@ -922,6 +1012,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Hold a channel.", "nickname": "hold", "responseClass": "void", @@ -952,6 +1045,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Remove a channel from hold.", "nickname": "unhold", "responseClass": "void", @@ -988,6 +1084,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Play music on hold to a channel.", "notes": "Using media operations such as /play on a channel playing MOH in this manner will suspend MOH without resuming automatically. If continuing music on hold is desired, the stasis application must reinitiate music on hold.", "nickname": "startMoh", @@ -1027,6 +1126,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Stop playing music on hold to a channel.", "nickname": "stopMoh", "responseClass": "void", @@ -1063,6 +1165,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Play silence to a channel.", "notes": "Using media operations such as /play on a channel playing silence in this manner will suspend silence without resuming automatically.", "nickname": "startSilence", @@ -1094,6 +1199,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Stop playing silence to a channel.", "nickname": "stopSilence", "responseClass": "void", @@ -1130,6 +1238,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Start playback of media.", "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", "nickname": "play", @@ -1208,6 +1319,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.2.0" + ], "summary": "Start playback of media and specify the playbackId.", "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", "nickname": "playWithId", @@ -1286,6 +1400,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Start a recording.", "notes": "Record audio from a channel. Note that this will not capture audio sent to the channel. The bridge itself has a record feature if that's what you want.", "nickname": "record", @@ -1397,7 +1514,7 @@ }, { "code": 409, - "reason": "Channel is not in a Stasis application; the channel is currently bridged with other hcannels; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail" + "reason": "Channel is not in a Stasis application; the channel is currently bridged with other channels; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail" }, { "code": 422, @@ -1413,6 +1530,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Get the value of a channel variable or function.", "nickname": "getChannelVar", "responseClass": "Variable", @@ -1451,6 +1571,9 @@ }, { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Set the value of a channel variable or function.", "nickname": "setChannelVar", "responseClass": "void", @@ -1503,6 +1626,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Start snooping.", "notes": "Snoop (spy/whisper) on a specific channel.", "nickname": "snoopChannel", @@ -1596,6 +1722,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.2.0" + ], "summary": "Start snooping.", "notes": "Snoop (spy/whisper) on a specific channel.", "nickname": "snoopChannelWithId", @@ -1689,6 +1818,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "14.0.0" + ], "summary": "Dial a created channel.", "nickname": "dial", "responseClass": "void", @@ -1742,6 +1874,10 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "13.27.0", + "16.4.0" + ], "summary": "RTP stats on a channel.", "nickname": "rtpstatistics", "responseClass": "RTPstat", @@ -1770,8 +1906,12 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "16.6.0", + "17.1.0" + ], "summary": "Start an External Media session.", - "notes": "Create a channel to an External Media source/sink.", + "notes": "Create a channel to an External Media source/sink. The combination of transport and encapsulation will select one of chan_rtp(udp/rtp), chan_audiosocket(tcp/audiosocket) or chan_websocket(websocket/none) channel drivers.", "nickname": "externalMedia", "responseClass": "Channel", "parameters": [ @@ -1801,15 +1941,15 @@ }, { "name": "external_host", - "description": "Hostname/ip:port of external host", + "description": "Hostname/ip:port or websocket_client connection ID of external host. May be empty for a websocket server connection.", "paramType": "query", - "required": true, + "required": false, "allowMultiple": false, "dataType": "string" }, { "name": "encapsulation", - "description": "Payload encapsulation protocol", + "description": "Payload encapsulation protocol. Must be 'none' for the websocket transport.", "paramType": "query", "required": false, "allowMultiple": false, @@ -1819,7 +1959,8 @@ "valueType": "LIST", "values": [ "rtp", - "audiosocket" + "audiosocket", + "none" ] } }, @@ -1835,13 +1976,14 @@ "valueType": "LIST", "values": [ "udp", - "tcp" + "tcp", + "websocket" ] } }, { "name": "connection_type", - "description": "Connection type (client/server)", + "description": "Connection type (client/server). 'server' is only valid for the websocket transport.", "paramType": "query", "required": false, "allowMultiple": false, @@ -1850,7 +1992,8 @@ "allowableValues": { "valueType": "LIST", "values": [ - "client" + "client", + "server" ] } }, @@ -1898,6 +2041,59 @@ ] } ] + }, + { + "path": "/channels/{channelId}/transfer_progress", + "description": "Inform the channel that the transfer is in progress.", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "22.3.0", + "21.8.0", + "20.13.0" + ], + "summary": "Inform the channel about the progress of the attended/blind transfer.", + "nickname": "transfer_progress", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "states", + "description": "The state of the progress", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Endpoint parameter not provided" + }, + { + "code": 404, + "reason": "Channel or endpoint not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] } ], "models": { diff --git a/codegen/src/main/resources/codegen-data/ari_10_0_0/deviceStates.json b/codegen/src/main/resources/codegen-data/ari_10_0_0/deviceStates.json index bd389355..f0a889bc 100644 --- a/codegen/src/main/resources/codegen-data/ari_10_0_0/deviceStates.json +++ b/codegen/src/main/resources/codegen-data/ari_10_0_0/deviceStates.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/deviceStates.{format}", + "since": [ + "12.0.0" + ], "requiresModules": [ "res_stasis_device_state" ], @@ -16,6 +19,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "List all ARI controlled device states.", "nickname": "list", "responseClass": "List[DeviceState]" @@ -28,6 +34,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Retrieve the current state of a device.", "nickname": "get", "responseClass": "DeviceState", @@ -44,6 +53,9 @@ }, { "httpMethod": "PUT", + "since": [ + "12.0.0" + ], "summary": "Change the state of a device controlled by ARI. (Note - implicitly creates the device state).", "nickname": "update", "responseClass": "void", @@ -92,6 +104,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Destroy a device-state controlled by ARI.", "nickname": "delete", "responseClass": "void", diff --git a/codegen/src/main/resources/codegen-data/ari_10_0_0/endpoints.json b/codegen/src/main/resources/codegen-data/ari_10_0_0/endpoints.json index 3f3f98ce..233f2c84 100644 --- a/codegen/src/main/resources/codegen-data/ari_10_0_0/endpoints.json +++ b/codegen/src/main/resources/codegen-data/ari_10_0_0/endpoints.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/endpoints.{format}", + "since": [ + "12.0.0" + ], "apis": [ { "path": "/endpoints", @@ -13,6 +16,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "List all endpoints.", "nickname": "list", "responseClass": "List[Endpoint]" @@ -25,6 +31,9 @@ "operations": [ { "httpMethod": "PUT", + "since": [ + "13.0.0" + ], "summary": "Send a message to some technology URI or endpoint.", "nickname": "sendMessage", "responseClass": "void", @@ -81,6 +90,10 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "18.20.0", + "20.5.0" + ], "summary": "Refer an endpoint or technology URI to some technology URI or endpoint.", "nickname": "refer", "responseClass": "void", @@ -146,6 +159,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "List available endoints for a given endpoint technology.", "nickname": "listByTech", "responseClass": "List[Endpoint]", @@ -172,6 +188,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Details for an endpoint.", "nickname": "get", "responseClass": "Endpoint", @@ -208,6 +227,9 @@ "operations": [ { "httpMethod": "PUT", + "since": [ + "13.0.0" + ], "summary": "Send a message to some endpoint in a technology.", "nickname": "sendMessageToEndpoint", "responseClass": "void", @@ -268,6 +290,10 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "18.20.0", + "20.5.0" + ], "summary": "Refer an endpoint or technology URI to some technology URI or endpoint.", "nickname": "referToEndpoint", "responseClass": "void", diff --git a/codegen/src/main/resources/codegen-data/ari_10_0_0/events.json b/codegen/src/main/resources/codegen-data/ari_10_0_0/events.json index 2bd1eeab..f08a665e 100644 --- a/codegen/src/main/resources/codegen-data/ari_10_0_0/events.json +++ b/codegen/src/main/resources/codegen-data/ari_10_0_0/events.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.2", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/events.{format}", + "since": [ + "12.0.0" + ], "requiresModules": [ "res_http_websocket" ], @@ -16,6 +19,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "upgrade": "websocket", "websocketProtocol": "ari", "summary": "WebSocket connection for events.", @@ -48,6 +54,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.3.0" + ], "summary": "Generate a user event.", "nickname": "userEvent", "responseClass": "void", @@ -160,6 +169,8 @@ "RecordingFinished", "RecordingFailed", "ApplicationMoveFailed", + "ApplicationRegistered", + "ApplicationUnregistered", "ApplicationReplaced", "BridgeCreated", "BridgeDestroyed", @@ -190,7 +201,9 @@ "StasisStart", "TextMessageReceived", "ChannelConnectedLine", - "PeerStatusChange" + "PeerStatusChange", + "ChannelTransfer", + "RESTResponse" ] }, "ContactInfo": { @@ -356,6 +369,16 @@ } } }, + "ApplicationRegistered": { + "id": "ApplicationRegistered", + "description": "Notification that a Stasis app has been registered.", + "properties": {} + }, + "ApplicationUnregistered": { + "id": "ApplicationUnregistered", + "description": "Notification that a Stasis app has been unregistered.", + "properties": {} + }, "ApplicationReplaced": { "id": "ApplicationReplaced", "description": "Notification that another WebSocket has taken over for an application.\n\nAn application may only be subscribed to by a single WebSocket at a time. If multiple WebSockets attempt to subscribe to the same application, the newer WebSocket wins, and the older one receives this event.", @@ -556,6 +579,10 @@ "description": "Text representation of the cause of the hangup", "type": "string" }, + "tech_cause": { + "type": "int", + "description": "Integer representation of the technology-specific off-nominal cause of the hangup." + }, "channel": { "required": true, "type": "Channel" @@ -701,6 +728,10 @@ "type": "int", "description": "Integer representation of the cause of the hangup." }, + "tech_cause": { + "type": "int", + "description": "Integer representation of the technology-specific off-nominal cause of the hangup." + }, "soft": { "type": "boolean", "description": "Whether the hangup request was a soft hangup request." @@ -925,6 +956,229 @@ "description": "The channel whose connected line has changed." } } + }, + "ChannelTransfer": { + "id": "ChannelTransfer", + "description": "transfer on a channel.", + "properties": { + "state": { + "required": false, + "type": "string", + "description": "Transfer State" + }, + "refer_to": { + "required": true, + "type": "ReferTo", + "description": "Refer-To information with optionally both affected channels" + }, + "referred_by": { + "required": true, + "type": "ReferredBy", + "description": "Referred-By SIP Header according rfc3892" + } + } + }, + "ReferTo": { + "id": "ReferTo", + "description": "transfer destination requested by transferee", + "properties": { + "requested_destination": { + "required": true, + "type": "RequiredDestination" + }, + "destination_channel": { + "required": false, + "type": "Channel", + "description": "The Channel Object, that is to be replaced" + }, + "connected_channel": { + "required": false, + "type": "Channel", + "description": "Channel, connected to the to be replaced channel" + }, + "bridge": { + "required": false, + "type": "Bridge", + "description": "Bridge connecting both destination channels" + } + } + }, + "ReferredBy": { + "id": "ReferredBy", + "description": "transfer destination requested by transferee", + "properties": { + "source_channel": { + "required": true, + "type": "Channel", + "description": "The channel on which the refer was received" + }, + "connected_channel": { + "required": false, + "type": "Channel", + "description": "Channel, Connected to the channel, receiving the transfer request on." + }, + "bridge": { + "required": false, + "type": "Bridge", + "description": "Bridge connecting both Channels" + } + } + }, + "RequiredDestination": { + "id": "RequiredDestination", + "description": "Information about the requested destination", + "properties": { + "protocol_id": { + "required": false, + "type": "string", + "description": "the requested protocol-id by the referee in case of SIP channel, this is a SIP Call ID, Mutually exclusive to destination" + }, + "destination": { + "required": false, + "type": "string", + "description": "Destination User Part. Only for Blind transfer. Mutually exclusive to protocol_id" + }, + "additional_protocol_params": { + "required": false, + "type": "List[AdditionalParam]", + "description": "List of additional protocol specific information" + } + } + }, + "AdditionalParam": { + "id": "AdditionalParam", + "description": "Protocol specific additional parameter", + "properties": { + "parameter_name": { + "required": true, + "type": "string", + "description": "Name of the parameter" + }, + "parameter_value": { + "required": true, + "type": "string", + "description": "Value of the parameter" + } + } + }, + "RESTHeader": { + "id": "RESTHeader", + "description": "REST over Websocket header", + "properties": { + "name": { + "type": "string", + "description": "Header name", + "required": true + }, + "value": { + "required": true, + "type": "string", + "description": "Header value" + } + } + }, + "RESTQueryStringParameter": { + "id": "RESTQueryStringParameter", + "description": "REST over Websocket Query String Parameter", + "properties": { + "name": { + "type": "string", + "description": "Parameter name", + "required": true + }, + "value": { + "required": true, + "type": "string", + "description": "Parameter value" + } + } + }, + "RESTRequest": { + "id": "RESTRequest", + "description": "REST over Websocket Request.", + "properties": { + "type": { + "type": "string", + "description": "Message type. Must be 'RESTRequest'", + "required": true + }, + "transaction_id": { + "type": "string", + "description": "Opaque transaction id. Can be any valid string. Will be returned in any response to this request.", + "required": true + }, + "request_id": { + "type": "string", + "description": "Opaque request id. Can be any valid string. Will be returned in any response to this request.", + "required": true + }, + "method": { + "required": true, + "type": "string", + "description": "HTTP method (GET, PUT, POST, DELETE, etc.)" + }, + "uri": { + "required": true, + "type": "string", + "description": "Resource URI with optional query string parameters." + }, + "content_type": { + "required": false, + "type": "string", + "description": "The Content-Type of the message body." + }, + "query_strings": { + "required": false, + "type": "List[RESTQueryStringParameter]", + "description": "Request query string parameters." + }, + "message_body": { + "required": false, + "type": "string", + "description": "Request message body. Only content types application/json and application/x-www-form-urlencoded are supported." + } + } + }, + "RESTResponse": { + "id": "RESTResponse", + "description": "REST over Websocket Response.", + "properties": { + "transaction_id": { + "type": "string", + "description": "Opaque transaction id. Will be whatever was specified on the original request.", + "required": true + }, + "request_id": { + "type": "string", + "description": "Opaque request id. Will be whatever was specified on the original request.", + "required": true + }, + "status_code": { + "required": true, + "type": "int", + "description": "HTTP status code" + }, + "reason_phrase": { + "required": true, + "type": "string", + "description": "HTTP reason phrase" + }, + "uri": { + "required": true, + "type": "string", + "description": "Original request resource URI" + }, + "content_type": { + "required": false, + "type": "string", + "description": "The Content-Type of the message body." + }, + "message_body": { + "required": false, + "type": "string", + "description": "Response message body" + } + } } } } diff --git a/codegen/src/main/resources/codegen-data/ari_10_0_0/mailboxes.json b/codegen/src/main/resources/codegen-data/ari_10_0_0/mailboxes.json index 8f5941b8..d99e1eac 100644 --- a/codegen/src/main/resources/codegen-data/ari_10_0_0/mailboxes.json +++ b/codegen/src/main/resources/codegen-data/ari_10_0_0/mailboxes.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/mailboxes.{format}", + "since": [ + "12.1.0" + ], "requiresModules": [ "res_stasis_mailbox" ], @@ -16,6 +19,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.1.0" + ], "summary": "List all mailboxes.", "nickname": "list", "responseClass": "List[Mailbox]" @@ -28,6 +34,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.1.0" + ], "summary": "Retrieve the current state of a mailbox.", "nickname": "get", "responseClass": "Mailbox", @@ -50,6 +59,9 @@ }, { "httpMethod": "PUT", + "since": [ + "12.1.0" + ], "summary": "Change the state of a mailbox. (Note - implicitly creates the mailbox).", "nickname": "update", "responseClass": "void", @@ -88,6 +100,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.1.0" + ], "summary": "Destroy a mailbox.", "nickname": "delete", "responseClass": "void", diff --git a/codegen/src/main/resources/codegen-data/ari_10_0_0/playbacks.json b/codegen/src/main/resources/codegen-data/ari_10_0_0/playbacks.json index 793986fc..a7892f18 100644 --- a/codegen/src/main/resources/codegen-data/ari_10_0_0/playbacks.json +++ b/codegen/src/main/resources/codegen-data/ari_10_0_0/playbacks.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/playbacks.{format}", + "since": [ + "12.0.0" + ], "requiresModules": [ "res_stasis_playback" ], @@ -16,6 +19,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Get a playback's details.", "nickname": "get", "responseClass": "Playback", @@ -38,6 +44,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Stop a playback.", "nickname": "stop", "responseClass": "void", @@ -66,6 +75,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Control a playback.", "nickname": "control", "responseClass": "void", diff --git a/codegen/src/main/resources/codegen-data/ari_10_0_0/recordings.json b/codegen/src/main/resources/codegen-data/ari_10_0_0/recordings.json index 6ffd6d8e..1496db8a 100644 --- a/codegen/src/main/resources/codegen-data/ari_10_0_0/recordings.json +++ b/codegen/src/main/resources/codegen-data/ari_10_0_0/recordings.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/recordings.{format}", + "since": [ + "12.0.0" + ], "requiresModules": [ "res_stasis_recording" ], @@ -16,6 +19,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "List recordings that are complete.", "nickname": "listStored", "responseClass": "List[StoredRecording]" @@ -28,6 +34,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Get a stored recording's details.", "nickname": "getStored", "responseClass": "StoredRecording", @@ -50,6 +59,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Delete a stored recording.", "nickname": "deleteStored", "responseClass": "void", @@ -78,6 +90,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "14.0.0" + ], "summary": "Get the file associated with the stored recording.", "nickname": "getStoredFile", "responseClass": "binary", @@ -110,6 +125,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.5.0" + ], "summary": "Copy a stored recording.", "nickname": "copyStored", "responseClass": "StoredRecording", @@ -150,6 +168,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "List live recordings.", "nickname": "getLive", "responseClass": "LiveRecording", @@ -172,6 +193,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Stop a live recording and discard it.", "nickname": "cancel", "responseClass": "void", @@ -199,6 +223,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Stop a live recording and store it.", "nickname": "stop", "responseClass": "void", @@ -226,6 +253,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Pause a live recording.", "notes": "Pausing a recording suspends silence detection, which will be restarted when the recording is unpaused. Paused time is not included in the accounting for maxDurationSeconds.", "nickname": "pause", @@ -253,6 +283,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Unpause a live recording.", "nickname": "unpause", "responseClass": "void", @@ -284,6 +317,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Mute a live recording.", "notes": "Muting a recording suspends silence detection, which will be restarted when the recording is unmuted.", "nickname": "mute", @@ -311,6 +347,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Unmute a live recording.", "nickname": "unmute", "responseClass": "void", diff --git a/codegen/src/main/resources/codegen-data/ari_10_0_0/sounds.json b/codegen/src/main/resources/codegen-data/ari_10_0_0/sounds.json index 8fbe1c57..aee4d369 100644 --- a/codegen/src/main/resources/codegen-data/ari_10_0_0/sounds.json +++ b/codegen/src/main/resources/codegen-data/ari_10_0_0/sounds.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/sounds.{format}", + "since": [ + "12.0.0" + ], "apis": [ { "path": "/sounds", @@ -13,6 +16,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "List all sounds.", "nickname": "list", "responseClass": "List[Sound]", @@ -42,6 +48,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Get a sound's details.", "nickname": "get", "responseClass": "Sound", diff --git a/codegen/src/main/resources/codegen-data/ari_11_0_0/applications.json b/codegen/src/main/resources/codegen-data/ari_11_0_0/applications.json new file mode 100644 index 00000000..8ad9f36d --- /dev/null +++ b/codegen/src/main/resources/codegen-data/ari_11_0_0/applications.json @@ -0,0 +1,242 @@ +{ + "_copyright": "Copyright (C) 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "2.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/applications.{format}", + "since": [ + "13.0.0" + ], + "apis": [ + { + "path": "/applications", + "description": "Stasis applications", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "13.0.0" + ], + "summary": "List all applications.", + "nickname": "list", + "responseClass": "List[Application]" + } + ] + }, + { + "path": "/applications/{applicationName}", + "description": "Stasis application", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "13.0.0" + ], + "summary": "Get details of an application.", + "nickname": "get", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Application does not exist." + } + ] + } + ] + }, + { + "path": "/applications/{applicationName}/subscription", + "description": "Stasis application", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "13.0.0" + ], + "summary": "Subscribe an application to a event source.", + "notes": "Returns the state of the application after the subscriptions have changed", + "nickname": "subscribe", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "eventSource", + "description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}[/{resource}], deviceState:{deviceName}", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing parameter." + }, + { + "code": 404, + "reason": "Application does not exist." + }, + { + "code": 422, + "reason": "Event source does not exist." + } + ] + }, + { + "httpMethod": "DELETE", + "since": [ + "13.0.0" + ], + "summary": "Unsubscribe an application from an event source.", + "notes": "Returns the state of the application after the subscriptions have changed", + "nickname": "unsubscribe", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "eventSource", + "description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}[/{resource}], deviceState:{deviceName}", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing parameter; event source scheme not recognized." + }, + { + "code": 404, + "reason": "Application does not exist." + }, + { + "code": 409, + "reason": "Application not subscribed to event source." + }, + { + "code": 422, + "reason": "Event source does not exist." + } + ] + } + ] + }, + { + "path": "/applications/{applicationName}/eventFilter", + "description": "Stasis application", + "operations": [ + { + "httpMethod": "PUT", + "since": [ + "13.26.0", + "16.3.0" + ], + "summary": "Filter application events types.", + "notes": "Allowed and/or disallowed event type filtering can be done. The body (parameter) should specify a JSON key/value object that describes the type of event filtering needed. One, or both of the following keys can be designated:

\"allowed\" - Specifies an allowed list of event types
\"disallowed\" - Specifies a disallowed list of event types

Further, each of those key's value should be a JSON array that holds zero, or more JSON key/value objects. Each of these objects must contain the following key with an associated value:

\"type\" - The type name of the event to filter

The value must be the string name (case sensitive) of the event type that needs filtering. For example:

{ \"allowed\": [ { \"type\": \"StasisStart\" }, { \"type\": \"StasisEnd\" } ] }

As this specifies only an allowed list, then only those two event type messages are sent to the application. No other event messages are sent.

The following rules apply:

* If the body is empty, both the allowed and disallowed filters are set empty.
* If both list types are given then both are set to their respective values (note, specifying an empty array for a given type sets that type to empty).
* If only one list type is given then only that type is set. The other type is not updated.
* An empty \"allowed\" list means all events are allowed.
* An empty \"disallowed\" list means no events are disallowed.
* Disallowed events take precedence over allowed events if the event type is specified in both lists.", + "nickname": "filter", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "filter", + "description": "Specify which event types to allow/disallow", + "paramType": "body", + "required": false, + "dataType": "object", + "allowMultiple": false + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Bad request." + }, + { + "code": 404, + "reason": "Application does not exist." + } + ] + } + ] + } + ], + "models": { + "Application": { + "id": "Application", + "description": "Details of a Stasis application", + "properties": { + "name": { + "type": "string", + "description": "Name of this application", + "required": true + }, + "channel_ids": { + "type": "List[string]", + "description": "Id's for channels subscribed to.", + "required": true + }, + "bridge_ids": { + "type": "List[string]", + "description": "Id's for bridges subscribed to.", + "required": true + }, + "endpoint_ids": { + "type": "List[string]", + "description": "{tech}/{resource} for endpoints subscribed to.", + "required": true + }, + "device_names": { + "type": "List[string]", + "description": "Names of the devices subscribed to.", + "required": true + }, + "events_allowed": { + "type": "List[object]", + "description": "Event types sent to the application.", + "required": true + }, + "events_disallowed": { + "type": "List[object]", + "description": "Event types not sent to the application.", + "required": true + } + } + } + } +} diff --git a/codegen/src/main/resources/codegen-data/ari_11_0_0/asterisk.json b/codegen/src/main/resources/codegen-data/ari_11_0_0/asterisk.json new file mode 100644 index 00000000..83fef8b7 --- /dev/null +++ b/codegen/src/main/resources/codegen-data/ari_11_0_0/asterisk.json @@ -0,0 +1,777 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "2.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/asterisk.{format}", + "since": [ + "12.0.0" + ], + "apis": [ + { + "path": "/asterisk/config/dynamic/{configClass}/{objectType}/{id}", + "description": "Asterisk dynamic configuration", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "13.5.0" + ], + "summary": "Retrieve a dynamic configuration object.", + "nickname": "getObject", + "responseClass": "List[ConfigTuple]", + "parameters": [ + { + "name": "configClass", + "description": "The configuration class containing dynamic configuration objects.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "objectType", + "description": "The type of configuration object to retrieve.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "id", + "description": "The unique identifier of the object to retrieve.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "{configClass|objectType|id} not found" + } + ] + }, + { + "httpMethod": "PUT", + "since": [ + "13.5.0" + ], + "summary": "Create or update a dynamic configuration object.", + "nickname": "updateObject", + "responseClass": "List[ConfigTuple]", + "parameters": [ + { + "name": "configClass", + "description": "The configuration class containing dynamic configuration objects.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "objectType", + "description": "The type of configuration object to create or update.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "id", + "description": "The unique identifier of the object to create or update.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "fields", + "description": "The body object should have a value that is a list of ConfigTuples, which provide the fields to update. Ex. [ { \"attribute\": \"directmedia\", \"value\": \"false\" } ]", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Bad request body" + }, + { + "code": 403, + "reason": "Could not create or update object" + }, + { + "code": 404, + "reason": "{configClass|objectType} not found" + } + ] + }, + { + "httpMethod": "DELETE", + "since": [ + "13.5.0" + ], + "summary": "Delete a dynamic configuration object.", + "nickname": "deleteObject", + "responseClass": "void", + "parameters": [ + { + "name": "configClass", + "description": "The configuration class containing dynamic configuration objects.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "objectType", + "description": "The type of configuration object to delete.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "id", + "description": "The unique identifier of the object to delete.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 403, + "reason": "Could not delete object" + }, + { + "code": 404, + "reason": "{configClass|objectType|id} not found" + } + ] + } + ] + }, + { + "path": "/asterisk/info", + "description": "Asterisk system information (similar to core show settings)", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "12.0.0" + ], + "summary": "Gets Asterisk system information.", + "nickname": "getInfo", + "responseClass": "AsteriskInfo", + "parameters": [ + { + "name": "only", + "description": "Filter information returned", + "paramType": "query", + "required": false, + "allowMultiple": true, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "build", + "system", + "config", + "status" + ] + } + } + ] + } + ] + }, + { + "path": "/asterisk/ping", + "description": "Asterisk ping", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "13.25.0", + "16.2.0" + ], + "summary": "Response pong message.", + "nickname": "ping", + "responseClass": "AsteriskPing" + } + ] + }, + { + "path": "/asterisk/modules", + "description": "Asterisk modules", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "13.5.0" + ], + "summary": "List Asterisk modules.", + "nickname": "listModules", + "responseClass": "List[Module]" + } + ] + }, + { + "path": "/asterisk/modules/{moduleName}", + "description": "Asterisk module", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "13.5.0" + ], + "summary": "Get Asterisk module information.", + "nickname": "getModule", + "responseClass": "Module", + "parameters": [ + { + "name": "moduleName", + "description": "Module's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Module could not be found in running modules." + }, + { + "code": 409, + "reason": "Module information could not be retrieved." + } + ] + }, + { + "httpMethod": "POST", + "since": [ + "13.5.0" + ], + "summary": "Load an Asterisk module.", + "nickname": "loadModule", + "responseClass": "void", + "parameters": [ + { + "name": "moduleName", + "description": "Module's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 409, + "reason": "Module could not be loaded." + } + ] + }, + { + "httpMethod": "DELETE", + "since": [ + "13.5.0" + ], + "summary": "Unload an Asterisk module.", + "nickname": "unloadModule", + "responseClass": "void", + "parameters": [ + { + "name": "moduleName", + "description": "Module's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Module not found in running modules." + }, + { + "code": 409, + "reason": "Module could not be unloaded." + } + ] + }, + { + "httpMethod": "PUT", + "since": [ + "13.5.0" + ], + "summary": "Reload an Asterisk module.", + "nickname": "reloadModule", + "responseClass": "void", + "parameters": [ + { + "name": "moduleName", + "description": "Module's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Module not found in running modules." + }, + { + "code": 409, + "reason": "Module could not be reloaded." + } + ] + } + ] + }, + { + "path": "/asterisk/logging", + "description": "Asterisk log channels", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "13.6.0" + ], + "summary": "Gets Asterisk log channel information.", + "nickname": "listLogChannels", + "responseClass": "List[LogChannel]" + } + ] + }, + { + "path": "/asterisk/logging/{logChannelName}", + "description": "Asterisk log channel", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "13.6.0" + ], + "summary": "Adds a log channel.", + "nickname": "addLog", + "responseClass": "void", + "parameters": [ + { + "name": "logChannelName", + "description": "The log channel to add", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "configuration", + "description": "levels of the log channel", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Bad request body" + }, + { + "code": 409, + "reason": "Log channel could not be created." + } + ] + }, + { + "httpMethod": "DELETE", + "since": [ + "13.6.0" + ], + "summary": "Deletes a log channel.", + "nickname": "deleteLog", + "responseClass": "void", + "parameters": [ + { + "name": "logChannelName", + "description": "Log channels name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Log channel does not exist." + } + ] + } + ] + }, + { + "path": "/asterisk/logging/{logChannelName}/rotate", + "description": "Asterisk log channel", + "operations": [ + { + "httpMethod": "PUT", + "since": [ + "13.6.0" + ], + "summary": "Rotates a log channel.", + "nickname": "rotateLog", + "responseClass": "void", + "parameters": [ + { + "name": "logChannelName", + "description": "Log channel's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Log channel does not exist." + } + ] + } + ] + }, + { + "path": "/asterisk/variable", + "description": "Global variables", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "12.0.0" + ], + "summary": "Get the value of a global variable.", + "nickname": "getGlobalVar", + "responseClass": "Variable", + "parameters": [ + { + "name": "variable", + "description": "The variable to get", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + } + ] + }, + { + "httpMethod": "POST", + "since": [ + "12.0.0" + ], + "summary": "Set the value of a global variable.", + "nickname": "setGlobalVar", + "responseClass": "void", + "parameters": [ + { + "name": "variable", + "description": "The variable to set", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "value", + "description": "The value to set the variable to", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + } + ] + } + ] + } + ], + "models": { + "BuildInfo": { + "id": "BuildInfo", + "description": "Info about how Asterisk was built", + "properties": { + "os": { + "required": true, + "type": "string", + "description": "OS Asterisk was built on." + }, + "kernel": { + "required": true, + "type": "string", + "description": "Kernel version Asterisk was built on." + }, + "options": { + "required": true, + "type": "string", + "description": "Compile time options, or empty string if default." + }, + "machine": { + "required": true, + "type": "string", + "description": "Machine architecture (x86_64, i686, ppc, etc.)" + }, + "date": { + "required": true, + "type": "string", + "description": "Date and time when Asterisk was built." + }, + "user": { + "required": true, + "type": "string", + "description": "Username that build Asterisk" + } + } + }, + "SystemInfo": { + "id": "SystemInfo", + "description": "Info about Asterisk", + "properties": { + "version": { + "required": true, + "type": "string", + "description": "Asterisk version." + }, + "entity_id": { + "required": true, + "type": "string", + "description": "" + } + } + }, + "SetId": { + "id": "SetId", + "description": "Effective user/group id", + "properties": { + "user": { + "required": true, + "type": "string", + "description": "Effective user id." + }, + "group": { + "required": true, + "type": "string", + "description": "Effective group id." + } + } + }, + "ConfigInfo": { + "id": "ConfigInfo", + "description": "Info about Asterisk configuration", + "properties": { + "name": { + "required": true, + "type": "string", + "description": "Asterisk system name." + }, + "default_language": { + "required": true, + "type": "string", + "description": "Default language for media playback." + }, + "max_channels": { + "required": false, + "type": "int", + "description": "Maximum number of simultaneous channels." + }, + "max_open_files": { + "required": false, + "type": "int", + "description": "Maximum number of open file handles (files, sockets)." + }, + "max_load": { + "required": false, + "type": "double", + "description": "Maximum load avg on system." + }, + "setid": { + "required": true, + "type": "SetId", + "description": "Effective user/group id for running Asterisk." + } + } + }, + "StatusInfo": { + "id": "StatusInfo", + "description": "Info about Asterisk status", + "properties": { + "startup_time": { + "required": true, + "type": "Date", + "description": "Time when Asterisk was started." + }, + "last_reload_time": { + "required": true, + "type": "Date", + "description": "Time when Asterisk was last reloaded." + } + } + }, + "AsteriskInfo": { + "id": "AsteriskInfo", + "description": "Asterisk system information", + "properties": { + "build": { + "required": false, + "type": "BuildInfo", + "description": "Info about how Asterisk was built" + }, + "system": { + "required": false, + "type": "SystemInfo", + "description": "Info about the system running Asterisk" + }, + "config": { + "required": false, + "type": "ConfigInfo", + "description": "Info about Asterisk configuration" + }, + "status": { + "required": false, + "type": "StatusInfo", + "description": "Info about Asterisk status" + } + } + }, + "AsteriskPing": { + "id": "AsteriskPing", + "description": "Asterisk ping information", + "properties": { + "asterisk_id": { + "required": true, + "type": "string", + "description": "Asterisk id info" + }, + "ping": { + "required": true, + "type": "string", + "description": "Always string value is pong" + }, + "timestamp": { + "required": true, + "type": "string", + "description": "The timestamp string of request received time" + } + } + }, + "Module": { + "id": "Module", + "description": "Details of an Asterisk module", + "properties": { + "name": { + "type": "string", + "description": "The name of this module", + "required": true + }, + "description": { + "type": "string", + "description": "The description of this module", + "required": true + }, + "use_count": { + "type": "int", + "description": "The number of times this module is being used", + "required": true + }, + "status": { + "type": "string", + "description": "The running status of this module", + "required": true + }, + "support_level": { + "type": "string", + "description": "The support state of this module", + "required": true + } + } + }, + "LogChannel": { + "id": "LogChannel", + "description": "Details of an Asterisk log channel", + "properties": { + "channel": { + "type": "string", + "description": "The log channel path", + "required": true + }, + "type": { + "type": "string", + "description": "Types of logs for the log channel", + "required": true + }, + "status": { + "type": "string", + "description": "Whether or not a log type is enabled", + "required": true + }, + "configuration": { + "type": "string", + "description": "The various log levels", + "required": true + } + } + }, + "Variable": { + "id": "Variable", + "description": "The value of a channel variable", + "properties": { + "value": { + "required": true, + "type": "string", + "description": "The value of the variable requested" + } + } + }, + "ConfigTuple": { + "id": "ConfigTuple", + "description": "A key/value pair that makes up part of a configuration object.", + "properties": { + "attribute": { + "required": true, + "type": "string", + "description": "A configuration object attribute." + }, + "value": { + "required": true, + "type": "string", + "description": "The value for the attribute." + } + } + } + } +} diff --git a/codegen/src/main/resources/codegen-data/ari_11_0_0/bridges.json b/codegen/src/main/resources/codegen-data/ari_11_0_0/bridges.json new file mode 100644 index 00000000..ae5ee56f --- /dev/null +++ b/codegen/src/main/resources/codegen-data/ari_11_0_0/bridges.json @@ -0,0 +1,864 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "2.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/bridges.{format}", + "since": [ + "12.0.0" + ], + "requiresModules": [ + "res_stasis_recording", + "res_stasis_playback" + ], + "apis": [ + { + "path": "/bridges", + "description": "Active bridges", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "12.0.0" + ], + "summary": "List all active bridges in Asterisk.", + "nickname": "list", + "responseClass": "List[Bridge]" + }, + { + "httpMethod": "POST", + "since": [ + "12.0.0" + ], + "summary": "Create a new bridge.", + "notes": "This bridge persists until it has been shut down, or Asterisk has been shut down.", + "nickname": "create", + "responseClass": "Bridge", + "parameters": [ + { + "name": "type", + "description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu, video_single, sdp_label).", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "bridgeId", + "description": "Unique ID to give to the bridge being created.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Name to give to the bridge being created.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 409, + "reason": "Bridge with the same bridgeId already exists" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}", + "description": "Individual bridge", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "12.2.0" + ], + "summary": "Create a new bridge.", + "notes": "This bridge persists until it has been shut down, or Asterisk has been shut down.", + "nickname": "createWithId", + "responseClass": "Bridge", + "parameters": [ + { + "name": "type", + "description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu, video_single, sdp_label) to set.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "bridgeId", + "description": "Unique ID to give to the bridge being created.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Set the name of the bridge.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 409, + "reason": "Bridge with the same bridgeId already exists" + } + ] + }, + { + "httpMethod": "GET", + "since": [ + "12.0.0" + ], + "summary": "Get bridge details.", + "nickname": "get", + "responseClass": "Bridge", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + } + ] + }, + { + "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], + "summary": "Shut down a bridge.", + "notes": "If any channels are in this bridge, they will be removed and resume whatever they were doing beforehand.", + "nickname": "destroy", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/addChannel", + "description": "Add a channel to a bridge", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "12.0.0" + ], + "summary": "Add a channel to a bridge.", + "nickname": "addChannel", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "channel", + "description": "Ids of channels to add to bridge", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + }, + { + "name": "role", + "description": "Channel's role in the bridge", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "absorbDTMF", + "description": "Absorb DTMF coming from this channel, preventing it to pass through to the bridge", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean", + "defaultValue": false + }, + { + "name": "mute", + "description": "Mute audio from this channel, preventing it to pass through to the bridge", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean", + "defaultValue": false + }, + { + "name": "inhibitConnectedLineUpdates", + "description": "Do not present the identity of the newly connected channel to other bridge members", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean", + "defaultValue": false + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Channel not found" + }, + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application; Channel currently recording" + }, + { + "code": 422, + "reason": "Channel not in Stasis application" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/removeChannel", + "description": "Remove a channel from a bridge", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "12.0.0" + ], + "summary": "Remove a channel from a bridge.", + "nickname": "removeChannel", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "channel", + "description": "Ids of channels to remove from bridge", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Channel not found" + }, + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + }, + { + "code": 422, + "reason": "Channel not in this bridge" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/videoSource/{channelId}", + "description": "Set a channel as the video source in a multi-party bridge", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "13.13.0", + "14.2.0" + ], + "summary": "Set a channel as the video source in a multi-party mixing bridge. This operation has no effect on bridges with two or fewer participants.", + "nickname": "setVideoSource", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge or Channel not found" + }, + { + "code": 409, + "reason": "Channel not in Stasis application" + }, + { + "code": 422, + "reason": "Channel not in this Bridge" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/videoSource", + "description": "Removes any explicit video source", + "operations": [ + { + "httpMethod": "DELETE", + "since": [ + "13.13.0", + "14.2.0" + ], + "summary": "Removes any explicit video source in a multi-party mixing bridge. This operation has no effect on bridges with two or fewer participants. When no explicit video source is set, talk detection will be used to determine the active video stream.", + "nickname": "clearVideoSource", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/moh", + "description": "Play music on hold to a bridge", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "12.0.0" + ], + "summary": "Play music on hold to a bridge or change the MOH class that is playing.", + "nickname": "startMoh", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "mohClass", + "description": "Channel's id", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], + "summary": "Stop playing music on hold to a bridge.", + "notes": "This will only stop music on hold being played via POST bridges/{bridgeId}/moh.", + "nickname": "stopMoh", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/play", + "description": "Play media to the participants of a bridge", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "12.0.0" + ], + "summary": "Start playback of media on a bridge.", + "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "play", + "responseClass": "Playback", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media URIs to play.", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + }, + { + "name": "announcer_format", + "description": "Format of the 'Anouncer' channel attached to the bridge. Defaults to the format of the channel in the bridge with the highest sampe rate.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of milliseconds to skip before playing. Only applies to the first URI if multiple media URIs are specified.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "playbackId", + "description": "Playback Id.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in a Stasis application" + }, + { + "code": 422, + "reason": "The format specified is unknown on this system" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/play/{playbackId}", + "description": "Play media to a bridge", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "12.3.0" + ], + "summary": "Start playback of media on a bridge.", + "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "playWithId", + "responseClass": "Playback", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "playbackId", + "description": "Playback ID.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media URIs to play.", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + }, + { + "name": "announcer_format", + "description": "Format of the 'Anouncer' channel attached to the bridge. Defaults to the format of the channel in the bridge with the highest sampe rate.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of milliseconds to skip before playing. Only applies to the first URI if multiple media URIs are specified.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in a Stasis application" + }, + { + "code": 422, + "reason": "The format specified is unknown on this system" + } + ] + + } + ] + }, + { + "path": "/bridges/{bridgeId}/record", + "description": "Record audio on a bridge", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "12.0.0" + ], + "summary": "Start a recording.", + "notes": "This records the mixed audio from all channels participating in this bridge.", + "nickname": "record", + "responseClass": "LiveRecording", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Recording's filename", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "format", + "description": "Format to encode audio in", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "recorder_format", + "description": "Format of the 'Recorder' channel attached to the bridge. Defaults to the same format as the 'format' parameter.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "maxDurationSeconds", + "description": "Maximum duration of the recording, in seconds. 0 for no limit.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "maxSilenceSeconds", + "description": "Maximum duration of silence, in seconds. 0 for no limit.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "ifExists", + "description": "Action to take if a recording with the same name already exists.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "fail", + "allowableValues": { + "valueType": "LIST", + "values": [ + "fail", + "overwrite", + "append" + ] + } + }, + { + "name": "beep", + "description": "Play beep when recording begins", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean", + "defaultValue": false + }, + { + "name": "terminateOn", + "description": "DTMF input to terminate recording.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "any", + "*", + "#" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge is not in a Stasis application; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail" + }, + { + "code": 422, + "reason": "The format specified is unknown on this system" + } + ] + } + ] + } + ], + "models": { + "Bridge": { + "id": "Bridge", + "description": "The merging of media from one or more channels.\n\nEveryone on the bridge receives the same audio.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for this bridge", + "required": true + }, + "technology": { + "type": "string", + "description": "Name of the current bridging technology", + "required": true + }, + "bridge_type": { + "type": "string", + "description": "Type of bridge technology", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "mixing", + "holding" + ] + } + }, + "bridge_class": { + "type": "string", + "description": "Bridging class", + "required": true + }, + "creator": { + "type": "string", + "description": "Entity that created the bridge", + "required": true + }, + "name": { + "type": "string", + "description": "Name the creator gave the bridge", + "required": true + }, + "channels": { + "type": "List[string]", + "description": "Ids of channels participating in this bridge", + "required": true + }, + "video_mode": { + "type": "string", + "description": "The video mode the bridge is using. One of 'none', 'talker', 'sfu', or 'single'.", + "required": false + }, + "video_source_id": { + "type": "string", + "description": "The ID of the channel that is the source of video in this bridge, if one exists.", + "required": false + }, + "creationtime": { + "required": true, + "type": "Date", + "description": "Timestamp when bridge was created" + } + } + } + } +} diff --git a/codegen/src/main/resources/codegen-data/ari_11_0_0/channels.json b/codegen/src/main/resources/codegen-data/ari_11_0_0/channels.json new file mode 100644 index 00000000..a50b8720 --- /dev/null +++ b/codegen/src/main/resources/codegen-data/ari_11_0_0/channels.json @@ -0,0 +1,2399 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "2.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/channels.{format}", + "since": [ + "12.0.0" + ], + "requiresModules": [ + "res_stasis_answer", + "res_stasis_playback", + "res_stasis_recording", + "res_stasis_snoop" + ], + "apis": [ + { + "path": "/channels", + "description": "Active channels", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "12.0.0" + ], + "summary": "List all active channels in Asterisk.", + "nickname": "list", + "responseClass": "List[Channel]" + }, + { + "httpMethod": "POST", + "since": [ + "12.0.0" + ], + "summary": "Create a new channel (originate).", + "notes": "The new channel is created immediately and a snapshot of it returned. If a Stasis application is provided it will be automatically subscribed to the originated channel for further events and updates.", + "nickname": "originate", + "responseClass": "Channel", + "parameters": [ + { + "name": "endpoint", + "description": "Endpoint to call.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "extension", + "description": "The extension to dial after the endpoint answers. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "context", + "description": "The context to dial after the endpoint answers. If omitted, uses 'default'. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "priority", + "description": "The priority to dial after the endpoint answers. If omitted, uses 1. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "long" + }, + { + "name": "label", + "description": "The label to dial after the endpoint answers. Will supersede 'priority' if provided. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "app", + "description": "The application that is subscribed to the originated channel. When the channel is answered, it will be passed to this Stasis application. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application provided by 'app'. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "callerId", + "description": "CallerID to use when dialing the endpoint or extension.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "timeout", + "description": "Timeout (in seconds) before giving up dialing, or -1 for no timeout.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 30 + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds variable key/value pairs to set on the channel on creation. Other keys in the body object are interpreted as query parameters. Ex. { \"endpoint\": \"SIP/Alice\", \"variables\": { \"CALLERID(name)\": \"Alice\" } }", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + }, + { + "name": "channelId", + "description": "The unique id to assign the channel on creation.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "otherChannelId", + "description": "The unique id to assign the second channel when using local channels.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "originator", + "description": "The unique id of the channel which is originating this one.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "formats", + "description": "The format name capability list to use if originator is not specified. Ex. \"ulaw,slin16\". Format names can be found with \"core show codecs\".", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for originating a channel." + }, + { + "code": 409, + "reason": "Channel with given unique ID already exists." + } + ] + } + ] + }, + { + "path": "/channels/create", + "description": "Create a channel and place it in a Stasis app, but do not dial the channel yet.", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "14.0.0" + ], + "summary": "Create channel.", + "nickname": "create", + "responseClass": "Channel", + "parameters": [ + { + "name": "endpoint", + "description": "Endpoint for channel communication", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "app", + "description": "Stasis Application to place channel into", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application provided by 'app'. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "channelId", + "description": "The unique id to assign the channel on creation.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "otherChannelId", + "description": "The unique id to assign the second channel when using local channels.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "originator", + "description": "Unique ID of the calling channel", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "formats", + "description": "The format name capability list to use if originator is not specified. Ex. \"ulaw,slin16\". Format names can be found with \"core show codecs\".", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds variable key/value pairs to set on the channel on creation. Other keys in the body object are interpreted as query parameters. Ex. { \"endpoint\": \"SIP/Alice\", \"variables\": { \"CALLERID(name)\": \"Alice\" } }", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + } + ], + "errorResponses": [ + { + "code": 409, + "reason": "Channel with given unique ID already exists." + } + ] + } + ] + }, + { + "path": "/channels/{channelId}", + "description": "Active channel", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "12.0.0" + ], + "summary": "Channel details.", + "nickname": "get", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + } + ] + }, + { + "httpMethod": "POST", + "since": [ + "12.2.0" + ], + "summary": "Create a new channel (originate with id).", + "notes": "The new channel is created immediately and a snapshot of it returned. If a Stasis application is provided it will be automatically subscribed to the originated channel for further events and updates.", + "nickname": "originateWithId", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "The unique id to assign the channel on creation.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "endpoint", + "description": "Endpoint to call.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "extension", + "description": "The extension to dial after the endpoint answers. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "context", + "description": "The context to dial after the endpoint answers. If omitted, uses 'default'. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "priority", + "description": "The priority to dial after the endpoint answers. If omitted, uses 1. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "long" + }, + { + "name": "label", + "description": "The label to dial after the endpoint answers. Will supersede 'priority' if provided. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "app", + "description": "The application that is subscribed to the originated channel. When the channel is answered, it will be passed to this Stasis application. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application provided by 'app'. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "callerId", + "description": "CallerID to use when dialing the endpoint or extension.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "timeout", + "description": "Timeout (in seconds) before giving up dialing, or -1 for no timeout.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 30 + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds variable key/value pairs to set on the channel on creation. Other keys in the body object are interpreted as query parameters. Ex. { \"endpoint\": \"SIP/Alice\", \"variables\": { \"CALLERID(name)\": \"Alice\" } }", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + }, + { + "name": "otherChannelId", + "description": "The unique id to assign the second channel when using local channels.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "originator", + "description": "The unique id of the channel which is originating this one.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "formats", + "description": "The format name capability list to use if originator is not specified. Ex. \"ulaw,slin16\". Format names can be found with \"core show codecs\".", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for originating a channel." + }, + { + "code": 409, + "reason": "Channel with given unique ID already exists." + } + ] + + }, + { + "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], + "summary": "Delete (i.e. hangup) a channel.", + "nickname": "hangup", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "reason_code", + "description": "The reason code for hanging up the channel for detail use. Mutually exclusive with 'reason'. See detail hangup codes at here. https://docs.asterisk.org/Configuration/Miscellaneous/Hangup-Cause-Mappings/", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "reason", + "description": "Reason for hanging up the channel for simple use. Mutually exclusive with 'reason_code'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "normal", + "busy", + "congestion", + "no_answer", + "timeout", + "rejected", + "unallocated", + "normal_unspecified", + "number_incomplete", + "codec_mismatch", + "interworking", + "failure", + "answered_elsewhere" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid reason for hangup provided" + }, + { + "code": 404, + "reason": "Channel not found" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/continue", + "description": "Exit application; continue execution in the dialplan", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "12.0.0" + ], + "summary": "Exit application; continue execution in the dialplan.", + "nickname": "continueInDialplan", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "context", + "description": "The context to continue to.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "extension", + "description": "The extension to continue to.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "priority", + "description": "The priority to continue to.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "label", + "description": "The label to continue to - will supersede 'priority' if both are provided.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/move", + "description": "Move the channel from one Stasis application to another.", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "13.26.0", + "16.3.0" + ], + "summary": "Move the channel from one Stasis application to another.", + "nickname": "move", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "app", + "description": "The channel will be passed to this Stasis application.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application provided by 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": "404", + "reason": "Channel not found" + }, + { + "code": "409", + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/redirect", + "description": "Inform the channel that it should redirect itself to a different location. Note that this will almost certainly cause the channel to exit the application.", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "13.3.0" + ], + "summary": "Redirect the channel to a different location.", + "nickname": "redirect", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "endpoint", + "description": "The endpoint to redirect the channel to", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Endpoint parameter not provided" + }, + { + "code": 404, + "reason": "Channel or endpoint not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 422, + "reason": "Endpoint is not the same type as the channel" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/answer", + "description": "Answer a channel", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "12.0.0" + ], + "summary": "Answer a channel.", + "nickname": "answer", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/ring", + "description": "Send a ringing indication to a channel", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "12.0.0" + ], + "summary": "Indicate ringing to a channel.", + "nickname": "ring", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + }, + { + "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], + "summary": "Stop ringing indication on a channel if locally generated.", + "nickname": "ringStop", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/progress", + "description": "Indicate progress on a channel", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "22.6.0", + "21.11.0", + "20.16.0" + ], + "summary": "Indicate progress on a channel.", + "nickname": "progress", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/dtmf", + "description": "Send DTMF to a channel", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "12.0.0" + ], + "summary": "Send provided DTMF to a given channel.", + "nickname": "sendDTMF", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "dtmf", + "description": "DTMF To send.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "before", + "description": "Amount of time to wait before DTMF digits (specified in milliseconds) start.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0 + }, + { + "name": "between", + "description": "Amount of time in between DTMF digits (specified in milliseconds).", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 100 + }, + { + "name": "duration", + "description": "Length of each DTMF digit (specified in milliseconds).", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 100 + }, + { + "name": "after", + "description": "Amount of time to wait after DTMF digits (specified in milliseconds) end.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0 + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "DTMF is required" + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/mute", + "description": "Mute a channel", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "12.0.0" + ], + "summary": "Mute a channel.", + "nickname": "mute", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "direction", + "description": "Direction in which to mute audio", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "both", + "allowableValues": { + "valueType": "LIST", + "values": [ + "both", + "in", + "out" + ] + } + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + }, + { + "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], + "summary": "Unmute a channel.", + "nickname": "unmute", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "direction", + "description": "Direction in which to unmute audio", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "both", + "allowableValues": { + "valueType": "LIST", + "values": [ + "both", + "in", + "out" + ] + } + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/hold", + "description": "Put a channel on hold", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "12.0.0" + ], + "summary": "Hold a channel.", + "nickname": "hold", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + }, + { + "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], + "summary": "Remove a channel from hold.", + "nickname": "unhold", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/moh", + "description": "Play music on hold to a channel", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "12.0.0" + ], + "summary": "Play music on hold to a channel.", + "notes": "Using media operations such as /play on a channel playing MOH in this manner will suspend MOH without resuming automatically. If continuing music on hold is desired, the stasis application must reinitiate music on hold.", + "nickname": "startMoh", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "mohClass", + "description": "Music on hold class to use", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + }, + { + "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], + "summary": "Stop playing music on hold to a channel.", + "nickname": "stopMoh", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/silence", + "description": "Play silence to a channel", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "12.0.0" + ], + "summary": "Play silence to a channel.", + "notes": "Using media operations such as /play on a channel playing silence in this manner will suspend silence without resuming automatically.", + "nickname": "startSilence", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + }, + { + "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], + "summary": "Stop playing silence to a channel.", + "nickname": "stopSilence", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/play", + "description": "Play media to a channel", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "12.0.0" + ], + "summary": "Start playback of media.", + "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "play", + "responseClass": "Playback", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media URIs to play.", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of milliseconds to skip before playing. Only applies to the first URI if multiple media URIs are specified.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000 + }, + { + "name": "playbackId", + "description": "Playback ID.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/play/{playbackId}", + "description": "Play media to a channel", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "12.2.0" + ], + "summary": "Start playback of media and specify the playbackId.", + "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "playWithId", + "responseClass": "Playback", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "playbackId", + "description": "Playback ID.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media URIs to play.", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of milliseconds to skip before playing. Only applies to the first URI if multiple media URIs are specified.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000 + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/record", + "description": "Record audio from a channel", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "12.0.0" + ], + "summary": "Start a recording.", + "notes": "Record audio from a channel. Note that this will not capture audio sent to the channel. The bridge itself has a record feature if that's what you want.", + "nickname": "record", + "responseClass": "LiveRecording", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Recording's filename", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "format", + "description": "Format to encode audio in", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "maxDurationSeconds", + "description": "Maximum duration of the recording, in seconds. 0 for no limit", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "maxSilenceSeconds", + "description": "Maximum duration of silence, in seconds. 0 for no limit", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "ifExists", + "description": "Action to take if a recording with the same name already exists.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "fail", + "allowableValues": { + "valueType": "LIST", + "values": [ + "fail", + "overwrite", + "append" + ] + } + }, + { + "name": "beep", + "description": "Play beep when recording begins", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean", + "defaultValue": false + }, + { + "name": "terminateOn", + "description": "DTMF input to terminate recording", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "any", + "*", + "#" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel is not in a Stasis application; the channel is currently bridged with other channels; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail" + }, + { + "code": 422, + "reason": "The format specified is unknown on this system" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/variable", + "description": "Variables on a channel", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "12.0.0" + ], + "summary": "Get the value of a channel variable or function.", + "nickname": "getChannelVar", + "responseClass": "Variable", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variable", + "description": "The channel variable or function to get", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + }, + { + "code": 404, + "reason": "Channel or variable not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "POST", + "since": [ + "12.0.0" + ], + "summary": "Set the value of a channel variable or function.", + "nickname": "setChannelVar", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variable", + "description": "The channel variable or function to set", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "value", + "description": "The value to set the variable to", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/snoop", + "description": "Snoop (spy/whisper) on a channel", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "12.0.0" + ], + "summary": "Start snooping.", + "notes": "Snoop (spy/whisper) on a specific channel.", + "nickname": "snoopChannel", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "spy", + "description": "Direction of audio to spy on", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "whisper", + "description": "Direction of audio to whisper into", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "app", + "description": "Application the snooping channel is placed into", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "snoopId", + "description": "Unique ID to assign to snooping channel", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Channel not found" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/snoop/{snoopId}", + "description": "Snoop (spy/whisper) on a channel", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "12.2.0" + ], + "summary": "Start snooping.", + "notes": "Snoop (spy/whisper) on a specific channel.", + "nickname": "snoopChannelWithId", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "snoopId", + "description": "Unique ID to assign to snooping channel", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "spy", + "description": "Direction of audio to spy on", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "whisper", + "description": "Direction of audio to whisper into", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "app", + "description": "Application the snooping channel is placed into", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Channel not found" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/dial", + "description": "Dial a channel", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "14.0.0" + ], + "summary": "Dial a created channel.", + "nickname": "dial", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "caller", + "description": "Channel ID of caller", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "timeout", + "description": "Dial timeout", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel cannot be found." + }, + { + "code": 409, + "reason": "Channel cannot be dialed." + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/rtp_statistics", + "description": "Get RTP statistics information for RTP on a channel", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "13.27.0", + "16.4.0" + ], + "summary": "RTP stats on a channel.", + "nickname": "rtpstatistics", + "responseClass": "RTPstat", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel cannot be found." + } + ] + } + ] + }, + { + "path": "/channels/externalMedia", + "description": "Create a channel to an External Media source/sink.", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "16.6.0", + "17.1.0" + ], + "summary": "Start an External Media session.", + "notes": "Create a channel to an External Media source/sink. The combination of transport and encapsulation will select one of chan_rtp(udp/rtp), chan_audiosocket(tcp/audiosocket) or chan_websocket(websocket/none) channel drivers.", + "nickname": "externalMedia", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "The unique id to assign the channel on creation.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "app", + "description": "Stasis Application to place channel into", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds variable key/value pairs to set on the channel on creation. Other keys in the body object are interpreted as query parameters. Ex. { \"endpoint\": \"SIP/Alice\", \"variables\": { \"CALLERID(name)\": \"Alice\" } }", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + }, + { + "name": "external_host", + "description": "Hostname/ip:port or websocket_client connection ID of external host. May be empty for a websocket server connection.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "encapsulation", + "description": "Payload encapsulation protocol. Must be 'none' for the websocket transport.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "rtp", + "allowableValues": { + "valueType": "LIST", + "values": [ + "rtp", + "audiosocket", + "none" + ] + } + }, + { + "name": "transport", + "description": "Transport protocol", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "udp", + "allowableValues": { + "valueType": "LIST", + "values": [ + "udp", + "tcp", + "websocket" + ] + } + }, + { + "name": "connection_type", + "description": "Connection type (client/server). 'server' is only valid for the websocket transport.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "client", + "allowableValues": { + "valueType": "LIST", + "values": [ + "client", + "server" + ] + } + }, + { + "name": "format", + "description": "Format to encode audio in", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "direction", + "description": "External media direction", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "both", + "allowableValues": { + "valueType": "LIST", + "values": [ + "both" + ] + } + }, + { + "name": "data", + "description": "An arbitrary data field", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 409, + "reason": "Channel is not in a Stasis application; Channel is already bridged" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/transfer_progress", + "description": "Inform the channel that the transfer is in progress.", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "22.3.0", + "21.8.0", + "20.13.0" + ], + "summary": "Inform the channel about the progress of the attended/blind transfer.", + "nickname": "transfer_progress", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "states", + "description": "The state of the progress", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Endpoint parameter not provided" + }, + { + "code": 404, + "reason": "Channel or endpoint not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] + } + ], + "models": { + "Dialed": { + "id": "Dialed", + "description": "Dialed channel information.", + "properties": {} + }, + "DialplanCEP": { + "id": "DialplanCEP", + "description": "Dialplan location (context/extension/priority)", + "properties": { + "context": { + "required": true, + "type": "string", + "description": "Context in the dialplan" + }, + "exten": { + "required": true, + "type": "string", + "description": "Extension in the dialplan" + }, + "priority": { + "required": true, + "type": "long", + "description": "Priority in the dialplan" + }, + "app_name": { + "required": true, + "type": "string", + "description": "Name of current dialplan application" + }, + "app_data": { + "required": true, + "type": "string", + "description": "Parameter of current dialplan application" + } + } + }, + "CallerID": { + "id": "CallerID", + "description": "Caller identification", + "properties": { + "name": { + "required": true, + "type": "string" + }, + "number": { + "required": true, + "type": "string" + } + } + }, + "RTPstat": { + "id": "RTPstat", + "description": "A statistics of a RTP.", + "properties": { + "txcount": { + "required": true, + "type": "int", + "description": "Number of packets transmitted." + }, + "rxcount": { + "required": true, + "type": "int", + "description": "Number of packets received." + }, + "txjitter": { + "required": false, + "type": "double", + "description": "Jitter on transmitted packets." + }, + "rxjitter": { + "required": false, + "type": "double", + "description": "Jitter on received packets." + }, + "remote_maxjitter": { + "required": false, + "type": "double", + "description": "Maximum jitter on remote side." + }, + "remote_minjitter": { + "required": false, + "type": "double", + "description": "Minimum jitter on remote side." + }, + "remote_normdevjitter": { + "required": false, + "type": "double", + "description": "Average jitter on remote side." + }, + "remote_stdevjitter": { + "required": false, + "type": "double", + "description": "Standard deviation jitter on remote side." + }, + "local_maxjitter": { + "required": false, + "type": "double", + "description": "Maximum jitter on local side." + }, + "local_minjitter": { + "required": false, + "type": "double", + "description": "Minimum jitter on local side." + }, + "local_normdevjitter": { + "required": false, + "type": "double", + "description": "Average jitter on local side." + }, + "local_stdevjitter": { + "required": false, + "type": "double", + "description": "Standard deviation jitter on local side." + }, + "txploss": { + "required": true, + "type": "int", + "description": "Number of transmitted packets lost." + }, + "rxploss": { + "required": true, + "type": "int", + "description": "Number of received packets lost." + }, + "remote_maxrxploss": { + "required": false, + "type": "double", + "description": "Maximum number of packets lost on remote side." + }, + "remote_minrxploss": { + "required": false, + "type": "double", + "description": "Minimum number of packets lost on remote side." + }, + "remote_normdevrxploss": { + "required": false, + "type": "double", + "description": "Average number of packets lost on remote side." + }, + "remote_stdevrxploss": { + "required": false, + "type": "double", + "description": "Standard deviation packets lost on remote side." + }, + "local_maxrxploss": { + "required": false, + "type": "double", + "description": "Maximum number of packets lost on local side." + }, + "local_minrxploss": { + "required": false, + "type": "double", + "description": "Minimum number of packets lost on local side." + }, + "local_normdevrxploss": { + "required": false, + "type": "double", + "description": "Average number of packets lost on local side." + }, + "local_stdevrxploss": { + "required": false, + "type": "double", + "description": "Standard deviation packets lost on local side." + }, + "rtt": { + "required": false, + "type": "double", + "description": "Total round trip time." + }, + "maxrtt": { + "required": false, + "type": "double", + "description": "Maximum round trip time." + }, + "minrtt": { + "required": false, + "type": "double", + "description": "Minimum round trip time." + }, + "normdevrtt": { + "required": false, + "type": "double", + "description": "Average round trip time." + }, + "stdevrtt": { + "required": false, + "type": "double", + "description": "Standard deviation round trip time." + }, + "local_ssrc": { + "required": true, + "type": "int", + "description": "Our SSRC." + }, + "remote_ssrc": { + "required": true, + "type": "int", + "description": "Their SSRC." + }, + "txoctetcount": { + "required": true, + "type": "int", + "description": "Number of octets transmitted." + }, + "rxoctetcount": { + "required": true, + "type": "int", + "description": "Number of octets received." + }, + "channel_uniqueid": { + "required": true, + "type": "string", + "description": "The Asterisk channel's unique ID that owns this instance." + } + } + }, + "Channel": { + "id": "Channel", + "description": "A specific communication connection between Asterisk and an Endpoint.", + "properties": { + "id": { + "required": true, + "type": "string", + "description": "Unique identifier of the channel.\n\nThis is the same as the Uniqueid field in AMI." + }, + "protocol_id": { + "required": true, + "type": "string", + "description": "Protocol id from underlying channel driver (i.e. Call-ID for chan_pjsip; will be empty if not applicable or not implemented by driver)." + }, + "name": { + "required": true, + "type": "string", + "description": "Name of the channel (i.e. SIP/foo-0000a7e3)" + }, + "state": { + "required": true, + "type": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "Down", + "Rsrved", + "OffHook", + "Dialing", + "Ring", + "Ringing", + "Up", + "Busy", + "Dialing Offhook", + "Pre-ring", + "Unknown" + ] + } + }, + "caller": { + "required": true, + "type": "CallerID" + }, + "connected": { + "required": true, + "type": "CallerID" + }, + "accountcode": { + "required": true, + "type": "string" + }, + "dialplan": { + "required": true, + "type": "DialplanCEP", + "description": "Current location in the dialplan" + }, + "creationtime": { + "required": true, + "type": "Date", + "description": "Timestamp when channel was created" + }, + "language": { + "required": true, + "type": "string", + "description": "The default spoken language" + }, + "channelvars": { + "required": false, + "type": "object", + "description": "Channel variables" + }, + "caller_rdnis": { + "type": "string", + "description": "The Caller ID RDNIS" + }, + "tenantid": { + "required": false, + "type": "string", + "description": "The Tenant ID for the channel" + } + } + } + } +} diff --git a/codegen/src/main/resources/codegen-data/ari_11_0_0/deviceStates.json b/codegen/src/main/resources/codegen-data/ari_11_0_0/deviceStates.json new file mode 100644 index 00000000..f0a889bc --- /dev/null +++ b/codegen/src/main/resources/codegen-data/ari_11_0_0/deviceStates.json @@ -0,0 +1,169 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "Kevin Harwell ", + "_svn_revision": "$Revision$", + "apiVersion": "2.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/deviceStates.{format}", + "since": [ + "12.0.0" + ], + "requiresModules": [ + "res_stasis_device_state" + ], + "apis": [ + { + "path": "/deviceStates", + "description": "Device states", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "12.0.0" + ], + "summary": "List all ARI controlled device states.", + "nickname": "list", + "responseClass": "List[DeviceState]" + } + ] + }, + { + "path": "/deviceStates/{deviceName}", + "description": "Device state", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "12.0.0" + ], + "summary": "Retrieve the current state of a device.", + "nickname": "get", + "responseClass": "DeviceState", + "parameters": [ + { + "name": "deviceName", + "description": "Name of the device", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ] + }, + { + "httpMethod": "PUT", + "since": [ + "12.0.0" + ], + "summary": "Change the state of a device controlled by ARI. (Note - implicitly creates the device state).", + "nickname": "update", + "responseClass": "void", + "parameters": [ + { + "name": "deviceName", + "description": "Name of the device", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "deviceState", + "description": "Device state value", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "NOT_INUSE", + "INUSE", + "BUSY", + "INVALID", + "UNAVAILABLE", + "RINGING", + "RINGINUSE", + "ONHOLD" + ] + } + + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Device name is missing" + }, + { + "code": 409, + "reason": "Uncontrolled device specified" + } + ] + }, + { + "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], + "summary": "Destroy a device-state controlled by ARI.", + "nickname": "delete", + "responseClass": "void", + "parameters": [ + { + "name": "deviceName", + "description": "Name of the device", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Device name is missing" + }, + { + "code": 409, + "reason": "Uncontrolled device specified" + } + ] + } + ] + } + ], + "models": { + "DeviceState": { + "id": "DeviceState", + "description": "Represents the state of a device.", + "properties": { + "name": { + "type": "string", + "description": "Name of the device.", + "required": true + }, + "state": { + "type": "string", + "description": "Device's state", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "UNKNOWN", + "NOT_INUSE", + "INUSE", + "BUSY", + "INVALID", + "UNAVAILABLE", + "RINGING", + "RINGINUSE", + "ONHOLD" + ] + } + } + } + } + } +} diff --git a/codegen/src/main/resources/codegen-data/ari_11_0_0/endpoints.json b/codegen/src/main/resources/codegen-data/ari_11_0_0/endpoints.json new file mode 100644 index 00000000..233f2c84 --- /dev/null +++ b/codegen/src/main/resources/codegen-data/ari_11_0_0/endpoints.json @@ -0,0 +1,423 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "2.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/endpoints.{format}", + "since": [ + "12.0.0" + ], + "apis": [ + { + "path": "/endpoints", + "description": "Asterisk endpoints", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "12.0.0" + ], + "summary": "List all endpoints.", + "nickname": "list", + "responseClass": "List[Endpoint]" + } + ] + }, + { + "path": "/endpoints/sendMessage", + "description": "Send a message to some technology URI or endpoint.", + "operations": [ + { + "httpMethod": "PUT", + "since": [ + "13.0.0" + ], + "summary": "Send a message to some technology URI or endpoint.", + "nickname": "sendMessage", + "responseClass": "void", + "parameters": [ + { + "name": "to", + "description": "The endpoint resource or technology specific URI to send the message to. Valid resources are pjsip, and xmpp.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "from", + "description": "The endpoint resource or technology specific identity to send this message from. Valid resources are pjsip, and xmpp.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "body", + "description": "The body of the message", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variables", + "descriptioni": "The \"variables\" key in the body object holds technology specific key/value pairs to append to the message. These can be interpreted and used by the various resource types; for example, pjsip and sip resource types will add the key/value pairs as SIP headers,", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for sending a message." + }, + { + "code": 404, + "reason": "Endpoint not found" + } + ] + } + ] + }, + { + "path": "/endpoints/refer", + "description": "Refer an endpoint or technology URI to some technology URI or endpoint.", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "18.20.0", + "20.5.0" + ], + "summary": "Refer an endpoint or technology URI to some technology URI or endpoint.", + "nickname": "refer", + "responseClass": "void", + "parameters": [ + { + "name": "to", + "description": "The endpoint resource or technology specific URI that should be referred to somewhere. Valid resource is pjsip.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "from", + "description": "The endpoint resource or technology specific identity to refer from.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "refer_to", + "description": "The endpoint resource or technology specific URI to refer to.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "to_self", + "description": "If true and \"refer_to\" refers to an Asterisk endpoint, the \"refer_to\" value is set to point to this Asterisk endpoint - so the referee is referred to Asterisk. Otherwise, use the contact URI associated with the endpoint.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean", + "defaultValue": false + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds technology specific key/value pairs to append to the message. These can be interpreted and used by the various resource types; for example, the pjsip resource type will add the key/value pairs as SIP headers. The \"display_name\" key is used by the PJSIP technology. Its value will be prepended as a display name to the Refer-To URI.", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for referring." + }, + { + "code": 404, + "reason": "Endpoint not found" + } + ] + } + ] + }, + { + "path": "/endpoints/{tech}", + "description": "Asterisk endpoints", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "12.0.0" + ], + "summary": "List available endoints for a given endpoint technology.", + "nickname": "listByTech", + "responseClass": "List[Endpoint]", + "parameters": [ + { + "name": "tech", + "description": "Technology of the endpoints (pjsip,iax2,...)", + "paramType": "path", + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Endpoints not found" + } + ] + } + ] + }, + { + "path": "/endpoints/{tech}/{resource}", + "description": "Single endpoint", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "12.0.0" + ], + "summary": "Details for an endpoint.", + "nickname": "get", + "responseClass": "Endpoint", + "parameters": [ + { + "name": "tech", + "description": "Technology of the endpoint", + "paramType": "path", + "dataType": "string" + }, + { + "name": "resource", + "description": "ID of the endpoint", + "paramType": "path", + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for sending a message." + }, + { + "code": 404, + "reason": "Endpoints not found" + } + ] + } + ] + }, + { + "path": "/endpoints/{tech}/{resource}/sendMessage", + "description": "Send a message to some endpoint in a technology.", + "operations": [ + { + "httpMethod": "PUT", + "since": [ + "13.0.0" + ], + "summary": "Send a message to some endpoint in a technology.", + "nickname": "sendMessageToEndpoint", + "responseClass": "void", + "parameters": [ + { + "name": "tech", + "description": "Technology of the endpoint", + "paramType": "path", + "dataType": "string" + }, + { + "name": "resource", + "description": "ID of the endpoint", + "paramType": "path", + "dataType": "string" + }, + { + "name": "from", + "description": "The endpoint resource or technology specific identity to send this message from. Valid resources are pjsip and xmpp.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "body", + "description": "The body of the message", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variables", + "descriptioni": "The \"variables\" key in the body object holds technology specific key/value pairs to append to the message. These can be interpreted and used by the various resource types; for example, pjsip and sip resource types will add the key/value pairs as SIP headers,", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for sending a message." + }, + { + "code": 404, + "reason": "Endpoint not found" + } + ] + } + ] + }, + { + "path": "/endpoints/{tech}/{resource}/refer", + "description": "Refer an endpoint in a technology to some technology URI or endpoint..", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "18.20.0", + "20.5.0" + ], + "summary": "Refer an endpoint or technology URI to some technology URI or endpoint.", + "nickname": "referToEndpoint", + "responseClass": "void", + "parameters": [ + { + "name": "tech", + "description": "Technology of the endpoint", + "paramType": "path", + "dataType": "string" + }, + { + "name": "resource", + "description": "ID of the endpoint", + "paramType": "path", + "dataType": "string" + }, + { + "name": "from", + "description": "The endpoint resource or technology specific identity to refer from.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "refer_to", + "description": "The endpoint resource or technology specific URI to refer to.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "to_self", + "description": "If true and \"refer_to\" refers to an Asterisk endpoint, the \"refer_to\" value is set to point to this Asterisk endpoint - so the referee is referred to Asterisk. Otherwise, use the contact URI associated with the endpoint.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean", + "defaultValue": false + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds technology specific key/value pairs to append to the message. These can be interpreted and used by the various resource types; for example, the pjsip resource type will add the key/value pairs as SIP headers,", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for referring." + }, + { + "code": 404, + "reason": "Endpoint not found" + } + ] + } + ] + } + ], + "models": { + "Endpoint": { + "id": "Endpoint", + "description": "An external device that may offer/accept calls to/from Asterisk.\n\nUnlike most resources, which have a single unique identifier, an endpoint is uniquely identified by the technology/resource pair.", + "properties": { + "technology": { + "type": "string", + "description": "Technology of the endpoint", + "required": true + }, + "resource": { + "type": "string", + "description": "Identifier of the endpoint, specific to the given technology.", + "required": true + }, + "state": { + "type": "string", + "description": "Endpoint's state", + "required": false, + "allowableValues": { + "valueType": "LIST", + "values": [ + "unknown", + "offline", + "online" + ] + } + }, + "channel_ids": { + "type": "List[string]", + "description": "Id's of channels associated with this endpoint", + "required": true + } + } + }, + "TextMessage": { + "id": "TextMessage", + "description": "A text message.", + "properties": { + "from": { + "type": "string", + "description": "A technology specific URI specifying the source of the message. For pjsip technology, any SIP URI can be specified. For xmpp, the URI must correspond to the client connection being used to send the message.", + "required": true + }, + "to": { + "type": "string", + "description": "A technology specific URI specifying the destination of the message. Valid technologies include pjsip, and xmp. The destination of a message should be an endpoint.", + "required": true + }, + "body": { + "type": "string", + "description": "The text of the message.", + "required": true + }, + "variables": { + "type": "object", + "description": "Technology specific key/value pairs (JSON object) associated with the message.", + "required": false + } + } + } + } +} diff --git a/codegen/src/main/resources/codegen-data/ari_11_0_0/events.json b/codegen/src/main/resources/codegen-data/ari_11_0_0/events.json new file mode 100644 index 00000000..f08a665e --- /dev/null +++ b/codegen/src/main/resources/codegen-data/ari_11_0_0/events.json @@ -0,0 +1,1184 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "2.0.0", + "swaggerVersion": "1.2", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/events.{format}", + "since": [ + "12.0.0" + ], + "requiresModules": [ + "res_http_websocket" + ], + "apis": [ + { + "path": "/events", + "description": "Events from Asterisk to applications", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "12.0.0" + ], + "upgrade": "websocket", + "websocketProtocol": "ari", + "summary": "WebSocket connection for events.", + "nickname": "eventWebsocket", + "responseClass": "Message", + "parameters": [ + { + "name": "app", + "description": "Applications to subscribe to.", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + }, + { + "name": "subscribeAll", + "description": "Subscribe to all Asterisk events. If provided, the applications listed will be subscribed to all events, effectively disabling the application specific subscriptions. Default is 'false'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean" + } + ] + } + ] + }, + { + "path": "/events/user/{eventName}", + "description": "Stasis application user events", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "12.3.0" + ], + "summary": "Generate a user event.", + "nickname": "userEvent", + "responseClass": "void", + "parameters": [ + { + "name": "eventName", + "description": "Event name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "application", + "description": "The name of the application that will receive this event", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "source", + "description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}, deviceState:{deviceName}", + "paramType": "query", + "required": false, + "allowMultiple": true, + "dataType": "string" + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds custom key/value pairs to add to the user event. Ex. { \"variables\": { \"key\": \"value\" } }", + "paramType": "body", + "required": false, + "allowMultiple": false, + "dataType": "containers" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Application does not exist." + }, + { + "code": 422, + "reason": "Event source not found." + }, + { + "code": 400, + "reason": "Invalid even tsource URI or userevent data." + } + ] + } + ] + } + ], + "models": { + "Message": { + "id": "Message", + "description": "Base type for errors and events", + "discriminator": "type", + "properties": { + "type": { + "type": "string", + "required": true, + "description": "Indicates the type of this message." + }, + "asterisk_id": { + "type": "string", + "required": false, + "description": "The unique ID for the Asterisk instance that raised this event." + } + }, + "subTypes": [ + "MissingParams", + "Event" + ] + }, + "MissingParams": { + "id": "MissingParams", + "description": "Error event sent when required params are missing.", + "properties": { + "params": { + "required": true, + "type": "List[string]", + "description": "A list of the missing parameters" + } + } + }, + "Event": { + "id": "Event", + "description": "Base type for asynchronous events from Asterisk.", + "properties": { + "application": { + "type": "string", + "description": "Name of the application receiving the event.", + "required": true + }, + "timestamp": { + "type": "Date", + "description": "Time at which this event was created.", + "required": true + } + }, + "subTypes": [ + "DeviceStateChanged", + "PlaybackStarted", + "PlaybackContinuing", + "PlaybackFinished", + "RecordingStarted", + "RecordingFinished", + "RecordingFailed", + "ApplicationMoveFailed", + "ApplicationRegistered", + "ApplicationUnregistered", + "ApplicationReplaced", + "BridgeCreated", + "BridgeDestroyed", + "BridgeMerged", + "BridgeBlindTransfer", + "BridgeAttendedTransfer", + "BridgeVideoSourceChanged", + "ChannelCreated", + "ChannelDestroyed", + "ChannelEnteredBridge", + "ChannelLeftBridge", + "ChannelStateChange", + "ChannelDtmfReceived", + "ChannelDialplan", + "ChannelCallerId", + "ChannelUserevent", + "ChannelHangupRequest", + "ChannelVarset", + "ChannelToneDetected", + "ChannelTalkingStarted", + "ChannelTalkingFinished", + "ChannelHold", + "ChannelUnhold", + "ContactStatusChange", + "EndpointStateChange", + "Dial", + "StasisEnd", + "StasisStart", + "TextMessageReceived", + "ChannelConnectedLine", + "PeerStatusChange", + "ChannelTransfer", + "RESTResponse" + ] + }, + "ContactInfo": { + "id": "ContactInfo", + "description": "Detailed information about a contact on an endpoint.", + "properties": { + "uri": { + "type": "string", + "description": "The location of the contact.", + "required": true + }, + "contact_status": { + "type": "string", + "description": "The current status of the contact.", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "Unreachable", + "Reachable", + "Unknown", + "NonQualified", + "Removed" + ] + } + }, + "aor": { + "type": "string", + "description": "The Address of Record this contact belongs to.", + "required": true + }, + "roundtrip_usec": { + "type": "string", + "description": "Current round trip time, in microseconds, for the contact.", + "required": false + } + } + }, + "Peer": { + "id": "Peer", + "description": "Detailed information about a remote peer that communicates with Asterisk.", + "properties": { + "peer_status": { + "type": "string", + "description": "The current state of the peer. Note that the values of the status are dependent on the underlying peer technology.", + "required": true + }, + "cause": { + "type": "string", + "description": "An optional reason associated with the change in peer_status.", + "required": false + }, + "address": { + "type": "string", + "description": "The IP address of the peer.", + "required": false + }, + "port": { + "type": "string", + "description": "The port of the peer.", + "required": false + }, + "time": { + "type": "string", + "description": "The last known time the peer was contacted.", + "required": false + } + } + }, + "DeviceStateChanged": { + "id": "DeviceStateChanged", + "description": "Notification that a device state has changed.", + "properties": { + "device_state": { + "type": "DeviceState", + "description": "Device state object", + "required": true + } + } + }, + "PlaybackStarted": { + "id": "PlaybackStarted", + "description": "Event showing the start of a media playback operation.", + "properties": { + "playback": { + "type": "Playback", + "description": "Playback control object", + "required": true + } + } + }, + "PlaybackContinuing": { + "id": "PlaybackContinuing", + "description": "Event showing the continuation of a media playback operation from one media URI to the next in the list.", + "properties": { + "playback": { + "type": "Playback", + "description": "Playback control object", + "required": true + } + } + }, + "PlaybackFinished": { + "id": "PlaybackFinished", + "description": "Event showing the completion of a media playback operation.", + "properties": { + "playback": { + "type": "Playback", + "description": "Playback control object", + "required": true + } + } + }, + "RecordingStarted": { + "id": "RecordingStarted", + "description": "Event showing the start of a recording operation.", + "properties": { + "recording": { + "type": "LiveRecording", + "description": "Recording control object", + "required": true + } + } + }, + "RecordingFinished": { + "id": "RecordingFinished", + "description": "Event showing the completion of a recording operation.", + "properties": { + "recording": { + "type": "LiveRecording", + "description": "Recording control object", + "required": true + } + } + }, + "RecordingFailed": { + "id": "RecordingFailed", + "description": "Event showing failure of a recording operation.", + "properties": { + "recording": { + "type": "LiveRecording", + "description": "Recording control object", + "required": true + } + } + }, + "ApplicationMoveFailed": { + "id": "ApplicationMoveFailed", + "description": "Notification that trying to move a channel to another Stasis application failed.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + }, + "destination": { + "required": true, + "type": "string" + }, + "args": { + "required": true, + "type": "List[string]", + "description": "Arguments to the application" + } + } + }, + "ApplicationRegistered": { + "id": "ApplicationRegistered", + "description": "Notification that a Stasis app has been registered.", + "properties": {} + }, + "ApplicationUnregistered": { + "id": "ApplicationUnregistered", + "description": "Notification that a Stasis app has been unregistered.", + "properties": {} + }, + "ApplicationReplaced": { + "id": "ApplicationReplaced", + "description": "Notification that another WebSocket has taken over for an application.\n\nAn application may only be subscribed to by a single WebSocket at a time. If multiple WebSockets attempt to subscribe to the same application, the newer WebSocket wins, and the older one receives this event.", + "properties": {} + }, + "BridgeCreated": { + "id": "BridgeCreated", + "description": "Notification that a bridge has been created.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + } + } + }, + "BridgeDestroyed": { + "id": "BridgeDestroyed", + "description": "Notification that a bridge has been destroyed.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + } + } + }, + "BridgeMerged": { + "id": "BridgeMerged", + "description": "Notification that one bridge has merged into another.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "bridge_from": { + "required": true, + "type": "Bridge" + } + } + }, + "BridgeVideoSourceChanged": { + "id": "BridgeVideoSourceChanged", + "description": "Notification that the source of video in a bridge has changed.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "old_video_source_id": { + "required": false, + "type": "string" + } + } + }, + "BridgeBlindTransfer": { + "id": "BridgeBlindTransfer", + "description": "Notification that a blind transfer has occurred.", + "properties": { + "channel": { + "description": "The channel performing the blind transfer", + "required": true, + "type": "Channel" + }, + "replace_channel": { + "description": "The channel that is replacing transferer when the transferee(s) can not be transferred directly", + "required": false, + "type": "Channel" + }, + "transferee": { + "description": "The channel that is being transferred", + "required": false, + "type": "Channel" + }, + "exten": { + "description": "The extension transferred to", + "required": true, + "type": "string" + }, + "context": { + "description": "The context transferred to", + "required": true, + "type": "string" + }, + "result": { + "description": "The result of the transfer attempt", + "required": true, + "type": "string" + }, + "is_external": { + "description": "Whether the transfer was externally initiated or not", + "required": true, + "type": "boolean" + }, + "bridge": { + "description": "The bridge being transferred", + "type": "Bridge" + } + } + }, + "BridgeAttendedTransfer": { + "id": "BridgeAttendedTransfer", + "description": "Notification that an attended transfer has occurred.", + "properties": { + "transferer_first_leg": { + "description": "First leg of the transferer", + "required": true, + "type": "Channel" + }, + "transferer_second_leg": { + "description": "Second leg of the transferer", + "required": true, + "type": "Channel" + }, + "replace_channel": { + "description": "The channel that is replacing transferer_first_leg in the swap", + "required": false, + "type": "Channel" + }, + "transferee": { + "description": "The channel that is being transferred", + "required": false, + "type": "Channel" + }, + "transfer_target": { + "description": "The channel that is being transferred to", + "required": false, + "type": "Channel" + }, + "result": { + "description": "The result of the transfer attempt", + "required": true, + "type": "string" + }, + "is_external": { + "description": "Whether the transfer was externally initiated or not", + "required": true, + "type": "boolean" + }, + "transferer_first_leg_bridge": { + "description": "Bridge the transferer first leg is in", + "type": "Bridge" + }, + "transferer_second_leg_bridge": { + "description": "Bridge the transferer second leg is in", + "type": "Bridge" + }, + "destination_type": { + "description": "How the transfer was accomplished", + "required": true, + "type": "string" + }, + "destination_bridge": { + "description": "Bridge that survived the merge result", + "type": "string" + }, + "destination_application": { + "description": "Application that has been transferred into", + "type": "string" + }, + "destination_link_first_leg": { + "description": "First leg of a link transfer result", + "type": "Channel" + }, + "destination_link_second_leg": { + "description": "Second leg of a link transfer result", + "type": "Channel" + }, + "destination_threeway_channel": { + "description": "Transferer channel that survived the threeway result", + "type": "Channel" + }, + "destination_threeway_bridge": { + "description": "Bridge that survived the threeway result", + "type": "Bridge" + } + } + }, + "ChannelCreated": { + "id": "ChannelCreated", + "description": "Notification that a channel has been created.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelDestroyed": { + "id": "ChannelDestroyed", + "description": "Notification that a channel has been destroyed.", + "properties": { + "cause": { + "required": true, + "description": "Integer representation of the cause of the hangup", + "type": "int" + }, + "cause_txt": { + "required": true, + "description": "Text representation of the cause of the hangup", + "type": "string" + }, + "tech_cause": { + "type": "int", + "description": "Integer representation of the technology-specific off-nominal cause of the hangup." + }, + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelEnteredBridge": { + "id": "ChannelEnteredBridge", + "description": "Notification that a channel has entered a bridge.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "channel": { + "type": "Channel" + } + } + }, + "ChannelLeftBridge": { + "id": "ChannelLeftBridge", + "description": "Notification that a channel has left a bridge.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelStateChange": { + "id": "ChannelStateChange", + "description": "Notification of a channel's state change.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelDtmfReceived": { + "id": "ChannelDtmfReceived", + "description": "DTMF received on a channel.\n\nThis event is sent when the DTMF ends. There is no notification about the start of DTMF", + "properties": { + "digit": { + "required": true, + "type": "string", + "description": "DTMF digit received (0-9, A-E, # or *)" + }, + "duration_ms": { + "required": true, + "type": "int", + "description": "Number of milliseconds DTMF was received" + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which DTMF was received" + } + } + }, + "ChannelDialplan": { + "id": "ChannelDialplan", + "description": "Channel changed location in the dialplan.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel that changed dialplan location." + }, + "dialplan_app": { + "required": true, + "type": "string", + "description": "The application about to be executed." + }, + "dialplan_app_data": { + "required": true, + "type": "string", + "description": "The data to be passed to the application." + } + } + }, + "ChannelCallerId": { + "id": "ChannelCallerId", + "description": "Channel changed Caller ID.", + "properties": { + "caller_presentation": { + "required": true, + "type": "int", + "description": "The integer representation of the Caller Presentation value." + }, + "caller_presentation_txt": { + "required": true, + "type": "string", + "description": "The text representation of the Caller Presentation value." + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel that changed Caller ID." + } + } + }, + "ChannelUserevent": { + "id": "ChannelUserevent", + "description": "User-generated event with additional user-defined fields in the object.", + "properties": { + "eventname": { + "required": true, + "type": "string", + "description": "The name of the user event." + }, + "channel": { + "required": false, + "type": "Channel", + "description": "A channel that is signaled with the user event." + }, + "bridge": { + "required": false, + "type": "Bridge", + "description": "A bridge that is signaled with the user event." + }, + "endpoint": { + "required": false, + "type": "Endpoint", + "description": "A endpoint that is signaled with the user event." + }, + "userevent": { + "required": true, + "type": "object", + "description": "Custom Userevent data" + } + } + }, + "ChannelHangupRequest": { + "id": "ChannelHangupRequest", + "description": "A hangup was requested on the channel.", + "properties": { + "cause": { + "type": "int", + "description": "Integer representation of the cause of the hangup." + }, + "tech_cause": { + "type": "int", + "description": "Integer representation of the technology-specific off-nominal cause of the hangup." + }, + "soft": { + "type": "boolean", + "description": "Whether the hangup request was a soft hangup request." + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which the hangup was requested." + } + } + }, + "ChannelVarset": { + "id": "ChannelVarset", + "description": "Channel variable changed.", + "properties": { + "variable": { + "required": true, + "type": "string", + "description": "The variable that changed." + }, + "value": { + "required": true, + "type": "string", + "description": "The new value of the variable." + }, + "channel": { + "required": false, + "type": "Channel", + "description": "The channel on which the variable was set.\n\nIf missing, the variable is a global variable." + } + } + }, + "ChannelHold": { + "id": "ChannelHold", + "description": "A channel initiated a media hold.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel that initiated the hold event." + }, + "musicclass": { + "required": false, + "type": "string", + "description": "The music on hold class that the initiator requested." + } + } + }, + "ChannelUnhold": { + "id": "ChannelUnhold", + "description": "A channel initiated a media unhold.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel that initiated the unhold event." + } + } + }, + "ChannelToneDetected": { + "id": "ChannelToneDetected", + "description": "Tone was detected on the channel.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel the tone was detected on." + } + } + }, + "ChannelTalkingStarted": { + "id": "ChannelTalkingStarted", + "description": "Talking was detected on the channel.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which talking started." + } + } + }, + "ChannelTalkingFinished": { + "id": "ChannelTalkingFinished", + "description": "Talking is no longer detected on the channel.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which talking completed." + }, + "duration": { + "required": true, + "type": "int", + "description": "The length of time, in milliseconds, that talking was detected on the channel" + } + } + }, + "ContactStatusChange": { + "id": "ContactStatusChange", + "description": "The state of a contact on an endpoint has changed.", + "properties": { + "endpoint": { + "required": true, + "type": "Endpoint" + }, + "contact_info": { + "required": true, + "type": "ContactInfo" + } + } + }, + "PeerStatusChange": { + "id": "PeerStatusChange", + "description": "The state of a peer associated with an endpoint has changed.", + "properties": { + "endpoint": { + "required": true, + "type": "Endpoint" + }, + "peer": { + "required": true, + "type": "Peer" + } + } + }, + "EndpointStateChange": { + "id": "EndpointStateChange", + "description": "Endpoint state changed.", + "properties": { + "endpoint": { + "required": true, + "type": "Endpoint" + } + } + }, + "Dial": { + "id": "Dial", + "description": "Dialing state has changed.", + "properties": { + "caller": { + "required": false, + "type": "Channel", + "description": "The calling channel." + }, + "peer": { + "required": true, + "type": "Channel", + "description": "The dialed channel." + }, + "forward": { + "required": false, + "type": "string", + "description": "Forwarding target requested by the original dialed channel." + }, + "forwarded": { + "required": false, + "type": "Channel", + "description": "Channel that the caller has been forwarded to." + }, + "dialstring": { + "required": false, + "type": "string", + "description": "The dial string for calling the peer channel." + }, + "dialstatus": { + "required": true, + "type": "string", + "description": "Current status of the dialing attempt to the peer." + } + } + }, + "StasisEnd": { + "id": "StasisEnd", + "description": "Notification that a channel has left a Stasis application.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "StasisStart": { + "id": "StasisStart", + "description": "Notification that a channel has entered a Stasis application.", + "properties": { + "args": { + "required": true, + "type": "List[string]", + "description": "Arguments to the application" + }, + "channel": { + "required": true, + "type": "Channel" + }, + "replace_channel": { + "required": false, + "type": "Channel" + } + } + }, + "TextMessageReceived": { + "id": "TextMessageReceived", + "description": "A text message was received from an endpoint.", + "properties": { + "message": { + "required": true, + "type": "TextMessage" + }, + "endpoint": { + "required": false, + "type": "Endpoint" + } + } + }, + "ChannelConnectedLine": { + "id": "ChannelConnectedLine", + "description": "Channel changed Connected Line.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel whose connected line has changed." + } + } + }, + "ChannelTransfer": { + "id": "ChannelTransfer", + "description": "transfer on a channel.", + "properties": { + "state": { + "required": false, + "type": "string", + "description": "Transfer State" + }, + "refer_to": { + "required": true, + "type": "ReferTo", + "description": "Refer-To information with optionally both affected channels" + }, + "referred_by": { + "required": true, + "type": "ReferredBy", + "description": "Referred-By SIP Header according rfc3892" + } + } + }, + "ReferTo": { + "id": "ReferTo", + "description": "transfer destination requested by transferee", + "properties": { + "requested_destination": { + "required": true, + "type": "RequiredDestination" + }, + "destination_channel": { + "required": false, + "type": "Channel", + "description": "The Channel Object, that is to be replaced" + }, + "connected_channel": { + "required": false, + "type": "Channel", + "description": "Channel, connected to the to be replaced channel" + }, + "bridge": { + "required": false, + "type": "Bridge", + "description": "Bridge connecting both destination channels" + } + } + }, + "ReferredBy": { + "id": "ReferredBy", + "description": "transfer destination requested by transferee", + "properties": { + "source_channel": { + "required": true, + "type": "Channel", + "description": "The channel on which the refer was received" + }, + "connected_channel": { + "required": false, + "type": "Channel", + "description": "Channel, Connected to the channel, receiving the transfer request on." + }, + "bridge": { + "required": false, + "type": "Bridge", + "description": "Bridge connecting both Channels" + } + } + }, + "RequiredDestination": { + "id": "RequiredDestination", + "description": "Information about the requested destination", + "properties": { + "protocol_id": { + "required": false, + "type": "string", + "description": "the requested protocol-id by the referee in case of SIP channel, this is a SIP Call ID, Mutually exclusive to destination" + }, + "destination": { + "required": false, + "type": "string", + "description": "Destination User Part. Only for Blind transfer. Mutually exclusive to protocol_id" + }, + "additional_protocol_params": { + "required": false, + "type": "List[AdditionalParam]", + "description": "List of additional protocol specific information" + } + } + }, + "AdditionalParam": { + "id": "AdditionalParam", + "description": "Protocol specific additional parameter", + "properties": { + "parameter_name": { + "required": true, + "type": "string", + "description": "Name of the parameter" + }, + "parameter_value": { + "required": true, + "type": "string", + "description": "Value of the parameter" + } + } + }, + "RESTHeader": { + "id": "RESTHeader", + "description": "REST over Websocket header", + "properties": { + "name": { + "type": "string", + "description": "Header name", + "required": true + }, + "value": { + "required": true, + "type": "string", + "description": "Header value" + } + } + }, + "RESTQueryStringParameter": { + "id": "RESTQueryStringParameter", + "description": "REST over Websocket Query String Parameter", + "properties": { + "name": { + "type": "string", + "description": "Parameter name", + "required": true + }, + "value": { + "required": true, + "type": "string", + "description": "Parameter value" + } + } + }, + "RESTRequest": { + "id": "RESTRequest", + "description": "REST over Websocket Request.", + "properties": { + "type": { + "type": "string", + "description": "Message type. Must be 'RESTRequest'", + "required": true + }, + "transaction_id": { + "type": "string", + "description": "Opaque transaction id. Can be any valid string. Will be returned in any response to this request.", + "required": true + }, + "request_id": { + "type": "string", + "description": "Opaque request id. Can be any valid string. Will be returned in any response to this request.", + "required": true + }, + "method": { + "required": true, + "type": "string", + "description": "HTTP method (GET, PUT, POST, DELETE, etc.)" + }, + "uri": { + "required": true, + "type": "string", + "description": "Resource URI with optional query string parameters." + }, + "content_type": { + "required": false, + "type": "string", + "description": "The Content-Type of the message body." + }, + "query_strings": { + "required": false, + "type": "List[RESTQueryStringParameter]", + "description": "Request query string parameters." + }, + "message_body": { + "required": false, + "type": "string", + "description": "Request message body. Only content types application/json and application/x-www-form-urlencoded are supported." + } + } + }, + "RESTResponse": { + "id": "RESTResponse", + "description": "REST over Websocket Response.", + "properties": { + "transaction_id": { + "type": "string", + "description": "Opaque transaction id. Will be whatever was specified on the original request.", + "required": true + }, + "request_id": { + "type": "string", + "description": "Opaque request id. Will be whatever was specified on the original request.", + "required": true + }, + "status_code": { + "required": true, + "type": "int", + "description": "HTTP status code" + }, + "reason_phrase": { + "required": true, + "type": "string", + "description": "HTTP reason phrase" + }, + "uri": { + "required": true, + "type": "string", + "description": "Original request resource URI" + }, + "content_type": { + "required": false, + "type": "string", + "description": "The Content-Type of the message body." + }, + "message_body": { + "required": false, + "type": "string", + "description": "Response message body" + } + } + } + } +} diff --git a/codegen/src/main/resources/codegen-data/ari_11_0_0/mailboxes.json b/codegen/src/main/resources/codegen-data/ari_11_0_0/mailboxes.json new file mode 100644 index 00000000..d99e1eac --- /dev/null +++ b/codegen/src/main/resources/codegen-data/ari_11_0_0/mailboxes.json @@ -0,0 +1,152 @@ +{ + "_copyright": "Copyright (C) 2013, Digium, Inc.", + "_author": "Jonathan Rose ", + "_svn_revision": "$Revision$", + "apiVersion": "2.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/mailboxes.{format}", + "since": [ + "12.1.0" + ], + "requiresModules": [ + "res_stasis_mailbox" + ], + "apis": [ + { + "path": "/mailboxes", + "description": "Mailboxes", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "12.1.0" + ], + "summary": "List all mailboxes.", + "nickname": "list", + "responseClass": "List[Mailbox]" + } + ] + }, + { + "path": "/mailboxes/{mailboxName}", + "description": "Mailbox state", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "12.1.0" + ], + "summary": "Retrieve the current state of a mailbox.", + "nickname": "get", + "responseClass": "Mailbox", + "parameters": [ + { + "name": "mailboxName", + "description": "Name of the mailbox", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Mailbox not found" + } + ] + }, + { + "httpMethod": "PUT", + "since": [ + "12.1.0" + ], + "summary": "Change the state of a mailbox. (Note - implicitly creates the mailbox).", + "nickname": "update", + "responseClass": "void", + "parameters": [ + { + "name": "mailboxName", + "description": "Name of the mailbox", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "oldMessages", + "description": "Count of old messages in the mailbox", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "newMessages", + "description": "Count of new messages in the mailbox", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "int" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Mailbox not found" + } + ] + }, + { + "httpMethod": "DELETE", + "since": [ + "12.1.0" + ], + "summary": "Destroy a mailbox.", + "nickname": "delete", + "responseClass": "void", + "parameters": [ + { + "name": "mailboxName", + "description": "Name of the mailbox", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Mailbox not found" + } + ] + } + ] + } + ], + "models": { + "Mailbox": { + "id": "Mailbox", + "description": "Represents the state of a mailbox.", + "properties": { + "name": { + "type": "string", + "description": "Name of the mailbox.", + "required": true + }, + "old_messages": { + "type": "int", + "description": "Count of old messages in the mailbox.", + "required": true + }, + "new_messages": { + "type": "int", + "description": "Count of new messages in the mailbox.", + "required": true + } + } + } + } +} diff --git a/codegen/src/main/resources/codegen-data/ari_11_0_0/playbacks.json b/codegen/src/main/resources/codegen-data/ari_11_0_0/playbacks.json new file mode 100644 index 00000000..a7892f18 --- /dev/null +++ b/codegen/src/main/resources/codegen-data/ari_11_0_0/playbacks.json @@ -0,0 +1,177 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "2.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/playbacks.{format}", + "since": [ + "12.0.0" + ], + "requiresModules": [ + "res_stasis_playback" + ], + "apis": [ + { + "path": "/playbacks/{playbackId}", + "description": "Control object for a playback operation.", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "12.0.0" + ], + "summary": "Get a playback's details.", + "nickname": "get", + "responseClass": "Playback", + "parameters": [ + { + "name": "playbackId", + "description": "Playback's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "The playback cannot be found" + } + ] + }, + { + "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], + "summary": "Stop a playback.", + "nickname": "stop", + "responseClass": "void", + "parameters": [ + { + "name": "playbackId", + "description": "Playback's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "The playback cannot be found" + } + ] + } + ] + }, + { + "path": "/playbacks/{playbackId}/control", + "description": "Control object for a playback operation.", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "12.0.0" + ], + "summary": "Control a playback.", + "nickname": "control", + "responseClass": "void", + "parameters": [ + { + "name": "playbackId", + "description": "Playback's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "operation", + "description": "Operation to perform on the playback.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "restart", + "pause", + "unpause", + "reverse", + "forward" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "The provided operation parameter was invalid" + }, + { + "code": 404, + "reason": "The playback cannot be found" + }, + { + "code": 409, + "reason": "The operation cannot be performed in the playback's current state" + } +] + } + ] + } + ], + "models": { + "Playback": { + "id": "Playback", + "description": "Object representing the playback of media to a channel", + "properties": { + "id": { + "type": "string", + "description": "ID for this playback operation", + "required": true + }, + "media_uri": { + "type": "string", + "description": "The URI for the media currently being played back.", + "required": true + }, + "next_media_uri": { + "type": "string", + "description": "If a list of URIs is being played, the next media URI to be played back.", + "required": false + }, + "target_uri": { + "type": "string", + "description": "URI for the channel or bridge to play the media on", + "required": true + }, + "language": { + "type": "string", + "description": "For media types that support multiple languages, the language requested for playback." + }, + "state": { + "type": "string", + "description": "Current state of the playback operation.", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "queued", + "playing", + "continuing", + "done", + "failed" + ] + } + } + } + } + } +} diff --git a/codegen/src/main/resources/codegen-data/ari_11_0_0/recordings.json b/codegen/src/main/resources/codegen-data/ari_11_0_0/recordings.json new file mode 100644 index 00000000..1496db8a --- /dev/null +++ b/codegen/src/main/resources/codegen-data/ari_11_0_0/recordings.json @@ -0,0 +1,452 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "2.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/recordings.{format}", + "since": [ + "12.0.0" + ], + "requiresModules": [ + "res_stasis_recording" + ], + "apis": [ + { + "path": "/recordings/stored", + "description": "Recordings", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "12.0.0" + ], + "summary": "List recordings that are complete.", + "nickname": "listStored", + "responseClass": "List[StoredRecording]" + } + ] + }, + { + "path": "/recordings/stored/{recordingName}", + "description": "Individual recording", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "12.0.0" + ], + "summary": "Get a stored recording's details.", + "nickname": "getStored", + "responseClass": "StoredRecording", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + }, + { + "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], + "summary": "Delete a stored recording.", + "nickname": "deleteStored", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "path": "/recordings/stored/{recordingName}/file", + "description": "The actual file associated with the stored recording", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "14.0.0" + ], + "summary": "Get the file associated with the stored recording.", + "nickname": "getStoredFile", + "responseClass": "binary", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 403, + "reason": "The recording file could not be opened" + }, + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "path": "/recordings/stored/{recordingName}/copy", + "description": "Copy an individual recording", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "12.5.0" + ], + "summary": "Copy a stored recording.", + "nickname": "copyStored", + "responseClass": "StoredRecording", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording to copy", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "destinationRecordingName", + "description": "The destination name of the recording", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "A recording with the same name already exists on the system" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}", + "description": "A recording that is in progress", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "12.0.0" + ], + "summary": "List live recordings.", + "nickname": "getLive", + "responseClass": "LiveRecording", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + }, + { + "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], + "summary": "Stop a live recording and discard it.", + "nickname": "cancel", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}/stop", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "12.0.0" + ], + "summary": "Stop a live recording and store it.", + "nickname": "stop", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}/pause", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "12.0.0" + ], + "summary": "Pause a live recording.", + "notes": "Pausing a recording suspends silence detection, which will be restarted when the recording is unpaused. Paused time is not included in the accounting for maxDurationSeconds.", + "nickname": "pause", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + }, + { + "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], + "summary": "Unpause a live recording.", + "nickname": "unpause", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}/mute", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "12.0.0" + ], + "summary": "Mute a live recording.", + "notes": "Muting a recording suspends silence detection, which will be restarted when the recording is unmuted.", + "nickname": "mute", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + }, + { + "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], + "summary": "Unmute a live recording.", + "nickname": "unmute", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + } + ] + } + ], + "models": { + "StoredRecording": { + "id": "StoredRecording", + "description": "A past recording that may be played back.", + "properties": { + "name": { + "required": true, + "type": "string" + }, + "format": { + "required": true, + "type": "string" + } + } + }, + "LiveRecording": { + "id": "LiveRecording", + "description": "A recording that is in progress", + "properties": { + "name": { + "required": true, + "type": "string", + "description": "Base name for the recording" + }, + "format": { + "required": true, + "type": "string", + "description": "Recording format (wav, gsm, etc.)" + }, + "target_uri": { + "required": true, + "type": "string", + "description": "URI for the channel or bridge being recorded" + }, + "state": { + "required": true, + "type": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "queued", + "recording", + "paused", + "done", + "failed", + "canceled" + ] + } + }, + "duration": { + "required": false, + "type": "int", + "description": "Duration in seconds of the recording" + }, + "talking_duration": { + "required": false, + "type": "int", + "description": "Duration of talking, in seconds, detected in the recording. This is only available if the recording was initiated with a non-zero maxSilenceSeconds." + }, + "silence_duration": { + "required": false, + "type": "int", + "description": "Duration of silence, in seconds, detected in the recording. This is only available if the recording was initiated with a non-zero maxSilenceSeconds." + }, + "cause": { + "required": false, + "type": "string", + "description": "Cause for recording failure if failed" + } + } + } + } +} diff --git a/codegen/src/main/resources/codegen-data/ari_11_0_0/sounds.json b/codegen/src/main/resources/codegen-data/ari_11_0_0/sounds.json new file mode 100644 index 00000000..aee4d369 --- /dev/null +++ b/codegen/src/main/resources/codegen-data/ari_11_0_0/sounds.json @@ -0,0 +1,108 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "2.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/sounds.{format}", + "since": [ + "12.0.0" + ], + "apis": [ + { + "path": "/sounds", + "description": "Sounds", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "12.0.0" + ], + "summary": "List all sounds.", + "nickname": "list", + "responseClass": "List[Sound]", + "parameters": [ + { + "name": "lang", + "description": "Lookup sound for a specific language.", + "paramType": "query", + "dataType": "string", + "required": false + }, + { + "name": "format", + "description": "Lookup sound in a specific format.", + "paramType": "query", + "dataType": "string", + "required": false, + "__note": "core show translation can show translation paths between formats, along with relative costs. so this could be just installed format, or we could follow that for transcoded formats." + } + ] + } + ] + }, + { + "path": "/sounds/{soundId}", + "description": "Individual sound", + "operations": [ + { + "httpMethod": "GET", + "since": [ + "12.0.0" + ], + "summary": "Get a sound's details.", + "nickname": "get", + "responseClass": "Sound", + "parameters": [ + { + "name": "soundId", + "description": "Sound's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ] + } + ] + } + ], + "models": { + "FormatLangPair": { + "id": "FormatLangPair", + "description": "Identifies the format and language of a sound file", + "properties": { + "language": { + "required": true, + "type": "string" + }, + "format": { + "required": true, + "type": "string" + } + } + }, + "Sound": { + "id": "Sound", + "description": "A media file that may be played back.", + "properties": { + "id": { + "required": true, + "description": "Sound's identifier.", + "type": "string" + }, + "text": { + "required": false, + "description": "Text description of the sound, usually the words spoken.", + "type": "string" + }, + "formats": { + "required": true, + "description": "The formats and languages in which this sound is available.", + "type": "List[FormatLangPair]" + } + } + } + } +} diff --git a/codegen/src/main/resources/codegen-data/ari_6_0_0/channels.json b/codegen/src/main/resources/codegen-data/ari_6_0_0/channels.json index 8d878a13..db4b3a8a 100644 --- a/codegen/src/main/resources/codegen-data/ari_6_0_0/channels.json +++ b/codegen/src/main/resources/codegen-data/ari_6_0_0/channels.json @@ -416,7 +416,7 @@ }, { "name": "reason_code", - "description": "The reason code for hanging up the channel for detail use. Mutually exclusive with 'reason'. See detail hangup codes at here. https://wiki.asterisk.org/wiki/display/AST/Hangup+Cause+Mappings", + "description": "The reason code for hanging up the channel for detail use. Mutually exclusive with 'reason'. See detail hangup codes at here. https://docs.asterisk.org/Configuration/Miscellaneous/Hangup-Cause-Mappings/", "paramType": "query", "required": false, "allowMultiple": false, diff --git a/codegen/src/main/resources/codegen-data/ari_8_0_0/applications.json b/codegen/src/main/resources/codegen-data/ari_8_0_0/applications.json index 09c5cd5c..8ad9f36d 100644 --- a/codegen/src/main/resources/codegen-data/ari_8_0_0/applications.json +++ b/codegen/src/main/resources/codegen-data/ari_8_0_0/applications.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/applications.{format}", + "since": [ + "13.0.0" + ], "apis": [ { "path": "/applications", @@ -13,6 +16,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "13.0.0" + ], "summary": "List all applications.", "nickname": "list", "responseClass": "List[Application]" @@ -25,6 +31,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "13.0.0" + ], "summary": "Get details of an application.", "nickname": "get", "responseClass": "Application", @@ -53,6 +62,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "13.0.0" + ], "summary": "Subscribe an application to a event source.", "notes": "Returns the state of the application after the subscriptions have changed", "nickname": "subscribe", @@ -92,6 +104,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "13.0.0" + ], "summary": "Unsubscribe an application from an event source.", "notes": "Returns the state of the application after the subscriptions have changed", "nickname": "unsubscribe", @@ -141,6 +156,10 @@ "operations": [ { "httpMethod": "PUT", + "since": [ + "13.26.0", + "16.3.0" + ], "summary": "Filter application events types.", "notes": "Allowed and/or disallowed event type filtering can be done. The body (parameter) should specify a JSON key/value object that describes the type of event filtering needed. One, or both of the following keys can be designated:

\"allowed\" - Specifies an allowed list of event types
\"disallowed\" - Specifies a disallowed list of event types

Further, each of those key's value should be a JSON array that holds zero, or more JSON key/value objects. Each of these objects must contain the following key with an associated value:

\"type\" - The type name of the event to filter

The value must be the string name (case sensitive) of the event type that needs filtering. For example:

{ \"allowed\": [ { \"type\": \"StasisStart\" }, { \"type\": \"StasisEnd\" } ] }

As this specifies only an allowed list, then only those two event type messages are sent to the application. No other event messages are sent.

The following rules apply:

* If the body is empty, both the allowed and disallowed filters are set empty.
* If both list types are given then both are set to their respective values (note, specifying an empty array for a given type sets that type to empty).
* If only one list type is given then only that type is set. The other type is not updated.
* An empty \"allowed\" list means all events are allowed.
* An empty \"disallowed\" list means no events are disallowed.
* Disallowed events take precedence over allowed events if the event type is specified in both lists.", "nickname": "filter", diff --git a/codegen/src/main/resources/codegen-data/ari_8_0_0/asterisk.json b/codegen/src/main/resources/codegen-data/ari_8_0_0/asterisk.json index 841e6cd8..83fef8b7 100644 --- a/codegen/src/main/resources/codegen-data/ari_8_0_0/asterisk.json +++ b/codegen/src/main/resources/codegen-data/ari_8_0_0/asterisk.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/asterisk.{format}", + "since": [ + "12.0.0" + ], "apis": [ { "path": "/asterisk/config/dynamic/{configClass}/{objectType}/{id}", @@ -13,6 +16,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "13.5.0" + ], "summary": "Retrieve a dynamic configuration object.", "nickname": "getObject", "responseClass": "List[ConfigTuple]", @@ -51,6 +57,9 @@ }, { "httpMethod": "PUT", + "since": [ + "13.5.0" + ], "summary": "Create or update a dynamic configuration object.", "nickname": "updateObject", "responseClass": "List[ConfigTuple]", @@ -105,6 +114,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "13.5.0" + ], "summary": "Delete a dynamic configuration object.", "nickname": "deleteObject", "responseClass": "void", @@ -153,6 +165,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Gets Asterisk system information.", "nickname": "getInfo", "responseClass": "AsteriskInfo", @@ -184,6 +199,10 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "13.25.0", + "16.2.0" + ], "summary": "Response pong message.", "nickname": "ping", "responseClass": "AsteriskPing" @@ -196,6 +215,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "13.5.0" + ], "summary": "List Asterisk modules.", "nickname": "listModules", "responseClass": "List[Module]" @@ -208,6 +230,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "13.5.0" + ], "summary": "Get Asterisk module information.", "nickname": "getModule", "responseClass": "Module", @@ -234,6 +259,9 @@ }, { "httpMethod": "POST", + "since": [ + "13.5.0" + ], "summary": "Load an Asterisk module.", "nickname": "loadModule", "responseClass": "void", @@ -256,6 +284,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "13.5.0" + ], "summary": "Unload an Asterisk module.", "nickname": "unloadModule", "responseClass": "void", @@ -282,6 +313,9 @@ }, { "httpMethod": "PUT", + "since": [ + "13.5.0" + ], "summary": "Reload an Asterisk module.", "nickname": "reloadModule", "responseClass": "void", @@ -314,6 +348,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "13.6.0" + ], "summary": "Gets Asterisk log channel information.", "nickname": "listLogChannels", "responseClass": "List[LogChannel]" @@ -326,6 +363,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "13.6.0" + ], "summary": "Adds a log channel.", "nickname": "addLog", "responseClass": "void", @@ -360,6 +400,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "13.6.0" + ], "summary": "Deletes a log channel.", "nickname": "deleteLog", "responseClass": "void", @@ -388,6 +431,9 @@ "operations": [ { "httpMethod": "PUT", + "since": [ + "13.6.0" + ], "summary": "Rotates a log channel.", "nickname": "rotateLog", "responseClass": "void", @@ -416,6 +462,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Get the value of a global variable.", "nickname": "getGlobalVar", "responseClass": "Variable", @@ -438,6 +487,9 @@ }, { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Set the value of a global variable.", "nickname": "setGlobalVar", "responseClass": "void", diff --git a/codegen/src/main/resources/codegen-data/ari_8_0_0/bridges.json b/codegen/src/main/resources/codegen-data/ari_8_0_0/bridges.json index 636d2540..ae5ee56f 100644 --- a/codegen/src/main/resources/codegen-data/ari_8_0_0/bridges.json +++ b/codegen/src/main/resources/codegen-data/ari_8_0_0/bridges.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/bridges.{format}", + "since": [ + "12.0.0" + ], "requiresModules": [ "res_stasis_recording", "res_stasis_playback" @@ -17,12 +20,18 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "List all active bridges in Asterisk.", "nickname": "list", "responseClass": "List[Bridge]" }, { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Create a new bridge.", "notes": "This bridge persists until it has been shut down, or Asterisk has been shut down.", "nickname": "create", @@ -52,6 +61,12 @@ "allowMultiple": false, "dataType": "string" } + ], + "errorResponses": [ + { + "code": 409, + "reason": "Bridge with the same bridgeId already exists" + } ] } ] @@ -62,7 +77,10 @@ "operations": [ { "httpMethod": "POST", - "summary": "Create a new bridge or updates an existing one.", + "since": [ + "12.2.0" + ], + "summary": "Create a new bridge.", "notes": "This bridge persists until it has been shut down, or Asterisk has been shut down.", "nickname": "createWithId", "responseClass": "Bridge", @@ -91,10 +109,19 @@ "allowMultiple": false, "dataType": "string" } + ], + "errorResponses": [ + { + "code": 409, + "reason": "Bridge with the same bridgeId already exists" + } ] }, { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Get bridge details.", "nickname": "get", "responseClass": "Bridge", @@ -117,6 +144,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Shut down a bridge.", "notes": "If any channels are in this bridge, they will be removed and resume whatever they were doing beforehand.", "nickname": "destroy", @@ -146,6 +176,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Add a channel to a bridge.", "nickname": "addChannel", "responseClass": "void", @@ -229,6 +262,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Remove a channel from a bridge.", "nickname": "removeChannel", "responseClass": "void", @@ -277,6 +313,10 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "13.13.0", + "14.2.0" + ], "summary": "Set a channel as the video source in a multi-party mixing bridge. This operation has no effect on bridges with two or fewer participants.", "nickname": "setVideoSource", "responseClass": "void", @@ -321,6 +361,10 @@ "operations": [ { "httpMethod": "DELETE", + "since": [ + "13.13.0", + "14.2.0" + ], "summary": "Removes any explicit video source in a multi-party mixing bridge. This operation has no effect on bridges with two or fewer participants. When no explicit video source is set, talk detection will be used to determine the active video stream.", "nickname": "clearVideoSource", "responseClass": "void", @@ -349,6 +393,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Play music on hold to a bridge or change the MOH class that is playing.", "nickname": "startMoh", "responseClass": "void", @@ -383,6 +430,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Stop playing music on hold to a bridge.", "notes": "This will only stop music on hold being played via POST bridges/{bridgeId}/moh.", "nickname": "stopMoh", @@ -416,6 +466,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Start playback of media on a bridge.", "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", "nickname": "play", @@ -437,6 +490,14 @@ "allowMultiple": true, "dataType": "string" }, + { + "name": "announcer_format", + "description": "Format of the 'Anouncer' channel attached to the bridge. Defaults to the format of the channel in the bridge with the highest sampe rate.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, { "name": "lang", "description": "For sounds, selects language for sound.", @@ -457,7 +518,6 @@ "valueType": "RANGE", "min": 0 } - }, { "name": "skipms", @@ -489,6 +549,10 @@ { "code": 409, "reason": "Bridge not in a Stasis application" + }, + { + "code": 422, + "reason": "The format specified is unknown on this system" } ] } @@ -500,6 +564,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.3.0" + ], "summary": "Start playback of media on a bridge.", "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", "nickname": "playWithId", @@ -529,6 +596,14 @@ "allowMultiple": true, "dataType": "string" }, + { + "name": "announcer_format", + "description": "Format of the 'Anouncer' channel attached to the bridge. Defaults to the format of the channel in the bridge with the highest sampe rate.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, { "name": "lang", "description": "For sounds, selects language for sound.", @@ -572,6 +647,10 @@ { "code": 409, "reason": "Bridge not in a Stasis application" + }, + { + "code": 422, + "reason": "The format specified is unknown on this system" } ] @@ -584,6 +663,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Start a recording.", "notes": "This records the mixed audio from all channels participating in this bridge.", "nickname": "record", @@ -613,6 +695,14 @@ "allowMultiple": false, "dataType": "string" }, + { + "name": "recorder_format", + "description": "Format of the 'Recorder' channel attached to the bridge. Defaults to the same format as the 'format' parameter.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, { "name": "maxDurationSeconds", "description": "Maximum duration of the recording, in seconds. 0 for no limit.", diff --git a/codegen/src/main/resources/codegen-data/ari_8_0_0/channels.json b/codegen/src/main/resources/codegen-data/ari_8_0_0/channels.json index 2a1d0a0c..0a08a4a9 100644 --- a/codegen/src/main/resources/codegen-data/ari_8_0_0/channels.json +++ b/codegen/src/main/resources/codegen-data/ari_8_0_0/channels.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/channels.{format}", + "since": [ + "12.0.0" + ], "requiresModules": [ "res_stasis_answer", "res_stasis_playback", @@ -19,12 +22,18 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "List all active channels in Asterisk.", "nickname": "list", "responseClass": "List[Channel]" }, { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Create a new channel (originate).", "notes": "The new channel is created immediately and a snapshot of it returned. If a Stasis application is provided it will be automatically subscribed to the originated channel for further events and updates.", "nickname": "originate", @@ -163,6 +172,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "14.0.0" + ], "summary": "Create channel.", "nickname": "create", "responseClass": "Channel", @@ -247,6 +259,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Channel details.", "nickname": "get", "responseClass": "Channel", @@ -269,6 +284,9 @@ }, { "httpMethod": "POST", + "since": [ + "12.2.0" + ], "summary": "Create a new channel (originate with id).", "notes": "The new channel is created immediately and a snapshot of it returned. If a Stasis application is provided it will be automatically subscribed to the originated channel for further events and updates.", "nickname": "originateWithId", @@ -402,6 +420,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Delete (i.e. hangup) a channel.", "nickname": "hangup", "responseClass": "void", @@ -468,6 +489,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Exit application; continue execution in the dialplan.", "nickname": "continueInDialplan", "responseClass": "void", @@ -536,6 +560,10 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "13.26.0", + "16.3.0" + ], "summary": "Move the channel from one Stasis application to another.", "nickname": "move", "responseClass": "void", @@ -584,6 +612,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "13.3.0" + ], "summary": "Redirect the channel to a different location.", "nickname": "redirect", "responseClass": "void", @@ -636,6 +667,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Answer a channel.", "nickname": "answer", "responseClass": "void", @@ -672,6 +706,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Indicate ringing to a channel.", "nickname": "ring", "responseClass": "void", @@ -702,6 +739,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Stop ringing indication on a channel if locally generated.", "nickname": "ringStop", "responseClass": "void", @@ -732,12 +772,56 @@ } ] }, + { + "path": "/channels/{channelId}/progress", + "description": "Indicate progress on a channel", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "22.6.0", + "21.11.0", + "20.16.0" + ], + "summary": "Indicate progress on a channel.", + "nickname": "progress", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] + }, { "path": "/channels/{channelId}/dtmf", "description": "Send DTMF to a channel", "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Send provided DTMF to a given channel.", "nickname": "sendDTMF", "responseClass": "void", @@ -822,6 +906,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Mute a channel.", "nickname": "mute", "responseClass": "void", @@ -869,6 +956,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Unmute a channel.", "nickname": "unmute", "responseClass": "void", @@ -922,6 +1012,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Hold a channel.", "nickname": "hold", "responseClass": "void", @@ -952,6 +1045,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Remove a channel from hold.", "nickname": "unhold", "responseClass": "void", @@ -988,6 +1084,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Play music on hold to a channel.", "notes": "Using media operations such as /play on a channel playing MOH in this manner will suspend MOH without resuming automatically. If continuing music on hold is desired, the stasis application must reinitiate music on hold.", "nickname": "startMoh", @@ -1027,6 +1126,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Stop playing music on hold to a channel.", "nickname": "stopMoh", "responseClass": "void", @@ -1063,6 +1165,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Play silence to a channel.", "notes": "Using media operations such as /play on a channel playing silence in this manner will suspend silence without resuming automatically.", "nickname": "startSilence", @@ -1094,6 +1199,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Stop playing silence to a channel.", "nickname": "stopSilence", "responseClass": "void", @@ -1130,6 +1238,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Start playback of media.", "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", "nickname": "play", @@ -1208,6 +1319,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.2.0" + ], "summary": "Start playback of media and specify the playbackId.", "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", "nickname": "playWithId", @@ -1286,6 +1400,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Start a recording.", "notes": "Record audio from a channel. Note that this will not capture audio sent to the channel. The bridge itself has a record feature if that's what you want.", "nickname": "record", @@ -1397,7 +1514,7 @@ }, { "code": 409, - "reason": "Channel is not in a Stasis application; the channel is currently bridged with other hcannels; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail" + "reason": "Channel is not in a Stasis application; the channel is currently bridged with other channels; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail" }, { "code": 422, @@ -1413,6 +1530,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Get the value of a channel variable or function.", "nickname": "getChannelVar", "responseClass": "Variable", @@ -1451,6 +1571,9 @@ }, { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Set the value of a channel variable or function.", "nickname": "setChannelVar", "responseClass": "void", @@ -1503,6 +1626,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Start snooping.", "notes": "Snoop (spy/whisper) on a specific channel.", "nickname": "snoopChannel", @@ -1596,6 +1722,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.2.0" + ], "summary": "Start snooping.", "notes": "Snoop (spy/whisper) on a specific channel.", "nickname": "snoopChannelWithId", @@ -1689,6 +1818,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "14.0.0" + ], "summary": "Dial a created channel.", "nickname": "dial", "responseClass": "void", @@ -1742,6 +1874,10 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "13.27.0", + "16.4.0" + ], "summary": "RTP stats on a channel.", "nickname": "rtpstatistics", "responseClass": "RTPstat", @@ -1770,8 +1906,12 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "16.6.0", + "17.1.0" + ], "summary": "Start an External Media session.", - "notes": "Create a channel to an External Media source/sink.", + "notes": "Create a channel to an External Media source/sink. The combination of transport and encapsulation will select one of chan_rtp(udp/rtp), chan_audiosocket(tcp/audiosocket) or chan_websocket(websocket/none) channel drivers.", "nickname": "externalMedia", "responseClass": "Channel", "parameters": [ @@ -1801,15 +1941,15 @@ }, { "name": "external_host", - "description": "Hostname/ip:port of external host", + "description": "Hostname/ip:port or websocket_client connection ID of external host. May be empty for a websocket server connection.", "paramType": "query", - "required": true, + "required": false, "allowMultiple": false, "dataType": "string" }, { "name": "encapsulation", - "description": "Payload encapsulation protocol", + "description": "Payload encapsulation protocol. Must be 'none' for the websocket transport.", "paramType": "query", "required": false, "allowMultiple": false, @@ -1819,7 +1959,8 @@ "valueType": "LIST", "values": [ "rtp", - "audiosocket" + "audiosocket", + "none" ] } }, @@ -1835,13 +1976,14 @@ "valueType": "LIST", "values": [ "udp", - "tcp" + "tcp", + "websocket" ] } }, { "name": "connection_type", - "description": "Connection type (client/server)", + "description": "Connection type (client/server). 'server' is only valid for the websocket transport.", "paramType": "query", "required": false, "allowMultiple": false, @@ -1850,7 +1992,8 @@ "allowableValues": { "valueType": "LIST", "values": [ - "client" + "client", + "server" ] } }, @@ -1898,6 +2041,59 @@ ] } ] + }, + { + "path": "/channels/{channelId}/transfer_progress", + "description": "Inform the channel that the transfer is in progress.", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "22.3.0", + "21.8.0", + "20.13.0" + ], + "summary": "Inform the channel about the progress of the attended/blind transfer.", + "nickname": "transfer_progress", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "states", + "description": "The state of the progress", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Endpoint parameter not provided" + }, + { + "code": 404, + "reason": "Channel or endpoint not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] } ], "models": { diff --git a/codegen/src/main/resources/codegen-data/ari_8_0_0/deviceStates.json b/codegen/src/main/resources/codegen-data/ari_8_0_0/deviceStates.json index bd389355..f0a889bc 100644 --- a/codegen/src/main/resources/codegen-data/ari_8_0_0/deviceStates.json +++ b/codegen/src/main/resources/codegen-data/ari_8_0_0/deviceStates.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/deviceStates.{format}", + "since": [ + "12.0.0" + ], "requiresModules": [ "res_stasis_device_state" ], @@ -16,6 +19,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "List all ARI controlled device states.", "nickname": "list", "responseClass": "List[DeviceState]" @@ -28,6 +34,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Retrieve the current state of a device.", "nickname": "get", "responseClass": "DeviceState", @@ -44,6 +53,9 @@ }, { "httpMethod": "PUT", + "since": [ + "12.0.0" + ], "summary": "Change the state of a device controlled by ARI. (Note - implicitly creates the device state).", "nickname": "update", "responseClass": "void", @@ -92,6 +104,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Destroy a device-state controlled by ARI.", "nickname": "delete", "responseClass": "void", diff --git a/codegen/src/main/resources/codegen-data/ari_8_0_0/endpoints.json b/codegen/src/main/resources/codegen-data/ari_8_0_0/endpoints.json index 7560b9cb..93c406f7 100644 --- a/codegen/src/main/resources/codegen-data/ari_8_0_0/endpoints.json +++ b/codegen/src/main/resources/codegen-data/ari_8_0_0/endpoints.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/endpoints.{format}", + "since": [ + "12.0.0" + ], "apis": [ { "path": "/endpoints", @@ -13,6 +16,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "List all endpoints.", "nickname": "list", "responseClass": "List[Endpoint]" @@ -25,6 +31,9 @@ "operations": [ { "httpMethod": "PUT", + "since": [ + "13.0.0" + ], "summary": "Send a message to some technology URI or endpoint.", "nickname": "sendMessage", "responseClass": "void", @@ -81,6 +90,10 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "18.20.0", + "20.5.0" + ], "summary": "Refer an endpoint or technology URI to some technology URI or endpoint.", "nickname": "refer", "responseClass": "void", @@ -146,6 +159,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "List available endoints for a given endpoint technology.", "nickname": "listByTech", "responseClass": "List[Endpoint]", @@ -172,6 +188,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Details for an endpoint.", "nickname": "get", "responseClass": "Endpoint", @@ -208,6 +227,9 @@ "operations": [ { "httpMethod": "PUT", + "since": [ + "13.0.0" + ], "summary": "Send a message to some endpoint in a technology.", "nickname": "sendMessageToEndpoint", "responseClass": "void", @@ -268,6 +290,10 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "18.20.0", + "20.5.0" + ], "summary": "Refer an endpoint or technology URI to some technology URI or endpoint.", "nickname": "referToEndpoint", "responseClass": "void", diff --git a/codegen/src/main/resources/codegen-data/ari_8_0_0/events.json b/codegen/src/main/resources/codegen-data/ari_8_0_0/events.json index c9822f6c..b7d14ef1 100644 --- a/codegen/src/main/resources/codegen-data/ari_8_0_0/events.json +++ b/codegen/src/main/resources/codegen-data/ari_8_0_0/events.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.2", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/events.{format}", + "since": [ + "12.0.0" + ], "requiresModules": [ "res_http_websocket" ], @@ -16,6 +19,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "upgrade": "websocket", "websocketProtocol": "ari", "summary": "WebSocket connection for events.", @@ -48,6 +54,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.3.0" + ], "summary": "Generate a user event.", "nickname": "userEvent", "responseClass": "void", @@ -160,6 +169,8 @@ "RecordingFinished", "RecordingFailed", "ApplicationMoveFailed", + "ApplicationRegistered", + "ApplicationUnregistered", "ApplicationReplaced", "BridgeCreated", "BridgeDestroyed", @@ -189,7 +200,9 @@ "StasisStart", "TextMessageReceived", "ChannelConnectedLine", - "PeerStatusChange" + "PeerStatusChange", + "ChannelTransfer", + "RESTResponse" ] }, "ContactInfo": { @@ -355,6 +368,16 @@ } } }, + "ApplicationRegistered": { + "id": "ApplicationRegistered", + "description": "Notification that a Stasis app has been registered.", + "properties": {} + }, + "ApplicationUnregistered": { + "id": "ApplicationUnregistered", + "description": "Notification that a Stasis app has been unregistered.", + "properties": {} + }, "ApplicationReplaced": { "id": "ApplicationReplaced", "description": "Notification that another WebSocket has taken over for an application.\n\nAn application may only be subscribed to by a single WebSocket at a time. If multiple WebSockets attempt to subscribe to the same application, the newer WebSocket wins, and the older one receives this event.", @@ -555,6 +578,10 @@ "description": "Text representation of the cause of the hangup", "type": "string" }, + "tech_cause": { + "type": "int", + "description": "Integer representation of the technology-specific off-nominal cause of the hangup." + }, "channel": { "required": true, "type": "Channel" @@ -700,6 +727,10 @@ "type": "int", "description": "Integer representation of the cause of the hangup." }, + "tech_cause": { + "type": "int", + "description": "Integer representation of the technology-specific off-nominal cause of the hangup." + }, "soft": { "type": "boolean", "description": "Whether the hangup request was a soft hangup request." @@ -913,6 +944,229 @@ "description": "The channel whose connected line has changed." } } + }, + "ChannelTransfer": { + "id": "ChannelTransfer", + "description": "transfer on a channel.", + "properties": { + "state": { + "required": false, + "type": "string", + "description": "Transfer State" + }, + "refer_to": { + "required": true, + "type": "ReferTo", + "description": "Refer-To information with optionally both affected channels" + }, + "referred_by": { + "required": true, + "type": "ReferredBy", + "description": "Referred-By SIP Header according rfc3892" + } + } + }, + "ReferTo": { + "id": "ReferTo", + "description": "transfer destination requested by transferee", + "properties": { + "requested_destination": { + "required": true, + "type": "RequiredDestination" + }, + "destination_channel": { + "required": false, + "type": "Channel", + "description": "The Channel Object, that is to be replaced" + }, + "connected_channel": { + "required": false, + "type": "Channel", + "description": "Channel, connected to the to be replaced channel" + }, + "bridge": { + "required": false, + "type": "Bridge", + "description": "Bridge connecting both destination channels" + } + } + }, + "ReferredBy": { + "id": "ReferredBy", + "description": "transfer destination requested by transferee", + "properties": { + "source_channel": { + "required": true, + "type": "Channel", + "description": "The channel on which the refer was received" + }, + "connected_channel": { + "required": false, + "type": "Channel", + "description": "Channel, Connected to the channel, receiving the transfer request on." + }, + "bridge": { + "required": false, + "type": "Bridge", + "description": "Bridge connecting both Channels" + } + } + }, + "RequiredDestination": { + "id": "RequiredDestination", + "description": "Information about the requested destination", + "properties": { + "protocol_id": { + "required": false, + "type": "string", + "description": "the requested protocol-id by the referee in case of SIP channel, this is a SIP Call ID, Mutually exclusive to destination" + }, + "destination": { + "required": false, + "type": "string", + "description": "Destination User Part. Only for Blind transfer. Mutually exclusive to protocol_id" + }, + "additional_protocol_params": { + "required": false, + "type": "List[AdditionalParam]", + "description": "List of additional protocol specific information" + } + } + }, + "AdditionalParam": { + "id": "AdditionalParam", + "description": "Protocol specific additional parameter", + "properties": { + "parameter_name": { + "required": true, + "type": "string", + "description": "Name of the parameter" + }, + "parameter_value": { + "required": true, + "type": "string", + "description": "Value of the parameter" + } + } + }, + "RESTHeader": { + "id": "RESTHeader", + "description": "REST over Websocket header", + "properties": { + "name": { + "type": "string", + "description": "Header name", + "required": true + }, + "value": { + "required": true, + "type": "string", + "description": "Header value" + } + } + }, + "RESTQueryStringParameter": { + "id": "RESTQueryStringParameter", + "description": "REST over Websocket Query String Parameter", + "properties": { + "name": { + "type": "string", + "description": "Parameter name", + "required": true + }, + "value": { + "required": true, + "type": "string", + "description": "Parameter value" + } + } + }, + "RESTRequest": { + "id": "RESTRequest", + "description": "REST over Websocket Request.", + "properties": { + "type": { + "type": "string", + "description": "Message type. Must be 'RESTRequest'", + "required": true + }, + "transaction_id": { + "type": "string", + "description": "Opaque transaction id. Can be any valid string. Will be returned in any response to this request.", + "required": true + }, + "request_id": { + "type": "string", + "description": "Opaque request id. Can be any valid string. Will be returned in any response to this request.", + "required": true + }, + "method": { + "required": true, + "type": "string", + "description": "HTTP method (GET, PUT, POST, DELETE, etc.)" + }, + "uri": { + "required": true, + "type": "string", + "description": "Resource URI with optional query string parameters." + }, + "content_type": { + "required": false, + "type": "string", + "description": "The Content-Type of the message body." + }, + "query_strings": { + "required": false, + "type": "List[RESTQueryStringParameter]", + "description": "Request query string parameters." + }, + "message_body": { + "required": false, + "type": "string", + "description": "Request message body. Only content types application/json and application/x-www-form-urlencoded are supported." + } + } + }, + "RESTResponse": { + "id": "RESTResponse", + "description": "REST over Websocket Response.", + "properties": { + "transaction_id": { + "type": "string", + "description": "Opaque transaction id. Will be whatever was specified on the original request.", + "required": true + }, + "request_id": { + "type": "string", + "description": "Opaque request id. Will be whatever was specified on the original request.", + "required": true + }, + "status_code": { + "required": true, + "type": "int", + "description": "HTTP status code" + }, + "reason_phrase": { + "required": true, + "type": "string", + "description": "HTTP reason phrase" + }, + "uri": { + "required": true, + "type": "string", + "description": "Original request resource URI" + }, + "content_type": { + "required": false, + "type": "string", + "description": "The Content-Type of the message body." + }, + "message_body": { + "required": false, + "type": "string", + "description": "Response message body" + } + } } } } diff --git a/codegen/src/main/resources/codegen-data/ari_8_0_0/mailboxes.json b/codegen/src/main/resources/codegen-data/ari_8_0_0/mailboxes.json index 8f5941b8..d99e1eac 100644 --- a/codegen/src/main/resources/codegen-data/ari_8_0_0/mailboxes.json +++ b/codegen/src/main/resources/codegen-data/ari_8_0_0/mailboxes.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/mailboxes.{format}", + "since": [ + "12.1.0" + ], "requiresModules": [ "res_stasis_mailbox" ], @@ -16,6 +19,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.1.0" + ], "summary": "List all mailboxes.", "nickname": "list", "responseClass": "List[Mailbox]" @@ -28,6 +34,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.1.0" + ], "summary": "Retrieve the current state of a mailbox.", "nickname": "get", "responseClass": "Mailbox", @@ -50,6 +59,9 @@ }, { "httpMethod": "PUT", + "since": [ + "12.1.0" + ], "summary": "Change the state of a mailbox. (Note - implicitly creates the mailbox).", "nickname": "update", "responseClass": "void", @@ -88,6 +100,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.1.0" + ], "summary": "Destroy a mailbox.", "nickname": "delete", "responseClass": "void", diff --git a/codegen/src/main/resources/codegen-data/ari_8_0_0/playbacks.json b/codegen/src/main/resources/codegen-data/ari_8_0_0/playbacks.json index 793986fc..a7892f18 100644 --- a/codegen/src/main/resources/codegen-data/ari_8_0_0/playbacks.json +++ b/codegen/src/main/resources/codegen-data/ari_8_0_0/playbacks.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/playbacks.{format}", + "since": [ + "12.0.0" + ], "requiresModules": [ "res_stasis_playback" ], @@ -16,6 +19,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Get a playback's details.", "nickname": "get", "responseClass": "Playback", @@ -38,6 +44,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Stop a playback.", "nickname": "stop", "responseClass": "void", @@ -66,6 +75,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Control a playback.", "nickname": "control", "responseClass": "void", diff --git a/codegen/src/main/resources/codegen-data/ari_8_0_0/recordings.json b/codegen/src/main/resources/codegen-data/ari_8_0_0/recordings.json index 6ffd6d8e..1496db8a 100644 --- a/codegen/src/main/resources/codegen-data/ari_8_0_0/recordings.json +++ b/codegen/src/main/resources/codegen-data/ari_8_0_0/recordings.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/recordings.{format}", + "since": [ + "12.0.0" + ], "requiresModules": [ "res_stasis_recording" ], @@ -16,6 +19,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "List recordings that are complete.", "nickname": "listStored", "responseClass": "List[StoredRecording]" @@ -28,6 +34,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Get a stored recording's details.", "nickname": "getStored", "responseClass": "StoredRecording", @@ -50,6 +59,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Delete a stored recording.", "nickname": "deleteStored", "responseClass": "void", @@ -78,6 +90,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "14.0.0" + ], "summary": "Get the file associated with the stored recording.", "nickname": "getStoredFile", "responseClass": "binary", @@ -110,6 +125,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.5.0" + ], "summary": "Copy a stored recording.", "nickname": "copyStored", "responseClass": "StoredRecording", @@ -150,6 +168,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "List live recordings.", "nickname": "getLive", "responseClass": "LiveRecording", @@ -172,6 +193,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Stop a live recording and discard it.", "nickname": "cancel", "responseClass": "void", @@ -199,6 +223,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Stop a live recording and store it.", "nickname": "stop", "responseClass": "void", @@ -226,6 +253,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Pause a live recording.", "notes": "Pausing a recording suspends silence detection, which will be restarted when the recording is unpaused. Paused time is not included in the accounting for maxDurationSeconds.", "nickname": "pause", @@ -253,6 +283,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Unpause a live recording.", "nickname": "unpause", "responseClass": "void", @@ -284,6 +317,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Mute a live recording.", "notes": "Muting a recording suspends silence detection, which will be restarted when the recording is unmuted.", "nickname": "mute", @@ -311,6 +347,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Unmute a live recording.", "nickname": "unmute", "responseClass": "void", diff --git a/codegen/src/main/resources/codegen-data/ari_8_0_0/sounds.json b/codegen/src/main/resources/codegen-data/ari_8_0_0/sounds.json index 8fbe1c57..aee4d369 100644 --- a/codegen/src/main/resources/codegen-data/ari_8_0_0/sounds.json +++ b/codegen/src/main/resources/codegen-data/ari_8_0_0/sounds.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/sounds.{format}", + "since": [ + "12.0.0" + ], "apis": [ { "path": "/sounds", @@ -13,6 +16,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "List all sounds.", "nickname": "list", "responseClass": "List[Sound]", @@ -42,6 +48,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Get a sound's details.", "nickname": "get", "responseClass": "Sound", diff --git a/codegen/src/main/resources/codegen-data/ari_9_0_0/applications.json b/codegen/src/main/resources/codegen-data/ari_9_0_0/applications.json index 09c5cd5c..8ad9f36d 100644 --- a/codegen/src/main/resources/codegen-data/ari_9_0_0/applications.json +++ b/codegen/src/main/resources/codegen-data/ari_9_0_0/applications.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/applications.{format}", + "since": [ + "13.0.0" + ], "apis": [ { "path": "/applications", @@ -13,6 +16,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "13.0.0" + ], "summary": "List all applications.", "nickname": "list", "responseClass": "List[Application]" @@ -25,6 +31,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "13.0.0" + ], "summary": "Get details of an application.", "nickname": "get", "responseClass": "Application", @@ -53,6 +62,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "13.0.0" + ], "summary": "Subscribe an application to a event source.", "notes": "Returns the state of the application after the subscriptions have changed", "nickname": "subscribe", @@ -92,6 +104,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "13.0.0" + ], "summary": "Unsubscribe an application from an event source.", "notes": "Returns the state of the application after the subscriptions have changed", "nickname": "unsubscribe", @@ -141,6 +156,10 @@ "operations": [ { "httpMethod": "PUT", + "since": [ + "13.26.0", + "16.3.0" + ], "summary": "Filter application events types.", "notes": "Allowed and/or disallowed event type filtering can be done. The body (parameter) should specify a JSON key/value object that describes the type of event filtering needed. One, or both of the following keys can be designated:

\"allowed\" - Specifies an allowed list of event types
\"disallowed\" - Specifies a disallowed list of event types

Further, each of those key's value should be a JSON array that holds zero, or more JSON key/value objects. Each of these objects must contain the following key with an associated value:

\"type\" - The type name of the event to filter

The value must be the string name (case sensitive) of the event type that needs filtering. For example:

{ \"allowed\": [ { \"type\": \"StasisStart\" }, { \"type\": \"StasisEnd\" } ] }

As this specifies only an allowed list, then only those two event type messages are sent to the application. No other event messages are sent.

The following rules apply:

* If the body is empty, both the allowed and disallowed filters are set empty.
* If both list types are given then both are set to their respective values (note, specifying an empty array for a given type sets that type to empty).
* If only one list type is given then only that type is set. The other type is not updated.
* An empty \"allowed\" list means all events are allowed.
* An empty \"disallowed\" list means no events are disallowed.
* Disallowed events take precedence over allowed events if the event type is specified in both lists.", "nickname": "filter", diff --git a/codegen/src/main/resources/codegen-data/ari_9_0_0/asterisk.json b/codegen/src/main/resources/codegen-data/ari_9_0_0/asterisk.json index 841e6cd8..83fef8b7 100644 --- a/codegen/src/main/resources/codegen-data/ari_9_0_0/asterisk.json +++ b/codegen/src/main/resources/codegen-data/ari_9_0_0/asterisk.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/asterisk.{format}", + "since": [ + "12.0.0" + ], "apis": [ { "path": "/asterisk/config/dynamic/{configClass}/{objectType}/{id}", @@ -13,6 +16,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "13.5.0" + ], "summary": "Retrieve a dynamic configuration object.", "nickname": "getObject", "responseClass": "List[ConfigTuple]", @@ -51,6 +57,9 @@ }, { "httpMethod": "PUT", + "since": [ + "13.5.0" + ], "summary": "Create or update a dynamic configuration object.", "nickname": "updateObject", "responseClass": "List[ConfigTuple]", @@ -105,6 +114,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "13.5.0" + ], "summary": "Delete a dynamic configuration object.", "nickname": "deleteObject", "responseClass": "void", @@ -153,6 +165,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Gets Asterisk system information.", "nickname": "getInfo", "responseClass": "AsteriskInfo", @@ -184,6 +199,10 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "13.25.0", + "16.2.0" + ], "summary": "Response pong message.", "nickname": "ping", "responseClass": "AsteriskPing" @@ -196,6 +215,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "13.5.0" + ], "summary": "List Asterisk modules.", "nickname": "listModules", "responseClass": "List[Module]" @@ -208,6 +230,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "13.5.0" + ], "summary": "Get Asterisk module information.", "nickname": "getModule", "responseClass": "Module", @@ -234,6 +259,9 @@ }, { "httpMethod": "POST", + "since": [ + "13.5.0" + ], "summary": "Load an Asterisk module.", "nickname": "loadModule", "responseClass": "void", @@ -256,6 +284,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "13.5.0" + ], "summary": "Unload an Asterisk module.", "nickname": "unloadModule", "responseClass": "void", @@ -282,6 +313,9 @@ }, { "httpMethod": "PUT", + "since": [ + "13.5.0" + ], "summary": "Reload an Asterisk module.", "nickname": "reloadModule", "responseClass": "void", @@ -314,6 +348,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "13.6.0" + ], "summary": "Gets Asterisk log channel information.", "nickname": "listLogChannels", "responseClass": "List[LogChannel]" @@ -326,6 +363,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "13.6.0" + ], "summary": "Adds a log channel.", "nickname": "addLog", "responseClass": "void", @@ -360,6 +400,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "13.6.0" + ], "summary": "Deletes a log channel.", "nickname": "deleteLog", "responseClass": "void", @@ -388,6 +431,9 @@ "operations": [ { "httpMethod": "PUT", + "since": [ + "13.6.0" + ], "summary": "Rotates a log channel.", "nickname": "rotateLog", "responseClass": "void", @@ -416,6 +462,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Get the value of a global variable.", "nickname": "getGlobalVar", "responseClass": "Variable", @@ -438,6 +487,9 @@ }, { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Set the value of a global variable.", "nickname": "setGlobalVar", "responseClass": "void", diff --git a/codegen/src/main/resources/codegen-data/ari_9_0_0/bridges.json b/codegen/src/main/resources/codegen-data/ari_9_0_0/bridges.json index 636d2540..4cd15b97 100644 --- a/codegen/src/main/resources/codegen-data/ari_9_0_0/bridges.json +++ b/codegen/src/main/resources/codegen-data/ari_9_0_0/bridges.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/bridges.{format}", + "since": [ + "12.0.0" + ], "requiresModules": [ "res_stasis_recording", "res_stasis_playback" @@ -17,12 +20,18 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "List all active bridges in Asterisk.", "nickname": "list", "responseClass": "List[Bridge]" }, { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Create a new bridge.", "notes": "This bridge persists until it has been shut down, or Asterisk has been shut down.", "nickname": "create", @@ -52,6 +61,12 @@ "allowMultiple": false, "dataType": "string" } + ], + "errorResponses": [ + { + "code": 409, + "reason": "Bridge with the same bridgeId already exists" + } ] } ] @@ -62,7 +77,10 @@ "operations": [ { "httpMethod": "POST", - "summary": "Create a new bridge or updates an existing one.", + "since": [ + "12.2.0" + ], + "summary": "Create a new bridge.", "notes": "This bridge persists until it has been shut down, or Asterisk has been shut down.", "nickname": "createWithId", "responseClass": "Bridge", @@ -91,10 +109,19 @@ "allowMultiple": false, "dataType": "string" } + ], + "errorResponses": [ + { + "code": 409, + "reason": "Bridge with the same bridgeId already exists" + } ] }, { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Get bridge details.", "nickname": "get", "responseClass": "Bridge", @@ -117,6 +144,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Shut down a bridge.", "notes": "If any channels are in this bridge, they will be removed and resume whatever they were doing beforehand.", "nickname": "destroy", @@ -146,6 +176,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Add a channel to a bridge.", "nickname": "addChannel", "responseClass": "void", @@ -229,6 +262,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Remove a channel from a bridge.", "nickname": "removeChannel", "responseClass": "void", @@ -277,6 +313,10 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "13.13.0", + "14.2.0" + ], "summary": "Set a channel as the video source in a multi-party mixing bridge. This operation has no effect on bridges with two or fewer participants.", "nickname": "setVideoSource", "responseClass": "void", @@ -321,6 +361,10 @@ "operations": [ { "httpMethod": "DELETE", + "since": [ + "13.13.0", + "14.2.0" + ], "summary": "Removes any explicit video source in a multi-party mixing bridge. This operation has no effect on bridges with two or fewer participants. When no explicit video source is set, talk detection will be used to determine the active video stream.", "nickname": "clearVideoSource", "responseClass": "void", @@ -349,6 +393,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Play music on hold to a bridge or change the MOH class that is playing.", "nickname": "startMoh", "responseClass": "void", @@ -383,6 +430,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Stop playing music on hold to a bridge.", "notes": "This will only stop music on hold being played via POST bridges/{bridgeId}/moh.", "nickname": "stopMoh", @@ -416,6 +466,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Start playback of media on a bridge.", "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", "nickname": "play", @@ -500,6 +553,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.3.0" + ], "summary": "Start playback of media on a bridge.", "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", "nickname": "playWithId", @@ -584,6 +640,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Start a recording.", "notes": "This records the mixed audio from all channels participating in this bridge.", "nickname": "record", diff --git a/codegen/src/main/resources/codegen-data/ari_9_0_0/channels.json b/codegen/src/main/resources/codegen-data/ari_9_0_0/channels.json index ab4a0421..a50b8720 100644 --- a/codegen/src/main/resources/codegen-data/ari_9_0_0/channels.json +++ b/codegen/src/main/resources/codegen-data/ari_9_0_0/channels.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/channels.{format}", + "since": [ + "12.0.0" + ], "requiresModules": [ "res_stasis_answer", "res_stasis_playback", @@ -19,12 +22,18 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "List all active channels in Asterisk.", "nickname": "list", "responseClass": "List[Channel]" }, { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Create a new channel (originate).", "notes": "The new channel is created immediately and a snapshot of it returned. If a Stasis application is provided it will be automatically subscribed to the originated channel for further events and updates.", "nickname": "originate", @@ -163,6 +172,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "14.0.0" + ], "summary": "Create channel.", "nickname": "create", "responseClass": "Channel", @@ -247,6 +259,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Channel details.", "nickname": "get", "responseClass": "Channel", @@ -269,6 +284,9 @@ }, { "httpMethod": "POST", + "since": [ + "12.2.0" + ], "summary": "Create a new channel (originate with id).", "notes": "The new channel is created immediately and a snapshot of it returned. If a Stasis application is provided it will be automatically subscribed to the originated channel for further events and updates.", "nickname": "originateWithId", @@ -402,6 +420,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Delete (i.e. hangup) a channel.", "nickname": "hangup", "responseClass": "void", @@ -468,6 +489,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Exit application; continue execution in the dialplan.", "nickname": "continueInDialplan", "responseClass": "void", @@ -536,6 +560,10 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "13.26.0", + "16.3.0" + ], "summary": "Move the channel from one Stasis application to another.", "nickname": "move", "responseClass": "void", @@ -584,6 +612,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "13.3.0" + ], "summary": "Redirect the channel to a different location.", "nickname": "redirect", "responseClass": "void", @@ -636,6 +667,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Answer a channel.", "nickname": "answer", "responseClass": "void", @@ -672,6 +706,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Indicate ringing to a channel.", "nickname": "ring", "responseClass": "void", @@ -702,6 +739,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Stop ringing indication on a channel if locally generated.", "nickname": "ringStop", "responseClass": "void", @@ -732,12 +772,56 @@ } ] }, + { + "path": "/channels/{channelId}/progress", + "description": "Indicate progress on a channel", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "22.6.0", + "21.11.0", + "20.16.0" + ], + "summary": "Indicate progress on a channel.", + "nickname": "progress", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] + }, { "path": "/channels/{channelId}/dtmf", "description": "Send DTMF to a channel", "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Send provided DTMF to a given channel.", "nickname": "sendDTMF", "responseClass": "void", @@ -822,6 +906,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Mute a channel.", "nickname": "mute", "responseClass": "void", @@ -869,6 +956,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Unmute a channel.", "nickname": "unmute", "responseClass": "void", @@ -922,6 +1012,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Hold a channel.", "nickname": "hold", "responseClass": "void", @@ -952,6 +1045,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Remove a channel from hold.", "nickname": "unhold", "responseClass": "void", @@ -988,6 +1084,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Play music on hold to a channel.", "notes": "Using media operations such as /play on a channel playing MOH in this manner will suspend MOH without resuming automatically. If continuing music on hold is desired, the stasis application must reinitiate music on hold.", "nickname": "startMoh", @@ -1027,6 +1126,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Stop playing music on hold to a channel.", "nickname": "stopMoh", "responseClass": "void", @@ -1063,6 +1165,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Play silence to a channel.", "notes": "Using media operations such as /play on a channel playing silence in this manner will suspend silence without resuming automatically.", "nickname": "startSilence", @@ -1094,6 +1199,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Stop playing silence to a channel.", "nickname": "stopSilence", "responseClass": "void", @@ -1130,6 +1238,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Start playback of media.", "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", "nickname": "play", @@ -1208,6 +1319,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.2.0" + ], "summary": "Start playback of media and specify the playbackId.", "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", "nickname": "playWithId", @@ -1286,6 +1400,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Start a recording.", "notes": "Record audio from a channel. Note that this will not capture audio sent to the channel. The bridge itself has a record feature if that's what you want.", "nickname": "record", @@ -1397,7 +1514,7 @@ }, { "code": 409, - "reason": "Channel is not in a Stasis application; the channel is currently bridged with other hcannels; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail" + "reason": "Channel is not in a Stasis application; the channel is currently bridged with other channels; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail" }, { "code": 422, @@ -1413,6 +1530,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Get the value of a channel variable or function.", "nickname": "getChannelVar", "responseClass": "Variable", @@ -1451,6 +1571,9 @@ }, { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Set the value of a channel variable or function.", "nickname": "setChannelVar", "responseClass": "void", @@ -1503,6 +1626,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Start snooping.", "notes": "Snoop (spy/whisper) on a specific channel.", "nickname": "snoopChannel", @@ -1596,6 +1722,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.2.0" + ], "summary": "Start snooping.", "notes": "Snoop (spy/whisper) on a specific channel.", "nickname": "snoopChannelWithId", @@ -1689,6 +1818,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "14.0.0" + ], "summary": "Dial a created channel.", "nickname": "dial", "responseClass": "void", @@ -1742,6 +1874,10 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "13.27.0", + "16.4.0" + ], "summary": "RTP stats on a channel.", "nickname": "rtpstatistics", "responseClass": "RTPstat", @@ -1770,8 +1906,12 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "16.6.0", + "17.1.0" + ], "summary": "Start an External Media session.", - "notes": "Create a channel to an External Media source/sink.", + "notes": "Create a channel to an External Media source/sink. The combination of transport and encapsulation will select one of chan_rtp(udp/rtp), chan_audiosocket(tcp/audiosocket) or chan_websocket(websocket/none) channel drivers.", "nickname": "externalMedia", "responseClass": "Channel", "parameters": [ @@ -1801,15 +1941,15 @@ }, { "name": "external_host", - "description": "Hostname/ip:port of external host", + "description": "Hostname/ip:port or websocket_client connection ID of external host. May be empty for a websocket server connection.", "paramType": "query", - "required": true, + "required": false, "allowMultiple": false, "dataType": "string" }, { "name": "encapsulation", - "description": "Payload encapsulation protocol", + "description": "Payload encapsulation protocol. Must be 'none' for the websocket transport.", "paramType": "query", "required": false, "allowMultiple": false, @@ -1819,7 +1959,8 @@ "valueType": "LIST", "values": [ "rtp", - "audiosocket" + "audiosocket", + "none" ] } }, @@ -1835,13 +1976,14 @@ "valueType": "LIST", "values": [ "udp", - "tcp" + "tcp", + "websocket" ] } }, { "name": "connection_type", - "description": "Connection type (client/server)", + "description": "Connection type (client/server). 'server' is only valid for the websocket transport.", "paramType": "query", "required": false, "allowMultiple": false, @@ -1850,7 +1992,8 @@ "allowableValues": { "valueType": "LIST", "values": [ - "client" + "client", + "server" ] } }, @@ -1898,6 +2041,59 @@ ] } ] + }, + { + "path": "/channels/{channelId}/transfer_progress", + "description": "Inform the channel that the transfer is in progress.", + "operations": [ + { + "httpMethod": "POST", + "since": [ + "22.3.0", + "21.8.0", + "20.13.0" + ], + "summary": "Inform the channel about the progress of the attended/blind transfer.", + "nickname": "transfer_progress", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "states", + "description": "The state of the progress", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Endpoint parameter not provided" + }, + { + "code": 404, + "reason": "Channel or endpoint not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" + } + ] + } + ] } ], "models": { diff --git a/codegen/src/main/resources/codegen-data/ari_9_0_0/deviceStates.json b/codegen/src/main/resources/codegen-data/ari_9_0_0/deviceStates.json index bd389355..f0a889bc 100644 --- a/codegen/src/main/resources/codegen-data/ari_9_0_0/deviceStates.json +++ b/codegen/src/main/resources/codegen-data/ari_9_0_0/deviceStates.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/deviceStates.{format}", + "since": [ + "12.0.0" + ], "requiresModules": [ "res_stasis_device_state" ], @@ -16,6 +19,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "List all ARI controlled device states.", "nickname": "list", "responseClass": "List[DeviceState]" @@ -28,6 +34,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Retrieve the current state of a device.", "nickname": "get", "responseClass": "DeviceState", @@ -44,6 +53,9 @@ }, { "httpMethod": "PUT", + "since": [ + "12.0.0" + ], "summary": "Change the state of a device controlled by ARI. (Note - implicitly creates the device state).", "nickname": "update", "responseClass": "void", @@ -92,6 +104,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Destroy a device-state controlled by ARI.", "nickname": "delete", "responseClass": "void", diff --git a/codegen/src/main/resources/codegen-data/ari_9_0_0/endpoints.json b/codegen/src/main/resources/codegen-data/ari_9_0_0/endpoints.json index 3f3f98ce..233f2c84 100644 --- a/codegen/src/main/resources/codegen-data/ari_9_0_0/endpoints.json +++ b/codegen/src/main/resources/codegen-data/ari_9_0_0/endpoints.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/endpoints.{format}", + "since": [ + "12.0.0" + ], "apis": [ { "path": "/endpoints", @@ -13,6 +16,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "List all endpoints.", "nickname": "list", "responseClass": "List[Endpoint]" @@ -25,6 +31,9 @@ "operations": [ { "httpMethod": "PUT", + "since": [ + "13.0.0" + ], "summary": "Send a message to some technology URI or endpoint.", "nickname": "sendMessage", "responseClass": "void", @@ -81,6 +90,10 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "18.20.0", + "20.5.0" + ], "summary": "Refer an endpoint or technology URI to some technology URI or endpoint.", "nickname": "refer", "responseClass": "void", @@ -146,6 +159,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "List available endoints for a given endpoint technology.", "nickname": "listByTech", "responseClass": "List[Endpoint]", @@ -172,6 +188,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Details for an endpoint.", "nickname": "get", "responseClass": "Endpoint", @@ -208,6 +227,9 @@ "operations": [ { "httpMethod": "PUT", + "since": [ + "13.0.0" + ], "summary": "Send a message to some endpoint in a technology.", "nickname": "sendMessageToEndpoint", "responseClass": "void", @@ -268,6 +290,10 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "18.20.0", + "20.5.0" + ], "summary": "Refer an endpoint or technology URI to some technology URI or endpoint.", "nickname": "referToEndpoint", "responseClass": "void", diff --git a/codegen/src/main/resources/codegen-data/ari_9_0_0/events.json b/codegen/src/main/resources/codegen-data/ari_9_0_0/events.json index c9822f6c..e6fec303 100644 --- a/codegen/src/main/resources/codegen-data/ari_9_0_0/events.json +++ b/codegen/src/main/resources/codegen-data/ari_9_0_0/events.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.2", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/events.{format}", + "since": [ + "12.0.0" + ], "requiresModules": [ "res_http_websocket" ], @@ -16,6 +19,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "upgrade": "websocket", "websocketProtocol": "ari", "summary": "WebSocket connection for events.", @@ -48,6 +54,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.3.0" + ], "summary": "Generate a user event.", "nickname": "userEvent", "responseClass": "void", @@ -160,6 +169,8 @@ "RecordingFinished", "RecordingFailed", "ApplicationMoveFailed", + "ApplicationRegistered", + "ApplicationUnregistered", "ApplicationReplaced", "BridgeCreated", "BridgeDestroyed", @@ -189,7 +200,9 @@ "StasisStart", "TextMessageReceived", "ChannelConnectedLine", - "PeerStatusChange" + "PeerStatusChange", + "ChannelTransfer", + "RESTResponse" ] }, "ContactInfo": { @@ -355,6 +368,16 @@ } } }, + "ApplicationRegistered": { + "id": "ApplicationRegistered", + "description": "Notification that a Stasis app has been registered.", + "properties": {} + }, + "ApplicationUnregistered": { + "id": "ApplicationUnregistered", + "description": "Notification that a Stasis app has been unregistered.", + "properties": {} + }, "ApplicationReplaced": { "id": "ApplicationReplaced", "description": "Notification that another WebSocket has taken over for an application.\n\nAn application may only be subscribed to by a single WebSocket at a time. If multiple WebSockets attempt to subscribe to the same application, the newer WebSocket wins, and the older one receives this event.", @@ -913,6 +936,229 @@ "description": "The channel whose connected line has changed." } } + }, + "ChannelTransfer": { + "id": "ChannelTransfer", + "description": "transfer on a channel.", + "properties": { + "state": { + "required": false, + "type": "string", + "description": "Transfer State" + }, + "refer_to": { + "required": true, + "type": "ReferTo", + "description": "Refer-To information with optionally both affected channels" + }, + "referred_by": { + "required": true, + "type": "ReferredBy", + "description": "Referred-By SIP Header according rfc3892" + } + } + }, + "ReferTo": { + "id": "ReferTo", + "description": "transfer destination requested by transferee", + "properties": { + "requested_destination": { + "required": true, + "type": "RequiredDestination" + }, + "destination_channel": { + "required": false, + "type": "Channel", + "description": "The Channel Object, that is to be replaced" + }, + "connected_channel": { + "required": false, + "type": "Channel", + "description": "Channel, connected to the to be replaced channel" + }, + "bridge": { + "required": false, + "type": "Bridge", + "description": "Bridge connecting both destination channels" + } + } + }, + "ReferredBy": { + "id": "ReferredBy", + "description": "transfer destination requested by transferee", + "properties": { + "source_channel": { + "required": true, + "type": "Channel", + "description": "The channel on which the refer was received" + }, + "connected_channel": { + "required": false, + "type": "Channel", + "description": "Channel, Connected to the channel, receiving the transfer request on." + }, + "bridge": { + "required": false, + "type": "Bridge", + "description": "Bridge connecting both Channels" + } + } + }, + "RequiredDestination": { + "id": "RequiredDestination", + "description": "Information about the requested destination", + "properties": { + "protocol_id": { + "required": false, + "type": "string", + "description": "the requested protocol-id by the referee in case of SIP channel, this is a SIP Call ID, Mutually exclusive to destination" + }, + "destination": { + "required": false, + "type": "string", + "description": "Destination User Part. Only for Blind transfer. Mutually exclusive to protocol_id" + }, + "additional_protocol_params": { + "required": false, + "type": "List[AdditionalParam]", + "description": "List of additional protocol specific information" + } + } + }, + "AdditionalParam": { + "id": "AdditionalParam", + "description": "Protocol specific additional parameter", + "properties": { + "parameter_name": { + "required": true, + "type": "string", + "description": "Name of the parameter" + }, + "parameter_value": { + "required": true, + "type": "string", + "description": "Value of the parameter" + } + } + }, + "RESTHeader": { + "id": "RESTHeader", + "description": "REST over Websocket header", + "properties": { + "name": { + "type": "string", + "description": "Header name", + "required": true + }, + "value": { + "required": true, + "type": "string", + "description": "Header value" + } + } + }, + "RESTQueryStringParameter": { + "id": "RESTQueryStringParameter", + "description": "REST over Websocket Query String Parameter", + "properties": { + "name": { + "type": "string", + "description": "Parameter name", + "required": true + }, + "value": { + "required": true, + "type": "string", + "description": "Parameter value" + } + } + }, + "RESTRequest": { + "id": "RESTRequest", + "description": "REST over Websocket Request.", + "properties": { + "type": { + "type": "string", + "description": "Message type. Must be 'RESTRequest'", + "required": true + }, + "transaction_id": { + "type": "string", + "description": "Opaque transaction id. Can be any valid string. Will be returned in any response to this request.", + "required": true + }, + "request_id": { + "type": "string", + "description": "Opaque request id. Can be any valid string. Will be returned in any response to this request.", + "required": true + }, + "method": { + "required": true, + "type": "string", + "description": "HTTP method (GET, PUT, POST, DELETE, etc.)" + }, + "uri": { + "required": true, + "type": "string", + "description": "Resource URI with optional query string parameters." + }, + "content_type": { + "required": false, + "type": "string", + "description": "The Content-Type of the message body." + }, + "query_strings": { + "required": false, + "type": "List[RESTQueryStringParameter]", + "description": "Request query string parameters." + }, + "message_body": { + "required": false, + "type": "string", + "description": "Request message body. Only content types application/json and application/x-www-form-urlencoded are supported." + } + } + }, + "RESTResponse": { + "id": "RESTResponse", + "description": "REST over Websocket Response.", + "properties": { + "transaction_id": { + "type": "string", + "description": "Opaque transaction id. Will be whatever was specified on the original request.", + "required": true + }, + "request_id": { + "type": "string", + "description": "Opaque request id. Will be whatever was specified on the original request.", + "required": true + }, + "status_code": { + "required": true, + "type": "int", + "description": "HTTP status code" + }, + "reason_phrase": { + "required": true, + "type": "string", + "description": "HTTP reason phrase" + }, + "uri": { + "required": true, + "type": "string", + "description": "Original request resource URI" + }, + "content_type": { + "required": false, + "type": "string", + "description": "The Content-Type of the message body." + }, + "message_body": { + "required": false, + "type": "string", + "description": "Response message body" + } + } } } } diff --git a/codegen/src/main/resources/codegen-data/ari_9_0_0/mailboxes.json b/codegen/src/main/resources/codegen-data/ari_9_0_0/mailboxes.json index 8f5941b8..d99e1eac 100644 --- a/codegen/src/main/resources/codegen-data/ari_9_0_0/mailboxes.json +++ b/codegen/src/main/resources/codegen-data/ari_9_0_0/mailboxes.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/mailboxes.{format}", + "since": [ + "12.1.0" + ], "requiresModules": [ "res_stasis_mailbox" ], @@ -16,6 +19,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.1.0" + ], "summary": "List all mailboxes.", "nickname": "list", "responseClass": "List[Mailbox]" @@ -28,6 +34,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.1.0" + ], "summary": "Retrieve the current state of a mailbox.", "nickname": "get", "responseClass": "Mailbox", @@ -50,6 +59,9 @@ }, { "httpMethod": "PUT", + "since": [ + "12.1.0" + ], "summary": "Change the state of a mailbox. (Note - implicitly creates the mailbox).", "nickname": "update", "responseClass": "void", @@ -88,6 +100,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.1.0" + ], "summary": "Destroy a mailbox.", "nickname": "delete", "responseClass": "void", diff --git a/codegen/src/main/resources/codegen-data/ari_9_0_0/playbacks.json b/codegen/src/main/resources/codegen-data/ari_9_0_0/playbacks.json index 793986fc..a7892f18 100644 --- a/codegen/src/main/resources/codegen-data/ari_9_0_0/playbacks.json +++ b/codegen/src/main/resources/codegen-data/ari_9_0_0/playbacks.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/playbacks.{format}", + "since": [ + "12.0.0" + ], "requiresModules": [ "res_stasis_playback" ], @@ -16,6 +19,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Get a playback's details.", "nickname": "get", "responseClass": "Playback", @@ -38,6 +44,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Stop a playback.", "nickname": "stop", "responseClass": "void", @@ -66,6 +75,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Control a playback.", "nickname": "control", "responseClass": "void", diff --git a/codegen/src/main/resources/codegen-data/ari_9_0_0/recordings.json b/codegen/src/main/resources/codegen-data/ari_9_0_0/recordings.json index 6ffd6d8e..1496db8a 100644 --- a/codegen/src/main/resources/codegen-data/ari_9_0_0/recordings.json +++ b/codegen/src/main/resources/codegen-data/ari_9_0_0/recordings.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/recordings.{format}", + "since": [ + "12.0.0" + ], "requiresModules": [ "res_stasis_recording" ], @@ -16,6 +19,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "List recordings that are complete.", "nickname": "listStored", "responseClass": "List[StoredRecording]" @@ -28,6 +34,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Get a stored recording's details.", "nickname": "getStored", "responseClass": "StoredRecording", @@ -50,6 +59,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Delete a stored recording.", "nickname": "deleteStored", "responseClass": "void", @@ -78,6 +90,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "14.0.0" + ], "summary": "Get the file associated with the stored recording.", "nickname": "getStoredFile", "responseClass": "binary", @@ -110,6 +125,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.5.0" + ], "summary": "Copy a stored recording.", "nickname": "copyStored", "responseClass": "StoredRecording", @@ -150,6 +168,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "List live recordings.", "nickname": "getLive", "responseClass": "LiveRecording", @@ -172,6 +193,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Stop a live recording and discard it.", "nickname": "cancel", "responseClass": "void", @@ -199,6 +223,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Stop a live recording and store it.", "nickname": "stop", "responseClass": "void", @@ -226,6 +253,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Pause a live recording.", "notes": "Pausing a recording suspends silence detection, which will be restarted when the recording is unpaused. Paused time is not included in the accounting for maxDurationSeconds.", "nickname": "pause", @@ -253,6 +283,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Unpause a live recording.", "nickname": "unpause", "responseClass": "void", @@ -284,6 +317,9 @@ "operations": [ { "httpMethod": "POST", + "since": [ + "12.0.0" + ], "summary": "Mute a live recording.", "notes": "Muting a recording suspends silence detection, which will be restarted when the recording is unmuted.", "nickname": "mute", @@ -311,6 +347,9 @@ }, { "httpMethod": "DELETE", + "since": [ + "12.0.0" + ], "summary": "Unmute a live recording.", "nickname": "unmute", "responseClass": "void", diff --git a/codegen/src/main/resources/codegen-data/ari_9_0_0/sounds.json b/codegen/src/main/resources/codegen-data/ari_9_0_0/sounds.json index 8fbe1c57..aee4d369 100644 --- a/codegen/src/main/resources/codegen-data/ari_9_0_0/sounds.json +++ b/codegen/src/main/resources/codegen-data/ari_9_0_0/sounds.json @@ -6,6 +6,9 @@ "swaggerVersion": "1.1", "basePath": "http://localhost:8088/ari", "resourcePath": "/api-docs/sounds.{format}", + "since": [ + "12.0.0" + ], "apis": [ { "path": "/sounds", @@ -13,6 +16,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "List all sounds.", "nickname": "list", "responseClass": "List[Sound]", @@ -42,6 +48,9 @@ "operations": [ { "httpMethod": "GET", + "since": [ + "12.0.0" + ], "summary": "Get a sound's details.", "nickname": "get", "responseClass": "Sound", From c4545f11e3b5d11b28c9d5ef323c906cb77a22eb Mon Sep 17 00:00:00 2001 From: grahambrown11 <771817+grahambrown11@users.noreply.github.com> Date: Sat, 17 Jan 2026 10:21:56 +0000 Subject: [PATCH 12/17] ARI API Updates --- .../main/resources/codegen-data/ari_10_0_0/channels.json | 8 ++++++++ .../main/resources/codegen-data/ari_11_0_0/channels.json | 8 ++++++++ .../main/resources/codegen-data/ari_8_0_0/channels.json | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/codegen/src/main/resources/codegen-data/ari_10_0_0/channels.json b/codegen/src/main/resources/codegen-data/ari_10_0_0/channels.json index a50b8720..f7ea634d 100644 --- a/codegen/src/main/resources/codegen-data/ari_10_0_0/channels.json +++ b/codegen/src/main/resources/codegen-data/ari_10_0_0/channels.json @@ -2027,6 +2027,14 @@ "required": false, "allowMultiple": false, "dataType": "string" + }, + { + "name": "transport_data", + "description": "Transport-specific data. For websocket this is appended to the dialstring.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" } ], "errorResponses": [ diff --git a/codegen/src/main/resources/codegen-data/ari_11_0_0/channels.json b/codegen/src/main/resources/codegen-data/ari_11_0_0/channels.json index a50b8720..f7ea634d 100644 --- a/codegen/src/main/resources/codegen-data/ari_11_0_0/channels.json +++ b/codegen/src/main/resources/codegen-data/ari_11_0_0/channels.json @@ -2027,6 +2027,14 @@ "required": false, "allowMultiple": false, "dataType": "string" + }, + { + "name": "transport_data", + "description": "Transport-specific data. For websocket this is appended to the dialstring.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" } ], "errorResponses": [ diff --git a/codegen/src/main/resources/codegen-data/ari_8_0_0/channels.json b/codegen/src/main/resources/codegen-data/ari_8_0_0/channels.json index 0a08a4a9..e5ec6a4b 100644 --- a/codegen/src/main/resources/codegen-data/ari_8_0_0/channels.json +++ b/codegen/src/main/resources/codegen-data/ari_8_0_0/channels.json @@ -2027,6 +2027,14 @@ "required": false, "allowMultiple": false, "dataType": "string" + }, + { + "name": "transport_data", + "description": "Transport-specific data. For websocket this is appended to the dialstring.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" } ], "errorResponses": [ From 28d6d81e3d34349b3d2423691f89e9cf22904908 Mon Sep 17 00:00:00 2001 From: Graham Brown Date: Mon, 26 Jan 2026 15:55:12 +0200 Subject: [PATCH 13/17] Library updates --- .github/workflows/gradle.yml | 4 +- CHANGELOG.md | 3 + README.md | 3 + build.gradle | 48 ++--- codegen/build.gradle | 10 +- gradle/wrapper/gradle-wrapper.jar | Bin 59536 -> 61608 bytes gradle/wrapper/gradle-wrapper.properties | 3 +- gradlew | 18 +- gradlew.bat | 181 +++++++++--------- .../loway/oss/ari4java/tools/ARIEncoder.java | 22 ++- .../ari4java/tools/http/NettyHttpClient.java | 66 +++---- src/test/resources/log4j2.properties | 17 -- src/test/resources/logback.xml | 16 ++ 13 files changed, 208 insertions(+), 183 deletions(-) delete mode 100755 src/test/resources/log4j2.properties create mode 100644 src/test/resources/logback.xml diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 7cc999c9..d2f00c59 100755 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -22,11 +22,11 @@ jobs: key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} restore-keys: | ${{ runner.os }}-gradle- - - name: Set up JDK 1.8 + - name: Set up JDK 17 uses: actions/setup-java@v4 with: distribution: 'zulu' - java-version: '8' + java-version: '17' - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Build with Gradle diff --git a/CHANGELOG.md b/CHANGELOG.md index 4066cf05..50b679d7 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,11 @@ ### Added - Connection Pooling using Netty's FixedChannelPool - Examples have a Docker provider for Vagrant (in order to work around VirtualBox compatibility on Apple Silicon) +- `AriVersion.ARI_10_0_0` ### Changed +- :exclamation: Changed java compatibility to Java 17 in preparation for Jackson 3 which will be in the next release +- Library updates - Cannot wait for connection close due to using connection keep-alive (aka pooling) - Some methods in the Examples use the async approach diff --git a/README.md b/README.md index b152f6a7..41308438 100755 --- a/README.md +++ b/README.md @@ -39,6 +39,9 @@ The groupId is now `io.github.ari4java` make sure you update your build files if - [Getting Started](https://github.com/ari4java/ari4java/wiki/Getting-Started) - [Examples](https://github.com/ari4java/ari4java/wiki/Examples) +## Development +Please find the [Development Wiki](https://github.com/ari4java/ari4java/wiki/Development) + ## Licensing The library is released under the GNU LGPL (see [LICENSE](https://github.com/ari4java/ari4java/blob/master/LICENSE) file). Files under codegen-data come from the Asterisk project and are licensed under the GPLv2 (see LICENSE.asterisk file therein). diff --git a/build.gradle b/build.gradle index f51a70f2..41566a8a 100755 --- a/build.gradle +++ b/build.gradle @@ -3,12 +3,12 @@ plugins { id "jacoco" id "maven-publish" id "signing" - id "com.github.spotbugs" version "4.7.0" + id "com.github.spotbugs" version "5.0.0" id "org.sonarqube" version "2.7.1" } group = "io.github.ari4java" -version = "0.17.0" +version = "0.18.0" def projectUrl = "http://github.com/ari4java/ari4java" def build_number = "x" @@ -17,8 +17,8 @@ if (System.getenv("BUILD_NUMBER") != null) { } java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 withJavadocJar() withSourcesJar() } @@ -36,20 +36,20 @@ repositories { } dependencies { - implementation 'com.fasterxml.jackson.core:jackson-core:2.13.1' - implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.1' - implementation 'com.fasterxml.jackson.core:jackson-annotations:2.13.1' - implementation 'io.netty:netty-all:4.1.72.Final' + implementation 'com.fasterxml.jackson.core:jackson-core:2.21.0' + implementation 'com.fasterxml.jackson.core:jackson-databind:2.21.0' + implementation 'com.fasterxml.jackson.core:jackson-annotations:2.21' + implementation 'io.netty:netty-all:4.2.9.Final' implementation 'javax.xml.bind:jaxb-api:2.3.1' - implementation 'org.slf4j:slf4j-api:1.7.32' + implementation 'org.slf4j:slf4j-api:2.0.17' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2' testImplementation 'org.mockito:mockito-core:4.2.0' - testImplementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.17.0' + testImplementation 'ch.qos.logback:logback-classic:1.5.25' } -task buildProps(type: WriteProperties) { +tasks.register('buildProps', WriteProperties) { outputFile file("src/main/resources/build.properties") property "BUILD_NUMBER", build_number } @@ -84,11 +84,11 @@ test { jacocoTestReport { reports { - xml.enabled true - csv.enabled false - html.enabled true - xml.destination = file("${buildDir}/reports/jacocoTestReport.xml") - html.destination = file("${buildDir}/reports/jacocoTestReport/html") + xml.required.set(true) + csv.required.set(false) + html.required.set(true) + xml.outputLocation.set(file("${buildDir}/reports/jacocoTestReport.xml")) + html.outputLocation.set(file("${buildDir}/reports/jacocoTestReport/html")) } afterEvaluate { classDirectories.setFrom(files(classDirectories.files.collect { @@ -178,23 +178,15 @@ signing { spotbugsMain { reports { - html { - enabled = true - } - xml { - enabled = false - } + xml.required.set(true) + html.required.set(true) } } spotbugsTest { ignoreFailures = true reports { - html { - enabled = true - } - xml { - enabled = false - } + xml.required.set(false) + html.required.set(true) } } diff --git a/codegen/build.gradle b/codegen/build.gradle index fcddd813..eafcdd58 100755 --- a/codegen/build.gradle +++ b/codegen/build.gradle @@ -7,15 +7,15 @@ repositories { } dependencies { - implementation 'com.fasterxml.jackson.core:jackson-core:2.9.6' - implementation 'com.fasterxml.jackson.core:jackson-databind:2.9.6' - implementation 'com.fasterxml.jackson.core:jackson-annotations:2.9.6' + implementation 'com.fasterxml.jackson.core:jackson-core:2.20.0' + implementation 'com.fasterxml.jackson.core:jackson-databind:2.20.0' + implementation 'com.fasterxml.jackson.core:jackson-annotations:2.20' implementation 'com.google.googlejavaformat:google-java-format:1.7' } java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } task runCodegen(type: JavaExec) { diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae8848c63b8b4dea2cb829da983f2fa..ccebba7710deaf9f98673a68957ea02138b60d0a 100755 GIT binary patch delta 39624 zcmaI7V|1obvn?9iwrv|7+qP{xZ=8;8+twS~cG6Kt9oy*S_TJ~7ea<(=9rw?wAFI~$ zYgW~KYE~sKf>-W?Ln_OGLtrEoVkY6CgJL8xx%@i{$^YxXOxnc!Z=1rh4v_)_ii?2( z0s;dA0s%FGV%$6qD=7T7(@>XohBO3}|2~Fu zd_Kes>`?_XEIU~Bjw9}Pz0-wkP*b5sy}0%Dd42CUvwfb)1|u4J1Yn+%5qWqrFW1Esajt?}`3!?vIAPb-^qcpvDxa{H;c(duM~m zeZU^*uZbpbG(HR`L@g}LjND&%fa>1_XEam-N0gFjl+FPA1=mNH(NOiu*H?6q^O_#w zRP*yUKUhrn`!7DSJSk*J{*QRim+K3GUw(!C6<+;6NL=#*b)BLvCil|;l@6oH!~76` zI&vmc>!`29d<7g}!el4-`98LM$?^z!g`RX$YmlDZpHB*>;R`9nG5O6VGkfI<8MfV} z2i6^tRCE<6(m9?h(8m#LjD(4}OOyW;5($^;v3Aab1w2bLP&P7|>JBpwrwd_l>y9x5 zxUV$ocI94~cy%ZxP}-ydm@q*k1>+%C7*6Qj)8 zSS?AP6yvunr4awoB)@$96Sc!sy+ajBSo7q97bl^uH76=8pCEaR$k}O~v#D zN!k?`dTR@rBNDQlMTUb77;n6u;NI>aypX&nss(? ztsrq)>ldjT11|RyX>gjMxgg=D8}9BLduYT37v!D=+Nqe>=(VNz&~7}feB@BxOl{ge znYPQ%C(SB)d{s@6wk%qbDCFjaT zFzuX0@se|SvPf~-m5`|IX)xvEQKe!6!(YkR&HI^yPQ~LT_ow9)E~jmIoyc%qg#;yJ zuMC{|u1{lTbWKDc!HP4+x*bmpJ6`-DLL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RCjUpS>LxVn+q$k7a=7`GG`nA|e^}A+czc z{fI82+U-P??Xy2A)Q48HufZXvT!%fK2bd0<{J%n{n2(uC zRG^DUFHHC+316=Z3ic$s4u??65J2~J#v`^96@DPY!I1P_K!XX!LfiTA*)C)qBCO~l$C$Q0Q z4iMhJhlELPz#)yMAjo$p_Y{OE?htyU?)>xEg#Auq@n6fC9SEc!i7k#=PLv;j$a2Q} zKPimI^c=>*fdn`a$=L%qHzi2e8!+JZ6a}Q$1F)YGB>?!yIBE#Y6R4lUFWJZx9HQn4 z#88R>BGdTsN=?Hd1KuD210GBZfWUJQc!C6G_*j7@dg$RKd@hf&#E8)-5L0xI}LDW)Pd;|UF139#CcmEq zn;>M<145j@b?e{vyVepM64np6EnNm_H1;r{XNdxGdk`2~QeYqlmjVCG7bj5%{VO6v H_^bZ|3zHqB diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2e6e5897..aa02b02f 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip +networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 1b6c7873..79a61d42 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,10 +80,10 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' @@ -143,12 +143,16 @@ fi if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -205,6 +209,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/gradlew.bat b/gradlew.bat index 107acd32..6689b85b 100755 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,89 +1,92 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/src/main/java/ch/loway/oss/ari4java/tools/ARIEncoder.java b/src/main/java/ch/loway/oss/ari4java/tools/ARIEncoder.java index 4af771ec..435441b3 100755 --- a/src/main/java/ch/loway/oss/ari4java/tools/ARIEncoder.java +++ b/src/main/java/ch/loway/oss/ari4java/tools/ARIEncoder.java @@ -1,8 +1,9 @@ package ch.loway.oss.ari4java.tools; -import ch.loway.oss.ari4java.ARI; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import io.netty.handler.codec.base64.Base64; -import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; @@ -18,12 +19,25 @@ public class ARIEncoder { */ public static String encodeUrl(String url) { try { - return URLEncoder.encode(url, ARIEncoder.ENCODING.name()); - } catch (UnsupportedEncodingException e) { + return URLEncoder.encode(url, ARIEncoder.ENCODING); + } catch (Exception e) { // this should happen, but if so return the input return url; } } + public static String encodeCreds(String username, String password) { + ByteBuf buf1 = Unpooled.copiedBuffer(username + ":" + password, ARIEncoder.ENCODING); + try { + ByteBuf buf2 = Base64.encode(buf1, false); + try { + return "Basic " + buf2.toString(ARIEncoder.ENCODING); + } finally { + buf2.release(); + } + } finally { + buf1.release(); + } + } } diff --git a/src/main/java/ch/loway/oss/ari4java/tools/http/NettyHttpClient.java b/src/main/java/ch/loway/oss/ari4java/tools/http/NettyHttpClient.java index 3d430e6d..65246b6e 100755 --- a/src/main/java/ch/loway/oss/ari4java/tools/http/NettyHttpClient.java +++ b/src/main/java/ch/loway/oss/ari4java/tools/http/NettyHttpClient.java @@ -7,13 +7,12 @@ import io.netty.buffer.PooledByteBufAllocator; import io.netty.buffer.Unpooled; import io.netty.channel.*; -import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.channel.nio.NioIoHandler; import io.netty.channel.pool.ChannelPool; import io.netty.channel.pool.ChannelPoolHandler; import io.netty.channel.pool.FixedChannelPool; import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioSocketChannel; -import io.netty.handler.codec.base64.Base64; import io.netty.handler.codec.http.*; import io.netty.handler.codec.http.websocketx.*; import io.netty.handler.logging.ByteBufFormat; @@ -40,10 +39,10 @@ /** * HTTP and WebSocket client implementation based on netty.io. *

- * Threading is handled by NioEventLoopGroup, which selects on multiple + * Threading is handled by MultiThreadIoEventLoopGroup, which selects on multiple * sockets and provides threads to handle the events on the sockets. *

- * Requires netty-all-4.0.12.Final.jar + * Requires netty * * @author mwalton */ @@ -87,15 +86,15 @@ public class NettyHttpClient implements HttpClient, WsClient { protected int pingPeriod = 5; protected TimeUnit pingTimeUnit = TimeUnit.MINUTES; protected ChannelPool pool; - private int threadCount; + private final int threadCount; public NettyHttpClient() { // use at least 3 threads - threadCount = Math.max(3, SystemPropertyUtil.getInt( + threadCount = Math.min(3, SystemPropertyUtil.getInt( "io.netty.eventLoopThreads", NettyRuntime.availableProcessors() * 2)); logger.debug("Starting NioEventLoopGroup with {} threads", threadCount); - group = new NioEventLoopGroup(threadCount); - shutDownGroup = new NioEventLoopGroup(1); + group = new MultiThreadIoEventLoopGroup(threadCount, NioIoHandler.newFactory()); + shutDownGroup = new MultiThreadIoEventLoopGroup(1, NioIoHandler.newFactory()); } public void initialize(String baseUrl, String username, String password) throws URISyntaxException { @@ -109,17 +108,18 @@ public void initialize(String baseUrl, String username, String password) throws logger.warn("Not http(s), protocol: {}", protocol); throw new IllegalArgumentException("Unsupported protocol: " + protocol); } - this.auth = "Basic " + Base64.encode(Unpooled.copiedBuffer((username + ":" + password), ARIEncoder.ENCODING)).toString(ARIEncoder.ENCODING); + this.auth = ARIEncoder.encodeCreds(username, password); initHttpBootstrap(); } protected void initHttpBootstrap() { if (httpBootstrap == null) { // Bootstrap is the factory for HTTP connections - logger.debug("Bootstrap with\n" + - " connection timeout: {},\n" + - " read timeout: {},\n" + - " aggregator max-length: {}", + logger.debug(""" + Bootstrap with + connection timeout: {}, + read timeout: {}, + aggregator max-length: {}""", CONNECTION_TIMEOUT_SEC, READ_TIMEOUT_SEC, MAX_HTTP_REQUEST); @@ -396,28 +396,28 @@ public void httpActionAsync(String uri, String method, List parameter final NettyHttpClientHandler handler = (NettyHttpClientHandler) ch.pipeline().get(HTTP_HANDLER); handler.reset(); ch.writeAndFlush(request).addListener(future2 -> - group.execute(() -> { - try { - logger.debug("Wait for response..."); - handler.waitForResponse(READ_TIMEOUT_SEC); - if (handler.getException() != null) { - logger.debug("got an error: {}", handler.getException().toString()); - onFailure(responseHandler, new RestException(handler.getException())); - } else if (httpResponseOkay(handler.getResponseStatus())) { - logger.debug("got OK response"); - if (binary) { - responseHandler.onSuccess(handler.getResponseBytes()); + group.execute(() -> { + try { + logger.debug("Wait for response..."); + handler.waitForResponse(READ_TIMEOUT_SEC); + if (handler.getException() != null) { + logger.debug("got an error: {}", handler.getException().toString()); + onFailure(responseHandler, new RestException(handler.getException())); + } else if (httpResponseOkay(handler.getResponseStatus())) { + logger.debug("got OK response"); + if (binary) { + responseHandler.onSuccess(handler.getResponseBytes()); + } else { + responseHandler.onSuccess(handler.getResponseText()); + } } else { - responseHandler.onSuccess(handler.getResponseText()); + logger.debug("...done waiting"); + onFailure(responseHandler, makeException(handler.getResponseStatus(), handler.getResponseText(), errors)); } - } else { - logger.debug("...done waiting"); - onFailure(responseHandler, makeException(handler.getResponseStatus(), handler.getResponseText(), errors)); + } finally { + poolRelease(ch); } - } finally { - poolRelease(ch); - } - }) + }) ); } else { onFailure(responseHandler, future1.cause()); @@ -591,7 +591,7 @@ public void disconnect() throws RestException { * Checks if a response is okay. * All 2XX responses are supposed to be okay. * - * @param status + * @param status http status * @return whether it is a 2XX code or not (error!) */ private boolean httpResponseOkay(HttpResponseStatus status) { diff --git a/src/test/resources/log4j2.properties b/src/test/resources/log4j2.properties deleted file mode 100755 index 6f6701a0..00000000 --- a/src/test/resources/log4j2.properties +++ /dev/null @@ -1,17 +0,0 @@ -status = error -name = PropertiesConfig -filters = threshold -filter.threshold.type = ThresholdFilter -filter.threshold.level = trace -appenders = console -appender.console.type = Console -appender.console.name = STDOUT -appender.console.layout.type = PatternLayout -appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p [%.15t] %c{1.}:%L - %m%n -rootLogger.level = DEBUG -rootLogger.appenderRefs = stdout -rootLogger.appenderRef.stdout.ref = STDOUT -logger.ari4java.name = ch.loway.oss.ari4java -logger.ari4java.level = trace -logger.netty.name = io.netty -logger.netty.level = error diff --git a/src/test/resources/logback.xml b/src/test/resources/logback.xml new file mode 100644 index 00000000..b997c8f5 --- /dev/null +++ b/src/test/resources/logback.xml @@ -0,0 +1,16 @@ + + + + + + %cyan(%d{ISO8601}) %highlight(%-5level) [%blue(%t)] %green(%c{1}): %msg%n%throwable + + + + + + + + + + \ No newline at end of file From 9b965e29c3a45c133e7fe6b43c71270dd0575211 Mon Sep 17 00:00:00 2001 From: Graham Brown Date: Mon, 26 Jan 2026 15:55:58 +0200 Subject: [PATCH 14/17] change example inclusion and other example updates --- .gitignore | 7 + examples/Dockerfile | 6 +- examples/Vagrantfile | 2 +- examples/build.gradle | 20 +- examples/gradle/wrapper/gradle-wrapper.jar | Bin 59203 -> 59536 bytes .../gradle/wrapper/gradle-wrapper.properties | 2 +- examples/gradlew | 257 +++++++++++------- examples/gradlew.bat | 178 ++++++------ examples/settings.gradle | 4 +- .../examples/comprehensive/Asterisk.java | 18 +- .../examples/comprehensive/WebServer.java | 9 +- examples/vagrant/asterisk/keys/ca-req.cnf | 10 + examples/vagrant/asterisk/keys/cert-req.cnf | 17 ++ examples/vagrant/asterisk/modules.conf | 17 +- examples/vagrant/asterisk/musiconhold.conf | 5 + examples/vagrant/asterisk/pjsip.conf | 8 +- examples/vagrant/asterisk/pjsip_notify.conf | 57 ++++ examples/vagrant/asterisk/pjsip_wizard.conf | 13 +- .../vagrant/asterisk/websocket_client.conf | 2 + examples/vagrant/scripts/provision.sh | 46 ++-- .../vagrant/static-http/ari4java-phone.html | 39 ++- .../vagrant/static-http/jssip-3.10.1.min.js | 9 + .../vagrant/static-http/jssip-3.8.2.min.js | 9 - settings.gradle | 3 + 24 files changed, 465 insertions(+), 273 deletions(-) create mode 100644 examples/vagrant/asterisk/keys/ca-req.cnf create mode 100644 examples/vagrant/asterisk/keys/cert-req.cnf create mode 100644 examples/vagrant/asterisk/musiconhold.conf create mode 100644 examples/vagrant/asterisk/pjsip_notify.conf create mode 100644 examples/vagrant/asterisk/websocket_client.conf create mode 100644 examples/vagrant/static-http/jssip-3.10.1.min.js delete mode 100644 examples/vagrant/static-http/jssip-3.8.2.min.js diff --git a/.gitignore b/.gitignore index 38a9ec92..8d4b371e 100755 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,10 @@ oss.yaml # vagrant state folder .vagrant + +# local build examples +.inc-examples +# exclude keys +examples/vagrant/asterisk/keys/*.key +examples/vagrant/asterisk/keys/*.crt +examples/vagrant/asterisk/keys/*.csr diff --git a/examples/Dockerfile b/examples/Dockerfile index c06c503c..8ddd4afc 100644 --- a/examples/Dockerfile +++ b/examples/Dockerfile @@ -1,14 +1,14 @@ # Docker image to use with Vagrant # Aims to be as similar to normal Vagrant usage as possible -# Adds Puppet, SSH daemon, Systemd +# Adds SSH daemon, Systemd # Adapted from https://github.com/BashtonLtd/docker-vagrant-images/blob/master/ubuntu1404/Dockerfile -FROM ubuntu:focal +FROM ubuntu:noble ENV container docker RUN apt update && apt -y upgrade # Install system dependencies, you may not need all of these -RUN apt install -y --no-install-recommends ssh sudo libffi-dev systemd openssh-client nano +RUN apt install -y --no-install-recommends ssh sudo libffi-dev systemd openssh-client nano wget curl less # Add vagrant user and key for SSH RUN useradd --create-home -s /bin/bash vagrant diff --git a/examples/Vagrantfile b/examples/Vagrantfile index 498c70ed..9636f439 100644 --- a/examples/Vagrantfile +++ b/examples/Vagrantfile @@ -8,7 +8,7 @@ if not ENV["NET_BRIDGE"] then ENV["NET_BRIDGE"] = "off" end Vagrant.configure("2") do |config| - config.vm.box = "ubuntu/focal64" + config.vm.box = "cloud-image/ubuntu-24.04" config.vm.synced_folder "./vagrant", "/vagrant" config.vm.provider "virtualbox" do |v, override| v.memory = 1024 diff --git a/examples/build.gradle b/examples/build.gradle index 54003227..750df1e7 100755 --- a/examples/build.gradle +++ b/examples/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'java' + id "java" } repositories { @@ -7,24 +7,28 @@ repositories { } dependencies { - implementation 'ch.loway.oss.ari4java:ari4java:+' - implementation 'ch.qos.logback:logback-classic:1.2.10' - implementation 'io.netty:netty-all:4.1.72.Final' + if (file("../.inc-examples").exists()) { + implementation project(":") + } else { + implementation "ch.loway.oss.ari4java:ari4java:+" + } + implementation "ch.qos.logback:logback-classic:1.5.25" + implementation "io.netty:netty-all:4.2.9.Final" } java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } task runWeaselsExample(type: JavaExec) { dependsOn build classpath = sourceSets.main.runtimeClasspath - mainClass = 'ch.loway.oss.ari4java.examples.Weasels' + mainClass = "ch.loway.oss.ari4java.examples.Weasels" } task runComprehensiveExample(type: JavaExec) { dependsOn build classpath = sourceSets.main.runtimeClasspath - mainClass = 'ch.loway.oss.ari4java.examples.comprehensive.Boot' + mainClass = "ch.loway.oss.ari4java.examples.comprehensive.Boot" } diff --git a/examples/gradle/wrapper/gradle-wrapper.jar b/examples/gradle/wrapper/gradle-wrapper.jar index e708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R9Z!}wmp$#~Uc%u1oh#TP}wF*kJJmQX2#27kL z_dz(yKufo<=m71bZfLp^Ll#t3(IHkrgMcvx@~om%Ib(h(<$Da7urTI`x|%`wD--sN zJEEa>4DGSEG?0ulkosfj8IMNN4)B=ZtvGG{|4Fp=Xhg!wPNgYzS>{Bp%%Qa+624X@ X49Luk)baa85H9$5YCsTPT`SVRWMtMW diff --git a/examples/gradle/wrapper/gradle-wrapper.properties b/examples/gradle/wrapper/gradle-wrapper.properties index 2e6e5897..3ae1e2f1 100755 --- a/examples/gradle/wrapper/gradle-wrapper.properties +++ b/examples/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/gradlew b/examples/gradlew index 4f906e0c..1b6c7873 100755 --- a/examples/gradlew +++ b/examples/gradlew @@ -1,7 +1,7 @@ -#!/usr/bin/env sh +#!/bin/sh # -# Copyright 2015 the original author or authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,67 +17,101 @@ # ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +APP_BASE_NAME=${0##*/} # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" + JAVACMD=java which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the @@ -106,80 +140,95 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. # For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=`expr $i + 1` + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' exec "$JAVACMD" "$@" diff --git a/examples/gradlew.bat b/examples/gradlew.bat index 107acd32..ac1b06f9 100755 --- a/examples/gradlew.bat +++ b/examples/gradlew.bat @@ -1,89 +1,89 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/examples/settings.gradle b/examples/settings.gradle index 26f065f1..0f6b5991 100755 --- a/examples/settings.gradle +++ b/examples/settings.gradle @@ -1,7 +1,7 @@ -if (file(".build-local").exists()) { +if (file("../.build-examples").exists()) { includeBuild("../") { dependencySubstitution { - substitute(module("ch.loway.oss.ari4java:ari4java")).with(project(":")) + substitute(module("ch.loway.oss.ari4java:ari4java")).using(project(":")) } } } diff --git a/examples/src/main/java/ch/loway/oss/ari4java/examples/comprehensive/Asterisk.java b/examples/src/main/java/ch/loway/oss/ari4java/examples/comprehensive/Asterisk.java index 0d671698..c33e6c1d 100644 --- a/examples/src/main/java/ch/loway/oss/ari4java/examples/comprehensive/Asterisk.java +++ b/examples/src/main/java/ch/loway/oss/ari4java/examples/comprehensive/Asterisk.java @@ -44,6 +44,20 @@ public boolean start() { logger.info("Starting ARI..."); try { ari = ARI.build(address, ARI_APP_NAME, user, pass, version); + // execute syncronously to validate ARI before starting the event websocket + AsteriskInfo info = ari.asterisk().getInfo().execute(); + logger.info("Asterisk {}", info.getSystem().getVersion()); + threadPool = Executors.newFixedThreadPool(5); + ari.events().eventWebsocket(ARI_APP_NAME).execute(new Handler()); + return true; + } catch (Throwable t) { + logger.error("Error: {}", t.getMessage(), t); + } + return false; + } + + private void getAsteriskInfo() { + try { ari.asterisk().getInfo().execute(new AriCallback() { @Override public void onSuccess(AsteriskInfo info) { @@ -55,13 +69,9 @@ public void onFailure(RestException e) { logger.error("Error getting Asterisk version: {}", e.getMessage(), e); } }); - threadPool = Executors.newFixedThreadPool(5); - ari.events().eventWebsocket(ARI_APP_NAME).execute(new Handler()); - return true; } catch (Throwable t) { logger.error("Error: {}", t.getMessage(), t); } - return false; } /** diff --git a/examples/src/main/java/ch/loway/oss/ari4java/examples/comprehensive/WebServer.java b/examples/src/main/java/ch/loway/oss/ari4java/examples/comprehensive/WebServer.java index 4be3365b..21c77b4f 100644 --- a/examples/src/main/java/ch/loway/oss/ari4java/examples/comprehensive/WebServer.java +++ b/examples/src/main/java/ch/loway/oss/ari4java/examples/comprehensive/WebServer.java @@ -5,7 +5,7 @@ import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import io.netty.channel.*; -import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.channel.nio.NioIoHandler; import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioServerSocketChannel; import io.netty.handler.codec.http.*; @@ -30,8 +30,8 @@ public WebServer(int port, Asterisk asterisk) { public void start() { logger.info("Starting HTTP Server on port {}", port); - parentGroup = new NioEventLoopGroup(1); - workerGroup = new NioEventLoopGroup(5); + parentGroup = new MultiThreadIoEventLoopGroup(1, NioIoHandler.newFactory()); + workerGroup = new MultiThreadIoEventLoopGroup(5, NioIoHandler.newFactory()); try { ServerBootstrap b = new ServerBootstrap(); b.group(parentGroup, workerGroup) @@ -73,8 +73,7 @@ public void channelReadComplete(ChannelHandlerContext ctx) { @Override protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception { - if (msg instanceof HttpRequest) { - HttpRequest request = (HttpRequest) msg; + if (msg instanceof HttpRequest request) { uri = request.uri(); method = request.method(); logger.debug("HttpRequest method: {}, uri: {}", method, uri); diff --git a/examples/vagrant/asterisk/keys/ca-req.cnf b/examples/vagrant/asterisk/keys/ca-req.cnf new file mode 100644 index 00000000..b23f7977 --- /dev/null +++ b/examples/vagrant/asterisk/keys/ca-req.cnf @@ -0,0 +1,10 @@ +[req] +distinguished_name = req_distinguished_name +prompt = no + +[req_distinguished_name] +O = ARI4JavaCA +CN = ari4java.localhost + +[ext] +basicConstraints=CA:TRUE diff --git a/examples/vagrant/asterisk/keys/cert-req.cnf b/examples/vagrant/asterisk/keys/cert-req.cnf new file mode 100644 index 00000000..c54ada2e --- /dev/null +++ b/examples/vagrant/asterisk/keys/cert-req.cnf @@ -0,0 +1,17 @@ +[req] +default_bits = 2048 +distinguished_name = req_distinguished_name +req_extensions = v3_req +prompt = no + +[req_distinguished_name] +O = ARI4Java +CN = ari4java.localhost + +[v3_req] +subjectAltName = @alt_names + +[alt_names] +DNS.1 = localhost +IP.1 = 127.0.0.1 +IP.2 = 192.168.56.44 diff --git a/examples/vagrant/asterisk/modules.conf b/examples/vagrant/asterisk/modules.conf index be4c2cc2..da3c74e5 100644 --- a/examples/vagrant/asterisk/modules.conf +++ b/examples/vagrant/asterisk/modules.conf @@ -35,6 +35,7 @@ load = cdr_csv.so load = chan_bridge_media.so load = chan_pjsip.so load = chan_iax2.so +load = chan_rtp.so ; Codecs @@ -80,12 +81,14 @@ load = func_hangupcause.so load = pbx_config.so load = pbx_spool.so +load = pbx_loopback.so ; Resources load = res_curl.so load = res_musiconhold.so load = res_pjproject.so +load = res_pjsip.so load = res_pjsip_acl.so load = res_pjsip_authenticator_digest.so load = res_pjsip_caller_id.so @@ -95,16 +98,16 @@ load = res_pjsip_diversion.so load = res_pjsip_dlg_options.so load = res_pjsip_dtmf_info.so load = res_pjsip_empty_info.so -load = res_pjsip_endpoint_identifier_user.so -load = res_pjsip_endpoint_identifier_ip.so load = res_pjsip_endpoint_identifier_anonymous.so +load = res_pjsip_endpoint_identifier_ip.so +load = res_pjsip_endpoint_identifier_user.so load = res_pjsip_exten_state.so load = res_pjsip_header_funcs.so load = res_pjsip_history.so load = res_pjsip_logger.so load = res_pjsip_messaging.so -load = res_pjsip_mwi_body_generator.so load = res_pjsip_mwi.so +load = res_pjsip_mwi_body_generator.so load = res_pjsip_nat.so load = res_pjsip_notify.so load = res_pjsip_one_touch_record_info.so @@ -120,16 +123,14 @@ load = res_pjsip_pubsub.so load = res_pjsip_refer.so load = res_pjsip_registrar.so load = res_pjsip_rfc3326.so +;load = res_pjsip_rfc3329.so load = res_pjsip_sdp_rtp.so load = res_pjsip_send_to_voicemail.so load = res_pjsip_session.so load = res_pjsip_sips_contact.so -load = res_pjsip.so load = res_pjsip_t38.so load = res_pjsip_transport_websocket.so load = res_pjsip_xpidf_body_generator.so -load = res_hep_pjsip.so -load = res_pjsip_phoneprov_provider.so load = res_rtp_asterisk.so load = res_rtp_multicast.so load = res_sorcery_astdb.so @@ -139,9 +140,13 @@ load = res_sorcery_realtime.so load = res_timing_timerfd.so load = res_timing_pthread.so load = res_http_media_cache.so +load = res_http_post.so load = res_http_websocket.so load = res_crypto.so load = res_srtp.so +load = res_timing_pthread.so +load = res_timing_timerfd.so +load = res_websocket_client.so ; Stasis (ARI) diff --git a/examples/vagrant/asterisk/musiconhold.conf b/examples/vagrant/asterisk/musiconhold.conf new file mode 100644 index 00000000..bc3ba212 --- /dev/null +++ b/examples/vagrant/asterisk/musiconhold.conf @@ -0,0 +1,5 @@ +[general] + +[default] +mode = files +directory = moh diff --git a/examples/vagrant/asterisk/pjsip.conf b/examples/vagrant/asterisk/pjsip.conf index 6ffee21f..e610ad06 100644 --- a/examples/vagrant/asterisk/pjsip.conf +++ b/examples/vagrant/asterisk/pjsip.conf @@ -5,19 +5,19 @@ type = transport protocol = udp bind = 0.0.0.0 -domain = ari4java.local +domain = ari4java.localhost [transport-wss] type=transport protocol=wss bind=0.0.0.0 -domain = ari4java.local +domain = ari4java.localhost websocket_write_timeout = 5000 [192.168.44.56] type = domain-alias -domain = ari4java.local +domain = ari4java.localhost [localhost] type = domain-alias -domain = ari4java.local +domain = ari4java.localhost diff --git a/examples/vagrant/asterisk/pjsip_notify.conf b/examples/vagrant/asterisk/pjsip_notify.conf new file mode 100644 index 00000000..8224ee1f --- /dev/null +++ b/examples/vagrant/asterisk/pjsip_notify.conf @@ -0,0 +1,57 @@ +; rfc3842 +; put empty "Content=>" at the end to have CRLF after last body line + +[clear-mwi] +Event=>message-summary +Content-type=>application/simple-message-summary +Content=>Messages-Waiting: no +Content=>Message-Account: sip:asterisk@127.0.0.1 +Content=>Voice-Message: 0/0 (0/0) +Content=> + +; Aastra + +[aastra-check-cfg] +Event=>check-sync + +[aastra-xml] +Event=>aastra-xml + +; Digium + +[digium-check-cfg] +Event=>check-sync + +; Linksys + +[linksys-cold-restart] +Event=>reboot_now + +[linksys-warm-restart] +Event=>restart_now + +; Polycom + +[polycom-check-cfg] +Event=>check-sync + +; Sipura + +[sipura-check-cfg] +Event=>resync + +[sipura-get-report] +Event=>report + +; snom + +[snom-check-cfg] +Event=>check-sync\;reboot=false + +[snom-reboot] +Event=>check-sync\;reboot=true + +; Cisco + +[cisco-check-cfg] +Event=>check-sync diff --git a/examples/vagrant/asterisk/pjsip_wizard.conf b/examples/vagrant/asterisk/pjsip_wizard.conf index fcdc248c..7cbbb7ac 100644 --- a/examples/vagrant/asterisk/pjsip_wizard.conf +++ b/examples/vagrant/asterisk/pjsip_wizard.conf @@ -13,12 +13,14 @@ endpoint/direct_media = no endpoint/force_rport = yes endpoint/disable_direct_media_on_nat = yes endpoint/direct_media_method = invite +endpoint/rtp_symmetric = yes endpoint/moh_suggest = default endpoint/send_rpid = yes endpoint/rewrite_contact = yes endpoint/send_pai = yes endpoint/allow_transfer = yes endpoint/device_state_busy_at = 1 +endpoint/from_domain = ari4java.localhost aor/qualify_frequency = 30 aor/authenticate_qualify = no aor/max_contacts = 1 @@ -32,11 +34,16 @@ transport = transport-wss endpoint/disallow=all endpoint/allow = opus,ulaw endpoint/webrtc = yes -endpoint/rtp_symmetric = yes -;endpoint/dtls_auto_generate_cert = yes +endpoint/media_encryption = dtls +endpoint/use_avpf = yes +endpoint/force_avp = yes endpoint/dtls_ca_file = /etc/asterisk/keys/ca.crt endpoint/dtls_cert_file = /etc/asterisk/keys/asterisk.crt endpoint/dtls_private_key = /etc/asterisk/keys/asterisk.key +endpoint/dtls_verify = fingerprint +endpoint/dtls_setup = actpass +endpoint/media_use_received_transport = yes +endpoint/rtcp_mux = yes ; User Extensions using the templates defined above [100](web-phone-defaults) @@ -51,7 +58,7 @@ inbound_auth/password = abc123 endpoint/context = from-internal endpoint/callerid = Extn 200 <200> -[300](web-phone-defaults) +[300](phone-defaults) inbound_auth/username = 300 inbound_auth/password = abc123 endpoint/context = from-internal diff --git a/examples/vagrant/asterisk/websocket_client.conf b/examples/vagrant/asterisk/websocket_client.conf new file mode 100644 index 00000000..ccc8a102 --- /dev/null +++ b/examples/vagrant/asterisk/websocket_client.conf @@ -0,0 +1,2 @@ +; Empty WebSocket Client Configuration +[general] diff --git a/examples/vagrant/scripts/provision.sh b/examples/vagrant/scripts/provision.sh index f04741cd..7f59296f 100755 --- a/examples/vagrant/scripts/provision.sh +++ b/examples/vagrant/scripts/provision.sh @@ -12,6 +12,8 @@ if [ "$DOCKER" == "false" ]; then sed -i 's/ubuntu-focal$/localpbx/g' /etc/hosts systemctl restart systemd-logind.service hostnamectl set-hostname localpbx +else + sed -i 's/localhost$/localhost ari4java.localhost/g' /etc/hosts fi # get the latest packages and upgrade them @@ -23,13 +25,15 @@ apt -y upgrade # install some pre-requisites echo "Installing some pre-requisites ..." apt -y install \ - curl \ - wget \ sox \ lame \ mpg123 \ libopusfile-dev \ - autoconf + autoconf \ + ca-certificates + +# update CAs +update-ca-certificates # set the timezone ln -snf /usr/share/zoneinfo/$(curl https://ipapi.co/timezone) /etc/localtime @@ -40,7 +44,11 @@ adduser --system --group --no-create-home asterisk mkdir -p /var/{lib,log,spool}/asterisk # goto home folder, download and build Asterisk using the version specified in AST_VER -AST_VER=16.27.0 +AST_VER=16.27.0 # works but old Jun-2022 +#AST_VER=18.26.4 # Aug-2025 +#AST_VER=20.0.3 # what different use... May-2023 +AST_VER=20.18.0 # LTS Jan-2026 +#AST_VER=22.8.0 # latest LTS Jan-2026, but JsSIP doesn't work on this version echo "Download, compile & setup Asterisk $AST_VER ..." cd ~ wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-$AST_VER.tar.gz @@ -67,20 +75,16 @@ fi make menuselect.makeopts if [ "$DOCKER" == "true" ]; then menuselect/menuselect \ - --enable CORE-SOUNDS-EN-SLN16 \ - --enable EXTRA-SOUNDS-EN-G722 \ + --enable CORE-SOUNDS-EN-WAV \ --enable EXTRA-SOUNDS-EN-WAV \ - --enable EXTRA-SOUNDS-EN-SLN16 \ --enable format_mp3 \ --disable chan_sip \ --disable BUILD_NATIVE \ menuselect.makeopts else menuselect/menuselect \ - --enable CORE-SOUNDS-EN-SLN16 \ - --enable EXTRA-SOUNDS-EN-G722 \ + --enable CORE-SOUNDS-EN-WAV \ --enable EXTRA-SOUNDS-EN-WAV \ - --enable EXTRA-SOUNDS-EN-SLN16 \ --enable codec_opus \ --enable format_mp3 \ --disable chan_sip \ @@ -99,18 +103,20 @@ if [ "$DOCKER" == "true" ]; then sed -i 's/format_ogg_opus/format_ogg_opus_open_source/g' /etc/asterisk/modules.conf fi # create keys for TLS -echo "Creating TLS keys ..." -mkdir -p /etc/asterisk/keys -openssl genrsa -des3 -out /etc/asterisk/keys/ca.key -passout pass:asterisk 4096 > /dev/null -openssl req -batch -new -x509 -days 3650 -subj "/O=ARI4Java/CN=ARI4Java CA" -key /etc/asterisk/keys/ca.key -passin pass:asterisk -out /etc/asterisk/keys/ca.crt > /dev/null -openssl genrsa -out /etc/asterisk/keys/asterisk.key 2048 > /dev/null -SUBJECT="/O=ARI4Java/CN=192.168.56.44" -if [ "$DOCKER" == "true" ]; then - SUBJECT="/O=ARI4Java/CN=localhost" +echo "TLS keys ..." +if [ ! -f /vagrant/asterisk/keys/asterisk.crt ]; then + openssl genrsa -des3 -out /vagrant/asterisk/keys/ca.key -passout pass:asterisk 4096 > /dev/null + openssl req -batch -new -x509 -days 3650 -config /vagrant/scripts/ca-req.cnf extensions v3_ca -key /vagrant/asterisk/keys/ca.key -passin pass:asterisk -out /vagrant/asterisk/keys/ca.crt > /dev/null + openssl genrsa -noenc -out /vagrant/asterisk/keys/asterisk.key 2048 > /dev/null + openssl req -batch -new -config /vagrant/scripts/cert-req.cnf -key /vagrant/asterisk/keys/asterisk.key -out /vagrant/asterisk/keys/asterisk.csr > /dev/null + openssl x509 -req -days 3650 -in /vagrant/asterisk/keys/asterisk.csr -CA /vagrant/asterisk/keys/ca.crt -CAkey /vagrant/asterisk/keys/ca.key -passin pass:asterisk -set_serial 01 -out /vagrant/asterisk/keys/asterisk.crt -extensions v3_req -extfile /vagrant/scripts/cert-req.cnf > /dev/null fi -openssl req -batch -new -subj "$SUBJECT" -key /etc/asterisk/keys/asterisk.key -out /etc/asterisk/keys/asterisk.csr > /dev/null -openssl x509 -req -days 3650 -in /etc/asterisk/keys/asterisk.csr -CA /etc/asterisk/keys/ca.crt -CAkey /etc/asterisk/keys/ca.key -passin pass:asterisk -set_serial 01 -out /etc/asterisk/keys/asterisk.crt > /dev/null +mkdir -p /etc/asterisk/keys +cp /vagrant/asterisk/keys/ca.crt /etc/asterisk/keys/ +cp /vagrant/asterisk/keys/asterisk.{key,crt} /etc/asterisk/keys/ chown -R asterisk:asterisk /etc/asterisk/keys +chmod 400 /etc/asterisk/keys/*.key +chmod 444 /etc/asterisk/keys/*.crt # add to systemd & start echo "Setup & Start Asterisk Service" diff --git a/examples/vagrant/static-http/ari4java-phone.html b/examples/vagrant/static-http/ari4java-phone.html index ef5097d0..c5e0ed72 100644 --- a/examples/vagrant/static-http/ari4java-phone.html +++ b/examples/vagrant/static-http/ari4java-phone.html @@ -7,7 +7,7 @@ - +

+ - \ No newline at end of file diff --git a/examples/vagrant/static-http/jssip-3.10.1.min.js b/examples/vagrant/static-http/jssip-3.10.1.min.js new file mode 100644 index 00000000..9ccbe302 --- /dev/null +++ b/examples/vagrant/static-http/jssip-3.10.1.min.js @@ -0,0 +1,9 @@ +/* + * JsSIP v3.10.1 + * the Javascript SIP library + * Copyright: 2012-2023 + * Homepage: https://jssip.net + * License: MIT + */ + +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).JsSIP=e()}}(function(){return function(){return function e(t,n,r){function s(o,l){if(!n[o]){if(!t[o]){var u="function"==typeof require&&require;if(!l&&u)return u(o,!0);if(i)return i(o,!0);var a=new Error("Cannot find module '"+o+"'");throw a.code="MODULE_NOT_FOUND",a}var c=n[o]={exports:{}};t[o][0].call(c.exports,function(e){return s(t[o][1][e]||e)},c,c.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return l=e.done,e},e:function(e){u=!0,o=e},f:function(){try{l||null==n.return||n.return()}finally{if(u)throw o}}}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0)return t}},connection_recovery_min_interval:function(e){if(i.isDecimal(e)){var t=Number(e);if(t>0)return t}},contact_uri:function(e){if("string"==typeof e){var t=l.parse(e,"SIP_URI");if(-1!==t)return t}},display_name:function(e){return e},instance_id:function(e){return/^uuid:/i.test(e)&&(e=e.substr(5)),-1===l.parse(e,"uuid")?void 0:e},no_answer_timeout:function(e){if(i.isDecimal(e)){var t=Number(e);if(t>0)return t}},session_timers:function(e){if("boolean"==typeof e)return e},session_timers_refresh_method:function(e){if("string"==typeof e&&((e=e.toUpperCase())===o.INVITE||e===o.UPDATE))return e},session_timers_force_refresher:function(e){if("boolean"==typeof e)return e},password:function(e){return String(e)},realm:function(e){return String(e)},ha1:function(e){return String(e)},register:function(e){if("boolean"==typeof e)return e},register_expires:function(e){if(i.isDecimal(e)){var t=Number(e);if(t>0)return t}},registrar_server:function(e){/^sip:/i.test(e)||(e="".concat(o.SIP,":").concat(e));var t=u.parse(e);return t?t.user?void 0:t:void 0},use_preloaded_route:function(e){if("boolean"==typeof e)return e},extra_headers:function(e){var t=[];if(Array.isArray(e)&&e.length){var n,s=r(e);try{for(s.s();!(n=s.n()).done;){var i=n.value;"string"==typeof i&&t.push(i)}}catch(e){s.e(e)}finally{s.f()}return t}}}};n.load=function(e,t){for(var n in h.mandatory){if(!t.hasOwnProperty(n))throw new c.ConfigurationError(n);var r=t[n],s=h.mandatory[n](r);if(void 0===s)throw new c.ConfigurationError(n,r);e[n]=s}for(var o in h.optional)if(t.hasOwnProperty(o)){var l=t[o];if(i.isEmpty(l))continue;var u=h.optional[o](l);if(void 0===u)throw new c.ConfigurationError(o,l);e[o]=u}}},{"./Constants":2,"./Exceptions":6,"./Grammar":7,"./Socket":22,"./URI":27,"./Utils":28}],2:[function(e,t,n){"use strict";var r=e("../package.json");t.exports={USER_AGENT:"".concat(r.title," ").concat(r.version),SIP:"sip",SIPS:"sips",causes:{CONNECTION_ERROR:"Connection Error",REQUEST_TIMEOUT:"Request Timeout",SIP_FAILURE_CODE:"SIP Failure Code",INTERNAL_ERROR:"Internal Error",BUSY:"Busy",REJECTED:"Rejected",REDIRECTED:"Redirected",UNAVAILABLE:"Unavailable",NOT_FOUND:"Not Found",ADDRESS_INCOMPLETE:"Address Incomplete",INCOMPATIBLE_SDP:"Incompatible SDP",MISSING_SDP:"Missing SDP",AUTHENTICATION_ERROR:"Authentication Error",BYE:"Terminated",WEBRTC_ERROR:"WebRTC Error",CANCELED:"Canceled",NO_ANSWER:"No Answer",EXPIRES:"Expires",NO_ACK:"No ACK",DIALOG_ERROR:"Dialog Error",USER_DENIED_MEDIA_ACCESS:"User Denied Media Access",BAD_MEDIA_DESCRIPTION:"Bad Media Description",RTP_TIMEOUT:"RTP Timeout"},SIP_ERROR_CAUSES:{REDIRECTED:[300,301,302,305,380],BUSY:[486,600],REJECTED:[403,603],NOT_FOUND:[404,604],UNAVAILABLE:[480,410,408,430],ADDRESS_INCOMPLETE:[484,424],INCOMPATIBLE_SDP:[488,606],AUTHENTICATION_ERROR:[401,407]},ACK:"ACK",BYE:"BYE",CANCEL:"CANCEL",INFO:"INFO",INVITE:"INVITE",MESSAGE:"MESSAGE",NOTIFY:"NOTIFY",OPTIONS:"OPTIONS",REGISTER:"REGISTER",REFER:"REFER",UPDATE:"UPDATE",SUBSCRIBE:"SUBSCRIBE",DTMF_TRANSPORT:{INFO:"INFO",RFC2833:"RFC2833"},REASON_PHRASE:{100:"Trying",180:"Ringing",181:"Call Is Being Forwarded",182:"Queued",183:"Session Progress",199:"Early Dialog Terminated",200:"OK",202:"Accepted",204:"No Notification",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",305:"Use Proxy",380:"Alternative Service",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",410:"Gone",412:"Conditional Request Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Unsupported URI Scheme",417:"Unknown Resource-Priority",420:"Bad Extension",421:"Extension Required",422:"Session Interval Too Small",423:"Interval Too Brief",424:"Bad Location Information",428:"Use Identity Header",429:"Provide Referrer Identity",430:"Flow Failed",433:"Anonymity Disallowed",436:"Bad Identity-Info",437:"Unsupported Certificate",438:"Invalid Identity Header",439:"First Hop Lacks Outbound Support",440:"Max-Breadth Exceeded",469:"Bad Info Package",470:"Consent Needed",478:"Unresolvable Destination",480:"Temporarily Unavailable",481:"Call/Transaction Does Not Exist",482:"Loop Detected",483:"Too Many Hops",484:"Address Incomplete",485:"Ambiguous",486:"Busy Here",487:"Request Terminated",488:"Not Acceptable Here",489:"Bad Event",491:"Request Pending",493:"Undecipherable",494:"Security Agreement Required",500:"JsSIP Internal Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Server Time-out",505:"Version Not Supported",513:"Message Too Large",580:"Precondition Failure",600:"Busy Everywhere",603:"Decline",604:"Does Not Exist Anywhere",606:"Not Acceptable"},ALLOWED_METHODS:"INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY",ACCEPTED_BODY_TYPES:"application/sdp, application/dtmf-relay",MAX_FORWARDS:69,SESSION_EXPIRES:90,MIN_SESSION_EXPIRES:60,CONNECTION_RECOVERY_MAX_INTERVAL:30,CONNECTION_RECOVERY_MIN_INTERVAL:2}},{"../package.json":40}],3:[function(e,t,n){"use strict";function r(e,t){for(var n=0;n3&&void 0!==arguments[3]?arguments[3]:d.STATUS_CONFIRMED;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._owner=t,this._ua=t._ua,this._uac_pending_reply=!1,this._uas_pending_reply=!1,!n.hasHeader("contact"))return{error:"unable to create a Dialog without Contact header field"};n instanceof o.IncomingResponse&&(s=n.status_code<200?d.STATUS_EARLY:d.STATUS_CONFIRMED);var i=n.parseHeader("contact");"UAS"===r?(this._id={call_id:n.call_id,local_tag:n.to_tag,remote_tag:n.from_tag,toString:function(){return this.call_id+this.local_tag+this.remote_tag}},this._state=s,this._remote_seqnum=n.cseq,this._local_uri=n.parseHeader("to").uri,this._remote_uri=n.parseHeader("from").uri,this._remote_target=i.uri,this._route_set=n.getHeaders("record-route"),this._ack_seqnum=this._remote_seqnum):"UAC"===r&&(this._id={call_id:n.call_id,local_tag:n.from_tag,remote_tag:n.to_tag,toString:function(){return this.call_id+this.local_tag+this.remote_tag}},this._state=s,this._local_seqnum=n.cseq,this._local_uri=n.parseHeader("from").uri,this._remote_uri=n.parseHeader("to").uri,this._remote_target=i.uri,this._route_set=n.getHeaders("record-route").reverse(),this._ack_seqnum=null),this._ua.newDialog(this),h.debug("new ".concat(r," dialog created with status ").concat(this._state===d.STATUS_EARLY?"EARLY":"CONFIRMED"))}return s(e,null,[{key:"C",get:function(){return d}}]),s(e,[{key:"isTerminated",value:function(){return this._status===d.STATUS_TERMINATED}},{key:"update",value:function(e,t){this._state=d.STATUS_CONFIRMED,h.debug("dialog ".concat(this._id.toString()," changed to CONFIRMED state")),"UAC"===t&&(this._route_set=e.getHeaders("record-route").reverse())}},{key:"terminate",value:function(){h.debug("dialog ".concat(this._id.toString()," deleted")),this._ua.destroyDialog(this),this._state=d.STATUS_TERMINATED}},{key:"sendRequest",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=c.cloneArray(n.extraHeaders),s=c.cloneObject(n.eventHandlers),i=n.body||null,o=this._createRequest(e,r,i);return s.onAuthenticated=function(){t._local_seqnum+=1},new a(this,o,s).send(),o}},{key:"receiveRequest",value:function(e){this._checkInDialogRequest(e)&&(e.method===l.ACK&&null!==this._ack_seqnum?this._ack_seqnum=null:e.method===l.INVITE&&(this._ack_seqnum=e.cseq),this._owner.receiveRequest(e))}},{key:"_createRequest",value:function(e,t,n){t=c.cloneArray(t),this._local_seqnum||(this._local_seqnum=Math.floor(1e4*Math.random()));var r=e===l.CANCEL||e===l.ACK?this._local_seqnum:this._local_seqnum+=1;return new o.OutgoingRequest(e,this._remote_target,this._ua,{cseq:r,call_id:this._id.call_id,from_uri:this._local_uri,from_tag:this._id.local_tag,to_uri:this._remote_uri,to_tag:this._id.remote_tag,route_set:this._route_set},t,n)}},{key:"_checkInDialogRequest",value:function(e){var t=this;if(this._remote_seqnum)if(e.cseqthis._remote_seqnum&&(this._remote_seqnum=e.cseq);else this._remote_seqnum=e.cseq;if(e.method===l.INVITE||e.method===l.UPDATE&&e.body){if(!0===this._uac_pending_reply)e.reply(491);else{if(!0===this._uas_pending_reply){var n=1+(10*Math.random()|0);return e.reply(500,null,["Retry-After:".concat(n)]),!1}this._uas_pending_reply=!0;e.server_transaction.on("stateChanged",function n(){e.server_transaction.state!==u.C.STATUS_ACCEPTED&&e.server_transaction.state!==u.C.STATUS_COMPLETED&&e.server_transaction.state!==u.C.STATUS_TERMINATED||(e.server_transaction.removeListener("stateChanged",n),t._uas_pending_reply=!1)})}e.hasHeader("contact")&&e.server_transaction.on("stateChanged",function(){e.server_transaction.state===u.C.STATUS_ACCEPTED&&(t._remote_target=e.parseHeader("contact").uri)})}else e.method===l.NOTIFY&&e.hasHeader("contact")&&e.server_transaction.on("stateChanged",function(){e.server_transaction.state===u.C.STATUS_COMPLETED&&(t._remote_target=e.parseHeader("contact").uri)});return!0}},{key:"id",get:function(){return this._id}},{key:"local_seqnum",get:function(){return this._local_seqnum},set:function(e){this._local_seqnum=e}},{key:"owner",get:function(){return this._owner}},{key:"uac_pending_reply",get:function(){return this._uac_pending_reply},set:function(e){this._uac_pending_reply=e}},{key:"uas_pending_reply",get:function(){return this._uas_pending_reply}}]),e}()},{"./Constants":2,"./Dialog/RequestSender":4,"./Logger":9,"./SIPMessage":21,"./Transactions":24,"./Utils":28}],4:[function(e,t,n){"use strict";function r(e,t){for(var n=0;n=200&&e.status_code<300?this._eventHandlers.onSuccessResponse(e):e.status_code>=300&&this._eventHandlers.onErrorResponse(e):(this._request.cseq=this._dialog.local_seqnum+=1,this._reattemptTimer=setTimeout(function(){t._dialog.isTerminated()||(t._reattempt=!0,t.send())},1e3)):e.status_code>=200&&e.status_code<300?this._eventHandlers.onSuccessResponse(e):e.status_code>=300&&this._eventHandlers.onErrorResponse(e)}},{key:"request",get:function(){return this._request}}])&&r(t.prototype,n),u&&r(t,u),e}()},{"../Constants":2,"../RequestSender":20,"../Transactions":24}],5:[function(e,t,n){"use strict";function r(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:null;if(this._algorithm=t.algorithm,this._realm=t.realm,this._nonce=t.nonce,this._opaque=t.opaque,this._stale=t.stale,this._algorithm){if("MD5"!==this._algorithm)return o.warn('authenticate() | challenge with Digest algorithm different than "MD5", authentication aborted'),!1}else this._algorithm="MD5";if(!this._nonce)return o.warn("authenticate() | challenge without Digest nonce, authentication aborted"),!1;if(!this._realm)return o.warn("authenticate() | challenge without Digest realm, authentication aborted"),!1;if(!this._credentials.password){if(!this._credentials.ha1)return o.warn("authenticate() | no plain SIP password nor ha1 provided, authentication aborted"),!1;if(this._credentials.realm!==this._realm)return o.warn('authenticate() | no plain SIP password, and stored `realm` does not match the given `realm`, cannot authenticate [stored:"%s", given:"%s"]',this._credentials.realm,this._realm),!1}if(t.qop)if(t.qop.indexOf("auth-int")>-1)this._qop="auth-int";else{if(!(t.qop.indexOf("auth")>-1))return o.warn('authenticate() | challenge without Digest qop different than "auth" or "auth-int", authentication aborted'),!1;this._qop="auth"}else this._qop=null;this._method=n,this._uri=r,this._cnonce=l||i.createRandomToken(12),this._nc+=1;var u,a,c=Number(this._nc).toString(16);return this._ncHex="00000000".substr(0,8-c.length)+c,4294967296===this._nc&&(this._nc=1,this._ncHex="00000001"),this._credentials.password?this._ha1=i.calculateMD5("".concat(this._credentials.username,":").concat(this._realm,":").concat(this._credentials.password)):this._ha1=this._credentials.ha1,"auth"===this._qop?(u="".concat(this._method,":").concat(this._uri),a=i.calculateMD5(u),o.debug('authenticate() | using qop=auth [a2:"%s"]',u),this._response=i.calculateMD5("".concat(this._ha1,":").concat(this._nonce,":").concat(this._ncHex,":").concat(this._cnonce,":auth:").concat(a))):"auth-int"===this._qop?(u="".concat(this._method,":").concat(this._uri,":").concat(i.calculateMD5(s||"")),a=i.calculateMD5(u),o.debug('authenticate() | using qop=auth-int [a2:"%s"]',u),this._response=i.calculateMD5("".concat(this._ha1,":").concat(this._nonce,":").concat(this._ncHex,":").concat(this._cnonce,":auth-int:").concat(a))):null===this._qop&&(u="".concat(this._method,":").concat(this._uri),a=i.calculateMD5(u),o.debug('authenticate() | using qop=null [a2:"%s"]',u),this._response=i.calculateMD5("".concat(this._ha1,":").concat(this._nonce,":").concat(a))),o.debug("authenticate() | response generated"),!0}},{key:"toString",value:function(){var e=[];if(!this._response)throw new Error("response field does not exist, cannot generate Authorization header");return e.push("algorithm=".concat(this._algorithm)),e.push('username="'.concat(this._credentials.username,'"')),e.push('realm="'.concat(this._realm,'"')),e.push('nonce="'.concat(this._nonce,'"')),e.push('uri="'.concat(this._uri,'"')),e.push('response="'.concat(this._response,'"')),this._opaque&&e.push('opaque="'.concat(this._opaque,'"')),this._qop&&(e.push("qop=".concat(this._qop)),e.push('cnonce="'.concat(this._cnonce,'"')),e.push("nc=".concat(this._ncHex))),"Digest ".concat(e.join(", "))}}])&&r(t.prototype,n),s&&r(t,s),e}()},{"./Logger":9,"./Utils":28}],6:[function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}function o(e){var t=a();return function(){var n,s=h(e);if(t){var i=h(this).constructor;n=Reflect.construct(s,arguments,i)}else n=s.apply(this,arguments);return function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function l(e){var t="function"==typeof Map?new Map:void 0;return(l=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return u(e,arguments,h(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),c(r,e)})(e)}function u(e,t,n){return(u=a()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var s=new(Function.bind.apply(e,r));return n&&c(s,n.prototype),s}).apply(null,arguments)}function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var d=function(e){i(n,l(Error));var t=o(n);function n(e,r){var i;return s(this,n),(i=t.call(this)).code=1,i.name="CONFIGURATION_ERROR",i.parameter=e,i.value=r,i.message=i.value?"Invalid value ".concat(JSON.stringify(i.value),' for parameter "').concat(i.parameter,'"'):"Missing parameter: ".concat(i.parameter),i}return n}(),f=function(e){i(n,l(Error));var t=o(n);function n(e){var r;return s(this,n),(r=t.call(this)).code=2,r.name="INVALID_STATE_ERROR",r.status=e,r.message="Invalid status: ".concat(e),r}return n}(),_=function(e){i(n,l(Error));var t=o(n);function n(e){var r;return s(this,n),(r=t.call(this)).code=3,r.name="NOT_SUPPORTED_ERROR",r.message=e,r}return n}(),p=function(e){i(n,l(Error));var t=o(n);function n(e){var r;return s(this,n),(r=t.call(this)).code=4,r.name="NOT_READY_ERROR",r.message=e,r}return n}();t.exports={ConfigurationError:d,InvalidStateError:f,NotSupportedError:_,NotReadyError:p}},{}],7:[function(e,t,n){"use strict";t.exports=function(){function t(e){return'"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E-\x1F\x80-\uFFFF]/g,escape)+'"'}var n={parse:function(n,r){var s={CRLF:c,DIGIT:h,ALPHA:d,HEXDIG:f,WSP:_,OCTET:p,DQUOTE:m,SP:v,HTAB:g,alphanum:y,reserved:T,unreserved:C,mark:b,escaped:S,LWS:E,SWS:A,HCOLON:R,TEXT_UTF8_TRIM:w,TEXT_UTF8char:I,UTF8_NONASCII:O,UTF8_CONT:k,LHEX:function(){var e;null===(e=h())&&(/^[a-f]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[a-f]")));return e},token:N,token_nodot:U,separators:function(){var e;40===n.charCodeAt(i)?(e="(",i++):(e=null,0===o&&a('"("'));null===e&&(41===n.charCodeAt(i)?(e=")",i++):(e=null,0===o&&a('")"')),null===e&&(60===n.charCodeAt(i)?(e="<",i++):(e=null,0===o&&a('"<"')),null===e&&(62===n.charCodeAt(i)?(e=">",i++):(e=null,0===o&&a('">"')),null===e&&(64===n.charCodeAt(i)?(e="@",i++):(e=null,0===o&&a('"@"')),null===e&&(44===n.charCodeAt(i)?(e=",",i++):(e=null,0===o&&a('","')),null===e&&(59===n.charCodeAt(i)?(e=";",i++):(e=null,0===o&&a('";"')),null===e&&(58===n.charCodeAt(i)?(e=":",i++):(e=null,0===o&&a('":"')),null===e&&(92===n.charCodeAt(i)?(e="\\",i++):(e=null,0===o&&a('"\\\\"')),null===e&&null===(e=m())&&(47===n.charCodeAt(i)?(e="/",i++):(e=null,0===o&&a('"/"')),null===e&&(91===n.charCodeAt(i)?(e="[",i++):(e=null,0===o&&a('"["')),null===e&&(93===n.charCodeAt(i)?(e="]",i++):(e=null,0===o&&a('"]"')),null===e&&(63===n.charCodeAt(i)?(e="?",i++):(e=null,0===o&&a('"?"')),null===e&&(61===n.charCodeAt(i)?(e="=",i++):(e=null,0===o&&a('"="')),null===e&&(123===n.charCodeAt(i)?(e="{",i++):(e=null,0===o&&a('"{"')),null===e&&(125===n.charCodeAt(i)?(e="}",i++):(e=null,0===o&&a('"}"')),null===e&&null===(e=v())&&(e=g()))))))))))))))));return e},word:x,STAR:D,SLASH:P,EQUAL:M,LPAREN:q,RPAREN:L,RAQUOT:H,LAQUOT:F,COMMA:j,SEMI:G,COLON:W,LDQUOT:V,RDQUOT:B,comment:function e(){var t,n,r;var s;s=i;t=q();if(null!==t){for(n=[],null===(r=K())&&null===(r=X())&&(r=e());null!==r;)n.push(r),null===(r=K())&&null===(r=X())&&(r=e());null!==n&&null!==(r=L())?t=[t,n,r]:(t=null,i=s)}else t=null,i=s;return t},ctext:K,quoted_string:z,quoted_string_clean:Y,qdtext:$,quoted_pair:X,SIP_URI_noparams:J,SIP_URI:Q,uri_scheme:Z,uri_scheme_sips:ee,uri_scheme_sip:te,userinfo:ne,user:re,user_unreserved:se,password:ie,hostport:oe,host:le,hostname:ue,domainlabel:ae,toplabel:ce,IPv6reference:he,IPv6address:de,h16:fe,ls32:_e,IPv4address:pe,dec_octet:me,port:ve,uri_parameters:ge,uri_parameter:ye,transport_param:Te,user_param:Ce,method_param:be,ttl_param:Se,maddr_param:Ee,lr_param:Ae,other_param:Re,pname:we,pvalue:Ie,paramchar:Oe,param_unreserved:ke,headers:Ne,header:Ue,hname:xe,hvalue:De,hnv_unreserved:Pe,Request_Response:function(){var e;null===(e=ht())&&(e=Me());return e},Request_Line:Me,Request_URI:qe,absoluteURI:Le,hier_part:He,net_path:Fe,abs_path:je,opaque_part:Ge,uric:We,uric_no_slash:Ve,path_segments:Be,segment:Ke,param:ze,pchar:Ye,scheme:$e,authority:Xe,srvr:Je,reg_name:Qe,query:Ze,SIP_Version:et,INVITEm:tt,ACKm:nt,OPTIONSm:rt,BYEm:st,CANCELm:it,REGISTERm:ot,SUBSCRIBEm:lt,NOTIFYm:ut,REFERm:at,Method:ct,Status_Line:ht,Status_Code:dt,extension_code:ft,Reason_Phrase:_t,Allow_Events:function(){var e,t,n,r,s,o;if(s=i,null!==(e=Lt())){for(t=[],o=i,null!==(n=j())&&null!==(r=Lt())?n=[n,r]:(n=null,i=o);null!==n;)t.push(n),o=i,null!==(n=j())&&null!==(r=Lt())?n=[n,r]:(n=null,i=o);null!==t?e=[e,t]:(e=null,i=s)}else e=null,i=s;return e},Call_ID:function(){var e,t,r,s,l,u;s=i,l=i,null!==(e=x())?(u=i,64===n.charCodeAt(i)?(t="@",i++):(t=null,0===o&&a('"@"')),null!==t&&null!==(r=x())?t=[t,r]:(t=null,i=u),null!==(t=null!==t?t:"")?e=[e,t]:(e=null,i=l)):(e=null,i=l);null!==e&&(c=s,e=void(jn=n.substring(i,c)));var c;null===e&&(i=s);return e},Contact:function(){var e,t,n,r,s,o,l;if(s=i,null===(e=D()))if(o=i,null!==(e=pt())){for(t=[],l=i,null!==(n=j())&&null!==(r=pt())?n=[n,r]:(n=null,i=l);null!==n;)t.push(n),l=i,null!==(n=j())&&null!==(r=pt())?n=[n,r]:(n=null,i=l);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;null!==e&&(e=function(e){var t,n;for(n=jn.multi_header.length,t=0;tl&&(l=i,u=[]),u.push(e))}function c(){var e;return"\r\n"===n.substr(i,2)?(e="\r\n",i+=2):(e=null,0===o&&a('"\\r\\n"')),e}function h(){var e;return/^[0-9]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[0-9]")),e}function d(){var e;return/^[a-zA-Z]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[a-zA-Z]")),e}function f(){var e;return/^[0-9a-fA-F]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[0-9a-fA-F]")),e}function _(){var e;return null===(e=v())&&(e=g()),e}function p(){var e;return/^[\0-\xFF]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[\\0-\\xFF]")),e}function m(){var e;return/^["]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a('["]')),e}function v(){var e;return 32===n.charCodeAt(i)?(e=" ",i++):(e=null,0===o&&a('" "')),e}function g(){var e;return 9===n.charCodeAt(i)?(e="\t",i++):(e=null,0===o&&a('"\\t"')),e}function y(){var e;return/^[a-zA-Z0-9]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[a-zA-Z0-9]")),e}function T(){var e;return 59===n.charCodeAt(i)?(e=";",i++):(e=null,0===o&&a('";"')),null===e&&(47===n.charCodeAt(i)?(e="/",i++):(e=null,0===o&&a('"/"')),null===e&&(63===n.charCodeAt(i)?(e="?",i++):(e=null,0===o&&a('"?"')),null===e&&(58===n.charCodeAt(i)?(e=":",i++):(e=null,0===o&&a('":"')),null===e&&(64===n.charCodeAt(i)?(e="@",i++):(e=null,0===o&&a('"@"')),null===e&&(38===n.charCodeAt(i)?(e="&",i++):(e=null,0===o&&a('"&"')),null===e&&(61===n.charCodeAt(i)?(e="=",i++):(e=null,0===o&&a('"="')),null===e&&(43===n.charCodeAt(i)?(e="+",i++):(e=null,0===o&&a('"+"')),null===e&&(36===n.charCodeAt(i)?(e="$",i++):(e=null,0===o&&a('"$"')),null===e&&(44===n.charCodeAt(i)?(e=",",i++):(e=null,0===o&&a('","'))))))))))),e}function C(){var e;return null===(e=y())&&(e=b()),e}function b(){var e;return 45===n.charCodeAt(i)?(e="-",i++):(e=null,0===o&&a('"-"')),null===e&&(95===n.charCodeAt(i)?(e="_",i++):(e=null,0===o&&a('"_"')),null===e&&(46===n.charCodeAt(i)?(e=".",i++):(e=null,0===o&&a('"."')),null===e&&(33===n.charCodeAt(i)?(e="!",i++):(e=null,0===o&&a('"!"')),null===e&&(126===n.charCodeAt(i)?(e="~",i++):(e=null,0===o&&a('"~"')),null===e&&(42===n.charCodeAt(i)?(e="*",i++):(e=null,0===o&&a('"*"')),null===e&&(39===n.charCodeAt(i)?(e="'",i++):(e=null,0===o&&a('"\'"')),null===e&&(40===n.charCodeAt(i)?(e="(",i++):(e=null,0===o&&a('"("')),null===e&&(41===n.charCodeAt(i)?(e=")",i++):(e=null,0===o&&a('")"')))))))))),e}function S(){var e,t,r,s,l;return s=i,l=i,37===n.charCodeAt(i)?(e="%",i++):(e=null,0===o&&a('"%"')),null!==e&&null!==(t=f())&&null!==(r=f())?e=[e,t,r]:(e=null,i=l),null!==e&&(e=e.join("")),null===e&&(i=s),e}function E(){var e,t,n,r,s,o;for(r=i,s=i,o=i,e=[],t=_();null!==t;)e.push(t),t=_();if(null!==e&&null!==(t=c())?e=[e,t]:(e=null,i=o),null!==(e=null!==e?e:"")){if(null!==(n=_()))for(t=[];null!==n;)t.push(n),n=_();else t=null;null!==t?e=[e,t]:(e=null,i=s)}else e=null,i=s;return null!==e&&(e=" "),null===e&&(i=r),e}function A(){var e;return e=null!==(e=E())?e:""}function R(){var e,t,r,s,l;for(s=i,l=i,e=[],null===(t=v())&&(t=g());null!==t;)e.push(t),null===(t=v())&&(t=g());return null!==e?(58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t&&null!==(r=A())?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(e=":"),null===e&&(i=s),e}function w(){var e,t,r,s,o,l,u,a;if(o=i,l=i,null!==(t=I()))for(e=[];null!==t;)e.push(t),t=I();else e=null;if(null!==e){for(t=[],u=i,r=[],s=E();null!==s;)r.push(s),s=E();for(null!==r&&null!==(s=I())?r=[r,s]:(r=null,i=u);null!==r;){for(t.push(r),u=i,r=[],s=E();null!==s;)r.push(s),s=E();null!==r&&null!==(s=I())?r=[r,s]:(r=null,i=u)}null!==t?e=[e,t]:(e=null,i=l)}else e=null,i=l;return null!==e&&(a=o,e=n.substring(i,a)),null===e&&(i=o),e}function I(){var e;return/^[!-~]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[!-~]")),null===e&&(e=O()),e}function O(){var e;return/^[\x80-\uFFFF]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[\\x80-\\uFFFF]")),e}function k(){var e;return/^[\x80-\xBF]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[\\x80-\\xBF]")),e}function N(){var e,t,r,s;if(r=i,null===(t=y())&&(45===n.charCodeAt(i)?(t="-",i++):(t=null,0===o&&a('"-"')),null===t&&(46===n.charCodeAt(i)?(t=".",i++):(t=null,0===o&&a('"."')),null===t&&(33===n.charCodeAt(i)?(t="!",i++):(t=null,0===o&&a('"!"')),null===t&&(37===n.charCodeAt(i)?(t="%",i++):(t=null,0===o&&a('"%"')),null===t&&(42===n.charCodeAt(i)?(t="*",i++):(t=null,0===o&&a('"*"')),null===t&&(95===n.charCodeAt(i)?(t="_",i++):(t=null,0===o&&a('"_"')),null===t&&(43===n.charCodeAt(i)?(t="+",i++):(t=null,0===o&&a('"+"')),null===t&&(96===n.charCodeAt(i)?(t="`",i++):(t=null,0===o&&a('"`"')),null===t&&(39===n.charCodeAt(i)?(t="'",i++):(t=null,0===o&&a('"\'"')),null===t&&(126===n.charCodeAt(i)?(t="~",i++):(t=null,0===o&&a('"~"')))))))))))),null!==t)for(e=[];null!==t;)e.push(t),null===(t=y())&&(45===n.charCodeAt(i)?(t="-",i++):(t=null,0===o&&a('"-"')),null===t&&(46===n.charCodeAt(i)?(t=".",i++):(t=null,0===o&&a('"."')),null===t&&(33===n.charCodeAt(i)?(t="!",i++):(t=null,0===o&&a('"!"')),null===t&&(37===n.charCodeAt(i)?(t="%",i++):(t=null,0===o&&a('"%"')),null===t&&(42===n.charCodeAt(i)?(t="*",i++):(t=null,0===o&&a('"*"')),null===t&&(95===n.charCodeAt(i)?(t="_",i++):(t=null,0===o&&a('"_"')),null===t&&(43===n.charCodeAt(i)?(t="+",i++):(t=null,0===o&&a('"+"')),null===t&&(96===n.charCodeAt(i)?(t="`",i++):(t=null,0===o&&a('"`"')),null===t&&(39===n.charCodeAt(i)?(t="'",i++):(t=null,0===o&&a('"\'"')),null===t&&(126===n.charCodeAt(i)?(t="~",i++):(t=null,0===o&&a('"~"'))))))))))));else e=null;return null!==e&&(s=r,e=n.substring(i,s)),null===e&&(i=r),e}function U(){var e,t,r,s;if(r=i,null===(t=y())&&(45===n.charCodeAt(i)?(t="-",i++):(t=null,0===o&&a('"-"')),null===t&&(33===n.charCodeAt(i)?(t="!",i++):(t=null,0===o&&a('"!"')),null===t&&(37===n.charCodeAt(i)?(t="%",i++):(t=null,0===o&&a('"%"')),null===t&&(42===n.charCodeAt(i)?(t="*",i++):(t=null,0===o&&a('"*"')),null===t&&(95===n.charCodeAt(i)?(t="_",i++):(t=null,0===o&&a('"_"')),null===t&&(43===n.charCodeAt(i)?(t="+",i++):(t=null,0===o&&a('"+"')),null===t&&(96===n.charCodeAt(i)?(t="`",i++):(t=null,0===o&&a('"`"')),null===t&&(39===n.charCodeAt(i)?(t="'",i++):(t=null,0===o&&a('"\'"')),null===t&&(126===n.charCodeAt(i)?(t="~",i++):(t=null,0===o&&a('"~"'))))))))))),null!==t)for(e=[];null!==t;)e.push(t),null===(t=y())&&(45===n.charCodeAt(i)?(t="-",i++):(t=null,0===o&&a('"-"')),null===t&&(33===n.charCodeAt(i)?(t="!",i++):(t=null,0===o&&a('"!"')),null===t&&(37===n.charCodeAt(i)?(t="%",i++):(t=null,0===o&&a('"%"')),null===t&&(42===n.charCodeAt(i)?(t="*",i++):(t=null,0===o&&a('"*"')),null===t&&(95===n.charCodeAt(i)?(t="_",i++):(t=null,0===o&&a('"_"')),null===t&&(43===n.charCodeAt(i)?(t="+",i++):(t=null,0===o&&a('"+"')),null===t&&(96===n.charCodeAt(i)?(t="`",i++):(t=null,0===o&&a('"`"')),null===t&&(39===n.charCodeAt(i)?(t="'",i++):(t=null,0===o&&a('"\'"')),null===t&&(126===n.charCodeAt(i)?(t="~",i++):(t=null,0===o&&a('"~"')))))))))));else e=null;return null!==e&&(s=r,e=n.substring(i,s)),null===e&&(i=r),e}function x(){var e,t,r,s;if(r=i,null===(t=y())&&(45===n.charCodeAt(i)?(t="-",i++):(t=null,0===o&&a('"-"')),null===t&&(46===n.charCodeAt(i)?(t=".",i++):(t=null,0===o&&a('"."')),null===t&&(33===n.charCodeAt(i)?(t="!",i++):(t=null,0===o&&a('"!"')),null===t&&(37===n.charCodeAt(i)?(t="%",i++):(t=null,0===o&&a('"%"')),null===t&&(42===n.charCodeAt(i)?(t="*",i++):(t=null,0===o&&a('"*"')),null===t&&(95===n.charCodeAt(i)?(t="_",i++):(t=null,0===o&&a('"_"')),null===t&&(43===n.charCodeAt(i)?(t="+",i++):(t=null,0===o&&a('"+"')),null===t&&(96===n.charCodeAt(i)?(t="`",i++):(t=null,0===o&&a('"`"')),null===t&&(39===n.charCodeAt(i)?(t="'",i++):(t=null,0===o&&a('"\'"')),null===t&&(126===n.charCodeAt(i)?(t="~",i++):(t=null,0===o&&a('"~"')),null===t&&(40===n.charCodeAt(i)?(t="(",i++):(t=null,0===o&&a('"("')),null===t&&(41===n.charCodeAt(i)?(t=")",i++):(t=null,0===o&&a('")"')),null===t&&(60===n.charCodeAt(i)?(t="<",i++):(t=null,0===o&&a('"<"')),null===t&&(62===n.charCodeAt(i)?(t=">",i++):(t=null,0===o&&a('">"')),null===t&&(58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null===t&&(92===n.charCodeAt(i)?(t="\\",i++):(t=null,0===o&&a('"\\\\"')),null===t&&null===(t=m())&&(47===n.charCodeAt(i)?(t="/",i++):(t=null,0===o&&a('"/"')),null===t&&(91===n.charCodeAt(i)?(t="[",i++):(t=null,0===o&&a('"["')),null===t&&(93===n.charCodeAt(i)?(t="]",i++):(t=null,0===o&&a('"]"')),null===t&&(63===n.charCodeAt(i)?(t="?",i++):(t=null,0===o&&a('"?"')),null===t&&(123===n.charCodeAt(i)?(t="{",i++):(t=null,0===o&&a('"{"')),null===t&&(125===n.charCodeAt(i)?(t="}",i++):(t=null,0===o&&a('"}"')))))))))))))))))))))))),null!==t)for(e=[];null!==t;)e.push(t),null===(t=y())&&(45===n.charCodeAt(i)?(t="-",i++):(t=null,0===o&&a('"-"')),null===t&&(46===n.charCodeAt(i)?(t=".",i++):(t=null,0===o&&a('"."')),null===t&&(33===n.charCodeAt(i)?(t="!",i++):(t=null,0===o&&a('"!"')),null===t&&(37===n.charCodeAt(i)?(t="%",i++):(t=null,0===o&&a('"%"')),null===t&&(42===n.charCodeAt(i)?(t="*",i++):(t=null,0===o&&a('"*"')),null===t&&(95===n.charCodeAt(i)?(t="_",i++):(t=null,0===o&&a('"_"')),null===t&&(43===n.charCodeAt(i)?(t="+",i++):(t=null,0===o&&a('"+"')),null===t&&(96===n.charCodeAt(i)?(t="`",i++):(t=null,0===o&&a('"`"')),null===t&&(39===n.charCodeAt(i)?(t="'",i++):(t=null,0===o&&a('"\'"')),null===t&&(126===n.charCodeAt(i)?(t="~",i++):(t=null,0===o&&a('"~"')),null===t&&(40===n.charCodeAt(i)?(t="(",i++):(t=null,0===o&&a('"("')),null===t&&(41===n.charCodeAt(i)?(t=")",i++):(t=null,0===o&&a('")"')),null===t&&(60===n.charCodeAt(i)?(t="<",i++):(t=null,0===o&&a('"<"')),null===t&&(62===n.charCodeAt(i)?(t=">",i++):(t=null,0===o&&a('">"')),null===t&&(58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null===t&&(92===n.charCodeAt(i)?(t="\\",i++):(t=null,0===o&&a('"\\\\"')),null===t&&null===(t=m())&&(47===n.charCodeAt(i)?(t="/",i++):(t=null,0===o&&a('"/"')),null===t&&(91===n.charCodeAt(i)?(t="[",i++):(t=null,0===o&&a('"["')),null===t&&(93===n.charCodeAt(i)?(t="]",i++):(t=null,0===o&&a('"]"')),null===t&&(63===n.charCodeAt(i)?(t="?",i++):(t=null,0===o&&a('"?"')),null===t&&(123===n.charCodeAt(i)?(t="{",i++):(t=null,0===o&&a('"{"')),null===t&&(125===n.charCodeAt(i)?(t="}",i++):(t=null,0===o&&a('"}"'))))))))))))))))))))))));else e=null;return null!==e&&(s=r,e=n.substring(i,s)),null===e&&(i=r),e}function D(){var e,t,r,s,l;return s=i,l=i,null!==(e=A())?(42===n.charCodeAt(i)?(t="*",i++):(t=null,0===o&&a('"*"')),null!==t&&null!==(r=A())?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(e="*"),null===e&&(i=s),e}function P(){var e,t,r,s,l;return s=i,l=i,null!==(e=A())?(47===n.charCodeAt(i)?(t="/",i++):(t=null,0===o&&a('"/"')),null!==t&&null!==(r=A())?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(e="/"),null===e&&(i=s),e}function M(){var e,t,r,s,l;return s=i,l=i,null!==(e=A())?(61===n.charCodeAt(i)?(t="=",i++):(t=null,0===o&&a('"="')),null!==t&&null!==(r=A())?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(e="="),null===e&&(i=s),e}function q(){var e,t,r,s,l;return s=i,l=i,null!==(e=A())?(40===n.charCodeAt(i)?(t="(",i++):(t=null,0===o&&a('"("')),null!==t&&null!==(r=A())?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(e="("),null===e&&(i=s),e}function L(){var e,t,r,s,l;return s=i,l=i,null!==(e=A())?(41===n.charCodeAt(i)?(t=")",i++):(t=null,0===o&&a('")"')),null!==t&&null!==(r=A())?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(e=")"),null===e&&(i=s),e}function H(){var e,t,r,s;return r=i,s=i,62===n.charCodeAt(i)?(e=">",i++):(e=null,0===o&&a('">"')),null!==e&&null!==(t=A())?e=[e,t]:(e=null,i=s),null!==e&&(e=">"),null===e&&(i=r),e}function F(){var e,t,r,s;return r=i,s=i,null!==(e=A())?(60===n.charCodeAt(i)?(t="<",i++):(t=null,0===o&&a('"<"')),null!==t?e=[e,t]:(e=null,i=s)):(e=null,i=s),null!==e&&(e="<"),null===e&&(i=r),e}function j(){var e,t,r,s,l;return s=i,l=i,null!==(e=A())?(44===n.charCodeAt(i)?(t=",",i++):(t=null,0===o&&a('","')),null!==t&&null!==(r=A())?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(e=","),null===e&&(i=s),e}function G(){var e,t,r,s,l;return s=i,l=i,null!==(e=A())?(59===n.charCodeAt(i)?(t=";",i++):(t=null,0===o&&a('";"')),null!==t&&null!==(r=A())?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(e=";"),null===e&&(i=s),e}function W(){var e,t,r,s,l;return s=i,l=i,null!==(e=A())?(58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t&&null!==(r=A())?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(e=":"),null===e&&(i=s),e}function V(){var e,t,n,r;return n=i,r=i,null!==(e=A())&&null!==(t=m())?e=[e,t]:(e=null,i=r),null!==e&&(e='"'),null===e&&(i=n),e}function B(){var e,t,n,r;return n=i,r=i,null!==(e=m())&&null!==(t=A())?e=[e,t]:(e=null,i=r),null!==e&&(e='"'),null===e&&(i=n),e}function K(){var e;return/^[!-']/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[!-']")),null===e&&(/^[*-[]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[*-[]")),null===e&&(/^[\]-~]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[\\]-~]")),null===e&&null===(e=O())&&(e=E()))),e}function z(){var e,t,r,s,o,l,u;if(o=i,l=i,null!==(e=A()))if(null!==(t=m())){for(r=[],null===(s=$())&&(s=X());null!==s;)r.push(s),null===(s=$())&&(s=X());null!==r&&null!==(s=m())?e=[e,t,r,s]:(e=null,i=l)}else e=null,i=l;else e=null,i=l;return null!==e&&(u=o,e=n.substring(i,u)),null===e&&(i=o),e}function Y(){var e,t,r,s,o,l,u,a;if(o=i,l=i,null!==(e=A()))if(null!==(t=m())){for(r=[],null===(s=$())&&(s=X());null!==s;)r.push(s),null===(s=$())&&(s=X());null!==r&&null!==(s=m())?e=[e,t,r,s]:(e=null,i=l)}else e=null,i=l;else e=null,i=l;return null!==e&&(u=o,e=(a=n.substring(i,u).trim()).substring(1,a.length-1).replace(/\\([\x00-\x09\x0b-\x0c\x0e-\x7f])/g,"$1")),null===e&&(i=o),e}function $(){var e;return null===(e=E())&&(33===n.charCodeAt(i)?(e="!",i++):(e=null,0===o&&a('"!"')),null===e&&(/^[#-[]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[#-[]")),null===e&&(/^[\]-~]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[\\]-~]")),null===e&&(e=O())))),e}function X(){var e,t,r;return r=i,92===n.charCodeAt(i)?(e="\\",i++):(e=null,0===o&&a('"\\\\"')),null!==e?(/^[\0-\t]/.test(n.charAt(i))?(t=n.charAt(i),i++):(t=null,0===o&&a("[\\0-\\t]")),null===t&&(/^[\x0B-\f]/.test(n.charAt(i))?(t=n.charAt(i),i++):(t=null,0===o&&a("[\\x0B-\\f]")),null===t&&(/^[\x0E-]/.test(n.charAt(i))?(t=n.charAt(i),i++):(t=null,0===o&&a("[\\x0E-]")))),null!==t?e=[e,t]:(e=null,i=r)):(e=null,i=r),e}function J(){var e,t,r,s,l,u;return l=i,u=i,null!==(e=Z())?(58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t&&null!==(r=null!==(r=ne())?r:"")&&null!==(s=oe())?e=[e,t,r,s]:(e=null,i=u)):(e=null,i=u),null!==e&&(e=function(e){try{jn.uri=new Hn(jn.scheme,jn.user,jn.host,jn.port),delete jn.scheme,delete jn.user,delete jn.host,delete jn.host_type,delete jn.port}catch(e){jn=-1}}()),null===e&&(i=l),e}function Q(){var e,t,s,l,u,c,h,d;return h=i,d=i,null!==(e=Z())?(58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t&&null!==(s=null!==(s=ne())?s:"")&&null!==(l=oe())&&null!==(u=ge())&&null!==(c=null!==(c=Ne())?c:"")?e=[e,t,s,l,u,c]:(e=null,i=d)):(e=null,i=d),null!==e&&(e=function(e){try{jn.uri=new Hn(jn.scheme,jn.user,jn.host,jn.port,jn.uri_params,jn.uri_headers),delete jn.scheme,delete jn.user,delete jn.host,delete jn.host_type,delete jn.port,delete jn.uri_params,"SIP_URI"===r&&(jn=jn.uri)}catch(e){jn=-1}}()),null===e&&(i=h),e}function Z(){var e;return null===(e=ee())&&(e=te()),e}function ee(){var e,t,r;return t=i,"sips"===n.substr(i,4).toLowerCase()?(e=n.substr(i,4),i+=4):(e=null,0===o&&a('"sips"')),null!==e&&(r=e,e=void(jn.scheme=r.toLowerCase())),null===e&&(i=t),e}function te(){var e,t,r;return t=i,"sip"===n.substr(i,3).toLowerCase()?(e=n.substr(i,3),i+=3):(e=null,0===o&&a('"sip"')),null!==e&&(r=e,e=void(jn.scheme=r.toLowerCase())),null===e&&(i=t),e}function ne(){var e,t,r,s,l,u,c;return s=i,l=i,null!==(e=re())?(u=i,58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t&&null!==(r=ie())?t=[t,r]:(t=null,i=u),null!==(t=null!==t?t:"")?(64===n.charCodeAt(i)?(r="@",i++):(r=null,0===o&&a('"@"')),null!==r?e=[e,t,r]:(e=null,i=l)):(e=null,i=l)):(e=null,i=l),null!==e&&(c=s,e=void(jn.user=decodeURIComponent(n.substring(i-1,c)))),null===e&&(i=s),e}function re(){var e,t;if(null===(t=C())&&null===(t=S())&&(t=se()),null!==t)for(e=[];null!==t;)e.push(t),null===(t=C())&&null===(t=S())&&(t=se());else e=null;return e}function se(){var e;return 38===n.charCodeAt(i)?(e="&",i++):(e=null,0===o&&a('"&"')),null===e&&(61===n.charCodeAt(i)?(e="=",i++):(e=null,0===o&&a('"="')),null===e&&(43===n.charCodeAt(i)?(e="+",i++):(e=null,0===o&&a('"+"')),null===e&&(36===n.charCodeAt(i)?(e="$",i++):(e=null,0===o&&a('"$"')),null===e&&(44===n.charCodeAt(i)?(e=",",i++):(e=null,0===o&&a('","')),null===e&&(59===n.charCodeAt(i)?(e=";",i++):(e=null,0===o&&a('";"')),null===e&&(63===n.charCodeAt(i)?(e="?",i++):(e=null,0===o&&a('"?"')),null===e&&(47===n.charCodeAt(i)?(e="/",i++):(e=null,0===o&&a('"/"'))))))))),e}function ie(){var e,t,r,s;for(r=i,e=[],null===(t=C())&&null===(t=S())&&(38===n.charCodeAt(i)?(t="&",i++):(t=null,0===o&&a('"&"')),null===t&&(61===n.charCodeAt(i)?(t="=",i++):(t=null,0===o&&a('"="')),null===t&&(43===n.charCodeAt(i)?(t="+",i++):(t=null,0===o&&a('"+"')),null===t&&(36===n.charCodeAt(i)?(t="$",i++):(t=null,0===o&&a('"$"')),null===t&&(44===n.charCodeAt(i)?(t=",",i++):(t=null,0===o&&a('","')))))));null!==t;)e.push(t),null===(t=C())&&null===(t=S())&&(38===n.charCodeAt(i)?(t="&",i++):(t=null,0===o&&a('"&"')),null===t&&(61===n.charCodeAt(i)?(t="=",i++):(t=null,0===o&&a('"="')),null===t&&(43===n.charCodeAt(i)?(t="+",i++):(t=null,0===o&&a('"+"')),null===t&&(36===n.charCodeAt(i)?(t="$",i++):(t=null,0===o&&a('"$"')),null===t&&(44===n.charCodeAt(i)?(t=",",i++):(t=null,0===o&&a('","')))))));return null!==e&&(s=r,e=void(jn.password=n.substring(i,s))),null===e&&(i=r),e}function oe(){var e,t,r,s,l;return s=i,null!==(e=le())?(l=i,58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t&&null!==(r=ve())?t=[t,r]:(t=null,i=l),null!==(t=null!==t?t:"")?e=[e,t]:(e=null,i=s)):(e=null,i=s),e}function le(){var e,t,r;return t=i,null===(e=ue())&&null===(e=pe())&&(e=he()),null!==e&&(r=t,jn.host=n.substring(i,r).toLowerCase(),e=jn.host),null===e&&(i=t),e}function ue(){var e,t,r,s,l,u,c;for(s=i,l=i,e=[],u=i,null!==(t=ae())?(46===n.charCodeAt(i)?(r=".",i++):(r=null,0===o&&a('"."')),null!==r?t=[t,r]:(t=null,i=u)):(t=null,i=u);null!==t;)e.push(t),u=i,null!==(t=ae())?(46===n.charCodeAt(i)?(r=".",i++):(r=null,0===o&&a('"."')),null!==r?t=[t,r]:(t=null,i=u)):(t=null,i=u);return null!==e&&null!==(t=ce())?(46===n.charCodeAt(i)?(r=".",i++):(r=null,0===o&&a('"."')),null!==(r=null!==r?r:"")?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(c=s,jn.host_type="domain",e=n.substring(i,c)),null===e&&(i=s),e}function ae(){var e,t,r,s;if(s=i,null!==(e=y())){for(t=[],null===(r=y())&&(45===n.charCodeAt(i)?(r="-",i++):(r=null,0===o&&a('"-"')),null===r&&(95===n.charCodeAt(i)?(r="_",i++):(r=null,0===o&&a('"_"'))));null!==r;)t.push(r),null===(r=y())&&(45===n.charCodeAt(i)?(r="-",i++):(r=null,0===o&&a('"-"')),null===r&&(95===n.charCodeAt(i)?(r="_",i++):(r=null,0===o&&a('"_"'))));null!==t?e=[e,t]:(e=null,i=s)}else e=null,i=s;return e}function ce(){var e,t,r,s;if(s=i,null!==(e=d())){for(t=[],null===(r=y())&&(45===n.charCodeAt(i)?(r="-",i++):(r=null,0===o&&a('"-"')),null===r&&(95===n.charCodeAt(i)?(r="_",i++):(r=null,0===o&&a('"_"'))));null!==r;)t.push(r),null===(r=y())&&(45===n.charCodeAt(i)?(r="-",i++):(r=null,0===o&&a('"-"')),null===r&&(95===n.charCodeAt(i)?(r="_",i++):(r=null,0===o&&a('"_"'))));null!==t?e=[e,t]:(e=null,i=s)}else e=null,i=s;return e}function he(){var e,t,r,s,l,u;return s=i,l=i,91===n.charCodeAt(i)?(e="[",i++):(e=null,0===o&&a('"["')),null!==e&&null!==(t=de())?(93===n.charCodeAt(i)?(r="]",i++):(r=null,0===o&&a('"]"')),null!==r?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(u=s,jn.host_type="IPv6",e=n.substring(i,u)),null===e&&(i=s),e}function de(){var e,t,r,s,l,u,c,h,d,f,_,p,m,v,g,y,T;return v=i,g=i,null!==(e=fe())?(58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t&&null!==(r=fe())?(58===n.charCodeAt(i)?(s=":",i++):(s=null,0===o&&a('":"')),null!==s&&null!==(l=fe())?(58===n.charCodeAt(i)?(u=":",i++):(u=null,0===o&&a('":"')),null!==u&&null!==(c=fe())?(58===n.charCodeAt(i)?(h=":",i++):(h=null,0===o&&a('":"')),null!==h&&null!==(d=fe())?(58===n.charCodeAt(i)?(f=":",i++):(f=null,0===o&&a('":"')),null!==f&&null!==(_=fe())?(58===n.charCodeAt(i)?(p=":",i++):(p=null,0===o&&a('":"')),null!==p&&null!==(m=_e())?e=[e,t,r,s,l,u,c,h,d,f,_,p,m]:(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g),null===e&&(g=i,"::"===n.substr(i,2)?(e="::",i+=2):(e=null,0===o&&a('"::"')),null!==e&&null!==(t=fe())?(58===n.charCodeAt(i)?(r=":",i++):(r=null,0===o&&a('":"')),null!==r&&null!==(s=fe())?(58===n.charCodeAt(i)?(l=":",i++):(l=null,0===o&&a('":"')),null!==l&&null!==(u=fe())?(58===n.charCodeAt(i)?(c=":",i++):(c=null,0===o&&a('":"')),null!==c&&null!==(h=fe())?(58===n.charCodeAt(i)?(d=":",i++):(d=null,0===o&&a('":"')),null!==d&&null!==(f=fe())?(58===n.charCodeAt(i)?(_=":",i++):(_=null,0===o&&a('":"')),null!==_&&null!==(p=_e())?e=[e,t,r,s,l,u,c,h,d,f,_,p]:(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g),null===e&&(g=i,"::"===n.substr(i,2)?(e="::",i+=2):(e=null,0===o&&a('"::"')),null!==e&&null!==(t=fe())?(58===n.charCodeAt(i)?(r=":",i++):(r=null,0===o&&a('":"')),null!==r&&null!==(s=fe())?(58===n.charCodeAt(i)?(l=":",i++):(l=null,0===o&&a('":"')),null!==l&&null!==(u=fe())?(58===n.charCodeAt(i)?(c=":",i++):(c=null,0===o&&a('":"')),null!==c&&null!==(h=fe())?(58===n.charCodeAt(i)?(d=":",i++):(d=null,0===o&&a('":"')),null!==d&&null!==(f=_e())?e=[e,t,r,s,l,u,c,h,d,f]:(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g),null===e&&(g=i,"::"===n.substr(i,2)?(e="::",i+=2):(e=null,0===o&&a('"::"')),null!==e&&null!==(t=fe())?(58===n.charCodeAt(i)?(r=":",i++):(r=null,0===o&&a('":"')),null!==r&&null!==(s=fe())?(58===n.charCodeAt(i)?(l=":",i++):(l=null,0===o&&a('":"')),null!==l&&null!==(u=fe())?(58===n.charCodeAt(i)?(c=":",i++):(c=null,0===o&&a('":"')),null!==c&&null!==(h=_e())?e=[e,t,r,s,l,u,c,h]:(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g),null===e&&(g=i,"::"===n.substr(i,2)?(e="::",i+=2):(e=null,0===o&&a('"::"')),null!==e&&null!==(t=fe())?(58===n.charCodeAt(i)?(r=":",i++):(r=null,0===o&&a('":"')),null!==r&&null!==(s=fe())?(58===n.charCodeAt(i)?(l=":",i++):(l=null,0===o&&a('":"')),null!==l&&null!==(u=_e())?e=[e,t,r,s,l,u]:(e=null,i=g)):(e=null,i=g)):(e=null,i=g),null===e&&(g=i,"::"===n.substr(i,2)?(e="::",i+=2):(e=null,0===o&&a('"::"')),null!==e&&null!==(t=fe())?(58===n.charCodeAt(i)?(r=":",i++):(r=null,0===o&&a('":"')),null!==r&&null!==(s=_e())?e=[e,t,r,s]:(e=null,i=g)):(e=null,i=g),null===e&&(g=i,"::"===n.substr(i,2)?(e="::",i+=2):(e=null,0===o&&a('"::"')),null!==e&&null!==(t=_e())?e=[e,t]:(e=null,i=g),null===e&&(g=i,"::"===n.substr(i,2)?(e="::",i+=2):(e=null,0===o&&a('"::"')),null!==e&&null!==(t=fe())?e=[e,t]:(e=null,i=g),null===e&&(g=i,null!==(e=fe())?("::"===n.substr(i,2)?(t="::",i+=2):(t=null,0===o&&a('"::"')),null!==t&&null!==(r=fe())?(58===n.charCodeAt(i)?(s=":",i++):(s=null,0===o&&a('":"')),null!==s&&null!==(l=fe())?(58===n.charCodeAt(i)?(u=":",i++):(u=null,0===o&&a('":"')),null!==u&&null!==(c=fe())?(58===n.charCodeAt(i)?(h=":",i++):(h=null,0===o&&a('":"')),null!==h&&null!==(d=fe())?(58===n.charCodeAt(i)?(f=":",i++):(f=null,0===o&&a('":"')),null!==f&&null!==(_=_e())?e=[e,t,r,s,l,u,c,h,d,f,_]:(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g),null===e&&(g=i,null!==(e=fe())?(y=i,58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t&&null!==(r=fe())?t=[t,r]:(t=null,i=y),null!==(t=null!==t?t:"")?("::"===n.substr(i,2)?(r="::",i+=2):(r=null,0===o&&a('"::"')),null!==r&&null!==(s=fe())?(58===n.charCodeAt(i)?(l=":",i++):(l=null,0===o&&a('":"')),null!==l&&null!==(u=fe())?(58===n.charCodeAt(i)?(c=":",i++):(c=null,0===o&&a('":"')),null!==c&&null!==(h=fe())?(58===n.charCodeAt(i)?(d=":",i++):(d=null,0===o&&a('":"')),null!==d&&null!==(f=_e())?e=[e,t,r,s,l,u,c,h,d,f]:(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g),null===e&&(g=i,null!==(e=fe())?(y=i,58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t&&null!==(r=fe())?t=[t,r]:(t=null,i=y),null!==(t=null!==t?t:"")?(y=i,58===n.charCodeAt(i)?(r=":",i++):(r=null,0===o&&a('":"')),null!==r&&null!==(s=fe())?r=[r,s]:(r=null,i=y),null!==(r=null!==r?r:"")?("::"===n.substr(i,2)?(s="::",i+=2):(s=null,0===o&&a('"::"')),null!==s&&null!==(l=fe())?(58===n.charCodeAt(i)?(u=":",i++):(u=null,0===o&&a('":"')),null!==u&&null!==(c=fe())?(58===n.charCodeAt(i)?(h=":",i++):(h=null,0===o&&a('":"')),null!==h&&null!==(d=_e())?e=[e,t,r,s,l,u,c,h,d]:(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g),null===e&&(g=i,null!==(e=fe())?(y=i,58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t&&null!==(r=fe())?t=[t,r]:(t=null,i=y),null!==(t=null!==t?t:"")?(y=i,58===n.charCodeAt(i)?(r=":",i++):(r=null,0===o&&a('":"')),null!==r&&null!==(s=fe())?r=[r,s]:(r=null,i=y),null!==(r=null!==r?r:"")?(y=i,58===n.charCodeAt(i)?(s=":",i++):(s=null,0===o&&a('":"')),null!==s&&null!==(l=fe())?s=[s,l]:(s=null,i=y),null!==(s=null!==s?s:"")?("::"===n.substr(i,2)?(l="::",i+=2):(l=null,0===o&&a('"::"')),null!==l&&null!==(u=fe())?(58===n.charCodeAt(i)?(c=":",i++):(c=null,0===o&&a('":"')),null!==c&&null!==(h=_e())?e=[e,t,r,s,l,u,c,h]:(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g),null===e&&(g=i,null!==(e=fe())?(y=i,58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t&&null!==(r=fe())?t=[t,r]:(t=null,i=y),null!==(t=null!==t?t:"")?(y=i,58===n.charCodeAt(i)?(r=":",i++):(r=null,0===o&&a('":"')),null!==r&&null!==(s=fe())?r=[r,s]:(r=null,i=y),null!==(r=null!==r?r:"")?(y=i,58===n.charCodeAt(i)?(s=":",i++):(s=null,0===o&&a('":"')),null!==s&&null!==(l=fe())?s=[s,l]:(s=null,i=y),null!==(s=null!==s?s:"")?(y=i,58===n.charCodeAt(i)?(l=":",i++):(l=null,0===o&&a('":"')),null!==l&&null!==(u=fe())?l=[l,u]:(l=null,i=y),null!==(l=null!==l?l:"")?("::"===n.substr(i,2)?(u="::",i+=2):(u=null,0===o&&a('"::"')),null!==u&&null!==(c=_e())?e=[e,t,r,s,l,u,c]:(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g),null===e&&(g=i,null!==(e=fe())?(y=i,58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t&&null!==(r=fe())?t=[t,r]:(t=null,i=y),null!==(t=null!==t?t:"")?(y=i,58===n.charCodeAt(i)?(r=":",i++):(r=null,0===o&&a('":"')),null!==r&&null!==(s=fe())?r=[r,s]:(r=null,i=y),null!==(r=null!==r?r:"")?(y=i,58===n.charCodeAt(i)?(s=":",i++):(s=null,0===o&&a('":"')),null!==s&&null!==(l=fe())?s=[s,l]:(s=null,i=y),null!==(s=null!==s?s:"")?(y=i,58===n.charCodeAt(i)?(l=":",i++):(l=null,0===o&&a('":"')),null!==l&&null!==(u=fe())?l=[l,u]:(l=null,i=y),null!==(l=null!==l?l:"")?(y=i,58===n.charCodeAt(i)?(u=":",i++):(u=null,0===o&&a('":"')),null!==u&&null!==(c=fe())?u=[u,c]:(u=null,i=y),null!==(u=null!==u?u:"")?("::"===n.substr(i,2)?(c="::",i+=2):(c=null,0===o&&a('"::"')),null!==c&&null!==(h=fe())?e=[e,t,r,s,l,u,c,h]:(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g),null===e&&(g=i,null!==(e=fe())?(y=i,58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t&&null!==(r=fe())?t=[t,r]:(t=null,i=y),null!==(t=null!==t?t:"")?(y=i,58===n.charCodeAt(i)?(r=":",i++):(r=null,0===o&&a('":"')),null!==r&&null!==(s=fe())?r=[r,s]:(r=null,i=y),null!==(r=null!==r?r:"")?(y=i,58===n.charCodeAt(i)?(s=":",i++):(s=null,0===o&&a('":"')),null!==s&&null!==(l=fe())?s=[s,l]:(s=null,i=y),null!==(s=null!==s?s:"")?(y=i,58===n.charCodeAt(i)?(l=":",i++):(l=null,0===o&&a('":"')),null!==l&&null!==(u=fe())?l=[l,u]:(l=null,i=y),null!==(l=null!==l?l:"")?(y=i,58===n.charCodeAt(i)?(u=":",i++):(u=null,0===o&&a('":"')),null!==u&&null!==(c=fe())?u=[u,c]:(u=null,i=y),null!==(u=null!==u?u:"")?(y=i,58===n.charCodeAt(i)?(c=":",i++):(c=null,0===o&&a('":"')),null!==c&&null!==(h=fe())?c=[c,h]:(c=null,i=y),null!==(c=null!==c?c:"")?("::"===n.substr(i,2)?(h="::",i+=2):(h=null,0===o&&a('"::"')),null!==h?e=[e,t,r,s,l,u,c,h]:(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g))))))))))))))),null!==e&&(T=v,jn.host_type="IPv6",e=n.substring(i,T)),null===e&&(i=v),e}function fe(){var e,t,n,r,s;return s=i,null!==(e=f())&&null!==(t=null!==(t=f())?t:"")&&null!==(n=null!==(n=f())?n:"")&&null!==(r=null!==(r=f())?r:"")?e=[e,t,n,r]:(e=null,i=s),e}function _e(){var e,t,r,s;return s=i,null!==(e=fe())?(58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t&&null!==(r=fe())?e=[e,t,r]:(e=null,i=s)):(e=null,i=s),null===e&&(e=pe()),e}function pe(){var e,t,r,s,l,u,c,h,d,f;return h=i,d=i,null!==(e=me())?(46===n.charCodeAt(i)?(t=".",i++):(t=null,0===o&&a('"."')),null!==t&&null!==(r=me())?(46===n.charCodeAt(i)?(s=".",i++):(s=null,0===o&&a('"."')),null!==s&&null!==(l=me())?(46===n.charCodeAt(i)?(u=".",i++):(u=null,0===o&&a('"."')),null!==u&&null!==(c=me())?e=[e,t,r,s,l,u,c]:(e=null,i=d)):(e=null,i=d)):(e=null,i=d)):(e=null,i=d),null!==e&&(f=h,jn.host_type="IPv4",e=n.substring(i,f)),null===e&&(i=h),e}function me(){var e,t,r,s;return s=i,"25"===n.substr(i,2)?(e="25",i+=2):(e=null,0===o&&a('"25"')),null!==e?(/^[0-5]/.test(n.charAt(i))?(t=n.charAt(i),i++):(t=null,0===o&&a("[0-5]")),null!==t?e=[e,t]:(e=null,i=s)):(e=null,i=s),null===e&&(s=i,50===n.charCodeAt(i)?(e="2",i++):(e=null,0===o&&a('"2"')),null!==e?(/^[0-4]/.test(n.charAt(i))?(t=n.charAt(i),i++):(t=null,0===o&&a("[0-4]")),null!==t&&null!==(r=h())?e=[e,t,r]:(e=null,i=s)):(e=null,i=s),null===e&&(s=i,49===n.charCodeAt(i)?(e="1",i++):(e=null,0===o&&a('"1"')),null!==e&&null!==(t=h())&&null!==(r=h())?e=[e,t,r]:(e=null,i=s),null===e&&(s=i,/^[1-9]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[1-9]")),null!==e&&null!==(t=h())?e=[e,t]:(e=null,i=s),null===e&&(e=h())))),e}function ve(){var e,t,n,r,s,o,l,u;return o=i,l=i,null!==(e=null!==(e=h())?e:"")&&null!==(t=null!==(t=h())?t:"")&&null!==(n=null!==(n=h())?n:"")&&null!==(r=null!==(r=h())?r:"")&&null!==(s=null!==(s=h())?s:"")?e=[e,t,n,r,s]:(e=null,i=l),null!==e&&(u=e,u=parseInt(u.join("")),jn.port=u,e=u),null===e&&(i=o),e}function ge(){var e,t,r,s;for(e=[],s=i,59===n.charCodeAt(i)?(t=";",i++):(t=null,0===o&&a('";"')),null!==t&&null!==(r=ye())?t=[t,r]:(t=null,i=s);null!==t;)e.push(t),s=i,59===n.charCodeAt(i)?(t=";",i++):(t=null,0===o&&a('";"')),null!==t&&null!==(r=ye())?t=[t,r]:(t=null,i=s);return e}function ye(){var e;return null===(e=Te())&&null===(e=Ce())&&null===(e=be())&&null===(e=Se())&&null===(e=Ee())&&null===(e=Ae())&&(e=Re()),e}function Te(){var e,t,r,s,l;return r=i,s=i,"transport="===n.substr(i,10).toLowerCase()?(e=n.substr(i,10),i+=10):(e=null,0===o&&a('"transport="')),null!==e?("udp"===n.substr(i,3).toLowerCase()?(t=n.substr(i,3),i+=3):(t=null,0===o&&a('"udp"')),null===t&&("tcp"===n.substr(i,3).toLowerCase()?(t=n.substr(i,3),i+=3):(t=null,0===o&&a('"tcp"')),null===t&&("sctp"===n.substr(i,4).toLowerCase()?(t=n.substr(i,4),i+=4):(t=null,0===o&&a('"sctp"')),null===t&&("tls"===n.substr(i,3).toLowerCase()?(t=n.substr(i,3),i+=3):(t=null,0===o&&a('"tls"')),null===t&&(t=N())))),null!==t?e=[e,t]:(e=null,i=s)):(e=null,i=s),null!==e&&(l=e[1],jn.uri_params||(jn.uri_params={}),e=void(jn.uri_params.transport=l.toLowerCase())),null===e&&(i=r),e}function Ce(){var e,t,r,s,l;return r=i,s=i,"user="===n.substr(i,5).toLowerCase()?(e=n.substr(i,5),i+=5):(e=null,0===o&&a('"user="')),null!==e?("phone"===n.substr(i,5).toLowerCase()?(t=n.substr(i,5),i+=5):(t=null,0===o&&a('"phone"')),null===t&&("ip"===n.substr(i,2).toLowerCase()?(t=n.substr(i,2),i+=2):(t=null,0===o&&a('"ip"')),null===t&&(t=N())),null!==t?e=[e,t]:(e=null,i=s)):(e=null,i=s),null!==e&&(l=e[1],jn.uri_params||(jn.uri_params={}),e=void(jn.uri_params.user=l.toLowerCase())),null===e&&(i=r),e}function be(){var e,t,r,s,l;return r=i,s=i,"method="===n.substr(i,7).toLowerCase()?(e=n.substr(i,7),i+=7):(e=null,0===o&&a('"method="')),null!==e&&null!==(t=ct())?e=[e,t]:(e=null,i=s),null!==e&&(l=e[1],jn.uri_params||(jn.uri_params={}),e=void(jn.uri_params.method=l)),null===e&&(i=r),e}function Se(){var e,t,r,s,l;return r=i,s=i,"ttl="===n.substr(i,4).toLowerCase()?(e=n.substr(i,4),i+=4):(e=null,0===o&&a('"ttl="')),null!==e&&null!==(t=An())?e=[e,t]:(e=null,i=s),null!==e&&(l=e[1],jn.params||(jn.params={}),e=void(jn.params.ttl=l)),null===e&&(i=r),e}function Ee(){var e,t,r,s,l;return r=i,s=i,"maddr="===n.substr(i,6).toLowerCase()?(e=n.substr(i,6),i+=6):(e=null,0===o&&a('"maddr="')),null!==e&&null!==(t=le())?e=[e,t]:(e=null,i=s),null!==e&&(l=e[1],jn.uri_params||(jn.uri_params={}),e=void(jn.uri_params.maddr=l)),null===e&&(i=r),e}function Ae(){var e,t,r,s,l,u;return s=i,l=i,"lr"===n.substr(i,2).toLowerCase()?(e=n.substr(i,2),i+=2):(e=null,0===o&&a('"lr"')),null!==e?(u=i,61===n.charCodeAt(i)?(t="=",i++):(t=null,0===o&&a('"="')),null!==t&&null!==(r=N())?t=[t,r]:(t=null,i=u),null!==(t=null!==t?t:"")?e=[e,t]:(e=null,i=l)):(e=null,i=l),null!==e&&(jn.uri_params||(jn.uri_params={}),e=void(jn.uri_params.lr=void 0)),null===e&&(i=s),e}function Re(){var e,t,r,s,l,u,c,h;return s=i,l=i,null!==(e=we())?(u=i,61===n.charCodeAt(i)?(t="=",i++):(t=null,0===o&&a('"="')),null!==t&&null!==(r=Ie())?t=[t,r]:(t=null,i=u),null!==(t=null!==t?t:"")?e=[e,t]:(e=null,i=l)):(e=null,i=l),null!==e&&(c=e[0],h=e[1],jn.uri_params||(jn.uri_params={}),h=void 0===h?void 0:h[1],e=void(jn.uri_params[c.toLowerCase()]=h)),null===e&&(i=s),e}function we(){var e,t,n;if(n=i,null!==(t=Oe()))for(e=[];null!==t;)e.push(t),t=Oe();else e=null;return null!==e&&(e=e.join("")),null===e&&(i=n),e}function Ie(){var e,t,n;if(n=i,null!==(t=Oe()))for(e=[];null!==t;)e.push(t),t=Oe();else e=null;return null!==e&&(e=e.join("")),null===e&&(i=n),e}function Oe(){var e;return null===(e=ke())&&null===(e=C())&&(e=S()),e}function ke(){var e;return 91===n.charCodeAt(i)?(e="[",i++):(e=null,0===o&&a('"["')),null===e&&(93===n.charCodeAt(i)?(e="]",i++):(e=null,0===o&&a('"]"')),null===e&&(47===n.charCodeAt(i)?(e="/",i++):(e=null,0===o&&a('"/"')),null===e&&(58===n.charCodeAt(i)?(e=":",i++):(e=null,0===o&&a('":"')),null===e&&(38===n.charCodeAt(i)?(e="&",i++):(e=null,0===o&&a('"&"')),null===e&&(43===n.charCodeAt(i)?(e="+",i++):(e=null,0===o&&a('"+"')),null===e&&(36===n.charCodeAt(i)?(e="$",i++):(e=null,0===o&&a('"$"')))))))),e}function Ne(){var e,t,r,s,l,u,c;if(u=i,63===n.charCodeAt(i)?(e="?",i++):(e=null,0===o&&a('"?"')),null!==e)if(null!==(t=Ue())){for(r=[],c=i,38===n.charCodeAt(i)?(s="&",i++):(s=null,0===o&&a('"&"')),null!==s&&null!==(l=Ue())?s=[s,l]:(s=null,i=c);null!==s;)r.push(s),c=i,38===n.charCodeAt(i)?(s="&",i++):(s=null,0===o&&a('"&"')),null!==s&&null!==(l=Ue())?s=[s,l]:(s=null,i=c);null!==r?e=[e,t,r]:(e=null,i=u)}else e=null,i=u;else e=null,i=u;return e}function Ue(){var e,t,r,s,l,u,c;return s=i,l=i,null!==(e=xe())?(61===n.charCodeAt(i)?(t="=",i++):(t=null,0===o&&a('"="')),null!==t&&null!==(r=De())?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(u=e[0],c=e[2],u=u.join("").toLowerCase(),c=c.join(""),jn.uri_headers||(jn.uri_headers={}),e=void(jn.uri_headers[u]?jn.uri_headers[u].push(c):jn.uri_headers[u]=[c])),null===e&&(i=s),e}function xe(){var e,t;if(null===(t=Pe())&&null===(t=C())&&(t=S()),null!==t)for(e=[];null!==t;)e.push(t),null===(t=Pe())&&null===(t=C())&&(t=S());else e=null;return e}function De(){var e,t;for(e=[],null===(t=Pe())&&null===(t=C())&&(t=S());null!==t;)e.push(t),null===(t=Pe())&&null===(t=C())&&(t=S());return e}function Pe(){var e;return 91===n.charCodeAt(i)?(e="[",i++):(e=null,0===o&&a('"["')),null===e&&(93===n.charCodeAt(i)?(e="]",i++):(e=null,0===o&&a('"]"')),null===e&&(47===n.charCodeAt(i)?(e="/",i++):(e=null,0===o&&a('"/"')),null===e&&(63===n.charCodeAt(i)?(e="?",i++):(e=null,0===o&&a('"?"')),null===e&&(58===n.charCodeAt(i)?(e=":",i++):(e=null,0===o&&a('":"')),null===e&&(43===n.charCodeAt(i)?(e="+",i++):(e=null,0===o&&a('"+"')),null===e&&(36===n.charCodeAt(i)?(e="$",i++):(e=null,0===o&&a('"$"')))))))),e}function Me(){var e,t,n,r,s,o;return o=i,null!==(e=ct())&&null!==(t=v())&&null!==(n=qe())&&null!==(r=v())&&null!==(s=et())?e=[e,t,n,r,s]:(e=null,i=o),e}function qe(){var e;return null===(e=Q())&&(e=Le()),e}function Le(){var e,t,r,s;return s=i,null!==(e=$e())?(58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t?(null===(r=He())&&(r=Ge()),null!==r?e=[e,t,r]:(e=null,i=s)):(e=null,i=s)):(e=null,i=s),e}function He(){var e,t,r,s,l;return s=i,null===(e=Fe())&&(e=je()),null!==e?(l=i,63===n.charCodeAt(i)?(t="?",i++):(t=null,0===o&&a('"?"')),null!==t&&null!==(r=Ze())?t=[t,r]:(t=null,i=l),null!==(t=null!==t?t:"")?e=[e,t]:(e=null,i=s)):(e=null,i=s),e}function Fe(){var e,t,r,s;return s=i,"//"===n.substr(i,2)?(e="//",i+=2):(e=null,0===o&&a('"//"')),null!==e&&null!==(t=Xe())&&null!==(r=null!==(r=je())?r:"")?e=[e,t,r]:(e=null,i=s),e}function je(){var e,t,r;return r=i,47===n.charCodeAt(i)?(e="/",i++):(e=null,0===o&&a('"/"')),null!==e&&null!==(t=Be())?e=[e,t]:(e=null,i=r),e}function Ge(){var e,t,n,r;if(r=i,null!==(e=Ve())){for(t=[],n=We();null!==n;)t.push(n),n=We();null!==t?e=[e,t]:(e=null,i=r)}else e=null,i=r;return e}function We(){var e;return null===(e=T())&&null===(e=C())&&(e=S()),e}function Ve(){var e;return null===(e=C())&&null===(e=S())&&(59===n.charCodeAt(i)?(e=";",i++):(e=null,0===o&&a('";"')),null===e&&(63===n.charCodeAt(i)?(e="?",i++):(e=null,0===o&&a('"?"')),null===e&&(58===n.charCodeAt(i)?(e=":",i++):(e=null,0===o&&a('":"')),null===e&&(64===n.charCodeAt(i)?(e="@",i++):(e=null,0===o&&a('"@"')),null===e&&(38===n.charCodeAt(i)?(e="&",i++):(e=null,0===o&&a('"&"')),null===e&&(61===n.charCodeAt(i)?(e="=",i++):(e=null,0===o&&a('"="')),null===e&&(43===n.charCodeAt(i)?(e="+",i++):(e=null,0===o&&a('"+"')),null===e&&(36===n.charCodeAt(i)?(e="$",i++):(e=null,0===o&&a('"$"')),null===e&&(44===n.charCodeAt(i)?(e=",",i++):(e=null,0===o&&a('","'))))))))))),e}function Be(){var e,t,r,s,l,u;if(l=i,null!==(e=Ke())){for(t=[],u=i,47===n.charCodeAt(i)?(r="/",i++):(r=null,0===o&&a('"/"')),null!==r&&null!==(s=Ke())?r=[r,s]:(r=null,i=u);null!==r;)t.push(r),u=i,47===n.charCodeAt(i)?(r="/",i++):(r=null,0===o&&a('"/"')),null!==r&&null!==(s=Ke())?r=[r,s]:(r=null,i=u);null!==t?e=[e,t]:(e=null,i=l)}else e=null,i=l;return e}function Ke(){var e,t,r,s,l,u;for(l=i,e=[],t=Ye();null!==t;)e.push(t),t=Ye();if(null!==e){for(t=[],u=i,59===n.charCodeAt(i)?(r=";",i++):(r=null,0===o&&a('";"')),null!==r&&null!==(s=ze())?r=[r,s]:(r=null,i=u);null!==r;)t.push(r),u=i,59===n.charCodeAt(i)?(r=";",i++):(r=null,0===o&&a('";"')),null!==r&&null!==(s=ze())?r=[r,s]:(r=null,i=u);null!==t?e=[e,t]:(e=null,i=l)}else e=null,i=l;return e}function ze(){var e,t;for(e=[],t=Ye();null!==t;)e.push(t),t=Ye();return e}function Ye(){var e;return null===(e=C())&&null===(e=S())&&(58===n.charCodeAt(i)?(e=":",i++):(e=null,0===o&&a('":"')),null===e&&(64===n.charCodeAt(i)?(e="@",i++):(e=null,0===o&&a('"@"')),null===e&&(38===n.charCodeAt(i)?(e="&",i++):(e=null,0===o&&a('"&"')),null===e&&(61===n.charCodeAt(i)?(e="=",i++):(e=null,0===o&&a('"="')),null===e&&(43===n.charCodeAt(i)?(e="+",i++):(e=null,0===o&&a('"+"')),null===e&&(36===n.charCodeAt(i)?(e="$",i++):(e=null,0===o&&a('"$"')),null===e&&(44===n.charCodeAt(i)?(e=",",i++):(e=null,0===o&&a('","'))))))))),e}function $e(){var e,t,r,s,l,u;if(s=i,l=i,null!==(e=d())){for(t=[],null===(r=d())&&null===(r=h())&&(43===n.charCodeAt(i)?(r="+",i++):(r=null,0===o&&a('"+"')),null===r&&(45===n.charCodeAt(i)?(r="-",i++):(r=null,0===o&&a('"-"')),null===r&&(46===n.charCodeAt(i)?(r=".",i++):(r=null,0===o&&a('"."')))));null!==r;)t.push(r),null===(r=d())&&null===(r=h())&&(43===n.charCodeAt(i)?(r="+",i++):(r=null,0===o&&a('"+"')),null===r&&(45===n.charCodeAt(i)?(r="-",i++):(r=null,0===o&&a('"-"')),null===r&&(46===n.charCodeAt(i)?(r=".",i++):(r=null,0===o&&a('"."')))));null!==t?e=[e,t]:(e=null,i=l)}else e=null,i=l;return null!==e&&(u=s,e=void(jn.scheme=n.substring(i,u))),null===e&&(i=s),e}function Xe(){var e;return null===(e=Je())&&(e=Qe()),e}function Je(){var e,t,r,s;return r=i,s=i,null!==(e=ne())?(64===n.charCodeAt(i)?(t="@",i++):(t=null,0===o&&a('"@"')),null!==t?e=[e,t]:(e=null,i=s)):(e=null,i=s),null!==(e=null!==e?e:"")&&null!==(t=oe())?e=[e,t]:(e=null,i=r),e=null!==e?e:""}function Qe(){var e,t;if(null===(t=C())&&null===(t=S())&&(36===n.charCodeAt(i)?(t="$",i++):(t=null,0===o&&a('"$"')),null===t&&(44===n.charCodeAt(i)?(t=",",i++):(t=null,0===o&&a('","')),null===t&&(59===n.charCodeAt(i)?(t=";",i++):(t=null,0===o&&a('";"')),null===t&&(58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null===t&&(64===n.charCodeAt(i)?(t="@",i++):(t=null,0===o&&a('"@"')),null===t&&(38===n.charCodeAt(i)?(t="&",i++):(t=null,0===o&&a('"&"')),null===t&&(61===n.charCodeAt(i)?(t="=",i++):(t=null,0===o&&a('"="')),null===t&&(43===n.charCodeAt(i)?(t="+",i++):(t=null,0===o&&a('"+"')))))))))),null!==t)for(e=[];null!==t;)e.push(t),null===(t=C())&&null===(t=S())&&(36===n.charCodeAt(i)?(t="$",i++):(t=null,0===o&&a('"$"')),null===t&&(44===n.charCodeAt(i)?(t=",",i++):(t=null,0===o&&a('","')),null===t&&(59===n.charCodeAt(i)?(t=";",i++):(t=null,0===o&&a('";"')),null===t&&(58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null===t&&(64===n.charCodeAt(i)?(t="@",i++):(t=null,0===o&&a('"@"')),null===t&&(38===n.charCodeAt(i)?(t="&",i++):(t=null,0===o&&a('"&"')),null===t&&(61===n.charCodeAt(i)?(t="=",i++):(t=null,0===o&&a('"="')),null===t&&(43===n.charCodeAt(i)?(t="+",i++):(t=null,0===o&&a('"+"'))))))))));else e=null;return e}function Ze(){var e,t;for(e=[],t=We();null!==t;)e.push(t),t=We();return e}function et(){var e,t,r,s,l,u,c,d,f;if(c=i,d=i,"sip"===n.substr(i,3).toLowerCase()?(e=n.substr(i,3),i+=3):(e=null,0===o&&a('"SIP"')),null!==e)if(47===n.charCodeAt(i)?(t="/",i++):(t=null,0===o&&a('"/"')),null!==t){if(null!==(s=h()))for(r=[];null!==s;)r.push(s),s=h();else r=null;if(null!==r)if(46===n.charCodeAt(i)?(s=".",i++):(s=null,0===o&&a('"."')),null!==s){if(null!==(u=h()))for(l=[];null!==u;)l.push(u),u=h();else l=null;null!==l?e=[e,t,r,s,l]:(e=null,i=d)}else e=null,i=d;else e=null,i=d}else e=null,i=d;else e=null,i=d;return null!==e&&(f=c,e=void(jn.sip_version=n.substring(i,f))),null===e&&(i=c),e}function tt(){var e;return"INVITE"===n.substr(i,6)?(e="INVITE",i+=6):(e=null,0===o&&a('"INVITE"')),e}function nt(){var e;return"ACK"===n.substr(i,3)?(e="ACK",i+=3):(e=null,0===o&&a('"ACK"')),e}function rt(){var e;return"OPTIONS"===n.substr(i,7)?(e="OPTIONS",i+=7):(e=null,0===o&&a('"OPTIONS"')),e}function st(){var e;return"BYE"===n.substr(i,3)?(e="BYE",i+=3):(e=null,0===o&&a('"BYE"')),e}function it(){var e;return"CANCEL"===n.substr(i,6)?(e="CANCEL",i+=6):(e=null,0===o&&a('"CANCEL"')),e}function ot(){var e;return"REGISTER"===n.substr(i,8)?(e="REGISTER",i+=8):(e=null,0===o&&a('"REGISTER"')),e}function lt(){var e;return"SUBSCRIBE"===n.substr(i,9)?(e="SUBSCRIBE",i+=9):(e=null,0===o&&a('"SUBSCRIBE"')),e}function ut(){var e;return"NOTIFY"===n.substr(i,6)?(e="NOTIFY",i+=6):(e=null,0===o&&a('"NOTIFY"')),e}function at(){var e;return"REFER"===n.substr(i,5)?(e="REFER",i+=5):(e=null,0===o&&a('"REFER"')),e}function ct(){var e,t,r;return t=i,null===(e=tt())&&null===(e=nt())&&null===(e=rt())&&null===(e=st())&&null===(e=it())&&null===(e=ot())&&null===(e=lt())&&null===(e=ut())&&null===(e=at())&&(e=N()),null!==e&&(r=t,jn.method=n.substring(i,r),e=jn.method),null===e&&(i=t),e}function ht(){var e,t,n,r,s,o;return o=i,null!==(e=et())&&null!==(t=v())&&null!==(n=dt())&&null!==(r=v())&&null!==(s=_t())?e=[e,t,n,r,s]:(e=null,i=o),e}function dt(){var e,t,n;return t=i,null!==(e=ft())&&(n=e,e=void(jn.status_code=parseInt(n.join("")))),null===e&&(i=t),e}function ft(){var e,t,n,r;return r=i,null!==(e=h())&&null!==(t=h())&&null!==(n=h())?e=[e,t,n]:(e=null,i=r),e}function _t(){var e,t,r,s;for(r=i,e=[],null===(t=T())&&null===(t=C())&&null===(t=S())&&null===(t=O())&&null===(t=k())&&null===(t=v())&&(t=g());null!==t;)e.push(t),null===(t=T())&&null===(t=C())&&null===(t=S())&&null===(t=O())&&null===(t=k())&&null===(t=v())&&(t=g());return null!==e&&(s=r,e=void(jn.reason_phrase=n.substring(i,s))),null===e&&(i=r),e}function pt(){var e,t,n,r,s,o,l;if(s=i,o=i,null===(e=J())&&(e=mt()),null!==e){for(t=[],l=i,null!==(n=G())&&null!==(r=gt())?n=[n,r]:(n=null,i=l);null!==n;)t.push(n),l=i,null!==(n=G())&&null!==(r=gt())?n=[n,r]:(n=null,i=l);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return null!==e&&(e=function(e){var t;jn.multi_header||(jn.multi_header=[]);try{t=new Fn(jn.uri,jn.display_name,jn.params),delete jn.uri,delete jn.display_name,delete jn.params}catch(e){t=null}jn.multi_header.push({possition:i,offset:e,parsed:t})}(s)),null===e&&(i=s),e}function mt(){var e,t,n,r,s;return s=i,null!==(e=null!==(e=vt())?e:"")&&null!==(t=F())&&null!==(n=Q())&&null!==(r=H())?e=[e,t,n,r]:(e=null,i=s),e}function vt(){var e,t,n,r,s,o,l,u;if(s=i,o=i,null!==(e=N())){for(t=[],l=i,null!==(n=E())&&null!==(r=N())?n=[n,r]:(n=null,i=l);null!==n;)t.push(n),l=i,null!==(n=E())&&null!==(r=N())?n=[n,r]:(n=null,i=l);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return null===e&&(e=Y()),null!==e&&(u=e,e=void(jn.display_name="string"==typeof u?u:u[1].reduce(function(e,t){return e+t[0]+t[1]},u[0]))),null===e&&(i=s),e}function gt(){var e;return null===(e=yt())&&null===(e=Tt())&&(e=St()),e}function yt(){var e,t,r,s,l,u;return s=i,l=i,"q"===n.substr(i,1).toLowerCase()?(e=n.substr(i,1),i++):(e=null,0===o&&a('"q"')),null!==e&&null!==(t=M())&&null!==(r=bt())?e=[e,t,r]:(e=null,i=l),null!==e&&(u=e[2],jn.params||(jn.params={}),e=void(jn.params.q=u)),null===e&&(i=s),e}function Tt(){var e,t,r,s,l,u;return s=i,l=i,"expires"===n.substr(i,7).toLowerCase()?(e=n.substr(i,7),i+=7):(e=null,0===o&&a('"expires"')),null!==e&&null!==(t=M())&&null!==(r=Ct())?e=[e,t,r]:(e=null,i=l),null!==e&&(u=e[2],jn.params||(jn.params={}),e=void(jn.params.expires=u)),null===e&&(i=s),e}function Ct(){var e,t,n;if(n=i,null!==(t=h()))for(e=[];null!==t;)e.push(t),t=h();else e=null;return null!==e&&(e=parseInt(e.join(""))),null===e&&(i=n),e}function bt(){var e,t,r,s,l,u,c,d,f;return u=i,c=i,48===n.charCodeAt(i)?(e="0",i++):(e=null,0===o&&a('"0"')),null!==e?(d=i,46===n.charCodeAt(i)?(t=".",i++):(t=null,0===o&&a('"."')),null!==t&&null!==(r=null!==(r=h())?r:"")&&null!==(s=null!==(s=h())?s:"")&&null!==(l=null!==(l=h())?l:"")?t=[t,r,s,l]:(t=null,i=d),null!==(t=null!==t?t:"")?e=[e,t]:(e=null,i=c)):(e=null,i=c),null!==e&&(f=u,e=parseFloat(n.substring(i,f))),null===e&&(i=u),e}function St(){var e,t,n,r,s,o,l,u;return r=i,s=i,null!==(e=N())?(o=i,null!==(t=M())&&null!==(n=Et())?t=[t,n]:(t=null,i=o),null!==(t=null!==t?t:"")?e=[e,t]:(e=null,i=s)):(e=null,i=s),null!==e&&(l=e[0],u=e[1],jn.params||(jn.params={}),u=void 0===u?void 0:u[1],e=void(jn.params[l.toLowerCase()]=u)),null===e&&(i=r),e}function Et(){var e;return null===(e=N())&&null===(e=le())&&(e=z()),e}function At(){var e;return"render"===n.substr(i,6).toLowerCase()?(e=n.substr(i,6),i+=6):(e=null,0===o&&a('"render"')),null===e&&("session"===n.substr(i,7).toLowerCase()?(e=n.substr(i,7),i+=7):(e=null,0===o&&a('"session"')),null===e&&("icon"===n.substr(i,4).toLowerCase()?(e=n.substr(i,4),i+=4):(e=null,0===o&&a('"icon"')),null===e&&("alert"===n.substr(i,5).toLowerCase()?(e=n.substr(i,5),i+=5):(e=null,0===o&&a('"alert"')),null===e&&(e=N())))),e}function Rt(){var e;return null===(e=wt())&&(e=St()),e}function wt(){var e,t,r,s;return s=i,"handling"===n.substr(i,8).toLowerCase()?(e=n.substr(i,8),i+=8):(e=null,0===o&&a('"handling"')),null!==e&&null!==(t=M())?("optional"===n.substr(i,8).toLowerCase()?(r=n.substr(i,8),i+=8):(r=null,0===o&&a('"optional"')),null===r&&("required"===n.substr(i,8).toLowerCase()?(r=n.substr(i,8),i+=8):(r=null,0===o&&a('"required"')),null===r&&(r=N())),null!==r?e=[e,t,r]:(e=null,i=s)):(e=null,i=s),e}function It(){var e,t,n,r,s,o,l,u;if(l=i,null!==(e=Ot()))if(null!==(t=P()))if(null!==(n=Dt())){for(r=[],u=i,null!==(s=G())&&null!==(o=Pt())?s=[s,o]:(s=null,i=u);null!==s;)r.push(s),u=i,null!==(s=G())&&null!==(o=Pt())?s=[s,o]:(s=null,i=u);null!==r?e=[e,t,n,r]:(e=null,i=l)}else e=null,i=l;else e=null,i=l;else e=null,i=l;return e}function Ot(){var e;return null===(e=kt())&&(e=Nt()),e}function kt(){var e;return"text"===n.substr(i,4).toLowerCase()?(e=n.substr(i,4),i+=4):(e=null,0===o&&a('"text"')),null===e&&("image"===n.substr(i,5).toLowerCase()?(e=n.substr(i,5),i+=5):(e=null,0===o&&a('"image"')),null===e&&("audio"===n.substr(i,5).toLowerCase()?(e=n.substr(i,5),i+=5):(e=null,0===o&&a('"audio"')),null===e&&("video"===n.substr(i,5).toLowerCase()?(e=n.substr(i,5),i+=5):(e=null,0===o&&a('"video"')),null===e&&("application"===n.substr(i,11).toLowerCase()?(e=n.substr(i,11),i+=11):(e=null,0===o&&a('"application"')),null===e&&(e=Ut()))))),e}function Nt(){var e;return"message"===n.substr(i,7).toLowerCase()?(e=n.substr(i,7),i+=7):(e=null,0===o&&a('"message"')),null===e&&("multipart"===n.substr(i,9).toLowerCase()?(e=n.substr(i,9),i+=9):(e=null,0===o&&a('"multipart"')),null===e&&(e=Ut())),e}function Ut(){var e;return null===(e=N())&&(e=xt()),e}function xt(){var e,t,r;return r=i,"x-"===n.substr(i,2).toLowerCase()?(e=n.substr(i,2),i+=2):(e=null,0===o&&a('"x-"')),null!==e&&null!==(t=N())?e=[e,t]:(e=null,i=r),e}function Dt(){var e;return null===(e=Ut())&&(e=N()),e}function Pt(){var e,t,n,r;return r=i,null!==(e=N())&&null!==(t=M())&&null!==(n=Mt())?e=[e,t,n]:(e=null,i=r),e}function Mt(){var e;return null===(e=N())&&(e=z()),e}function qt(){var e,t,n,r;if(n=i,null!==(t=h()))for(e=[];null!==t;)e.push(t),t=h();else e=null;return null!==e&&(r=e,e=void(jn.value=parseInt(r.join("")))),null===e&&(i=n),e}function Lt(){var e,t,r,s,l,u;if(l=i,null!==(e=U())){for(t=[],u=i,46===n.charCodeAt(i)?(r=".",i++):(r=null,0===o&&a('"."')),null!==r&&null!==(s=U())?r=[r,s]:(r=null,i=u);null!==r;)t.push(r),u=i,46===n.charCodeAt(i)?(r=".",i++):(r=null,0===o&&a('"."')),null!==r&&null!==(s=U())?r=[r,s]:(r=null,i=u);null!==t?e=[e,t]:(e=null,i=l)}else e=null,i=l;return e}function Ht(){var e;return null===(e=Ft())&&(e=St()),e}function Ft(){var e,t,r,s,l,u;return s=i,l=i,"tag"===n.substr(i,3).toLowerCase()?(e=n.substr(i,3),i+=3):(e=null,0===o&&a('"tag"')),null!==e&&null!==(t=M())&&null!==(r=N())?e=[e,t,r]:(e=null,i=l),null!==e&&(u=e[2],e=void(jn.tag=u)),null===e&&(i=s),e}function jt(){var e,t,r,s,l,u,c,h;if(c=i,"digest"===n.substr(i,6).toLowerCase()?(e=n.substr(i,6),i+=6):(e=null,0===o&&a('"Digest"')),null!==e)if(null!==(t=E()))if(null!==(r=Vt())){for(s=[],h=i,null!==(l=j())&&null!==(u=Vt())?l=[l,u]:(l=null,i=h);null!==l;)s.push(l),h=i,null!==(l=j())&&null!==(u=Vt())?l=[l,u]:(l=null,i=h);null!==s?e=[e,t,r,s]:(e=null,i=c)}else e=null,i=c;else e=null,i=c;else e=null,i=c;return null===e&&(e=Gt()),e}function Gt(){var e,t,n,r,s,o,l,u;if(l=i,null!==(e=N()))if(null!==(t=E()))if(null!==(n=Wt())){for(r=[],u=i,null!==(s=j())&&null!==(o=Wt())?s=[s,o]:(s=null,i=u);null!==s;)r.push(s),u=i,null!==(s=j())&&null!==(o=Wt())?s=[s,o]:(s=null,i=u);null!==r?e=[e,t,n,r]:(e=null,i=l)}else e=null,i=l;else e=null,i=l;else e=null,i=l;return e}function Wt(){var e,t,n,r;return r=i,null!==(e=N())&&null!==(t=M())?(null===(n=N())&&(n=z()),null!==n?e=[e,t,n]:(e=null,i=r)):(e=null,i=r),e}function Vt(){var e;return null===(e=Bt())&&null===(e=zt())&&null===(e=$t())&&null===(e=Jt())&&null===(e=Qt())&&null===(e=Zt())&&null===(e=en())&&(e=Wt()),e}function Bt(){var e,t,r,s;return s=i,"realm"===n.substr(i,5).toLowerCase()?(e=n.substr(i,5),i+=5):(e=null,0===o&&a('"realm"')),null!==e&&null!==(t=M())&&null!==(r=Kt())?e=[e,t,r]:(e=null,i=s),e}function Kt(){var e,t,n;return t=i,null!==(e=Y())&&(n=e,e=void(jn.realm=n)),null===e&&(i=t),e}function zt(){var e,t,r,s,l,u,c,h,d;if(h=i,"domain"===n.substr(i,6).toLowerCase()?(e=n.substr(i,6),i+=6):(e=null,0===o&&a('"domain"')),null!==e)if(null!==(t=M()))if(null!==(r=V()))if(null!==(s=Yt())){if(l=[],d=i,null!==(c=v()))for(u=[];null!==c;)u.push(c),c=v();else u=null;for(null!==u&&null!==(c=Yt())?u=[u,c]:(u=null,i=d);null!==u;){if(l.push(u),d=i,null!==(c=v()))for(u=[];null!==c;)u.push(c),c=v();else u=null;null!==u&&null!==(c=Yt())?u=[u,c]:(u=null,i=d)}null!==l&&null!==(u=B())?e=[e,t,r,s,l,u]:(e=null,i=h)}else e=null,i=h;else e=null,i=h;else e=null,i=h;else e=null,i=h;return e}function Yt(){var e;return null===(e=Le())&&(e=je()),e}function $t(){var e,t,r,s;return s=i,"nonce"===n.substr(i,5).toLowerCase()?(e=n.substr(i,5),i+=5):(e=null,0===o&&a('"nonce"')),null!==e&&null!==(t=M())&&null!==(r=Xt())?e=[e,t,r]:(e=null,i=s),e}function Xt(){var e,t,n;return t=i,null!==(e=Y())&&(n=e,e=void(jn.nonce=n)),null===e&&(i=t),e}function Jt(){var e,t,r,s,l,u;return s=i,l=i,"opaque"===n.substr(i,6).toLowerCase()?(e=n.substr(i,6),i+=6):(e=null,0===o&&a('"opaque"')),null!==e&&null!==(t=M())&&null!==(r=Y())?e=[e,t,r]:(e=null,i=l),null!==e&&(u=e[2],e=void(jn.opaque=u)),null===e&&(i=s),e}function Qt(){var e,t,r,s,l;return s=i,"stale"===n.substr(i,5).toLowerCase()?(e=n.substr(i,5),i+=5):(e=null,0===o&&a('"stale"')),null!==e&&null!==(t=M())?(l=i,"true"===n.substr(i,4).toLowerCase()?(r=n.substr(i,4),i+=4):(r=null,0===o&&a('"true"')),null!==r&&(r=void(jn.stale=!0)),null===r&&(i=l),null===r&&(l=i,"false"===n.substr(i,5).toLowerCase()?(r=n.substr(i,5),i+=5):(r=null,0===o&&a('"false"')),null!==r&&(r=void(jn.stale=!1)),null===r&&(i=l)),null!==r?e=[e,t,r]:(e=null,i=s)):(e=null,i=s),e}function Zt(){var e,t,r,s,l,u;return s=i,l=i,"algorithm"===n.substr(i,9).toLowerCase()?(e=n.substr(i,9),i+=9):(e=null,0===o&&a('"algorithm"')),null!==e&&null!==(t=M())?("md5"===n.substr(i,3).toLowerCase()?(r=n.substr(i,3),i+=3):(r=null,0===o&&a('"MD5"')),null===r&&("md5-sess"===n.substr(i,8).toLowerCase()?(r=n.substr(i,8),i+=8):(r=null,0===o&&a('"MD5-sess"')),null===r&&(r=N())),null!==r?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(u=e[2],e=void(jn.algorithm=u.toUpperCase())),null===e&&(i=s),e}function en(){var e,t,r,s,l,u,c,h,d,f;if(h=i,"qop"===n.substr(i,3).toLowerCase()?(e=n.substr(i,3),i+=3):(e=null,0===o&&a('"qop"')),null!==e)if(null!==(t=M()))if(null!==(r=V())){if(d=i,null!==(s=tn())){for(l=[],f=i,44===n.charCodeAt(i)?(u=",",i++):(u=null,0===o&&a('","')),null!==u&&null!==(c=tn())?u=[u,c]:(u=null,i=f);null!==u;)l.push(u),f=i,44===n.charCodeAt(i)?(u=",",i++):(u=null,0===o&&a('","')),null!==u&&null!==(c=tn())?u=[u,c]:(u=null,i=f);null!==l?s=[s,l]:(s=null,i=d)}else s=null,i=d;null!==s&&null!==(l=B())?e=[e,t,r,s,l]:(e=null,i=h)}else e=null,i=h;else e=null,i=h;else e=null,i=h;return e}function tn(){var e,t,r;return t=i,"auth-int"===n.substr(i,8).toLowerCase()?(e=n.substr(i,8),i+=8):(e=null,0===o&&a('"auth-int"')),null===e&&("auth"===n.substr(i,4).toLowerCase()?(e=n.substr(i,4),i+=4):(e=null,0===o&&a('"auth"')),null===e&&(e=N())),null!==e&&(r=e,jn.qop||(jn.qop=[]),e=void jn.qop.push(r.toLowerCase())),null===e&&(i=t),e}function nn(){var e,t,n,r,s,o,l;if(s=i,o=i,null!==(e=mt())){for(t=[],l=i,null!==(n=G())&&null!==(r=St())?n=[n,r]:(n=null,i=l);null!==n;)t.push(n),l=i,null!==(n=G())&&null!==(r=St())?n=[n,r]:(n=null,i=l);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return null!==e&&(e=function(e){var t;jn.multi_header||(jn.multi_header=[]);try{t=new Fn(jn.uri,jn.display_name,jn.params),delete jn.uri,delete jn.display_name,delete jn.params}catch(e){t=null}jn.multi_header.push({possition:i,offset:e,parsed:t})}(s)),null===e&&(i=s),e}function rn(){var e;return null===(e=sn())&&(e=St()),e}function sn(){var e,t,r,s,l,u,c;if(l=i,u=i,"cause"===n.substr(i,5).toLowerCase()?(e=n.substr(i,5),i+=5):(e=null,0===o&&a('"cause"')),null!==e)if(null!==(t=M())){if(null!==(s=h()))for(r=[];null!==s;)r.push(s),s=h();else r=null;null!==r?e=[e,t,r]:(e=null,i=u)}else e=null,i=u;else e=null,i=u;return null!==e&&(c=e[2],e=void(jn.cause=parseInt(c.join("")))),null===e&&(i=l),e}function on(){var e,t,n,r,s,o;if(s=i,null!==(e=mt())){for(t=[],o=i,null!==(n=G())&&null!==(r=St())?n=[n,r]:(n=null,i=o);null!==n;)t.push(n),o=i,null!==(n=G())&&null!==(r=St())?n=[n,r]:(n=null,i=o);null!==t?e=[e,t]:(e=null,i=s)}else e=null,i=s;return e}function ln(){var e,t,r;return t=i,"active"===n.substr(i,6).toLowerCase()?(e=n.substr(i,6),i+=6):(e=null,0===o&&a('"active"')),null===e&&("pending"===n.substr(i,7).toLowerCase()?(e=n.substr(i,7),i+=7):(e=null,0===o&&a('"pending"')),null===e&&("terminated"===n.substr(i,10).toLowerCase()?(e=n.substr(i,10),i+=10):(e=null,0===o&&a('"terminated"')),null===e&&(e=N()))),null!==e&&(r=t,e=void(jn.state=n.substring(i,r))),null===e&&(i=t),e}function un(){var e,t,r,s,l,u,c,h;return s=i,l=i,"reason"===n.substr(i,6).toLowerCase()?(e=n.substr(i,6),i+=6):(e=null,0===o&&a('"reason"')),null!==e&&null!==(t=M())&&null!==(r=an())?e=[e,t,r]:(e=null,i=l),null!==e&&(e=void(void 0!==(u=e[2])&&(jn.reason=u))),null===e&&(i=s),null===e&&(s=i,l=i,"expires"===n.substr(i,7).toLowerCase()?(e=n.substr(i,7),i+=7):(e=null,0===o&&a('"expires"')),null!==e&&null!==(t=M())&&null!==(r=Ct())?e=[e,t,r]:(e=null,i=l),null!==e&&(e=void(void 0!==(h=e[2])&&(jn.expires=h))),null===e&&(i=s),null===e&&(s=i,l=i,"retry_after"===n.substr(i,11).toLowerCase()?(e=n.substr(i,11),i+=11):(e=null,0===o&&a('"retry_after"')),null!==e&&null!==(t=M())&&null!==(r=Ct())?e=[e,t,r]:(e=null,i=l),null!==e&&(e=void(void 0!==(c=e[2])&&(jn.retry_after=c))),null===e&&(i=s),null===e&&(e=St()))),e}function an(){var e;return"deactivated"===n.substr(i,11).toLowerCase()?(e=n.substr(i,11),i+=11):(e=null,0===o&&a('"deactivated"')),null===e&&("probation"===n.substr(i,9).toLowerCase()?(e=n.substr(i,9),i+=9):(e=null,0===o&&a('"probation"')),null===e&&("rejected"===n.substr(i,8).toLowerCase()?(e=n.substr(i,8),i+=8):(e=null,0===o&&a('"rejected"')),null===e&&("timeout"===n.substr(i,7).toLowerCase()?(e=n.substr(i,7),i+=7):(e=null,0===o&&a('"timeout"')),null===e&&("giveup"===n.substr(i,6).toLowerCase()?(e=n.substr(i,6),i+=6):(e=null,0===o&&a('"giveup"')),null===e&&("noresource"===n.substr(i,10).toLowerCase()?(e=n.substr(i,10),i+=10):(e=null,0===o&&a('"noresource"')),null===e&&("invariant"===n.substr(i,9).toLowerCase()?(e=n.substr(i,9),i+=9):(e=null,0===o&&a('"invariant"')),null===e&&(e=N()))))))),e}function cn(){var e;return null===(e=Ft())&&(e=St()),e}function hn(){var e,t,n,r,s,o,l,u;if(l=i,null!==(e=yn()))if(null!==(t=E()))if(null!==(n=bn())){for(r=[],u=i,null!==(s=G())&&null!==(o=dn())?s=[s,o]:(s=null,i=u);null!==s;)r.push(s),u=i,null!==(s=G())&&null!==(o=dn())?s=[s,o]:(s=null,i=u);null!==r?e=[e,t,n,r]:(e=null,i=l)}else e=null,i=l;else e=null,i=l;else e=null,i=l;return e}function dn(){var e;return null===(e=fn())&&null===(e=_n())&&null===(e=pn())&&null===(e=mn())&&null===(e=vn())&&(e=St()),e}function fn(){var e,t,r,s,l,u;return s=i,l=i,"ttl"===n.substr(i,3).toLowerCase()?(e=n.substr(i,3),i+=3):(e=null,0===o&&a('"ttl"')),null!==e&&null!==(t=M())&&null!==(r=An())?e=[e,t,r]:(e=null,i=l),null!==e&&(u=e[2],e=void(jn.ttl=u)),null===e&&(i=s),e}function _n(){var e,t,r,s,l,u;return s=i,l=i,"maddr"===n.substr(i,5).toLowerCase()?(e=n.substr(i,5),i+=5):(e=null,0===o&&a('"maddr"')),null!==e&&null!==(t=M())&&null!==(r=le())?e=[e,t,r]:(e=null,i=l),null!==e&&(u=e[2],e=void(jn.maddr=u)),null===e&&(i=s),e}function pn(){var e,t,r,s,l,u;return s=i,l=i,"received"===n.substr(i,8).toLowerCase()?(e=n.substr(i,8),i+=8):(e=null,0===o&&a('"received"')),null!==e&&null!==(t=M())?(null===(r=pe())&&(r=de()),null!==r?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(u=e[2],e=void(jn.received=u)),null===e&&(i=s),e}function mn(){var e,t,r,s,l,u;return s=i,l=i,"branch"===n.substr(i,6).toLowerCase()?(e=n.substr(i,6),i+=6):(e=null,0===o&&a('"branch"')),null!==e&&null!==(t=M())&&null!==(r=N())?e=[e,t,r]:(e=null,i=l),null!==e&&(u=e[2],e=void(jn.branch=u)),null===e&&(i=s),e}function vn(){var e,t,r,s,l;return s=i,"rport"===n.substr(i,5).toLowerCase()?(e=n.substr(i,5),i+=5):(e=null,0===o&&a('"rport"')),null!==e?(l=i,null!==(t=M())&&null!==(r=gn())?t=[t,r]:(t=null,i=l),null!==(t=null!==t?t:"")?e=[e,t]:(e=null,i=s)):(e=null,i=s),e}function gn(){var e,t,n,r,s,o,l,u;return o=i,l=i,null!==(e=null!==(e=h())?e:"")&&null!==(t=null!==(t=h())?t:"")&&null!==(n=null!==(n=h())?n:"")&&null!==(r=null!==(r=h())?r:"")&&null!==(s=null!==(s=h())?s:"")?e=[e,t,n,r,s]:(e=null,i=l),null!==e&&(u=e,e=void(jn.rport=parseInt(u.join("")))),null===e&&(i=o),e}function yn(){var e,t,n,r,s,o;return o=i,null!==(e=Tn())&&null!==(t=P())&&null!==(n=N())&&null!==(r=P())&&null!==(s=Cn())?e=[e,t,n,r,s]:(e=null,i=o),e}function Tn(){var e,t,r;return t=i,"sip"===n.substr(i,3).toLowerCase()?(e=n.substr(i,3),i+=3):(e=null,0===o&&a('"SIP"')),null===e&&(e=N()),null!==e&&(r=e,e=void(jn.protocol=r)),null===e&&(i=t),e}function Cn(){var e,t,r;return t=i,"udp"===n.substr(i,3).toLowerCase()?(e=n.substr(i,3),i+=3):(e=null,0===o&&a('"UDP"')),null===e&&("tcp"===n.substr(i,3).toLowerCase()?(e=n.substr(i,3),i+=3):(e=null,0===o&&a('"TCP"')),null===e&&("tls"===n.substr(i,3).toLowerCase()?(e=n.substr(i,3),i+=3):(e=null,0===o&&a('"TLS"')),null===e&&("sctp"===n.substr(i,4).toLowerCase()?(e=n.substr(i,4),i+=4):(e=null,0===o&&a('"SCTP"')),null===e&&(e=N())))),null!==e&&(r=e,e=void(jn.transport=r)),null===e&&(i=t),e}function bn(){var e,t,n,r,s;return r=i,null!==(e=Sn())?(s=i,null!==(t=W())&&null!==(n=En())?t=[t,n]:(t=null,i=s),null!==(t=null!==t?t:"")?e=[e,t]:(e=null,i=r)):(e=null,i=r),e}function Sn(){var e,t,r;return t=i,null===(e=pe())&&null===(e=he())&&(e=ue()),null!==e&&(r=t,e=void(jn.host=n.substring(i,r))),null===e&&(i=t),e}function En(){var e,t,n,r,s,o,l,u;return o=i,l=i,null!==(e=null!==(e=h())?e:"")&&null!==(t=null!==(t=h())?t:"")&&null!==(n=null!==(n=h())?n:"")&&null!==(r=null!==(r=h())?r:"")&&null!==(s=null!==(s=h())?s:"")?e=[e,t,n,r,s]:(e=null,i=l),null!==e&&(u=e,e=void(jn.port=parseInt(u.join("")))),null===e&&(i=o),e}function An(){var e,t,n,r,s;return r=i,s=i,null!==(e=h())&&null!==(t=null!==(t=h())?t:"")&&null!==(n=null!==(n=h())?n:"")?e=[e,t,n]:(e=null,i=s),null!==e&&(e=parseInt(e.join(""))),null===e&&(i=r),e}function Rn(){var e,t,n;return t=i,null!==(e=Ct())&&(n=e,e=void(jn.expires=n)),null===e&&(i=t),e}function wn(){var e;return null===(e=In())&&(e=St()),e}function In(){var e,t,r,s,l,u;return s=i,l=i,"refresher"===n.substr(i,9).toLowerCase()?(e=n.substr(i,9),i+=9):(e=null,0===o&&a('"refresher"')),null!==e&&null!==(t=M())?("uac"===n.substr(i,3).toLowerCase()?(r=n.substr(i,3),i+=3):(r=null,0===o&&a('"uac"')),null===r&&("uas"===n.substr(i,3).toLowerCase()?(r=n.substr(i,3),i+=3):(r=null,0===o&&a('"uas"'))),null!==r?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(u=e[2],e=void(jn.refresher=u.toLowerCase())),null===e&&(i=s),e}function On(){var e,t;for(e=[],null===(t=I())&&null===(t=k())&&(t=E());null!==t;)e.push(t),null===(t=I())&&null===(t=k())&&(t=E());return e}function kn(){var e,t,r,s,l,u,c,h,d,f,_,p;return f=i,_=i,null!==(e=Un())?(45===n.charCodeAt(i)?(t="-",i++):(t=null,0===o&&a('"-"')),null!==t&&null!==(r=Nn())?(45===n.charCodeAt(i)?(s="-",i++):(s=null,0===o&&a('"-"')),null!==s&&null!==(l=Nn())?(45===n.charCodeAt(i)?(u="-",i++):(u=null,0===o&&a('"-"')),null!==u&&null!==(c=Nn())?(45===n.charCodeAt(i)?(h="-",i++):(h=null,0===o&&a('"-"')),null!==h&&null!==(d=xn())?e=[e,t,r,s,l,u,c,h,d]:(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_),null!==e&&(p=f,e[0],e=void(jn=n.substring(i+5,p))),null===e&&(i=f),e}function Nn(){var e,t,n,r,s;return s=i,null!==(e=f())&&null!==(t=f())&&null!==(n=f())&&null!==(r=f())?e=[e,t,n,r]:(e=null,i=s),e}function Un(){var e,t,n;return n=i,null!==(e=Nn())&&null!==(t=Nn())?e=[e,t]:(e=null,i=n),e}function xn(){var e,t,n,r;return r=i,null!==(e=Nn())&&null!==(t=Nn())&&null!==(n=Nn())?e=[e,t,n]:(e=null,i=r),e}function Dn(){var e,t,r,s,l,u,c;return s=i,l=i,null!==(e=x())?(u=i,64===n.charCodeAt(i)?(t="@",i++):(t=null,0===o&&a('"@"')),null!==t&&null!==(r=x())?t=[t,r]:(t=null,i=u),null!==(t=null!==t?t:"")?e=[e,t]:(e=null,i=l)):(e=null,i=l),null!==e&&(c=s,e=void(jn.call_id=n.substring(i,c))),null===e&&(i=s),e}function Pn(){var e;return null===(e=Mn())&&null===(e=qn())&&null===(e=Ln())&&(e=St()),e}function Mn(){var e,t,r,s,l,u;return s=i,l=i,"to-tag"===n.substr(i,6)?(e="to-tag",i+=6):(e=null,0===o&&a('"to-tag"')),null!==e&&null!==(t=M())&&null!==(r=N())?e=[e,t,r]:(e=null,i=l),null!==e&&(u=e[2],e=void(jn.to_tag=u)),null===e&&(i=s),e}function qn(){var e,t,r,s,l,u;return s=i,l=i,"from-tag"===n.substr(i,8)?(e="from-tag",i+=8):(e=null,0===o&&a('"from-tag"')),null!==e&&null!==(t=M())&&null!==(r=N())?e=[e,t,r]:(e=null,i=l),null!==e&&(u=e[2],e=void(jn.from_tag=u)),null===e&&(i=s),e}function Ln(){var e,t;return t=i,"early-only"===n.substr(i,10)?(e="early-only",i+=10):(e=null,0===o&&a('"early-only"')),null!==e&&(e=void(jn.early_only=!0)),null===e&&(i=t),e}var Hn=e("./URI"),Fn=e("./NameAddrHeader"),jn={};if(null===s[r]()||i!==n.length){var Gn=Math.max(i,l),Wn=Gn2&&void 0!==arguments[2]?arguments[2]:{},s=e;if(void 0===e||void 0===t)throw new TypeError("Not enough arguments");if(!(e=this._ua.normalizeTarget(e)))throw new TypeError("Invalid target: ".concat(s));var i=d.cloneArray(r.extraHeaders),o=d.cloneObject(r.eventHandlers),l=r.contentType||"text/plain",u={};for(var a in r.fromUserName&&(u.from_uri=new p("sip",r.fromUserName,this._ua.configuration.uri.host),i.push("P-Preferred-Identity: ".concat(this._ua.configuration.uri.toString()))),r.fromDisplayName&&(u.from_display_name=r.fromDisplayName),o)Object.prototype.hasOwnProperty.call(o,a)&&this.on(a,o[a]);i.push("Content-Type: ".concat(l)),this._request=new h.OutgoingRequest(c.MESSAGE,e,this._ua,u,i),t&&(this._request.body=t);var _=new f(this._ua,this._request,{onRequestTimeout:function(){n._onRequestTimeout()},onTransportError:function(){n._onTransportError()},onReceiveResponse:function(e){n._receiveResponse(e)}});this._newMessage("local",this._request),_.send()}},{key:"init_incoming",value:function(e){this._request=e,this._newMessage("remote",e),this._is_replied||(this._is_replied=!0,e.reply(200)),this._close()}},{key:"accept",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=d.cloneArray(e.extraHeaders),n=e.body;if("incoming"!==this._direction)throw new _.NotSupportedError('"accept" not supported for outgoing Message');if(this._is_replied)throw new Error("incoming Message already replied");this._is_replied=!0,this._request.reply(200,null,t,n)}},{key:"reject",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.status_code||480,n=e.reason_phrase,r=d.cloneArray(e.extraHeaders),s=e.body;if("incoming"!==this._direction)throw new _.NotSupportedError('"reject" not supported for outgoing Message');if(this._is_replied)throw new Error("incoming Message already replied");if(t<300||t>=700)throw new TypeError("Invalid status_code: ".concat(t));this._is_replied=!0,this._request.reply(t,n,r,s)}},{key:"_receiveResponse",value:function(e){if(!this._closed)switch(!0){case/^1[0-9]{2}$/.test(e.status_code):break;case/^2[0-9]{2}$/.test(e.status_code):this._succeeded("remote",e);break;default:var t=d.sipErrorCause(e.status_code);this._failed("remote",e,t)}}},{key:"_onRequestTimeout",value:function(){this._closed||this._failed("system",null,c.causes.REQUEST_TIMEOUT)}},{key:"_onTransportError",value:function(){this._closed||this._failed("system",null,c.causes.CONNECTION_ERROR)}},{key:"_close",value:function(){this._closed=!0,this._ua.destroyMessage(this)}},{key:"_newMessage",value:function(e,t){"remote"===e?(this._direction="incoming",this._local_identity=t.to,this._remote_identity=t.from):"local"===e&&(this._direction="outgoing",this._local_identity=t.from,this._remote_identity=t.to),this._ua.newMessage(this,{originator:e,message:this,request:t})}},{key:"_failed",value:function(e,t,n){m.debug("MESSAGE failed"),this._close(),m.debug('emit "failed"'),this.emit("failed",{originator:e,response:t||null,cause:n})}},{key:"_succeeded",value:function(e,t){m.debug("MESSAGE succeeded"),this._close(),m.debug('emit "succeeded"'),this.emit("succeeded",{originator:e,response:t})}},{key:"direction",get:function(){return this._direction}},{key:"local_identity",get:function(){return this._local_identity}},{key:"remote_identity",get:function(){return this._remote_identity}}])&&s(t.prototype,n),r&&s(t,r),a}()},{"./Constants":2,"./Exceptions":6,"./Logger":9,"./RequestSender":20,"./SIPMessage":21,"./URI":27,"./Utils":28,events:31}],11:[function(e,t,n){"use strict";function r(e,t){for(var n=0;n"),this._parameters)Object.prototype.hasOwnProperty.call(this._parameters,t)&&(e+=";".concat(t),null!==this._parameters[t]&&(e+="=".concat(this._parameters[t])));return e}},{key:"uri",get:function(){return this._uri}},{key:"display_name",get:function(){return this._display_name},set:function(e){this._display_name=0===e?"0":e}}]),e}()},{"./Grammar":7,"./URI":27}],12:[function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},s=e;if(void 0===e)throw new TypeError("A target is required for OPTIONS");if(!(e=this._ua.normalizeTarget(e)))throw new TypeError("Invalid target: ".concat(s));var i=d.cloneArray(r.extraHeaders),o=d.cloneObject(r.eventHandlers),l=r.contentType||"application/sdp";for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&this.on(u,o[u]);i.push("Content-Type: ".concat(l)),this._request=new h.OutgoingRequest(c.OPTIONS,e,this._ua,null,i),t&&(this._request.body=t);var a=new f(this._ua,this._request,{onRequestTimeout:function(){n._onRequestTimeout()},onTransportError:function(){n._onTransportError()},onReceiveResponse:function(e){n._receiveResponse(e)}});this._newOptions("local",this._request),a.send()}},{key:"init_incoming",value:function(e){this._request=e,this._newOptions("remote",e),this._is_replied||(this._is_replied=!0,e.reply(200)),this._close()}},{key:"accept",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=d.cloneArray(e.extraHeaders),n=e.body;if("incoming"!==this._direction)throw new _.NotSupportedError('"accept" not supported for outgoing Options');if(this._is_replied)throw new Error("incoming Options already replied");this._is_replied=!0,this._request.reply(200,null,t,n)}},{key:"reject",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.status_code||480,n=e.reason_phrase,r=d.cloneArray(e.extraHeaders),s=e.body;if("incoming"!==this._direction)throw new _.NotSupportedError('"reject" not supported for outgoing Options');if(this._is_replied)throw new Error("incoming Options already replied");if(t<300||t>=700)throw new TypeError("Invalid status_code: ".concat(t));this._is_replied=!0,this._request.reply(t,n,r,s)}},{key:"_receiveResponse",value:function(e){if(!this._closed)switch(!0){case/^1[0-9]{2}$/.test(e.status_code):break;case/^2[0-9]{2}$/.test(e.status_code):this._succeeded("remote",e);break;default:var t=d.sipErrorCause(e.status_code);this._failed("remote",e,t)}}},{key:"_onRequestTimeout",value:function(){this._closed||this._failed("system",null,c.causes.REQUEST_TIMEOUT)}},{key:"_onTransportError",value:function(){this._closed||this._failed("system",null,c.causes.CONNECTION_ERROR)}},{key:"_close",value:function(){this._closed=!0,this._ua.destroyMessage(this)}},{key:"_newOptions",value:function(e,t){"remote"===e?(this._direction="incoming",this._local_identity=t.to,this._remote_identity=t.from):"local"===e&&(this._direction="outgoing",this._local_identity=t.from,this._remote_identity=t.to),this._ua.newOptions(this,{originator:e,message:this,request:t})}},{key:"_failed",value:function(e,t,n){p.debug("OPTIONS failed"),this._close(),p.debug('emit "failed"'),this.emit("failed",{originator:e,response:t||null,cause:n})}},{key:"_succeeded",value:function(e,t){p.debug("OPTIONS succeeded"),this._close(),p.debug('emit "succeeded"'),this.emit("succeeded",{originator:e,response:t})}},{key:"direction",get:function(){return this._direction}},{key:"local_identity",get:function(){return this._local_identity}},{key:"remote_identity",get:function(){return this._remote_identity}}])&&s(t.prototype,n),r&&s(t,r),a}()},{"./Constants":2,"./Exceptions":6,"./Logger":9,"./RequestSender":20,"./SIPMessage":21,"./Utils":28,events:31}],13:[function(e,t,n){"use strict";function r(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return l=e.done,e},e:function(e){u=!0,o=e},f:function(){try{l||null==n.return||n.return()}finally{if(u)throw o}}}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return l=e.done,e},e:function(e){u=!0,o=e},f:function(){try{l||null==n.return||n.return()}finally{if(u)throw o}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;w.debug("connect()");var r=e,s=v.cloneObject(t.eventHandlers),i=v.cloneArray(t.extraHeaders),o=v.cloneObject(t.mediaConstraints,{audio:!0,video:!0}),l=t.mediaStream||null,u=v.cloneObject(t.pcConfig,{iceServers:[]}),a=t.rtcConstraints||null,c=t.rtcOfferConstraints||null;if(this._rtcOfferConstraints=c,this._rtcAnswerConstraints=t.rtcAnswerConstraints||null,this._data=t.data||this._data,void 0===e)throw new TypeError("Not enough arguments");if(this._status!==I.STATUS_NULL)throw new p.InvalidStateError(this._status);if(!window.RTCPeerConnection)throw new p.NotSupportedError("WebRTC not supported");if(!(e=this._ua.normalizeTarget(e)))throw new TypeError("Invalid target: ".concat(r));for(var h in this._sessionTimers.enabled&&v.isDecimal(t.sessionTimersExpires)&&(t.sessionTimersExpires>=_.MIN_SESSION_EXPIRES?this._sessionTimers.defaultExpires=t.sessionTimersExpires:this._sessionTimers.defaultExpires=_.SESSION_EXPIRES),s)Object.prototype.hasOwnProperty.call(s,h)&&this.on(h,s[h]);this._from_tag=v.newTag();var d=t.anonymous||!1,f={from_tag:this._from_tag};this._contact=this._ua.contact.toString({anonymous:d,outbound:!0}),d?(f.from_display_name="Anonymous",f.from_uri=new R("sip","anonymous","anonymous.invalid"),i.push("P-Preferred-Identity: ".concat(this._ua.configuration.uri.toString())),i.push("Privacy: id")):t.fromUserName&&(f.from_uri=new R("sip",t.fromUserName,this._ua.configuration.uri.host),i.push("P-Preferred-Identity: ".concat(this._ua.configuration.uri.toString()))),t.fromDisplayName&&(f.from_display_name=t.fromDisplayName),i.push("Contact: ".concat(this._contact)),i.push("Content-Type: application/sdp"),this._sessionTimers.enabled&&i.push("Session-Expires: ".concat(this._sessionTimers.defaultExpires).concat(this._ua.configuration.session_timers_force_refresher?";refresher=uac":"")),this._request=new y.InitialOutgoingInviteRequest(e,this._ua,f,i),this._id=this._request.call_id+this._from_tag,this._createRTCConnection(u,a),this._direction="outgoing",this._local_identity=this._request.from,this._remote_identity=this._request.to,n&&n(this),this._newRTCSession("local",this._request),this._sendInitialRequest(o,c,l)}},{key:"init_incoming",value:function(e,t){var n,r=this;w.debug("init_incoming()");var s=e.hasHeader("Content-Type")?e.getHeader("Content-Type").toLowerCase():void 0;e.body&&"application/sdp"!==s?e.reply(415):(this._status=I.STATUS_INVITE_RECEIVED,this._from_tag=e.from_tag,this._id=e.call_id+this._from_tag,this._request=e,this._contact=this._ua.contact.toString(),e.hasHeader("expires")&&(n=1e3*e.getHeader("expires")),e.to_tag=v.newTag(),this._createDialog(e,"UAS",!0)?(e.body?this._late_sdp=!1:this._late_sdp=!0,this._status=I.STATUS_WAITING_FOR_ANSWER,this._timers.userNoAnswerTimer=setTimeout(function(){e.reply(408),r._failed("local",null,_.causes.NO_ANSWER)},this._ua.configuration.no_answer_timeout),n&&(this._timers.expiresTimer=setTimeout(function(){r._status===I.STATUS_WAITING_FOR_ANSWER&&(e.reply(487),r._failed("system",null,_.causes.EXPIRES))},n)),this._direction="incoming",this._local_identity=e.to,this._remote_identity=e.from,t&&t(this),this._newRTCSession("remote",e),this._status!==I.STATUS_TERMINATED&&(e.reply(180,null,["Contact: ".concat(this._contact)]),this._progress("local",null))):e.reply(500,"Missing Contact header field"))}},{key:"answer",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};w.debug("answer()");var n=this._request,r=v.cloneArray(t.extraHeaders),i=v.cloneObject(t.mediaConstraints),o=t.mediaStream||null,l=v.cloneObject(t.pcConfig,{iceServers:[]}),u=t.rtcConstraints||null,a=t.rtcAnswerConstraints||null,c=v.cloneObject(t.rtcOfferConstraints),h=!1,d=!1,f=!1,m=!1;if(this._rtcAnswerConstraints=a,this._rtcOfferConstraints=t.rtcOfferConstraints||null,this._data=t.data||this._data,"incoming"!==this._direction)throw new p.NotSupportedError('"answer" not supported for outgoing RTCSession');if(this._status!==I.STATUS_WAITING_FOR_ANSWER)throw new p.InvalidStateError(this._status);if(this._sessionTimers.enabled&&v.isDecimal(t.sessionTimersExpires)&&(t.sessionTimersExpires>=_.MIN_SESSION_EXPIRES?this._sessionTimers.defaultExpires=t.sessionTimersExpires:this._sessionTimers.defaultExpires=_.SESSION_EXPIRES),this._status=I.STATUS_ANSWERED,this._createDialog(n,"UAS")){clearTimeout(this._timers.userNoAnswerTimer),r.unshift("Contact: ".concat(this._contact));var g=n.parseSDP();Array.isArray(g.media)||(g.media=[g.media]);var y,T=s(g.media);try{for(T.s();!(y=T.n()).done;){var C=y.value;"audio"===C.type&&(h=!0,C.direction&&"sendrecv"!==C.direction||(f=!0)),"video"===C.type&&(d=!0,C.direction&&"sendrecv"!==C.direction||(m=!0))}}catch(e){T.e(e)}finally{T.f()}if(o&&!1===i.audio){var b,S=s(o.getAudioTracks());try{for(S.s();!(b=S.n()).done;){var E=b.value;o.removeTrack(E)}}catch(e){S.e(e)}finally{S.f()}}if(o&&!1===i.video){var A,R=s(o.getVideoTracks());try{for(R.s();!(A=R.n()).done;){var O=A.value;o.removeTrack(O)}}catch(e){R.e(e)}finally{R.f()}}o||void 0!==i.audio||(i.audio=f),o||void 0!==i.video||(i.video=m),o||h||c.offerToReceiveAudio||(i.audio=!1),o||d||c.offerToReceiveVideo||(i.video=!1),this._createRTCConnection(l,u),Promise.resolve().then(function(){return o||(i.audio||i.video?(e._localMediaStreamLocallyGenerated=!0,navigator.mediaDevices.getUserMedia(i).catch(function(t){if(e._status===I.STATUS_TERMINATED)throw new Error("terminated");throw n.reply(480),e._failed("local",null,_.causes.USER_DENIED_MEDIA_ACCESS),w.warn('emit "getusermediafailed" [error:%o]',t),e.emit("getusermediafailed",t),new Error("getUserMedia() failed")})):void 0)}).then(function(t){if(e._status===I.STATUS_TERMINATED)throw new Error("terminated");e._localMediaStream=t,t&&t.getTracks().forEach(function(n){e._connection.addTrack(n,t)})}).then(function(){if(!e._late_sdp){var t={originator:"remote",type:"offer",sdp:n.body};w.debug('emit "sdp"'),e.emit("sdp",t);var r=new RTCSessionDescription({type:"offer",sdp:t.sdp});return e._connectionPromiseQueue=e._connectionPromiseQueue.then(function(){return e._connection.setRemoteDescription(r)}).catch(function(t){throw n.reply(488),e._failed("system",null,_.causes.WEBRTC_ERROR),w.warn('emit "peerconnection:setremotedescriptionfailed" [error:%o]',t),e.emit("peerconnection:setremotedescriptionfailed",t),new Error("peerconnection.setRemoteDescription() failed")}),e._connectionPromiseQueue}}).then(function(){if(e._status===I.STATUS_TERMINATED)throw new Error("terminated");return e._connecting(n),e._late_sdp?e._createLocalDescription("offer",e._rtcOfferConstraints).catch(function(){throw n.reply(500),new Error("_createLocalDescription() failed")}):e._createLocalDescription("answer",a).catch(function(){throw n.reply(500),new Error("_createLocalDescription() failed")})}).then(function(t){if(e._status===I.STATUS_TERMINATED)throw new Error("terminated");e._handleSessionTimersInIncomingRequest(n,r),n.reply(200,null,r,t,function(){e._status=I.STATUS_WAITING_FOR_ACK,e._setInvite2xxTimer(n,t),e._setACKTimer(),e._accepted("local")},function(){e._failed("system",null,_.causes.CONNECTION_ERROR)})}).catch(function(t){e._status!==I.STATUS_TERMINATED&&w.warn(t)})}else n.reply(500,"Error creating dialog")}},{key:"terminate",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};w.debug("terminate()");var n,r=t.cause||_.causes.BYE,s=v.cloneArray(t.extraHeaders),i=t.body,o=t.status_code,l=t.reason_phrase;if(this._status===I.STATUS_TERMINATED)throw new p.InvalidStateError(this._status);switch(this._status){case I.STATUS_NULL:case I.STATUS_INVITE_SENT:case I.STATUS_1XX_RECEIVED:if(w.debug("canceling session"),o&&(o<200||o>=700))throw new TypeError("Invalid status_code: ".concat(o));o&&(l=l||_.REASON_PHRASE[o]||"",n="SIP ;cause=".concat(o,' ;text="').concat(l,'"')),this._status===I.STATUS_NULL||this._status===I.STATUS_INVITE_SENT?(this._is_canceled=!0,this._cancel_reason=n):this._status===I.STATUS_1XX_RECEIVED&&this._request.cancel(n),this._status=I.STATUS_CANCELED,this._failed("local",null,_.causes.CANCELED);break;case I.STATUS_WAITING_FOR_ANSWER:case I.STATUS_ANSWERED:if(w.debug("rejecting session"),(o=o||480)<300||o>=700)throw new TypeError("Invalid status_code: ".concat(o));this._request.reply(o,l,s,i),this._failed("local",null,_.causes.REJECTED);break;case I.STATUS_WAITING_FOR_ACK:case I.STATUS_CONFIRMED:if(w.debug("terminating session"),l=t.reason_phrase||_.REASON_PHRASE[o]||"",o&&(o<200||o>=700))throw new TypeError("Invalid status_code: ".concat(o));if(o&&s.push("Reason: SIP ;cause=".concat(o,'; text="').concat(l,'"')),this._status===I.STATUS_WAITING_FOR_ACK&&"incoming"===this._direction&&this._request.server_transaction.state!==m.C.STATUS_TERMINATED){var u=this._dialog;this.receiveRequest=function(t){t.method===_.ACK&&(e.sendRequest(_.BYE,{extraHeaders:s,body:i}),u.terminate())},this._request.server_transaction.on("stateChanged",function(){e._request.server_transaction.state===m.C.STATUS_TERMINATED&&(e.sendRequest(_.BYE,{extraHeaders:s,body:i}),u.terminate())}),this._ended("local",null,r),this._dialog=u,this._ua.newDialog(u)}else this.sendRequest(_.BYE,{extraHeaders:s,body:i}),this._ended("local",null,r)}}},{key:"sendDTMF",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};w.debug("sendDTMF() | tones: %s",e);var n=0,r=t.duration||null,s=t.interToneGap||null,i=t.transportType||_.DTMF_TRANSPORT.INFO;if(void 0===e)throw new TypeError("Not enough arguments");if(this._status!==I.STATUS_CONFIRMED&&this._status!==I.STATUS_WAITING_FOR_ACK&&this._status!==I.STATUS_1XX_RECEIVED)throw new p.InvalidStateError(this._status);if(i!==_.DTMF_TRANSPORT.INFO&&i!==_.DTMF_TRANSPORT.RFC2833)throw new TypeError("invalid transportType: ".concat(i));if("number"==typeof e&&(e=e.toString()),!e||"string"!=typeof e||!e.match(/^[0-9A-DR#*,]+$/i))throw new TypeError("Invalid tones: ".concat(e));if(r&&!v.isDecimal(r))throw new TypeError("Invalid tone duration: ".concat(r));if(r?rb.C.MAX_DURATION?(w.debug('"duration" value is greater than the maximum allowed, setting it to '.concat(b.C.MAX_DURATION," milliseconds")),r=b.C.MAX_DURATION):r=Math.abs(r):r=b.C.DEFAULT_DURATION,t.duration=r,s&&!v.isDecimal(s))throw new TypeError("Invalid interToneGap: ".concat(s));if(s?s=this._tones.length)return void(this._tones=null);var l=this._tones[n];n+=1;if(","===l)o=2e3;else{var u=new b(this);t.eventHandlers={onFailed:function(){i._tones=null}},u.send(l,t),o=r+s}setTimeout(e.bind(this),o)}.call(this));else{var o=this._getDTMFRTPSender();o&&(e=o.toneBuffer+e,o.insertDTMF(e,r,s))}}},{key:"sendInfo",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(w.debug("sendInfo()"),this._status!==I.STATUS_CONFIRMED&&this._status!==I.STATUS_WAITING_FOR_ACK&&this._status!==I.STATUS_1XX_RECEIVED)throw new p.InvalidStateError(this._status);new S(this).send(e,t,n)}},{key:"mute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{audio:!0,video:!1};w.debug("mute()");var t=!1,n=!1;!1===this._audioMuted&&e.audio&&(t=!0,this._audioMuted=!0,this._toggleMuteAudio(!0)),!1===this._videoMuted&&e.video&&(n=!0,this._videoMuted=!0,this._toggleMuteVideo(!0)),!0!==t&&!0!==n||this._onmute({audio:t,video:n})}},{key:"unmute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{audio:!0,video:!0};w.debug("unmute()");var t=!1,n=!1;!0===this._audioMuted&&e.audio&&(t=!0,this._audioMuted=!1,!1===this._localHold&&this._toggleMuteAudio(!1)),!0===this._videoMuted&&e.video&&(n=!0,this._videoMuted=!1,!1===this._localHold&&this._toggleMuteVideo(!1)),!0!==t&&!0!==n||this._onunmute({audio:t,video:n})}},{key:"hold",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(w.debug("hold()"),this._status!==I.STATUS_WAITING_FOR_ACK&&this._status!==I.STATUS_CONFIRMED)return!1;if(!0===this._localHold)return!1;if(!this._isReadyToReOffer())return!1;this._localHold=!0,this._onhold("local");var r={succeeded:function(){n&&n()},failed:function(){e.terminate({cause:_.causes.WEBRTC_ERROR,status_code:500,reason_phrase:"Hold Failed"})}};return t.useUpdate?this._sendUpdate({sdpOffer:!0,eventHandlers:r,extraHeaders:t.extraHeaders}):this._sendReinvite({eventHandlers:r,extraHeaders:t.extraHeaders}),!0}},{key:"unhold",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(w.debug("unhold()"),this._status!==I.STATUS_WAITING_FOR_ACK&&this._status!==I.STATUS_CONFIRMED)return!1;if(!1===this._localHold)return!1;if(!this._isReadyToReOffer())return!1;this._localHold=!1,this._onunhold("local");var r={succeeded:function(){n&&n()},failed:function(){e.terminate({cause:_.causes.WEBRTC_ERROR,status_code:500,reason_phrase:"Unhold Failed"})}};return t.useUpdate?this._sendUpdate({sdpOffer:!0,eventHandlers:r,extraHeaders:t.extraHeaders}):this._sendReinvite({eventHandlers:r,extraHeaders:t.extraHeaders}),!0}},{key:"renegotiate",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;w.debug("renegotiate()");var r=t.rtcOfferConstraints||null;if(this._status!==I.STATUS_WAITING_FOR_ACK&&this._status!==I.STATUS_CONFIRMED)return!1;if(!this._isReadyToReOffer())return!1;var s={succeeded:function(){n&&n()},failed:function(){e.terminate({cause:_.causes.WEBRTC_ERROR,status_code:500,reason_phrase:"Media Renegotiation Failed"})}};return this._setLocalMediaStatus(),t.useUpdate?this._sendUpdate({sdpOffer:!0,eventHandlers:s,rtcOfferConstraints:r,extraHeaders:t.extraHeaders}):this._sendReinvite({eventHandlers:s,rtcOfferConstraints:r,extraHeaders:t.extraHeaders}),!0}},{key:"refer",value:function(e,t){var n=this;w.debug("refer()");var r=e;if(this._status!==I.STATUS_WAITING_FOR_ACK&&this._status!==I.STATUS_CONFIRMED)return!1;if(!(e=this._ua.normalizeTarget(e)))throw new TypeError("Invalid target: ".concat(r));var s=new A(this);s.sendRefer(e,t);var i=s.id;return this._referSubscribers[i]=s,s.on("requestFailed",function(){delete n._referSubscribers[i]}),s.on("accepted",function(){delete n._referSubscribers[i]}),s.on("failed",function(){delete n._referSubscribers[i]}),s}},{key:"sendRequest",value:function(e,t){return w.debug("sendRequest()"),this._dialog.sendRequest(e,t)}},{key:"receiveRequest",value:function(e){var t=this;if(w.debug("receiveRequest()"),e.method===_.CANCEL)this._status!==I.STATUS_WAITING_FOR_ANSWER&&this._status!==I.STATUS_ANSWERED||(this._status=I.STATUS_CANCELED,this._request.reply(487),this._failed("remote",e,_.causes.CANCELED));else switch(e.method){case _.ACK:if(this._status!==I.STATUS_WAITING_FOR_ACK)return;if(this._status=I.STATUS_CONFIRMED,clearTimeout(this._timers.ackTimer),clearTimeout(this._timers.invite2xxTimer),this._late_sdp){if(!e.body){this.terminate({cause:_.causes.MISSING_SDP,status_code:400});break}var n={originator:"remote",type:"answer",sdp:e.body};w.debug('emit "sdp"'),this.emit("sdp",n);var r=new RTCSessionDescription({type:"answer",sdp:n.sdp});this._connectionPromiseQueue=this._connectionPromiseQueue.then(function(){return t._connection.setRemoteDescription(r)}).then(function(){t._is_confirmed||t._confirmed("remote",e)}).catch(function(e){t.terminate({cause:_.causes.BAD_MEDIA_DESCRIPTION,status_code:488}),w.warn('emit "peerconnection:setremotedescriptionfailed" [error:%o]',e),t.emit("peerconnection:setremotedescriptionfailed",e)})}else this._is_confirmed||this._confirmed("remote",e);break;case _.BYE:this._status===I.STATUS_CONFIRMED||this._status===I.STATUS_WAITING_FOR_ACK?(e.reply(200),this._ended("remote",e,_.causes.BYE)):this._status===I.STATUS_INVITE_RECEIVED||this._status===I.STATUS_WAITING_FOR_ANSWER?(e.reply(200),this._request.reply(487,"BYE Received"),this._ended("remote",e,_.causes.BYE)):e.reply(403,"Wrong Status");break;case _.INVITE:this._status===I.STATUS_CONFIRMED?e.hasHeader("replaces")?this._receiveReplaces(e):this._receiveReinvite(e):e.reply(403,"Wrong Status");break;case _.INFO:if(this._status===I.STATUS_1XX_RECEIVED||this._status===I.STATUS_WAITING_FOR_ANSWER||this._status===I.STATUS_ANSWERED||this._status===I.STATUS_WAITING_FOR_ACK||this._status===I.STATUS_CONFIRMED){var s=e.hasHeader("Content-Type")?e.getHeader("Content-Type").toLowerCase():void 0;s&&s.match(/^application\/dtmf-relay/i)?new b(this).init_incoming(e):void 0!==s?new S(this).init_incoming(e):e.reply(415)}else e.reply(403,"Wrong Status");break;case _.UPDATE:this._status===I.STATUS_CONFIRMED?this._receiveUpdate(e):e.reply(403,"Wrong Status");break;case _.REFER:this._status===I.STATUS_CONFIRMED?this._receiveRefer(e):e.reply(403,"Wrong Status");break;case _.NOTIFY:this._status===I.STATUS_CONFIRMED?this._receiveNotify(e):e.reply(403,"Wrong Status");break;default:e.reply(501)}}},{key:"onTransportError",value:function(){w.warn("onTransportError()"),this._status!==I.STATUS_TERMINATED&&this.terminate({status_code:500,reason_phrase:_.causes.CONNECTION_ERROR,cause:_.causes.CONNECTION_ERROR})}},{key:"onRequestTimeout",value:function(){w.warn("onRequestTimeout()"),this._status!==I.STATUS_TERMINATED&&this.terminate({status_code:408,reason_phrase:_.causes.REQUEST_TIMEOUT,cause:_.causes.REQUEST_TIMEOUT})}},{key:"onDialogError",value:function(){w.warn("onDialogError()"),this._status!==I.STATUS_TERMINATED&&this.terminate({status_code:500,reason_phrase:_.causes.DIALOG_ERROR,cause:_.causes.DIALOG_ERROR})}},{key:"newDTMF",value:function(e){w.debug("newDTMF()"),this.emit("newDTMF",e)}},{key:"newInfo",value:function(e){w.debug("newInfo()"),this.emit("newInfo",e)}},{key:"_isReadyToReOffer",value:function(){return this._rtcReady?this._dialog?!0!==this._dialog.uac_pending_reply&&!0!==this._dialog.uas_pending_reply||(w.debug("_isReadyToReOffer() | there is another INVITE/UPDATE transaction in progress"),!1):(w.debug("_isReadyToReOffer() | session not established yet"),!1):(w.debug("_isReadyToReOffer() | internal WebRTC status not ready"),!1)}},{key:"_close",value:function(){if(w.debug("close()"),this._localMediaStream&&this._localMediaStreamLocallyGenerated&&(w.debug("close() | closing local MediaStream"),v.closeMediaStream(this._localMediaStream)),this._status!==I.STATUS_TERMINATED){if(this._status=I.STATUS_TERMINATED,this._connection)try{this._connection.close()}catch(e){w.warn("close() | error closing the RTCPeerConnection: %o",e)}for(var e in this._timers)Object.prototype.hasOwnProperty.call(this._timers,e)&&clearTimeout(this._timers[e]);for(var t in clearTimeout(this._sessionTimers.timer),this._dialog&&(this._dialog.terminate(),delete this._dialog),this._earlyDialogs)Object.prototype.hasOwnProperty.call(this._earlyDialogs,t)&&(this._earlyDialogs[t].terminate(),delete this._earlyDialogs[t]);for(var n in this._referSubscribers)Object.prototype.hasOwnProperty.call(this._referSubscribers,n)&&delete this._referSubscribers[n];this._ua.destroyRTCSession(this)}}},{key:"_setInvite2xxTimer",value:function(e,t){var n=g.T1;this._timers.invite2xxTimer=setTimeout(function r(){this._status===I.STATUS_WAITING_FOR_ACK&&(e.reply(200,null,["Contact: ".concat(this._contact)],t),ng.T2&&(n=g.T2),this._timers.invite2xxTimer=setTimeout(r.bind(this),n))}.bind(this),n)}},{key:"_setACKTimer",value:function(){var e=this;this._timers.ackTimer=setTimeout(function(){e._status===I.STATUS_WAITING_FOR_ACK&&(w.debug("no ACK received, terminating the session"),clearTimeout(e._timers.invite2xxTimer),e.sendRequest(_.BYE),e._ended("remote",null,_.causes.NO_ACK))},g.TIMER_H)}},{key:"_createRTCConnection",value:function(e,t){var n=this;this._connection=new RTCPeerConnection(e,t),this._connection.addEventListener("iceconnectionstatechange",function(){"failed"===n._connection.iceConnectionState&&n.terminate({cause:_.causes.RTP_TIMEOUT,status_code:408,reason_phrase:_.causes.RTP_TIMEOUT})}),w.debug('emit "peerconnection"'),this.emit("peerconnection",{peerconnection:this._connection})}},{key:"_createLocalDescription",value:function(e,t){var n=this;if(w.debug("createLocalDescription()"),"offer"!==e&&"answer"!==e)throw new Error('createLocalDescription() | invalid type "'.concat(e,'"'));var r=this._connection;return this._rtcReady=!1,Promise.resolve().then(function(){return"offer"===e?r.createOffer(t).catch(function(e){return w.warn('emit "peerconnection:createofferfailed" [error:%o]',e),n.emit("peerconnection:createofferfailed",e),Promise.reject(e)}):r.createAnswer(t).catch(function(e){return w.warn('emit "peerconnection:createanswerfailed" [error:%o]',e),n.emit("peerconnection:createanswerfailed",e),Promise.reject(e)})}).then(function(e){return r.setLocalDescription(e).catch(function(e){return n._rtcReady=!0,w.warn('emit "peerconnection:setlocaldescriptionfailed" [error:%o]',e),n.emit("peerconnection:setlocaldescriptionfailed",e),Promise.reject(e)})}).then(function(){var s=t&&t.iceRestart;if("complete"===r.iceGatheringState&&!s||"gathering"===r.iceGatheringState&&n._iceReady){n._rtcReady=!0;var i={originator:"local",type:e,sdp:r.localDescription.sdp};return w.debug('emit "sdp"'),n.emit("sdp",i),Promise.resolve(i.sdp)}return new Promise(function(t){var s,i,o=!1;n._iceReady=!1;var l=function(){if(!o){r.removeEventListener("icecandidate",s),r.removeEventListener("icegatheringstatechange",i),o=!0,n._rtcReady=!0,n._iceReady=!0;var l={originator:"local",type:e,sdp:r.localDescription.sdp};w.debug('emit "sdp"'),n.emit("sdp",l),t(l.sdp)}};r.addEventListener("icecandidate",s=function(e){var t=e.candidate;t?n.emit("icecandidate",{candidate:t,ready:l}):l()}),r.addEventListener("icegatheringstatechange",i=function(){"complete"===r.iceGatheringState&&l()})})})}},{key:"_createDialog",value:function(e,t,n){var r="UAS"===t?e.to_tag:e.from_tag,s="UAS"===t?e.from_tag:e.to_tag,i=e.call_id+r+s,o=this._earlyDialogs[i];if(n)return!!o||((o=new T(this,e,t,T.C.STATUS_EARLY)).error?(w.debug(o.error),this._failed("remote",e,_.causes.INTERNAL_ERROR),!1):(this._earlyDialogs[i]=o,!0));if(this._from_tag=e.from_tag,this._to_tag=e.to_tag,o)return o.update(e,t),this._dialog=o,delete this._earlyDialogs[i],!0;var l=new T(this,e,t);return l.error?(w.debug(l.error),this._failed("remote",e,_.causes.INTERNAL_ERROR),!1):(this._dialog=l,!0)}},{key:"_receiveReinvite",value:function(e){var t=this;w.debug("receiveReinvite()");var n=e.hasHeader("Content-Type")?e.getHeader("Content-Type").toLowerCase():void 0,r={request:e,callback:void 0,reject:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s=!0;var n=t.status_code||403,r=t.reason_phrase||"",i=v.cloneArray(t.extraHeaders);if(this._status!==I.STATUS_CONFIRMED)return!1;if(n<300||n>=700)throw new TypeError("Invalid status_code: ".concat(n));e.reply(n,r,i)}.bind(this)},s=!1;if(this.emit("reinvite",r),!s){if(this._late_sdp=!1,!e.body)return this._late_sdp=!0,this._remoteHold&&(this._remoteHold=!1,this._onunhold("remote")),void(this._connectionPromiseQueue=this._connectionPromiseQueue.then(function(){return t._createLocalDescription("offer",t._rtcOfferConstraints)}).then(function(e){i.call(t,e)}).catch(function(){e.reply(500)}));if("application/sdp"!==n)return w.debug("invalid Content-Type"),void e.reply(415);this._processInDialogSdpOffer(e).then(function(e){t._status!==I.STATUS_TERMINATED&&i.call(t,e)}).catch(function(e){w.warn(e)})}function i(t){var n=this,s=["Contact: ".concat(this._contact)];this._handleSessionTimersInIncomingRequest(e,s),this._late_sdp&&(t=this._mangleOffer(t)),e.reply(200,null,s,t,function(){n._status=I.STATUS_WAITING_FOR_ACK,n._setInvite2xxTimer(e,t),n._setACKTimer()}),"function"==typeof r.callback&&r.callback()}}},{key:"_receiveUpdate",value:function(e){var t=this;w.debug("receiveUpdate()");var n=e.hasHeader("Content-Type")?e.getHeader("Content-Type").toLowerCase():void 0,r={request:e,callback:void 0,reject:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s=!0;var n=t.status_code||403,r=t.reason_phrase||"",i=v.cloneArray(t.extraHeaders);if(this._status!==I.STATUS_CONFIRMED)return!1;if(n<300||n>=700)throw new TypeError("Invalid status_code: ".concat(n));e.reply(n,r,i)}.bind(this)},s=!1;if(this.emit("update",r),!s)if(e.body){if("application/sdp"!==n)return w.debug("invalid Content-Type"),void e.reply(415);this._processInDialogSdpOffer(e).then(function(e){t._status!==I.STATUS_TERMINATED&&i.call(t,e)}).catch(function(e){w.warn(e)})}else i.call(this,null);function i(t){var n=["Contact: ".concat(this._contact)];this._handleSessionTimersInIncomingRequest(e,n),e.reply(200,null,n,t),"function"==typeof r.callback&&r.callback()}}},{key:"_processInDialogSdpOffer",value:function(e){var t=this;w.debug("_processInDialogSdpOffer()");var n,r=e.parseSDP(),i=!1,o=s(r.media);try{for(o.s();!(n=o.n()).done;){var l=n.value;if(-1!==O.indexOf(l.type)){var u=l.direction||r.direction||"sendrecv";if("sendonly"!==u&&"inactive"!==u){i=!1;break}i=!0}}}catch(e){o.e(e)}finally{o.f()}var a={originator:"remote",type:"offer",sdp:e.body};w.debug('emit "sdp"'),this.emit("sdp",a);var c=new RTCSessionDescription({type:"offer",sdp:a.sdp});return this._connectionPromiseQueue=this._connectionPromiseQueue.then(function(){if(t._status===I.STATUS_TERMINATED)throw new Error("terminated");return t._connection.setRemoteDescription(c).catch(function(n){throw e.reply(488),w.warn('emit "peerconnection:setremotedescriptionfailed" [error:%o]',n),t.emit("peerconnection:setremotedescriptionfailed",n),n})}).then(function(){if(t._status===I.STATUS_TERMINATED)throw new Error("terminated");!0===t._remoteHold&&!1===i?(t._remoteHold=!1,t._onunhold("remote")):!1===t._remoteHold&&!0===i&&(t._remoteHold=!0,t._onhold("remote"))}).then(function(){if(t._status===I.STATUS_TERMINATED)throw new Error("terminated");return t._createLocalDescription("answer",t._rtcAnswerConstraints).catch(function(t){throw e.reply(500),w.warn('emit "peerconnection:createtelocaldescriptionfailed" [error:%o]',t),t})}).catch(function(e){w.warn("_processInDialogSdpOffer() failed [error: %o]",e)}),this._connectionPromiseQueue}},{key:"_receiveRefer",value:function(e){var t=this;if(w.debug("receiveRefer()"),!e.refer_to)return w.debug("no Refer-To header field present in REFER"),void e.reply(400);if(e.refer_to.uri.scheme!==_.SIP)return w.debug("Refer-To header field points to a non-SIP URI scheme"),void e.reply(416);e.reply(202);var r=new E(this,e.cseq);w.debug('emit "refer"'),this.emit("refer",{request:e,accept:function(s,i){(function(t){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t="function"==typeof t?t:null,this._status!==I.STATUS_WAITING_FOR_ACK&&this._status!==I.STATUS_CONFIRMED)return!1;var i=new n(this._ua);if(i.on("progress",function(e){var t=e.response;r.notify(t.status_code,t.reason_phrase)}),i.on("accepted",function(e){var t=e.response;r.notify(t.status_code,t.reason_phrase)}),i.on("_failed",function(e){var t=e.message,n=e.cause;t?r.notify(t.status_code,t.reason_phrase):r.notify(487,n)}),e.refer_to.uri.hasHeader("replaces")){var o=decodeURIComponent(e.refer_to.uri.getHeader("replaces"));s.extraHeaders=v.cloneArray(s.extraHeaders),s.extraHeaders.push("Replaces: ".concat(o))}i.connect(e.refer_to.uri.toAor(),s,t)}).call(t,s,i)},reject:function(){(function(){r.notify(603)}).call(t)}})}},{key:"_receiveNotify",value:function(e){switch(w.debug("receiveNotify()"),e.event||e.reply(400),e.event.event){case"refer":var t,n;if(e.event.params&&e.event.params.id)t=e.event.params.id,n=this._referSubscribers[t];else{if(1!==Object.keys(this._referSubscribers).length)return void e.reply(400,"Missing event id parameter");n=this._referSubscribers[Object.keys(this._referSubscribers)[0]]}if(!n)return void e.reply(481,"Subscription does not exist");n.receiveNotify(e),e.reply(200);break;default:e.reply(489)}}},{key:"_receiveReplaces",value:function(e){var t=this;w.debug("receiveReplaces()"),this.emit("replaces",{request:e,accept:function(r){(function(t){var r=this;if(this._status!==I.STATUS_WAITING_FOR_ACK&&this._status!==I.STATUS_CONFIRMED)return!1;var s=new n(this._ua);s.on("confirmed",function(){r.terminate()}),s.init_incoming(e,t)}).call(t,r)},reject:function(){(function(){w.debug("Replaced INVITE rejected by the user"),e.reply(486)}).call(t)}})}},{key:"_sendInitialRequest",value:function(e,t,n){var r=this,s=new C(this._ua,this._request,{onRequestTimeout:function(){r.onRequestTimeout()},onTransportError:function(){r.onTransportError()},onAuthenticated:function(e){r._request=e},onReceiveResponse:function(e){r._receiveInviteResponse(e)}});Promise.resolve().then(function(){return n||(e.audio||e.video?(r._localMediaStreamLocallyGenerated=!0,navigator.mediaDevices.getUserMedia(e).catch(function(e){if(r._status===I.STATUS_TERMINATED)throw new Error("terminated");throw r._failed("local",null,_.causes.USER_DENIED_MEDIA_ACCESS),w.warn('emit "getusermediafailed" [error:%o]',e),r.emit("getusermediafailed",e),e})):void 0)}).then(function(e){if(r._status===I.STATUS_TERMINATED)throw new Error("terminated");return r._localMediaStream=e,e&&e.getTracks().forEach(function(t){r._connection.addTrack(t,e)}),r._connecting(r._request),r._createLocalDescription("offer",t).catch(function(e){throw r._failed("local",null,_.causes.WEBRTC_ERROR),e})}).then(function(e){if(r._is_canceled||r._status===I.STATUS_TERMINATED)throw new Error("terminated");r._request.body=e,r._status=I.STATUS_INVITE_SENT,w.debug('emit "sending" [request:%o]',r._request),r.emit("sending",{request:r._request}),s.send()}).catch(function(e){r._status!==I.STATUS_TERMINATED&&w.warn(e)})}},{key:"_getDTMFRTPSender",value:function(){var e=this._connection.getSenders().find(function(e){return e.track&&"audio"===e.track.kind});if(e&&e.dtmf)return e.dtmf;w.warn("sendDTMF() | no local audio track to send DTMF with")}},{key:"_receiveInviteResponse",value:function(e){var t=this;if(w.debug("receiveInviteResponse()"),this._dialog&&e.status_code>=200&&e.status_code<=299){if(this._dialog.id.call_id===e.call_id&&this._dialog.id.local_tag===e.from_tag&&this._dialog.id.remote_tag===e.to_tag)return void this.sendRequest(_.ACK);var n=new T(this,e,"UAC");return void 0!==n.error?void w.debug(n.error):(this.sendRequest(_.ACK),void this.sendRequest(_.BYE))}if(this._is_canceled)e.status_code>=100&&e.status_code<200?this._request.cancel(this._cancel_reason):e.status_code>=200&&e.status_code<299&&this._acceptAndTerminate(e);else if(this._status===I.STATUS_INVITE_SENT||this._status===I.STATUS_1XX_RECEIVED)switch(!0){case/^100$/.test(e.status_code):this._status=I.STATUS_1XX_RECEIVED;break;case/^1[0-9]{2}$/.test(e.status_code):if(!e.to_tag){w.debug("1xx response received without to tag");break}if(e.hasHeader("contact")&&!this._createDialog(e,"UAC",!0))break;if(this._status=I.STATUS_1XX_RECEIVED,!e.body){this._progress("remote",e);break}var r={originator:"remote",type:"answer",sdp:e.body};w.debug('emit "sdp"'),this.emit("sdp",r);var s=new RTCSessionDescription({type:"answer",sdp:r.sdp});this._connectionPromiseQueue=this._connectionPromiseQueue.then(function(){return t._connection.setRemoteDescription(s)}).then(function(){return t._progress("remote",e)}).catch(function(e){w.warn('emit "peerconnection:setremotedescriptionfailed" [error:%o]',e),t.emit("peerconnection:setremotedescriptionfailed",e)});break;case/^2[0-9]{2}$/.test(e.status_code):if(this._status=I.STATUS_CONFIRMED,!e.body){this._acceptAndTerminate(e,400,_.causes.MISSING_SDP),this._failed("remote",e,_.causes.BAD_MEDIA_DESCRIPTION);break}if(!this._createDialog(e,"UAC"))break;var i={originator:"remote",type:"answer",sdp:e.body};w.debug('emit "sdp"'),this.emit("sdp",i);var o=new RTCSessionDescription({type:"answer",sdp:i.sdp});this._connectionPromiseQueue=this._connectionPromiseQueue.then(function(){if("stable"===t._connection.signalingState)return t._connection.createOffer(t._rtcOfferConstraints).then(function(e){return t._connection.setLocalDescription(e)}).catch(function(n){t._acceptAndTerminate(e,500,n.toString()),t._failed("local",e,_.causes.WEBRTC_ERROR)})}).then(function(){t._connection.setRemoteDescription(o).then(function(){t._handleSessionTimersInIncomingResponse(e),t._accepted("remote",e),t.sendRequest(_.ACK),t._confirmed("local",null)}).catch(function(n){t._acceptAndTerminate(e,488,"Not Acceptable Here"),t._failed("remote",e,_.causes.BAD_MEDIA_DESCRIPTION),w.warn('emit "peerconnection:setremotedescriptionfailed" [error:%o]',n),t.emit("peerconnection:setremotedescriptionfailed",n)})});break;default:var l=v.sipErrorCause(e.status_code);this._failed("remote",e,l)}}},{key:"_sendReinvite",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};w.debug("sendReinvite()");var n=v.cloneArray(t.extraHeaders),r=v.cloneObject(t.eventHandlers),s=t.rtcOfferConstraints||this._rtcOfferConstraints||null,i=!1;function o(e){r.failed&&r.failed(e)}n.push("Contact: ".concat(this._contact)),n.push("Content-Type: application/sdp"),this._sessionTimers.running&&n.push("Session-Expires: ".concat(this._sessionTimers.currentExpires,";refresher=").concat(this._sessionTimers.refresher?"uac":"uas")),this._connectionPromiseQueue=this._connectionPromiseQueue.then(function(){return e._createLocalDescription("offer",s)}).then(function(t){var s={originator:"local",type:"offer",sdp:t=e._mangleOffer(t)};w.debug('emit "sdp"'),e.emit("sdp",s),e.sendRequest(_.INVITE,{extraHeaders:n,body:t,eventHandlers:{onSuccessResponse:function(t){(function(e){var t=this;if(this._status===I.STATUS_TERMINATED)return;if(this.sendRequest(_.ACK),i)return;if(this._handleSessionTimersInIncomingResponse(e),!e.body)return void o.call(this);if(!e.hasHeader("Content-Type")||"application/sdp"!==e.getHeader("Content-Type").toLowerCase())return void o.call(this);var n={originator:"remote",type:"answer",sdp:e.body};w.debug('emit "sdp"'),this.emit("sdp",n);var s=new RTCSessionDescription({type:"answer",sdp:n.sdp});this._connectionPromiseQueue=this._connectionPromiseQueue.then(function(){return t._connection.setRemoteDescription(s)}).then(function(){r.succeeded&&r.succeeded(e)}).catch(function(e){o.call(t),w.warn('emit "peerconnection:setremotedescriptionfailed" [error:%o]',e),t.emit("peerconnection:setremotedescriptionfailed",e)})}).call(e,t),i=!0},onErrorResponse:function(t){o.call(e,t)},onTransportError:function(){e.onTransportError()},onRequestTimeout:function(){e.onRequestTimeout()},onDialogError:function(){e.onDialogError()}}})}).catch(function(){o()})}},{key:"_sendUpdate",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};w.debug("sendUpdate()");var n=v.cloneArray(t.extraHeaders),r=v.cloneObject(t.eventHandlers),s=t.rtcOfferConstraints||this._rtcOfferConstraints||null,i=t.sdpOffer||!1,o=!1;function l(e){var t=this;if(this._status!==I.STATUS_TERMINATED&&!o)if(this._handleSessionTimersInIncomingResponse(e),i){if(!e.body)return void u.call(this);if(!e.hasHeader("Content-Type")||"application/sdp"!==e.getHeader("Content-Type").toLowerCase())return void u.call(this);var n={originator:"remote",type:"answer",sdp:e.body};w.debug('emit "sdp"'),this.emit("sdp",n);var s=new RTCSessionDescription({type:"answer",sdp:n.sdp});this._connectionPromiseQueue=this._connectionPromiseQueue.then(function(){return t._connection.setRemoteDescription(s)}).then(function(){r.succeeded&&r.succeeded(e)}).catch(function(e){u.call(t),w.warn('emit "peerconnection:setremotedescriptionfailed" [error:%o]',e),t.emit("peerconnection:setremotedescriptionfailed",e)})}else r.succeeded&&r.succeeded(e)}function u(e){r.failed&&r.failed(e)}n.push("Contact: ".concat(this._contact)),this._sessionTimers.running&&n.push("Session-Expires: ".concat(this._sessionTimers.currentExpires,";refresher=").concat(this._sessionTimers.refresher?"uac":"uas")),i?(n.push("Content-Type: application/sdp"),this._connectionPromiseQueue=this._connectionPromiseQueue.then(function(){return e._createLocalDescription("offer",s)}).then(function(t){var r={originator:"local",type:"offer",sdp:t=e._mangleOffer(t)};w.debug('emit "sdp"'),e.emit("sdp",r),e.sendRequest(_.UPDATE,{extraHeaders:n,body:t,eventHandlers:{onSuccessResponse:function(t){l.call(e,t),o=!0},onErrorResponse:function(t){u.call(e,t)},onTransportError:function(){e.onTransportError()},onRequestTimeout:function(){e.onRequestTimeout()},onDialogError:function(){e.onDialogError()}}})}).catch(function(){u.call(e)})):this.sendRequest(_.UPDATE,{extraHeaders:n,eventHandlers:{onSuccessResponse:function(t){l.call(e,t)},onErrorResponse:function(t){u.call(e,t)},onTransportError:function(){e.onTransportError()},onRequestTimeout:function(){e.onRequestTimeout()},onDialogError:function(){e.onDialogError()}}})}},{key:"_acceptAndTerminate",value:function(e,t,n){w.debug("acceptAndTerminate()");var r=[];t&&(n=n||_.REASON_PHRASE[t]||"",r.push("Reason: SIP ;cause=".concat(t,'; text="').concat(n,'"'))),(this._dialog||this._createDialog(e,"UAC"))&&(this.sendRequest(_.ACK),this.sendRequest(_.BYE,{extraHeaders:r})),this._status=I.STATUS_TERMINATED}},{key:"_mangleOffer",value:function(e){if(!this._localHold&&!this._remoteHold)return e;if(e=d.parse(e),this._localHold&&!this._remoteHold){w.debug("mangleOffer() | me on hold, mangling offer");var t,n=s(e.media);try{for(n.s();!(t=n.n()).done;){var r=t.value;-1!==O.indexOf(r.type)&&(r.direction?"sendrecv"===r.direction?r.direction="sendonly":"recvonly"===r.direction&&(r.direction="inactive"):r.direction="sendonly")}}catch(e){n.e(e)}finally{n.f()}}else if(this._localHold&&this._remoteHold){w.debug("mangleOffer() | both on hold, mangling offer");var i,o=s(e.media);try{for(o.s();!(i=o.n()).done;){var l=i.value;-1!==O.indexOf(l.type)&&(l.direction="inactive")}}catch(e){o.e(e)}finally{o.f()}}else if(this._remoteHold){w.debug("mangleOffer() | remote on hold, mangling offer");var u,a=s(e.media);try{for(a.s();!(u=a.n()).done;){var c=u.value;-1!==O.indexOf(c.type)&&(c.direction?"sendrecv"===c.direction?c.direction="recvonly":"recvonly"===c.direction&&(c.direction="inactive"):c.direction="recvonly")}}catch(e){a.e(e)}finally{a.f()}}return d.write(e)}},{key:"_setLocalMediaStatus",value:function(){var e=!0,t=!0;(this._localHold||this._remoteHold)&&(e=!1,t=!1),this._audioMuted&&(e=!1),this._videoMuted&&(t=!1),this._toggleMuteAudio(!e),this._toggleMuteVideo(!t)}},{key:"_handleSessionTimersInIncomingRequest",value:function(e,t){var n;this._sessionTimers.enabled&&(e.session_expires&&e.session_expires>=_.MIN_SESSION_EXPIRES?(this._sessionTimers.currentExpires=e.session_expires,n=e.session_expires_refresher||"uas"):(this._sessionTimers.currentExpires=this._sessionTimers.defaultExpires,n="uas"),t.push("Session-Expires: ".concat(this._sessionTimers.currentExpires,";refresher=").concat(n)),this._sessionTimers.refresher="uas"===n,this._runSessionTimer())}},{key:"_handleSessionTimersInIncomingResponse",value:function(e){var t;this._sessionTimers.enabled&&(e.session_expires&&e.session_expires>=_.MIN_SESSION_EXPIRES?(this._sessionTimers.currentExpires=e.session_expires,t=e.session_expires_refresher||"uac"):(this._sessionTimers.currentExpires=this._sessionTimers.defaultExpires,t="uac"),this._sessionTimers.refresher="uac"===t,this._runSessionTimer())}},{key:"_runSessionTimer",value:function(){var e=this,t=this._sessionTimers.currentExpires;this._sessionTimers.running=!0,clearTimeout(this._sessionTimers.timer),this._sessionTimers.refresher?this._sessionTimers.timer=setTimeout(function(){e._status!==I.STATUS_TERMINATED&&e._isReadyToReOffer()&&(w.debug("runSessionTimer() | sending session refresh request"),e._sessionTimers.refreshMethod===_.UPDATE?e._sendUpdate():e._sendReinvite())},500*t):this._sessionTimers.timer=setTimeout(function(){e._status!==I.STATUS_TERMINATED&&(w.warn("runSessionTimer() | timer expired, terminating the session"),e.terminate({cause:_.causes.REQUEST_TIMEOUT,status_code:408,reason_phrase:"Session Timer Expired"}))},1100*t)}},{key:"_toggleMuteAudio",value:function(e){var t,n=s(this._connection.getSenders().filter(function(e){return e.track&&"audio"===e.track.kind}));try{for(n.s();!(t=n.n()).done;){t.value.track.enabled=!e}}catch(e){n.e(e)}finally{n.f()}}},{key:"_toggleMuteVideo",value:function(e){var t,n=s(this._connection.getSenders().filter(function(e){return e.track&&"video"===e.track.kind}));try{for(n.s();!(t=n.n()).done;){t.value.track.enabled=!e}}catch(e){n.e(e)}finally{n.f()}}},{key:"_newRTCSession",value:function(e,t){w.debug("newRTCSession()"),this._ua.newRTCSession(this,{originator:e,session:this,request:t})}},{key:"_connecting",value:function(e){w.debug("session connecting"),w.debug('emit "connecting"'),this.emit("connecting",{request:e})}},{key:"_progress",value:function(e,t){w.debug("session progress"),w.debug('emit "progress"'),this.emit("progress",{originator:e,response:t||null})}},{key:"_accepted",value:function(e,t){w.debug("session accepted"),this._start_time=new Date,w.debug('emit "accepted"'),this.emit("accepted",{originator:e,response:t||null})}},{key:"_confirmed",value:function(e,t){w.debug("session confirmed"),this._is_confirmed=!0,w.debug('emit "confirmed"'),this.emit("confirmed",{originator:e,ack:t||null})}},{key:"_ended",value:function(e,t,n){w.debug("session ended"),this._end_time=new Date,this._close(),w.debug('emit "ended"'),this.emit("ended",{originator:e,message:t||null,cause:n})}},{key:"_failed",value:function(e,t,n){w.debug("session failed"),w.debug('emit "_failed"'),this.emit("_failed",{originator:e,message:t||null,cause:n}),this._close(),w.debug('emit "failed"'),this.emit("failed",{originator:e,message:t||null,cause:n})}},{key:"_onhold",value:function(e){w.debug("session onhold"),this._setLocalMediaStatus(),w.debug('emit "hold"'),this.emit("hold",{originator:e})}},{key:"_onunhold",value:function(e){w.debug("session onunhold"),this._setLocalMediaStatus(),w.debug('emit "unhold"'),this.emit("unhold",{originator:e})}},{key:"_onmute",value:function(e){var t=e.audio,n=e.video;w.debug("session onmute"),this._setLocalMediaStatus(),w.debug('emit "muted"'),this.emit("muted",{audio:t,video:n})}},{key:"_onunmute",value:function(e){var t=e.audio,n=e.video;w.debug("session onunmute"),this._setLocalMediaStatus(),w.debug('emit "unmuted"'),this.emit("unmuted",{audio:t,video:n})}},{key:"C",get:function(){return I}},{key:"causes",get:function(){return _.causes}},{key:"id",get:function(){return this._id}},{key:"connection",get:function(){return this._connection}},{key:"contact",get:function(){return this._contact}},{key:"direction",get:function(){return this._direction}},{key:"local_identity",get:function(){return this._local_identity}},{key:"remote_identity",get:function(){return this._remote_identity}},{key:"start_time",get:function(){return this._start_time}},{key:"end_time",get:function(){return this._end_time}},{key:"data",get:function(){return this._data},set:function(e){this._data=e}},{key:"status",get:function(){return this._status}}]),n}()},{"./Constants":2,"./Dialog":3,"./Exceptions":6,"./Logger":9,"./RTCSession/DTMF":15,"./RTCSession/Info":16,"./RTCSession/ReferNotifier":17,"./RTCSession/ReferSubscriber":18,"./RequestSender":20,"./SIPMessage":21,"./Timers":23,"./Transactions":24,"./URI":27,"./Utils":28,events:31,"sdp-transform":37}],15:[function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(void 0===e)throw new TypeError("Not enough arguments");if(this._direction="outgoing",this._session.status!==this._session.C.STATUS_CONFIRMED&&this._session.status!==this._session.C.STATUS_WAITING_FOR_ACK)throw new h.InvalidStateError(this._session.status);var r=d.cloneArray(n.extraHeaders);if(this.eventHandlers=d.cloneObject(n.eventHandlers),"string"==typeof e)e=e.toUpperCase();else{if("number"!=typeof e)throw new TypeError("Invalid tone: ".concat(e));e=e.toString()}if(!e.match(/^[0-9A-DR#*]$/))throw new TypeError("Invalid tone: ".concat(e));this._tone=e,this._duration=n.duration,r.push("Content-Type: application/dtmf-relay");var s="Signal=".concat(this._tone,"\r\n");s+="Duration=".concat(this._duration),this._session.newDTMF({originator:"local",dtmf:this,request:this._request}),this._session.sendRequest(c.INFO,{extraHeaders:r,eventHandlers:{onSuccessResponse:function(e){t.emit("succeeded",{originator:"remote",response:e})},onErrorResponse:function(e){t.eventHandlers.onFailed&&t.eventHandlers.onFailed(),t.emit("failed",{originator:"remote",response:e})},onRequestTimeout:function(){t._session.onRequestTimeout()},onTransportError:function(){t._session.onTransportError()},onDialogError:function(){t._session.onDialogError()}},body:s})}},{key:"init_incoming",value:function(e){var t=/^(Signal\s*?=\s*?)([0-9A-D#*]{1})(\s)?.*/,n=/^(Duration\s?=\s?)([0-9]{1,4})(\s)?.*/;if(this._direction="incoming",this._request=e,e.reply(200),e.body){var r=e.body.split("\n");r.length>=1&&t.test(r[0])&&(this._tone=r[0].replace(t,"$2")),r.length>=2&&n.test(r[1])&&(this._duration=parseInt(r[1].replace(n,"$2"),10))}this._duration||(this._duration=_.DEFAULT_DURATION),this._tone?this._session.newDTMF({originator:"remote",dtmf:this,request:e}):f.debug("invalid INFO DTMF received, discarded")}},{key:"tone",get:function(){return this._tone}},{key:"duration",get:function(){return this._duration}}])&&s(t.prototype,n),r&&s(t,r),a}(),t.exports.C=_},{"../Constants":2,"../Exceptions":6,"../Logger":9,"../Utils":28,events:31}],16:[function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};if(this._direction="outgoing",void 0===e)throw new TypeError("Not enough arguments");if(this._session.status!==this._session.C.STATUS_CONFIRMED&&this._session.status!==this._session.C.STATUS_WAITING_FOR_ACK)throw new c.InvalidStateError(this._session.status);this._contentType=e,this._body=t;var s=h.cloneArray(r.extraHeaders);s.push("Content-Type: ".concat(e)),this._session.newInfo({originator:"local",info:this,request:this.request}),this._session.sendRequest(a.INFO,{extraHeaders:s,eventHandlers:{onSuccessResponse:function(e){n.emit("succeeded",{originator:"remote",response:e})},onErrorResponse:function(e){n.emit("failed",{originator:"remote",response:e})},onTransportError:function(){n._session.onTransportError()},onRequestTimeout:function(){n._session.onRequestTimeout()},onDialogError:function(){n._session.onDialogError()}},body:t})}},{key:"init_incoming",value:function(e){this._direction="incoming",this.request=e,e.reply(200),this._contentType=e.hasHeader("Content-Type")?e.getHeader("Content-Type").toLowerCase():void 0,this._body=e.body,this._session.newInfo({originator:"remote",info:this,request:e})}},{key:"contentType",get:function(){return this._contentType}},{key:"body",get:function(){return this._body}}])&&s(t.prototype,n),r&&s(t,r),d}()},{"../Constants":2,"../Exceptions":6,"../Utils":28,events:31}],17:[function(e,t,n){"use strict";function r(e,t){for(var n=0;n=200?"terminated;reason=noresource":"active;expires=".concat(this._expires),this._session.sendRequest(i.NOTIFY,{extraHeaders:["Event: ".concat(l.event_type,";id=").concat(this._id),"Subscription-State: ".concat(n),"Content-Type: ".concat(l.body_type)],body:"SIP/2.0 ".concat(e," ").concat(t),eventHandlers:{onErrorResponse:function(){this._active=!1}}}))}}])&&r(t.prototype,n),s&&r(t,s),e}()},{"../Constants":2,"../Logger":9}],18:[function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};f.debug("sendRefer()");var r=d.cloneArray(n.extraHeaders),s=d.cloneObject(n.eventHandlers);for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&this.on(i,s[i]);var o=null;n.replaces&&(o=n.replaces._request.call_id,o+=";to-tag=".concat(n.replaces._to_tag),o+=";from-tag=".concat(n.replaces._from_tag),o=encodeURIComponent(o));var l="Refer-To: <".concat(e).concat(o?"?Replaces=".concat(o):"",">");if(r.push(l),!r.some(function(e){return e.toLowerCase().startsWith("referred-by:")})){var u="Referred-By: <".concat(this._session._ua._configuration.uri._scheme,":").concat(this._session._ua._configuration.uri._user,"@").concat(this._session._ua._configuration.uri._host,">");r.push(u)}r.push("Contact: ".concat(this._session.contact));var a=this._session.sendRequest(c.REFER,{extraHeaders:r,eventHandlers:{onSuccessResponse:function(e){t._requestSucceeded(e)},onErrorResponse:function(e){t._requestFailed(e,c.causes.REJECTED)},onTransportError:function(){t._requestFailed(null,c.causes.CONNECTION_ERROR)},onRequestTimeout:function(){t._requestFailed(null,c.causes.REQUEST_TIMEOUT)},onDialogError:function(){t._requestFailed(null,c.causes.DIALOG_ERROR)}}});this._id=a.cseq}},{key:"receiveNotify",value:function(e){if(f.debug("receiveNotify()"),e.body){var t=h.parse(e.body.trim().split("\r\n",1)[0],"Status_Line");if(-1!==t)switch(!0){case/^100$/.test(t.status_code):this.emit("trying",{request:e,status_line:t});break;case/^1[0-9]{2}$/.test(t.status_code):this.emit("progress",{request:e,status_line:t});break;case/^2[0-9]{2}$/.test(t.status_code):this.emit("accepted",{request:e,status_line:t});break;default:this.emit("failed",{request:e,status_line:t})}else f.debug('receiveNotify() | error parsing NOTIFY body: "'.concat(e.body,'"'))}}},{key:"_requestSucceeded",value:function(e){f.debug("REFER succeeded"),f.debug('emit "requestSucceeded"'),this.emit("requestSucceeded",{response:e})}},{key:"_requestFailed",value:function(e,t){f.debug("REFER failed"),f.debug('emit "requestFailed"'),this.emit("requestFailed",{response:e||null,cause:t})}},{key:"id",get:function(){return this._id}}])&&s(t.prototype,n),r&&s(t,r),a}()},{"../Constants":2,"../Grammar":7,"../Logger":9,"../Utils":28,events:31}],19:[function(e,t,n){"use strict";function r(e,t){for(var n=0;n"'),this._contact+=";reg-id=".concat(this._reg_id),this._contact+=";+sip.instance=".concat(this._sipInstance)}var t,n,s;return t=e,(n=[{key:"setExtraHeaders",value:function(e){Array.isArray(e)||(e=[]),this._extraHeaders=e.slice()}},{key:"setExtraContactParams",value:function(e){for(var t in e instanceof Object||(e={}),this._extraContactParams="",e)if(Object.prototype.hasOwnProperty.call(e,t)){var n=e[t];this._extraContactParams+=";".concat(t),n&&(this._extraContactParams+="=".concat(n))}}},{key:"register",value:function(){var e=this;if(this._registering)a.debug("Register request in progress...");else{var t=this._extraHeaders.slice();t.push("Contact: ".concat(this._contact,";expires=").concat(this._expires).concat(this._extraContactParams)),t.push("Expires: ".concat(this._expires));var n=new l.OutgoingRequest(o.REGISTER,this._registrar,this._ua,{to_uri:this._to_uri,call_id:this._call_id,cseq:this._cseq+=1},t),r=new u(this._ua,n,{onRequestTimeout:function(){e._registrationFailure(null,o.causes.REQUEST_TIMEOUT)},onTransportError:function(){e._registrationFailure(null,o.causes.CONNECTION_ERROR)},onAuthenticated:function(){e._cseq+=1},onReceiveResponse:function(t){if(t.cseq===e._cseq)switch(null!==e._registrationTimer&&(clearTimeout(e._registrationTimer),e._registrationTimer=null),!0){case/^1[0-9]{2}$/.test(t.status_code):break;case/^2[0-9]{2}$/.test(t.status_code):if(e._registering=!1,!t.hasHeader("Contact")){a.debug("no Contact header in response to REGISTER, response ignored");break}var n=t.headers.Contact.reduce(function(e,t){return e.concat(t.parsed)},[]),r=n.find(function(t){return e._sipInstance===t.getParam("+sip.instance")&&e._reg_id===parseInt(t.getParam("reg-id"))});if(r||(r=n.find(function(t){return t.uri.user===e._ua.contact.uri.user})),!r){a.debug("no Contact header pointing to us, response ignored");break}var s=r.getParam("expires");!s&&t.hasHeader("expires")&&(s=t.getHeader("expires")),s||(s=e._expires),(s=Number(s))<10&&(s=10);var l=s>64?1e3*s/2+Math.floor(1e3*(s/2-32)*Math.random()):1e3*s-5e3;e._registrationTimer=setTimeout(function(){e._registrationTimer=null,0===e._ua.listeners("registrationExpiring").length?e.register():e._ua.emit("registrationExpiring")},l),r.hasParam("temp-gruu")&&(e._ua.contact.temp_gruu=r.getParam("temp-gruu").replace(/"/g,"")),r.hasParam("pub-gruu")&&(e._ua.contact.pub_gruu=r.getParam("pub-gruu").replace(/"/g,"")),e._registered||(e._registered=!0,e._ua.registered({response:t}));break;case/^423$/.test(t.status_code):t.hasHeader("min-expires")?(e._expires=Number(t.getHeader("min-expires")),e._expires<10&&(e._expires=10),e.register()):(a.debug("423 response received for REGISTER without Min-Expires"),e._registrationFailure(t,o.causes.SIP_FAILURE_CODE));break;default:var u=i.sipErrorCause(t.status_code);e._registrationFailure(t,u)}}});this._registering=!0,r.send()}}},{key:"unregister",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._registered){this._registered=!1,null!==this._registrationTimer&&(clearTimeout(this._registrationTimer),this._registrationTimer=null);var n=this._extraHeaders.slice();t.all?n.push("Contact: *".concat(this._extraContactParams)):n.push("Contact: ".concat(this._contact,";expires=0").concat(this._extraContactParams)),n.push("Expires: 0");var r=new l.OutgoingRequest(o.REGISTER,this._registrar,this._ua,{to_uri:this._to_uri,call_id:this._call_id,cseq:this._cseq+=1},n);new u(this._ua,r,{onRequestTimeout:function(){e._unregistered(null,o.causes.REQUEST_TIMEOUT)},onTransportError:function(){e._unregistered(null,o.causes.CONNECTION_ERROR)},onAuthenticated:function(){e._cseq+=1},onReceiveResponse:function(t){switch(!0){case/^1[0-9]{2}$/.test(t.status_code):break;case/^2[0-9]{2}$/.test(t.status_code):e._unregistered(t);break;default:var n=i.sipErrorCause(t.status_code);e._unregistered(t,n)}}}).send()}else a.debug("already unregistered")}},{key:"close",value:function(){this._registered&&this.unregister()}},{key:"onTransportClosed",value:function(){this._registering=!1,null!==this._registrationTimer&&(clearTimeout(this._registrationTimer),this._registrationTimer=null),this._registered&&(this._registered=!1,this._ua.unregistered({}))}},{key:"_registrationFailure",value:function(e,t){this._registering=!1,this._ua.registrationFailed({response:e||null,cause:t}),this._registered&&(this._registered=!1,this._ua.unregistered({response:e||null,cause:t}))}},{key:"_unregistered",value:function(e,t){this._registering=!1,this._registered=!1,this._ua.unregistered({response:e||null,cause:t||null})}},{key:"registered",get:function(){return this._registered}}])&&r(t.prototype,n),s&&r(t,s),e}()},{"./Constants":2,"./Logger":9,"./RequestSender":20,"./SIPMessage":21,"./Utils":28}],20:[function(e,t,n){"use strict";function r(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n")),this.setHeader("via",""),this.setHeader("max-forwards",p.MAX_FORWARDS);var l=s.to_uri||n,u=s.to_tag?{tag:s.to_tag}:null,a=void 0!==s.to_display_name?s.to_display_name:null;this.to=new v(l,a,u),this.setHeader("to",this.to.toString());var h,d=s.from_uri||r.configuration.uri,f={tag:s.from_tag||m.newTag()};h=void 0!==s.from_display_name?s.from_display_name:r.configuration.display_name?r.configuration.display_name:null,this.from=new v(d,h,f),this.setHeader("from",this.from.toString());var _=s.call_id||r.configuration.jssip_id+m.createRandomToken(15);this.call_id=_,this.setHeader("call-id",_);var g=s.cseq||Math.floor(1e4*Math.random());this.cseq=g,this.setHeader("cseq","".concat(g," ").concat(t))}return d(e,[{key:"setHeader",value:function(e,t){for(var n=new RegExp("^\\s*".concat(e,"\\s*:"),"i"),r=0;r1&&void 0!==arguments[1]?arguments[1]:0;if(e=m.headerize(e),this.headers[e]){if(!(t>=this.headers[e].length)){var n=this.headers[e][t],r=n.raw;if(n.parsed)return n.parsed;var s=g.parse(r,e.replace(/-/g,"_"));return-1===s?(this.headers[e].splice(t,1),void y.debug('error parsing "'.concat(e,'" header field with value "').concat(r,'"'))):(n.parsed=s,s)}y.debug('not so many "'.concat(e,'" headers present'))}else y.debug('header "'.concat(e,'" not present'))}},{key:"s",value:function(e,t){return this.parseHeader(e,t)}},{key:"setHeader",value:function(e,t){var n={raw:t};this.headers[m.headerize(e)]=[n]}},{key:"parseSDP",value:function(e){return!e&&this.sdp?this.sdp:(this.sdp=f.parse(this.body||""),this.sdp)}},{key:"toString",value:function(){return this.data}}]),e}(),S=function(e){s(n,b);var t=o(n);function n(e){var r;return c(this,n),(r=t.call(this)).ua=e,r.headers={},r.ruri=null,r.transport=null,r.server_transaction=null,r}return d(n,[{key:"reply",value:function(e,t,n,r,s,i){var o=[],l=this.getHeader("To");if(t=t||null,!(e=e||null)||e<100||e>699)throw new TypeError("Invalid status_code: ".concat(e));if(t&&"string"!=typeof t&&!(t instanceof String))throw new TypeError("Invalid reason_phrase: ".concat(t));t=t||p.REASON_PHRASE[e]||"",n=m.cloneArray(n),this.ua.configuration.extra_headers&&(n=n.concat(this.ua.configuration.extra_headers));var a="SIP/2.0 ".concat(e," ").concat(t,"\r\n");if(this.method===p.INVITE&&e>100&&e<=200){var c,h=u(this.getHeaders("record-route"));try{for(h.s();!(c=h.n()).done;){var d=c.value;a+="Record-Route: ".concat(d,"\r\n")}}catch(e){h.e(e)}finally{h.f()}}var f,_=u(this.getHeaders("via"));try{for(_.s();!(f=_.n()).done;){var v=f.value;a+="Via: ".concat(v,"\r\n")}}catch(e){_.e(e)}finally{_.f()}!this.to_tag&&e>100?l+=";tag=".concat(m.newTag()):this.to_tag&&!this.s("to").hasParam("tag")&&(l+=";tag=".concat(this.to_tag)),a+="To: ".concat(l,"\r\n"),a+="From: ".concat(this.getHeader("From"),"\r\n"),a+="Call-ID: ".concat(this.call_id,"\r\n"),a+="CSeq: ".concat(this.cseq," ").concat(this.method,"\r\n");var g,y=u(n);try{for(y.s();!(g=y.n()).done;){var T=g.value;a+="".concat(T.trim(),"\r\n")}}catch(e){y.e(e)}finally{y.f()}switch(this.method){case p.INVITE:this.ua.configuration.session_timers&&o.push("timer"),(this.ua.contact.pub_gruu||this.ua.contact.temp_gruu)&&o.push("gruu"),o.push("ice","replaces");break;case p.UPDATE:this.ua.configuration.session_timers&&o.push("timer"),r&&o.push("ice"),o.push("replaces")}if(o.push("outbound"),this.method===p.OPTIONS?(a+="Allow: ".concat(p.ALLOWED_METHODS,"\r\n"),a+="Accept: ".concat(p.ACCEPTED_BODY_TYPES,"\r\n")):405===e?a+="Allow: ".concat(p.ALLOWED_METHODS,"\r\n"):415===e&&(a+="Accept: ".concat(p.ACCEPTED_BODY_TYPES,"\r\n")),a+="Supported: ".concat(o,"\r\n"),r){var C=m.str_utf8_length(r);a+="Content-Type: application/sdp\r\n",a+="Content-Length: ".concat(C,"\r\n\r\n"),a+=r}else a+="Content-Length: ".concat(0,"\r\n\r\n");this.server_transaction.receiveResponse(e,a,s,i)}},{key:"reply_sl",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getHeaders("via");if(!e||e<100||e>699)throw new TypeError("Invalid status_code: ".concat(e));if(t&&"string"!=typeof t&&!(t instanceof String))throw new TypeError("Invalid reason_phrase: ".concat(t));t=t||p.REASON_PHRASE[e]||"";var r,s="SIP/2.0 ".concat(e," ").concat(t,"\r\n"),i=u(n);try{for(i.s();!(r=i.n()).done;){var o=r.value;s+="Via: ".concat(o,"\r\n")}}catch(e){i.e(e)}finally{i.f()}var l=this.getHeader("To");if(!this.to_tag&&e>100?l+=";tag=".concat(m.newTag()):this.to_tag&&!this.s("to").hasParam("tag")&&(l+=";tag=".concat(this.to_tag)),s+="To: ".concat(l,"\r\n"),s+="From: ".concat(this.getHeader("From"),"\r\n"),s+="Call-ID: ".concat(this.call_id,"\r\n"),s+="CSeq: ".concat(this.cseq," ").concat(this.method,"\r\n"),this.ua.configuration.extra_headers){var a,c=u(this.ua.configuration.extra_headers);try{for(c.s();!(a=c.n()).done;){var h=a.value;s+="".concat(h.trim(),"\r\n")}}catch(e){c.e(e)}finally{c.f()}}s+="Content-Length: ".concat(0,"\r\n\r\n"),this.transport.send(s)}}]),n}(),E=function(e){s(n,b);var t=o(n);function n(){var e;return c(this,n),(e=t.call(this)).headers={},e.status_code=null,e.reason_phrase=null,e}return n}();t.exports={OutgoingRequest:T,InitialOutgoingInviteRequest:C,IncomingRequest:S,IncomingResponse:E}},{"./Constants":2,"./Grammar":7,"./Logger":9,"./NameAddrHeader":11,"./Utils":28,"sdp-transform":37}],22:[function(e,t,n){"use strict";var r=e("./Logger"),s=e("./Utils"),i=e("./Grammar"),o=new r("Socket");n.isSocket=function(e){if(Array.isArray(e))return!1;if(void 0===e)return o.warn("undefined JsSIP.Socket instance"),!1;try{if(!s.isString(e.url))throw o.warn("missing or invalid JsSIP.Socket url property"),new Error("Missing or invalid JsSIP.Socket url property");if(!s.isString(e.via_transport))throw o.warn("missing or invalid JsSIP.Socket via_transport property"),new Error("Missing or invalid JsSIP.Socket via_transport property");if(-1===i.parse(e.sip_uri,"SIP_URI"))throw o.warn("missing or invalid JsSIP.Socket sip_uri property"),new Error("missing or invalid JsSIP.Socket sip_uri property")}catch(e){return!1}try{["connect","disconnect","send"].forEach(function(t){if(!s.isFunction(e[t]))throw o.warn("missing or invalid JsSIP.Socket method: ".concat(t)),new Error("Missing or invalid JsSIP.Socket method: ".concat(t))})}catch(e){return!1}return!0}},{"./Grammar":7,"./Logger":9,"./Utils":28}],23:[function(e,t,n){"use strict";var r=500;t.exports={T1:r,T2:4e3,T4:5e3,TIMER_B:32e3,TIMER_D:0,TIMER_F:32e3,TIMER_H:32e3,TIMER_I:0,TIMER_J:0,TIMER_K:0,TIMER_L:32e3,TIMER_M:32e3,PROVISIONAL_RESPONSE_INTERVAL:6e4}},{}],24:[function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n=100&&n<=199)switch(this.state){case b.STATUS_CALLING:this.stateChanged(b.STATUS_PROCEEDING),this.eventHandlers.onReceiveResponse(e);break;case b.STATUS_PROCEEDING:this.eventHandlers.onReceiveResponse(e)}else if(n>=200&&n<=299)switch(this.state){case b.STATUS_CALLING:case b.STATUS_PROCEEDING:this.stateChanged(b.STATUS_ACCEPTED),this.M=setTimeout(function(){t.timer_M()},m.TIMER_M),this.eventHandlers.onReceiveResponse(e);break;case b.STATUS_ACCEPTED:this.eventHandlers.onReceiveResponse(e)}else if(n>=300&&n<=699)switch(this.state){case b.STATUS_CALLING:case b.STATUS_PROCEEDING:this.stateChanged(b.STATUS_COMPLETED),this.sendACK(e),this.eventHandlers.onReceiveResponse(e);break;case b.STATUS_COMPLETED:this.sendACK(e)}}},{key:"C",get:function(){return b}}]),n}(),A=function(e){l(n,d);var t=a(n);function n(e,r,i,o){var l;s(this,n),(l=t.call(this)).id="z9hG4bK".concat(Math.floor(1e7*Math.random())),l.transport=r,l.request=i,l.eventHandlers=o;var u="SIP/2.0/".concat(r.via_transport);return u+=" ".concat(e.configuration.via_host,";branch=").concat(l.id),l.request.setHeader("via",u),l}return o(n,[{key:"send",value:function(){this.transport.send(this.request)||this.onTransportError()}},{key:"onTransportError",value:function(){y.debug("transport error occurred for transaction ".concat(this.id)),this.eventHandlers.onTransportError()}},{key:"C",get:function(){return b}}]),n}(),R=function(e){l(n,d);var t=a(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this)).type=b.NON_INVITE_SERVER,o.id=i.via_branch,o.ua=e,o.transport=r,o.request=i,o.last_response="",i.server_transaction=c(o),o.state=b.STATUS_TRYING,e.newTransaction(c(o)),o}return o(n,[{key:"stateChanged",value:function(e){this.state=e,this.emit("stateChanged")}},{key:"timer_J",value:function(){T.debug("Timer J expired for transaction ".concat(this.id)),this.stateChanged(b.STATUS_TERMINATED),this.ua.destroyTransaction(this)}},{key:"onTransportError",value:function(){this.transportError||(this.transportError=!0,T.debug("transport error occurred, deleting transaction ".concat(this.id)),clearTimeout(this.J),this.stateChanged(b.STATUS_TERMINATED),this.ua.destroyTransaction(this))}},{key:"receiveResponse",value:function(e,t,n,r){var s=this;if(100===e)switch(this.state){case b.STATUS_TRYING:this.stateChanged(b.STATUS_PROCEEDING),this.transport.send(t)||this.onTransportError();break;case b.STATUS_PROCEEDING:this.last_response=t,this.transport.send(t)?n&&n():(this.onTransportError(),r&&r())}else if(e>=200&&e<=699)switch(this.state){case b.STATUS_TRYING:case b.STATUS_PROCEEDING:this.stateChanged(b.STATUS_COMPLETED),this.last_response=t,this.J=setTimeout(function(){s.timer_J()},m.TIMER_J),this.transport.send(t)?n&&n():(this.onTransportError(),r&&r());break;case b.STATUS_COMPLETED:}}},{key:"C",get:function(){return b}}]),n}(),w=function(e){l(n,d);var t=a(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this)).type=b.INVITE_SERVER,o.id=i.via_branch,o.ua=e,o.transport=r,o.request=i,o.last_response="",i.server_transaction=c(o),o.state=b.STATUS_PROCEEDING,e.newTransaction(c(o)),o.resendProvisionalTimer=null,i.reply(100),o}return o(n,[{key:"stateChanged",value:function(e){this.state=e,this.emit("stateChanged")}},{key:"timer_H",value:function(){C.debug("Timer H expired for transaction ".concat(this.id)),this.state===b.STATUS_COMPLETED&&C.debug("ACK not received, dialog will be terminated"),this.stateChanged(b.STATUS_TERMINATED),this.ua.destroyTransaction(this)}},{key:"timer_I",value:function(){this.stateChanged(b.STATUS_TERMINATED),this.ua.destroyTransaction(this)}},{key:"timer_L",value:function(){C.debug("Timer L expired for transaction ".concat(this.id)),this.state===b.STATUS_ACCEPTED&&(this.stateChanged(b.STATUS_TERMINATED),this.ua.destroyTransaction(this))}},{key:"onTransportError",value:function(){this.transportError||(this.transportError=!0,C.debug("transport error occurred, deleting transaction ".concat(this.id)),null!==this.resendProvisionalTimer&&(clearInterval(this.resendProvisionalTimer),this.resendProvisionalTimer=null),clearTimeout(this.L),clearTimeout(this.H),clearTimeout(this.I),this.stateChanged(b.STATUS_TERMINATED),this.ua.destroyTransaction(this))}},{key:"resend_provisional",value:function(){this.transport.send(this.last_response)||this.onTransportError()}},{key:"receiveResponse",value:function(e,t,n,r){var s=this;if(e>=100&&e<=199)switch(this.state){case b.STATUS_PROCEEDING:this.transport.send(t)||this.onTransportError(),this.last_response=t}if(e>100&&e<=199&&this.state===b.STATUS_PROCEEDING)null===this.resendProvisionalTimer&&(this.resendProvisionalTimer=setInterval(function(){s.resend_provisional()},m.PROVISIONAL_RESPONSE_INTERVAL));else if(e>=200&&e<=299)switch(this.state){case b.STATUS_PROCEEDING:this.stateChanged(b.STATUS_ACCEPTED),this.last_response=t,this.L=setTimeout(function(){s.timer_L()},m.TIMER_L),null!==this.resendProvisionalTimer&&(clearInterval(this.resendProvisionalTimer),this.resendProvisionalTimer=null);case b.STATUS_ACCEPTED:this.transport.send(t)?n&&n():(this.onTransportError(),r&&r())}else if(e>=300&&e<=699)switch(this.state){case b.STATUS_PROCEEDING:null!==this.resendProvisionalTimer&&(clearInterval(this.resendProvisionalTimer),this.resendProvisionalTimer=null),this.transport.send(t)?(this.stateChanged(b.STATUS_COMPLETED),this.H=setTimeout(function(){s.timer_H()},m.TIMER_H),n&&n()):(this.onTransportError(),r&&r())}}},{key:"C",get:function(){return b}}]),n}();t.exports={C:b,NonInviteClientTransaction:S,InviteClientTransaction:E,AckClientTransaction:A,NonInviteServerTransaction:R,InviteServerTransaction:w,checkTransaction:function(e,t){var n,r=e._transactions;switch(t.method){case _.INVITE:if(n=r.ist[t.via_branch]){switch(n.state){case b.STATUS_PROCEEDING:n.transport.send(n.last_response);break;case b.STATUS_ACCEPTED:}return!0}break;case _.ACK:if(!(n=r.ist[t.via_branch]))return!1;if(n.state===b.STATUS_ACCEPTED)return!1;if(n.state===b.STATUS_COMPLETED)return n.state=b.STATUS_CONFIRMED,n.I=setTimeout(function(){n.timer_I()},m.TIMER_I),!0;break;case _.CANCEL:return(n=r.ist[t.via_branch])?(t.reply_sl(200),n.state!==b.STATUS_PROCEEDING):(t.reply_sl(481),!0);default:if(n=r.nist[t.via_branch]){switch(n.state){case b.STATUS_TRYING:break;case b.STATUS_PROCEEDING:case b.STATUS_COMPLETED:n.transport.send(n.last_response)}return!0}}}}},{"./Constants":2,"./Logger":9,"./SIPMessage":21,"./Timers":23,events:31}],25:[function(e,t,n){"use strict";function r(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:u.recovery_options;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),l.debug("new()"),this.status=u.STATUS_DISCONNECTED,this.socket=null,this.sockets=[],this.recovery_options=n,this.recover_attempts=0,this.recovery_timer=null,this.close_requested=!1;try{this.textDecoder=new TextDecoder("utf8")}catch(e){l.warn("cannot use TextDecoder: ".concat(e))}if(void 0===t)throw new TypeError("Invalid argument. undefined 'sockets' argument");t instanceof Array||(t=[t]),t.forEach(function(e){if(!i.isSocket(e.socket))throw new TypeError("Invalid argument. invalid 'JsSIP.Socket' instance");if(e.weight&&!Number(e.weight))throw new TypeError("Invalid argument. 'weight' attribute is not a number");this.sockets.push({socket:e.socket,weight:e.weight||0,status:u.SOCKET_STATUS_READY})},this),this._getSocket()}var t,n,s;return t=e,(n=[{key:"connect",value:function(){l.debug("connect()"),this.isConnected()?l.debug("Transport is already connected"):this.isConnecting()?l.debug("Transport is connecting"):(this.close_requested=!1,this.status=u.STATUS_CONNECTING,this.onconnecting({socket:this.socket,attempts:this.recover_attempts}),this.close_requested||(this.socket.onconnect=this._onConnect.bind(this),this.socket.ondisconnect=this._onDisconnect.bind(this),this.socket.ondata=this._onData.bind(this),this.socket.connect()))}},{key:"disconnect",value:function(){l.debug("close()"),this.close_requested=!0,this.recover_attempts=0,this.status=u.STATUS_DISCONNECTED,null!==this.recovery_timer&&(clearTimeout(this.recovery_timer),this.recovery_timer=null),this.socket.onconnect=function(){},this.socket.ondisconnect=function(){},this.socket.ondata=function(){},this.socket.disconnect(),this.ondisconnect({socket:this.socket,error:!1})}},{key:"send",value:function(e){if(l.debug("send()"),!this.isConnected())return l.warn("unable to send message, transport is not connected"),!1;var t=e.toString();return l.debug("sending message:\n\n".concat(t,"\n")),this.socket.send(t)}},{key:"isConnected",value:function(){return this.status===u.STATUS_CONNECTED}},{key:"isConnecting",value:function(){return this.status===u.STATUS_CONNECTING}},{key:"_reconnect",value:function(){var e=this;this.recover_attempts+=1;var t=Math.floor(Math.random()*Math.pow(2,this.recover_attempts)+1);tthis.recovery_options.max_interval&&(t=this.recovery_options.max_interval),l.debug("reconnection attempt: ".concat(this.recover_attempts,". next connection attempt in ").concat(t," seconds")),this.recovery_timer=setTimeout(function(){e.close_requested||e.isConnected()||e.isConnecting()||(e._getSocket(),e.connect())},1e3*t)}},{key:"_getSocket",value:function(){var e=[];if(this.sockets.forEach(function(t){t.status!==u.SOCKET_STATUS_ERROR&&(0===e.length?e.push(t):t.weight>e[0].weight?e=[t]:t.weight===e[0].weight&&e.push(t))}),0===e.length)return this.sockets.forEach(function(e){e.status=u.SOCKET_STATUS_READY}),void this._getSocket();var t=Math.floor(Math.random()*e.length);this.socket=e[t].socket}},{key:"_onConnect",value:function(){this.recover_attempts=0,this.status=u.STATUS_CONNECTED,null!==this.recovery_timer&&(clearTimeout(this.recovery_timer),this.recovery_timer=null),this.onconnect({socket:this})}},{key:"_onDisconnect",value:function(e,t,n){this.status=u.STATUS_DISCONNECTED,this.ondisconnect({socket:this.socket,error:e,code:t,reason:n}),this.close_requested||(this.sockets.forEach(function(e){this.socket===e.socket&&(e.status=u.SOCKET_STATUS_ERROR)},this),this._reconnect(e))}},{key:"_onData",value:function(e){if("\r\n\r\n"!==e)if("\r\n"!==e){if("string"!=typeof e){try{e=this.textDecoder?this.textDecoder.decode(e):String.fromCharCode.apply(null,new Uint8Array(e))}catch(e){return void l.debug("received binary message failed to be converted into string, message discarded")}l.debug("received binary message:\n\n".concat(e,"\n"))}else l.debug("received text message:\n\n".concat(e,"\n"));this.ondata({transport:this,message:e})}else l.debug("received message with CRLF Keep Alive response");else{l.debug("received message with double-CRLF Keep Alive request");try{this.socket.send("\r\n")}catch(e){l.warn("error sending Keep Alive response: ".concat(e))}}}},{key:"via_transport",get:function(){return this.socket.via_transport}},{key:"url",get:function(){return this.socket.url}},{key:"sip_uri",get:function(){return this.socket.sip_uri}}])&&r(t.prototype,n),s&&r(t,s),e}()},{"./Constants":2,"./Logger":9,"./Socket":22}],26:[function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=e.anonymous||null,n=e.outbound||null,r="<";return r+=t?this.temp_gruu||"sip:anonymous@anonymous.invalid;transport=ws":this.pub_gruu||this.uri.toString(),!n||(t?this.temp_gruu:this.pub_gruu)||(r+=";ob"),r+=">"}};var r=["authorization_user","password","realm","ha1","authorization_jwt","display_name","register","extra_headers"];for(var s in this._configuration)Object.prototype.hasOwnProperty.call(this._configuration,s)&&(-1!==r.indexOf(s)?Object.defineProperty(this._configuration,s,{writable:!0,configurable:!1}):Object.defineProperty(this._configuration,s,{writable:!1,configurable:!1}));for(var i in R.debug("configuration parameters after validation:"),this._configuration)if(Object.prototype.hasOwnProperty.call(A.settings,i))switch(i){case"uri":case"registrar_server":R.debug("- ".concat(i,": ").concat(this._configuration[i]));break;case"password":case"ha1":case"authorization_jwt":R.debug("- ".concat(i,": NOT SHOWN"));break;default:R.debug("- ".concat(i,": ").concat(JSON.stringify(this._configuration[i])))}}},{key:"C",get:function(){return w}},{key:"status",get:function(){return this._status}},{key:"contact",get:function(){return this._contact}},{key:"configuration",get:function(){return this._configuration}},{key:"transport",get:function(){return this._transport}}]),n}()},{"./Config":1,"./Constants":2,"./Exceptions":6,"./Logger":9,"./Message":10,"./Options":12,"./Parser":13,"./RTCSession":14,"./Registrator":19,"./SIPMessage":21,"./Transactions":24,"./Transport":25,"./URI":27,"./Utils":28,"./sanityCheck":30,events:31}],27:[function(e,t,n){"use strict";function r(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return l=e.done,e},e:function(e){u=!0,o=e},f:function(){try{l||null==n.return||n.return()}finally{if(u)throw o}}}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n4&&void 0!==arguments[4]?arguments[4]:{},o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!r)throw new TypeError('missing or invalid "host" parameter');for(var u in this._parameters={},this._headers={},this._scheme=t||l.SIP,this._user=n,this._host=r,this._port=s,i)Object.prototype.hasOwnProperty.call(i,u)&&this.setParam(u,i[u]);for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&this.setHeader(a,o[a])}return o(e,null,[{key:"parse",value:function(e){return-1!==(e=a.parse(e,"SIP_URI"))?e:void 0}}]),o(e,[{key:"setParam",value:function(e,t){e&&(this._parameters[e.toLowerCase()]=null==t?null:t.toString())}},{key:"getParam",value:function(e){if(e)return this._parameters[e.toLowerCase()]}},{key:"hasParam",value:function(e){if(e)return!!this._parameters.hasOwnProperty(e.toLowerCase())}},{key:"deleteParam",value:function(e){if(e=e.toLowerCase(),this._parameters.hasOwnProperty(e)){var t=this._parameters[e];return delete this._parameters[e],t}}},{key:"clearParams",value:function(){this._parameters={}}},{key:"setHeader",value:function(e,t){this._headers[u.headerize(e)]=Array.isArray(t)?t:[t]}},{key:"getHeader",value:function(e){if(e)return this._headers[u.headerize(e)]}},{key:"hasHeader",value:function(e){if(e)return!!this._headers.hasOwnProperty(u.headerize(e))}},{key:"deleteHeader",value:function(e){if(e=u.headerize(e),this._headers.hasOwnProperty(e)){var t=this._headers[e];return delete this._headers[e],t}}},{key:"clearHeaders",value:function(){this._headers={}}},{key:"clone",value:function(){return new e(this._scheme,this._user,this._host,this._port,JSON.parse(JSON.stringify(this._parameters)),JSON.parse(JSON.stringify(this._headers)))}},{key:"toString",value:function(){var e=[],t="".concat(this._scheme,":");for(var n in this._user&&(t+="".concat(u.escapeUser(this._user),"@")),t+=this._host,(this._port||0===this._port)&&(t+=":".concat(this._port)),this._parameters)Object.prototype.hasOwnProperty.call(this._parameters,n)&&(t+=";".concat(n),null!==this._parameters[n]&&(t+="=".concat(this._parameters[n])));for(var s in this._headers)if(Object.prototype.hasOwnProperty.call(this._headers,s)){var i,o=r(this._headers[s]);try{for(o.s();!(i=o.n()).done;){var l=i.value;e.push("".concat(s,"=").concat(l))}}catch(e){o.e(e)}finally{o.f()}}return e.length>0&&(t+="?".concat(e.join("&"))),t}},{key:"toAor",value:function(e){var t="".concat(this._scheme,":");return this._user&&(t+="".concat(u.escapeUser(this._user),"@")),t+=this._host,e&&(this._port||0===this._port)&&(t+=":".concat(this._port)),t}},{key:"scheme",get:function(){return this._scheme},set:function(e){this._scheme=e.toLowerCase()}},{key:"user",get:function(){return this._user},set:function(e){this._user=e}},{key:"host",get:function(){return this._host},set:function(e){this._host=e.toLowerCase()}},{key:"port",get:function(){return this._port},set:function(e){this._port=0===e?e:parseInt(e,10)||null}}]),e}()},{"./Constants":2,"./Grammar":7,"./Utils":28}],28:[function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,s=function(){};return{s:s,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return l=e.done,e},e:function(e){u=!0,o=e},f:function(){try{l||null==n.return||n.return()}finally{if(u)throw o}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:32,r="";for(t=0;t>>32-t}function n(e,t){var n=2147483648&e,r=2147483648&t,s=1073741824&e,i=1073741824&t,o=(1073741823&e)+(1073741823&t);return s&i?2147483648^o^n^r:s|i?1073741824&o?3221225472^o^n^r:1073741824^o^n^r:o^n^r}function r(e,r,s,i,o,l,u){return e=n(e,n(n(function(e,t,n){return e&t|~e&n}(r,s,i),o),u)),n(t(e,l),r)}function s(e,r,s,i,o,l,u){return e=n(e,n(n(function(e,t,n){return e&n|t&~n}(r,s,i),o),u)),n(t(e,l),r)}function i(e,r,s,i,o,l,u){return e=n(e,n(n(function(e,t,n){return e^t^n}(r,s,i),o),u)),n(t(e,l),r)}function o(e,r,s,i,o,l,u){return e=n(e,n(n(function(e,t,n){return t^(e|~n)}(r,s,i),o),u)),n(t(e,l),r)}function l(e){var t,n="",r="";for(t=0;t<=3;t++)n+=(r="0".concat((e>>>8*t&255).toString(16))).substr(r.length-2,2);return n}var u,a,c,h,d,f,_,p,m,v;for(u=function(e){for(var t,n=e.length,r=n+8,s=16*((r-r%64)/64+1),i=new Array(s-1),o=0,l=0;l>>29,i}(e=function(e){for(var t="",n=0;n127&&r<2048?(t+=String.fromCharCode(r>>6|192),t+=String.fromCharCode(63&r|128)):(t+=String.fromCharCode(r>>12|224),t+=String.fromCharCode(r>>6&63|128),t+=String.fromCharCode(63&r|128))}return t}(e)),_=1732584193,p=4023233417,m=2562383102,v=271733878,a=0;a1&&void 0!==arguments[1]?arguments[1]:{};return e&&Object.assign({},e)||t}},{"./Constants":2,"./Grammar":7,"./URI":27}],29:[function(e,t,n){"use strict";function r(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return l=e.done,e},e:function(e){u=!0,o=e},f:function(){try{l||null==n.return||n.return()}finally{if(u)throw o}}}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1)return d.debug("more than one Via header field present in the response, dropping the response"),!1},function(){var e=h.str_utf8_length(i.body),t=i.getHeader("content-length");if(e0&&l.length>i){l.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+l.length+' "'+String(t)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=l.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",u.name,u.message)}}else l=o[t]=n,++e._eventsCount;return e}function d(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var e=new Array(arguments.length),t=0;t1&&(t=arguments[1]),t instanceof Error)throw t;var u=new Error('Unhandled "error" event. ('+t+")");throw u.context=t,u}if(!(n=o[e]))return!1;var a="function"==typeof n;switch(r=arguments.length){case 1:!function(e,t,n){if(t)e.call(n);else for(var r=e.length,s=m(e,r),i=0;i=0;o--)if(n[o]===t||n[o].listener===t){l=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(var n=t,r=n+1,s=e.length;r=0;i--)this.removeListener(e,t[i]);return this},o.prototype.listeners=function(e){return _(this,e,!0)},o.prototype.rawListeners=function(e){return _(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],32:[function(e,t,n){(function(r){n.log=function(...e){return"object"==typeof console&&console.log&&console.log(...e)},n.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,s=0;e[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(s=r))}),e.splice(s,0,n)},n.save=function(e){try{e?n.storage.setItem("debug",e):n.storage.removeItem("debug")}catch(e){}},n.load=function(){let e;try{e=n.storage.getItem("debug")}catch(e){}!e&&void 0!==r&&"env"in r&&(e=r.env.DEBUG);return e},n.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},n.storage=function(){try{return localStorage}catch(e){}}(),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.exports=e("./common")(n);const{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,e("_process"))},{"./common":33,_process:35}],33:[function(e,t,n){t.exports=function(t){function n(e){let t=0;for(let n=0;n{if("%%"===t)return t;l++;const i=r.formatters[s];if("function"==typeof i){const r=e[l];t=i.call(n,r),e.splice(l,1),l--}return t}),r.formatArgs.call(n,e),(n.log||r.log).apply(n,e)}return o.namespace=e,o.enabled=r.enabled(e),o.useColors=r.useColors(),o.color=n(e),o.destroy=s,o.extend=i,"function"==typeof r.init&&r.init(o),r.instances.push(o),o}function s(){const e=r.instances.indexOf(this);return-1!==e&&(r.instances.splice(e,1),!0)}function i(e,t){const n=r(this.namespace+(void 0===t?":":t)+e);return n.log=this.log,n}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return r.debug=r,r.default=r,r.coerce=function(e){return e instanceof Error?e.stack||e.message:e},r.disable=function(){const e=[...r.names.map(o),...r.skips.map(o).map(e=>"-"+e)].join(",");return r.enable(""),e},r.enable=function(e){let t;r.save(e),r.names=[],r.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),s=n.length;for(t=0;t{r[e]=t[e]}),r.instances=[],r.names=[],r.skips=[],r.formatters={},r.selectColor=n,r.enable(r.load()),r}},{ms:34}],34:[function(e,t,n){var r=1e3,s=60*r,i=60*s,o=24*i,l=7*o,u=365.25*o;function a(e,t,n,r){var s=t>=1.5*n;return Math.round(e/n)+" "+r+(s?"s":"")}t.exports=function(e,t){t=t||{};var n=typeof e;if("string"===n&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*u;case"weeks":case"week":case"w":return n*l;case"days":case"day":case"d":return n*o;case"hours":case"hour":case"hrs":case"hr":case"h":return n*i;case"minutes":case"minute":case"mins":case"min":case"m":return n*s;case"seconds":case"second":case"secs":case"sec":case"s":return n*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}(e);if("number"===n&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=o)return a(e,t,o,"day");if(t>=i)return a(e,t,i,"hour");if(t>=s)return a(e,t,s,"minute");if(t>=r)return a(e,t,r,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=o)return Math.round(e/o)+"d";if(t>=i)return Math.round(e/i)+"h";if(t>=s)return Math.round(e/s)+"m";if(t>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],35:[function(e,t,n){var r,s,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function u(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{s="function"==typeof clearTimeout?clearTimeout:l}catch(e){s=l}}();var a,c=[],h=!1,d=-1;function f(){h&&a&&(h=!1,a.length?c=a.concat(c):d=-1,c.length&&_())}function _(){if(!h){var e=u(f);h=!0;for(var t=c.length;t;){for(a=c,c=[];++d1)for(var n=1;n1&&(e[n[0]]=void 0),e};n.parseParams=function(e){return e.split(/;\s?/).reduce(l,{})},n.parseFmtpConfig=n.parseParams,n.parsePayloads=function(e){return e.toString().split(" ").map(Number)},n.parseRemoteCandidates=function(e){for(var t=[],n=e.split(" ").map(r),s=0;s=r)return e;var s=n[t];switch(t+=1,e){case"%%":return"%";case"%s":return String(s);case"%d":return Number(s);case"%v":return""}})}.apply(null,r)},o=["v","o","s","i","u","e","p","c","b","t","r","z","a"],l=["i","c","b","a"];t.exports=function(e,t){t=t||{},null==e.version&&(e.version=0),null==e.name&&(e.name=" "),e.media.forEach(function(e){null==e.payloads&&(e.payloads="")});var n=t.outerOrder||o,s=t.innerOrder||l,u=[];return n.forEach(function(t){r[t].forEach(function(n){n.name in e&&null!=e[n.name]?u.push(i(t,n,e)):n.push in e&&null!=e[n.push]&&e[n.push].forEach(function(e){u.push(i(t,n,e))})})}),e.media.forEach(function(e){u.push(i("m",r.m[0],e)),s.forEach(function(t){r[t].forEach(function(n){n.name in e&&null!=e[n.name]?u.push(i(t,n,e)):n.push in e&&null!=e[n.push]&&e[n.push].forEach(function(e){u.push(i(t,n,e))})})})}),u.join("\r\n")+"\r\n"}},{"./grammar":36}],40:[function(e,t,n){t.exports={name:"jssip",title:"JsSIP",description:"the Javascript SIP library",version:"3.10.1",homepage:"https://jssip.net",contributors:["José Luis Millán (https://github.com/jmillan)","Iñaki Baz Castillo (https://inakibaz.me)"],types:"lib/JsSIP.d.ts",main:"lib-es5/JsSIP.js",keywords:["sip","websocket","webrtc","node","browser","library"],license:"MIT",repository:{type:"git",url:"https://github.com/versatica/JsSIP.git"},bugs:{url:"https://github.com/versatica/JsSIP/issues"},dependencies:{"@types/events":"^3.0.0","@types/debug":"^4.1.7",debug:"^4.3.1",events:"^3.3.0","sdp-transform":"^2.14.1"},devDependencies:{"@babel/core":"^7.19.6","@babel/preset-env":"^7.19.4","ansi-colors":"^3.2.4",browserify:"^16.5.1",eslint:"^5.16.0","fancy-log":"^1.3.3",gulp:"^4.0.2","gulp-babel":"^8.0.0","gulp-eslint":"^5.0.0","gulp-expect-file":"^1.0.2","gulp-header":"^2.0.9","gulp-nodeunit-runner":"^0.2.2","gulp-plumber":"^1.2.1","gulp-rename":"^1.4.0","gulp-uglify-es":"^1.0.4",pegjs:"^0.7.0","vinyl-buffer":"^1.0.1","vinyl-source-stream":"^2.0.0"},scripts:{lint:"node npm-scripts.js lint",test:"node npm-scripts.js test",prepublish:"node npm-scripts.js prepublish",release:"node npm-scripts.js release"}}},{}]},{},[8])(8)}); \ No newline at end of file diff --git a/examples/vagrant/static-http/jssip-3.8.2.min.js b/examples/vagrant/static-http/jssip-3.8.2.min.js deleted file mode 100644 index 8ba04757..00000000 --- a/examples/vagrant/static-http/jssip-3.8.2.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/* - * JsSIP v3.8.2 - * the Javascript SIP library - * Copyright: 2012-2021 - * Homepage: https://jssip.net - * License: MIT - */ - -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).JsSIP=e()}}(function(){return function(){return function e(t,n,r){function s(o,l){if(!n[o]){if(!t[o]){var u="function"==typeof require&&require;if(!l&&u)return u(o,!0);if(i)return i(o,!0);var a=new Error("Cannot find module '"+o+"'");throw a.code="MODULE_NOT_FOUND",a}var c=n[o]={exports:{}};t[o][0].call(c.exports,function(e){return s(t[o][1][e]||e)},c,c.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return l=e.done,e},e:function(e){u=!0,o=e},f:function(){try{l||null==n.return||n.return()}finally{if(u)throw o}}}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0)return t}},connection_recovery_min_interval:function(e){if(i.isDecimal(e)){var t=Number(e);if(t>0)return t}},contact_uri:function(e){if("string"==typeof e){var t=l.parse(e,"SIP_URI");if(-1!==t)return t}},display_name:function(e){return e},instance_id:function(e){return/^uuid:/i.test(e)&&(e=e.substr(5)),-1===l.parse(e,"uuid")?void 0:e},no_answer_timeout:function(e){if(i.isDecimal(e)){var t=Number(e);if(t>0)return t}},session_timers:function(e){if("boolean"==typeof e)return e},session_timers_refresh_method:function(e){if("string"==typeof e&&((e=e.toUpperCase())===o.INVITE||e===o.UPDATE))return e},session_timers_force_refresher:function(e){if("boolean"==typeof e)return e},password:function(e){return String(e)},realm:function(e){return String(e)},ha1:function(e){return String(e)},register:function(e){if("boolean"==typeof e)return e},register_expires:function(e){if(i.isDecimal(e)){var t=Number(e);if(t>0)return t}},registrar_server:function(e){/^sip:/i.test(e)||(e="".concat(o.SIP,":").concat(e));var t=u.parse(e);return t?t.user?void 0:t:void 0},use_preloaded_route:function(e){if("boolean"==typeof e)return e}}};n.load=function(e,t){for(var n in h.mandatory){if(!t.hasOwnProperty(n))throw new c.ConfigurationError(n);var r=t[n],s=h.mandatory[n](r);if(void 0===s)throw new c.ConfigurationError(n,r);e[n]=s}for(var o in h.optional)if(t.hasOwnProperty(o)){var l=t[o];if(i.isEmpty(l))continue;var u=h.optional[o](l);if(void 0===u)throw new c.ConfigurationError(o,l);e[o]=u}}},{"./Constants":2,"./Exceptions":6,"./Grammar":7,"./Socket":22,"./URI":27,"./Utils":28}],2:[function(e,t,n){"use strict";var r=e("../package.json");t.exports={USER_AGENT:"".concat(r.title," ").concat(r.version),SIP:"sip",SIPS:"sips",causes:{CONNECTION_ERROR:"Connection Error",REQUEST_TIMEOUT:"Request Timeout",SIP_FAILURE_CODE:"SIP Failure Code",INTERNAL_ERROR:"Internal Error",BUSY:"Busy",REJECTED:"Rejected",REDIRECTED:"Redirected",UNAVAILABLE:"Unavailable",NOT_FOUND:"Not Found",ADDRESS_INCOMPLETE:"Address Incomplete",INCOMPATIBLE_SDP:"Incompatible SDP",MISSING_SDP:"Missing SDP",AUTHENTICATION_ERROR:"Authentication Error",BYE:"Terminated",WEBRTC_ERROR:"WebRTC Error",CANCELED:"Canceled",NO_ANSWER:"No Answer",EXPIRES:"Expires",NO_ACK:"No ACK",DIALOG_ERROR:"Dialog Error",USER_DENIED_MEDIA_ACCESS:"User Denied Media Access",BAD_MEDIA_DESCRIPTION:"Bad Media Description",RTP_TIMEOUT:"RTP Timeout"},SIP_ERROR_CAUSES:{REDIRECTED:[300,301,302,305,380],BUSY:[486,600],REJECTED:[403,603],NOT_FOUND:[404,604],UNAVAILABLE:[480,410,408,430],ADDRESS_INCOMPLETE:[484,424],INCOMPATIBLE_SDP:[488,606],AUTHENTICATION_ERROR:[401,407]},ACK:"ACK",BYE:"BYE",CANCEL:"CANCEL",INFO:"INFO",INVITE:"INVITE",MESSAGE:"MESSAGE",NOTIFY:"NOTIFY",OPTIONS:"OPTIONS",REGISTER:"REGISTER",REFER:"REFER",UPDATE:"UPDATE",SUBSCRIBE:"SUBSCRIBE",DTMF_TRANSPORT:{INFO:"INFO",RFC2833:"RFC2833"},REASON_PHRASE:{100:"Trying",180:"Ringing",181:"Call Is Being Forwarded",182:"Queued",183:"Session Progress",199:"Early Dialog Terminated",200:"OK",202:"Accepted",204:"No Notification",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",305:"Use Proxy",380:"Alternative Service",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",410:"Gone",412:"Conditional Request Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Unsupported URI Scheme",417:"Unknown Resource-Priority",420:"Bad Extension",421:"Extension Required",422:"Session Interval Too Small",423:"Interval Too Brief",424:"Bad Location Information",428:"Use Identity Header",429:"Provide Referrer Identity",430:"Flow Failed",433:"Anonymity Disallowed",436:"Bad Identity-Info",437:"Unsupported Certificate",438:"Invalid Identity Header",439:"First Hop Lacks Outbound Support",440:"Max-Breadth Exceeded",469:"Bad Info Package",470:"Consent Needed",478:"Unresolvable Destination",480:"Temporarily Unavailable",481:"Call/Transaction Does Not Exist",482:"Loop Detected",483:"Too Many Hops",484:"Address Incomplete",485:"Ambiguous",486:"Busy Here",487:"Request Terminated",488:"Not Acceptable Here",489:"Bad Event",491:"Request Pending",493:"Undecipherable",494:"Security Agreement Required",500:"JsSIP Internal Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Server Time-out",505:"Version Not Supported",513:"Message Too Large",580:"Precondition Failure",600:"Busy Everywhere",603:"Decline",604:"Does Not Exist Anywhere",606:"Not Acceptable"},ALLOWED_METHODS:"INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY",ACCEPTED_BODY_TYPES:"application/sdp, application/dtmf-relay",MAX_FORWARDS:69,SESSION_EXPIRES:90,MIN_SESSION_EXPIRES:60,CONNECTION_RECOVERY_MAX_INTERVAL:30,CONNECTION_RECOVERY_MIN_INTERVAL:2}},{"../package.json":40}],3:[function(e,t,n){"use strict";function r(e,t){for(var n=0;n3&&void 0!==arguments[3]?arguments[3]:d.STATUS_CONFIRMED;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._owner=t,this._ua=t._ua,this._uac_pending_reply=!1,this._uas_pending_reply=!1,!n.hasHeader("contact"))return{error:"unable to create a Dialog without Contact header field"};n instanceof o.IncomingResponse&&(s=n.status_code<200?d.STATUS_EARLY:d.STATUS_CONFIRMED);var i=n.parseHeader("contact");"UAS"===r?(this._id={call_id:n.call_id,local_tag:n.to_tag,remote_tag:n.from_tag,toString:function(){return this.call_id+this.local_tag+this.remote_tag}},this._state=s,this._remote_seqnum=n.cseq,this._local_uri=n.parseHeader("to").uri,this._remote_uri=n.parseHeader("from").uri,this._remote_target=i.uri,this._route_set=n.getHeaders("record-route"),this._ack_seqnum=this._remote_seqnum):"UAC"===r&&(this._id={call_id:n.call_id,local_tag:n.from_tag,remote_tag:n.to_tag,toString:function(){return this.call_id+this.local_tag+this.remote_tag}},this._state=s,this._local_seqnum=n.cseq,this._local_uri=n.parseHeader("from").uri,this._remote_uri=n.parseHeader("to").uri,this._remote_target=i.uri,this._route_set=n.getHeaders("record-route").reverse(),this._ack_seqnum=null),this._ua.newDialog(this),h.debug("new ".concat(r," dialog created with status ").concat(this._state===d.STATUS_EARLY?"EARLY":"CONFIRMED"))}return s(e,null,[{key:"C",get:function(){return d}}]),s(e,[{key:"update",value:function(e,t){this._state=d.STATUS_CONFIRMED,h.debug("dialog ".concat(this._id.toString()," changed to CONFIRMED state")),"UAC"===t&&(this._route_set=e.getHeaders("record-route").reverse())}},{key:"terminate",value:function(){h.debug("dialog ".concat(this._id.toString()," deleted")),this._ua.destroyDialog(this)}},{key:"sendRequest",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=c.cloneArray(n.extraHeaders),s=c.cloneObject(n.eventHandlers),i=n.body||null,o=this._createRequest(e,r,i);return s.onAuthenticated=function(){t._local_seqnum+=1},new a(this,o,s).send(),o}},{key:"receiveRequest",value:function(e){this._checkInDialogRequest(e)&&(e.method===l.ACK&&null!==this._ack_seqnum?this._ack_seqnum=null:e.method===l.INVITE&&(this._ack_seqnum=e.cseq),this._owner.receiveRequest(e))}},{key:"_createRequest",value:function(e,t,n){t=c.cloneArray(t),this._local_seqnum||(this._local_seqnum=Math.floor(1e4*Math.random()));var r=e===l.CANCEL||e===l.ACK?this._local_seqnum:this._local_seqnum+=1;return new o.OutgoingRequest(e,this._remote_target,this._ua,{cseq:r,call_id:this._id.call_id,from_uri:this._local_uri,from_tag:this._id.local_tag,to_uri:this._remote_uri,to_tag:this._id.remote_tag,route_set:this._route_set},t,n)}},{key:"_checkInDialogRequest",value:function(e){var t=this;if(this._remote_seqnum)if(e.cseqthis._remote_seqnum&&(this._remote_seqnum=e.cseq);else this._remote_seqnum=e.cseq;if(e.method===l.INVITE||e.method===l.UPDATE&&e.body){if(!0===this._uac_pending_reply)e.reply(491);else{if(!0===this._uas_pending_reply){var n=1+(10*Math.random()|0);return e.reply(500,null,["Retry-After:".concat(n)]),!1}this._uas_pending_reply=!0;e.server_transaction.on("stateChanged",function n(){e.server_transaction.state!==u.C.STATUS_ACCEPTED&&e.server_transaction.state!==u.C.STATUS_COMPLETED&&e.server_transaction.state!==u.C.STATUS_TERMINATED||(e.server_transaction.removeListener("stateChanged",n),t._uas_pending_reply=!1)})}e.hasHeader("contact")&&e.server_transaction.on("stateChanged",function(){e.server_transaction.state===u.C.STATUS_ACCEPTED&&(t._remote_target=e.parseHeader("contact").uri)})}else e.method===l.NOTIFY&&e.hasHeader("contact")&&e.server_transaction.on("stateChanged",function(){e.server_transaction.state===u.C.STATUS_COMPLETED&&(t._remote_target=e.parseHeader("contact").uri)});return!0}},{key:"id",get:function(){return this._id}},{key:"local_seqnum",get:function(){return this._local_seqnum},set:function(e){this._local_seqnum=e}},{key:"owner",get:function(){return this._owner}},{key:"uac_pending_reply",get:function(){return this._uac_pending_reply},set:function(e){this._uac_pending_reply=e}},{key:"uas_pending_reply",get:function(){return this._uas_pending_reply}}]),e}()},{"./Constants":2,"./Dialog/RequestSender":4,"./Logger":9,"./SIPMessage":21,"./Transactions":24,"./Utils":28}],4:[function(e,t,n){"use strict";function r(e,t){for(var n=0;n=200&&e.status_code<300?this._eventHandlers.onSuccessResponse(e):e.status_code>=300&&this._eventHandlers.onErrorResponse(e):(this._request.cseq=this._dialog.local_seqnum+=1,this._reattemptTimer=setTimeout(function(){t._dialog.owner.status!==o.C.STATUS_TERMINATED&&(t._reattempt=!0,t._request_sender.send())},1e3)):e.status_code>=200&&e.status_code<300?this._eventHandlers.onSuccessResponse(e):e.status_code>=300&&this._eventHandlers.onErrorResponse(e)}},{key:"request",get:function(){return this._request}}])&&r(t.prototype,n),a&&r(t,a),e}()},{"../Constants":2,"../RTCSession":14,"../RequestSender":20,"../Transactions":24}],5:[function(e,t,n){"use strict";function r(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:null;if(this._algorithm=t.algorithm,this._realm=t.realm,this._nonce=t.nonce,this._opaque=t.opaque,this._stale=t.stale,this._algorithm){if("MD5"!==this._algorithm)return o.warn('authenticate() | challenge with Digest algorithm different than "MD5", authentication aborted'),!1}else this._algorithm="MD5";if(!this._nonce)return o.warn("authenticate() | challenge without Digest nonce, authentication aborted"),!1;if(!this._realm)return o.warn("authenticate() | challenge without Digest realm, authentication aborted"),!1;if(!this._credentials.password){if(!this._credentials.ha1)return o.warn("authenticate() | no plain SIP password nor ha1 provided, authentication aborted"),!1;if(this._credentials.realm!==this._realm)return o.warn('authenticate() | no plain SIP password, and stored `realm` does not match the given `realm`, cannot authenticate [stored:"%s", given:"%s"]',this._credentials.realm,this._realm),!1}if(t.qop)if(t.qop.indexOf("auth-int")>-1)this._qop="auth-int";else{if(!(t.qop.indexOf("auth")>-1))return o.warn('authenticate() | challenge without Digest qop different than "auth" or "auth-int", authentication aborted'),!1;this._qop="auth"}else this._qop=null;this._method=n,this._uri=r,this._cnonce=l||i.createRandomToken(12),this._nc+=1;var u,a,c=Number(this._nc).toString(16);return this._ncHex="00000000".substr(0,8-c.length)+c,4294967296===this._nc&&(this._nc=1,this._ncHex="00000001"),this._credentials.password?this._ha1=i.calculateMD5("".concat(this._credentials.username,":").concat(this._realm,":").concat(this._credentials.password)):this._ha1=this._credentials.ha1,"auth"===this._qop?(u="".concat(this._method,":").concat(this._uri),a=i.calculateMD5(u),o.debug('authenticate() | using qop=auth [a2:"%s"]',u),this._response=i.calculateMD5("".concat(this._ha1,":").concat(this._nonce,":").concat(this._ncHex,":").concat(this._cnonce,":auth:").concat(a))):"auth-int"===this._qop?(u="".concat(this._method,":").concat(this._uri,":").concat(i.calculateMD5(s||"")),a=i.calculateMD5(u),o.debug('authenticate() | using qop=auth-int [a2:"%s"]',u),this._response=i.calculateMD5("".concat(this._ha1,":").concat(this._nonce,":").concat(this._ncHex,":").concat(this._cnonce,":auth-int:").concat(a))):null===this._qop&&(u="".concat(this._method,":").concat(this._uri),a=i.calculateMD5(u),o.debug('authenticate() | using qop=null [a2:"%s"]',u),this._response=i.calculateMD5("".concat(this._ha1,":").concat(this._nonce,":").concat(a))),o.debug("authenticate() | response generated"),!0}},{key:"toString",value:function(){var e=[];if(!this._response)throw new Error("response field does not exist, cannot generate Authorization header");return e.push("algorithm=".concat(this._algorithm)),e.push('username="'.concat(this._credentials.username,'"')),e.push('realm="'.concat(this._realm,'"')),e.push('nonce="'.concat(this._nonce,'"')),e.push('uri="'.concat(this._uri,'"')),e.push('response="'.concat(this._response,'"')),this._opaque&&e.push('opaque="'.concat(this._opaque,'"')),this._qop&&(e.push("qop=".concat(this._qop)),e.push('cnonce="'.concat(this._cnonce,'"')),e.push("nc=".concat(this._ncHex))),"Digest ".concat(e.join(", "))}}])&&r(t.prototype,n),s&&r(t,s),e}()},{"./Logger":9,"./Utils":28}],6:[function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}function o(e){var t=a();return function(){var n,s=h(e);if(t){var i=h(this).constructor;n=Reflect.construct(s,arguments,i)}else n=s.apply(this,arguments);return function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function l(e){var t="function"==typeof Map?new Map:void 0;return(l=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return u(e,arguments,h(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),c(r,e)})(e)}function u(e,t,n){return(u=a()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var s=new(Function.bind.apply(e,r));return n&&c(s,n.prototype),s}).apply(null,arguments)}function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var d=function(e){i(n,l(Error));var t=o(n);function n(e,r){var i;return s(this,n),(i=t.call(this)).code=1,i.name="CONFIGURATION_ERROR",i.parameter=e,i.value=r,i.message=i.value?"Invalid value ".concat(JSON.stringify(i.value),' for parameter "').concat(i.parameter,'"'):"Missing parameter: ".concat(i.parameter),i}return n}(),f=function(e){i(n,l(Error));var t=o(n);function n(e){var r;return s(this,n),(r=t.call(this)).code=2,r.name="INVALID_STATE_ERROR",r.status=e,r.message="Invalid status: ".concat(e),r}return n}(),_=function(e){i(n,l(Error));var t=o(n);function n(e){var r;return s(this,n),(r=t.call(this)).code=3,r.name="NOT_SUPPORTED_ERROR",r.message=e,r}return n}(),p=function(e){i(n,l(Error));var t=o(n);function n(e){var r;return s(this,n),(r=t.call(this)).code=4,r.name="NOT_READY_ERROR",r.message=e,r}return n}();t.exports={ConfigurationError:d,InvalidStateError:f,NotSupportedError:_,NotReadyError:p}},{}],7:[function(e,t,n){"use strict";t.exports=function(){function t(e){return'"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E-\x1F\x80-\uFFFF]/g,escape)+'"'}var n={parse:function(n,r){var s={CRLF:c,DIGIT:h,ALPHA:d,HEXDIG:f,WSP:_,OCTET:p,DQUOTE:m,SP:v,HTAB:g,alphanum:y,reserved:T,unreserved:C,mark:b,escaped:S,LWS:E,SWS:A,HCOLON:R,TEXT_UTF8_TRIM:w,TEXT_UTF8char:I,UTF8_NONASCII:O,UTF8_CONT:k,LHEX:function(){var e;null===(e=h())&&(/^[a-f]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[a-f]")));return e},token:N,token_nodot:D,separators:function(){var e;40===n.charCodeAt(i)?(e="(",i++):(e=null,0===o&&a('"("'));null===e&&(41===n.charCodeAt(i)?(e=")",i++):(e=null,0===o&&a('")"')),null===e&&(60===n.charCodeAt(i)?(e="<",i++):(e=null,0===o&&a('"<"')),null===e&&(62===n.charCodeAt(i)?(e=">",i++):(e=null,0===o&&a('">"')),null===e&&(64===n.charCodeAt(i)?(e="@",i++):(e=null,0===o&&a('"@"')),null===e&&(44===n.charCodeAt(i)?(e=",",i++):(e=null,0===o&&a('","')),null===e&&(59===n.charCodeAt(i)?(e=";",i++):(e=null,0===o&&a('";"')),null===e&&(58===n.charCodeAt(i)?(e=":",i++):(e=null,0===o&&a('":"')),null===e&&(92===n.charCodeAt(i)?(e="\\",i++):(e=null,0===o&&a('"\\\\"')),null===e&&null===(e=m())&&(47===n.charCodeAt(i)?(e="/",i++):(e=null,0===o&&a('"/"')),null===e&&(91===n.charCodeAt(i)?(e="[",i++):(e=null,0===o&&a('"["')),null===e&&(93===n.charCodeAt(i)?(e="]",i++):(e=null,0===o&&a('"]"')),null===e&&(63===n.charCodeAt(i)?(e="?",i++):(e=null,0===o&&a('"?"')),null===e&&(61===n.charCodeAt(i)?(e="=",i++):(e=null,0===o&&a('"="')),null===e&&(123===n.charCodeAt(i)?(e="{",i++):(e=null,0===o&&a('"{"')),null===e&&(125===n.charCodeAt(i)?(e="}",i++):(e=null,0===o&&a('"}"')),null===e&&null===(e=v())&&(e=g()))))))))))))))));return e},word:U,STAR:x,SLASH:P,EQUAL:M,LPAREN:q,RPAREN:L,RAQUOT:H,LAQUOT:F,COMMA:j,SEMI:G,COLON:W,LDQUOT:V,RDQUOT:B,comment:function e(){var t,n,r;var s;s=i;t=q();if(null!==t){for(n=[],null===(r=K())&&null===(r=X())&&(r=e());null!==r;)n.push(r),null===(r=K())&&null===(r=X())&&(r=e());null!==n&&null!==(r=L())?t=[t,n,r]:(t=null,i=s)}else t=null,i=s;return t},ctext:K,quoted_string:z,quoted_string_clean:Y,qdtext:$,quoted_pair:X,SIP_URI_noparams:J,SIP_URI:Q,uri_scheme:Z,uri_scheme_sips:ee,uri_scheme_sip:te,userinfo:ne,user:re,user_unreserved:se,password:ie,hostport:oe,host:le,hostname:ue,domainlabel:ae,toplabel:ce,IPv6reference:he,IPv6address:de,h16:fe,ls32:_e,IPv4address:pe,dec_octet:me,port:ve,uri_parameters:ge,uri_parameter:ye,transport_param:Te,user_param:Ce,method_param:be,ttl_param:Se,maddr_param:Ee,lr_param:Ae,other_param:Re,pname:we,pvalue:Ie,paramchar:Oe,param_unreserved:ke,headers:Ne,header:De,hname:Ue,hvalue:xe,hnv_unreserved:Pe,Request_Response:function(){var e;null===(e=ht())&&(e=Me());return e},Request_Line:Me,Request_URI:qe,absoluteURI:Le,hier_part:He,net_path:Fe,abs_path:je,opaque_part:Ge,uric:We,uric_no_slash:Ve,path_segments:Be,segment:Ke,param:ze,pchar:Ye,scheme:$e,authority:Xe,srvr:Je,reg_name:Qe,query:Ze,SIP_Version:et,INVITEm:tt,ACKm:nt,OPTIONSm:rt,BYEm:st,CANCELm:it,REGISTERm:ot,SUBSCRIBEm:lt,NOTIFYm:ut,REFERm:at,Method:ct,Status_Line:ht,Status_Code:dt,extension_code:ft,Reason_Phrase:_t,Allow_Events:function(){var e,t,n,r,s,o;if(s=i,null!==(e=Lt())){for(t=[],o=i,null!==(n=j())&&null!==(r=Lt())?n=[n,r]:(n=null,i=o);null!==n;)t.push(n),o=i,null!==(n=j())&&null!==(r=Lt())?n=[n,r]:(n=null,i=o);null!==t?e=[e,t]:(e=null,i=s)}else e=null,i=s;return e},Call_ID:function(){var e,t,r,s,l,u;s=i,l=i,null!==(e=U())?(u=i,64===n.charCodeAt(i)?(t="@",i++):(t=null,0===o&&a('"@"')),null!==t&&null!==(r=U())?t=[t,r]:(t=null,i=u),null!==(t=null!==t?t:"")?e=[e,t]:(e=null,i=l)):(e=null,i=l);null!==e&&(c=s,e=void(jn=n.substring(i,c)));var c;null===e&&(i=s);return e},Contact:function(){var e,t,n,r,s,o,l;if(s=i,null===(e=x()))if(o=i,null!==(e=pt())){for(t=[],l=i,null!==(n=j())&&null!==(r=pt())?n=[n,r]:(n=null,i=l);null!==n;)t.push(n),l=i,null!==(n=j())&&null!==(r=pt())?n=[n,r]:(n=null,i=l);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;null!==e&&(e=function(e){var t,n;for(n=jn.multi_header.length,t=0;tl&&(l=i,u=[]),u.push(e))}function c(){var e;return"\r\n"===n.substr(i,2)?(e="\r\n",i+=2):(e=null,0===o&&a('"\\r\\n"')),e}function h(){var e;return/^[0-9]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[0-9]")),e}function d(){var e;return/^[a-zA-Z]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[a-zA-Z]")),e}function f(){var e;return/^[0-9a-fA-F]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[0-9a-fA-F]")),e}function _(){var e;return null===(e=v())&&(e=g()),e}function p(){var e;return/^[\0-\xFF]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[\\0-\\xFF]")),e}function m(){var e;return/^["]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a('["]')),e}function v(){var e;return 32===n.charCodeAt(i)?(e=" ",i++):(e=null,0===o&&a('" "')),e}function g(){var e;return 9===n.charCodeAt(i)?(e="\t",i++):(e=null,0===o&&a('"\\t"')),e}function y(){var e;return/^[a-zA-Z0-9]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[a-zA-Z0-9]")),e}function T(){var e;return 59===n.charCodeAt(i)?(e=";",i++):(e=null,0===o&&a('";"')),null===e&&(47===n.charCodeAt(i)?(e="/",i++):(e=null,0===o&&a('"/"')),null===e&&(63===n.charCodeAt(i)?(e="?",i++):(e=null,0===o&&a('"?"')),null===e&&(58===n.charCodeAt(i)?(e=":",i++):(e=null,0===o&&a('":"')),null===e&&(64===n.charCodeAt(i)?(e="@",i++):(e=null,0===o&&a('"@"')),null===e&&(38===n.charCodeAt(i)?(e="&",i++):(e=null,0===o&&a('"&"')),null===e&&(61===n.charCodeAt(i)?(e="=",i++):(e=null,0===o&&a('"="')),null===e&&(43===n.charCodeAt(i)?(e="+",i++):(e=null,0===o&&a('"+"')),null===e&&(36===n.charCodeAt(i)?(e="$",i++):(e=null,0===o&&a('"$"')),null===e&&(44===n.charCodeAt(i)?(e=",",i++):(e=null,0===o&&a('","'))))))))))),e}function C(){var e;return null===(e=y())&&(e=b()),e}function b(){var e;return 45===n.charCodeAt(i)?(e="-",i++):(e=null,0===o&&a('"-"')),null===e&&(95===n.charCodeAt(i)?(e="_",i++):(e=null,0===o&&a('"_"')),null===e&&(46===n.charCodeAt(i)?(e=".",i++):(e=null,0===o&&a('"."')),null===e&&(33===n.charCodeAt(i)?(e="!",i++):(e=null,0===o&&a('"!"')),null===e&&(126===n.charCodeAt(i)?(e="~",i++):(e=null,0===o&&a('"~"')),null===e&&(42===n.charCodeAt(i)?(e="*",i++):(e=null,0===o&&a('"*"')),null===e&&(39===n.charCodeAt(i)?(e="'",i++):(e=null,0===o&&a('"\'"')),null===e&&(40===n.charCodeAt(i)?(e="(",i++):(e=null,0===o&&a('"("')),null===e&&(41===n.charCodeAt(i)?(e=")",i++):(e=null,0===o&&a('")"')))))))))),e}function S(){var e,t,r,s,l;return s=i,l=i,37===n.charCodeAt(i)?(e="%",i++):(e=null,0===o&&a('"%"')),null!==e&&null!==(t=f())&&null!==(r=f())?e=[e,t,r]:(e=null,i=l),null!==e&&(e=e.join("")),null===e&&(i=s),e}function E(){var e,t,n,r,s,o;for(r=i,s=i,o=i,e=[],t=_();null!==t;)e.push(t),t=_();if(null!==e&&null!==(t=c())?e=[e,t]:(e=null,i=o),null!==(e=null!==e?e:"")){if(null!==(n=_()))for(t=[];null!==n;)t.push(n),n=_();else t=null;null!==t?e=[e,t]:(e=null,i=s)}else e=null,i=s;return null!==e&&(e=" "),null===e&&(i=r),e}function A(){var e;return e=null!==(e=E())?e:""}function R(){var e,t,r,s,l;for(s=i,l=i,e=[],null===(t=v())&&(t=g());null!==t;)e.push(t),null===(t=v())&&(t=g());return null!==e?(58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t&&null!==(r=A())?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(e=":"),null===e&&(i=s),e}function w(){var e,t,r,s,o,l,u,a;if(o=i,l=i,null!==(t=I()))for(e=[];null!==t;)e.push(t),t=I();else e=null;if(null!==e){for(t=[],u=i,r=[],s=E();null!==s;)r.push(s),s=E();for(null!==r&&null!==(s=I())?r=[r,s]:(r=null,i=u);null!==r;){for(t.push(r),u=i,r=[],s=E();null!==s;)r.push(s),s=E();null!==r&&null!==(s=I())?r=[r,s]:(r=null,i=u)}null!==t?e=[e,t]:(e=null,i=l)}else e=null,i=l;return null!==e&&(a=o,e=n.substring(i,a)),null===e&&(i=o),e}function I(){var e;return/^[!-~]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[!-~]")),null===e&&(e=O()),e}function O(){var e;return/^[\x80-\uFFFF]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[\\x80-\\uFFFF]")),e}function k(){var e;return/^[\x80-\xBF]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[\\x80-\\xBF]")),e}function N(){var e,t,r,s;if(r=i,null===(t=y())&&(45===n.charCodeAt(i)?(t="-",i++):(t=null,0===o&&a('"-"')),null===t&&(46===n.charCodeAt(i)?(t=".",i++):(t=null,0===o&&a('"."')),null===t&&(33===n.charCodeAt(i)?(t="!",i++):(t=null,0===o&&a('"!"')),null===t&&(37===n.charCodeAt(i)?(t="%",i++):(t=null,0===o&&a('"%"')),null===t&&(42===n.charCodeAt(i)?(t="*",i++):(t=null,0===o&&a('"*"')),null===t&&(95===n.charCodeAt(i)?(t="_",i++):(t=null,0===o&&a('"_"')),null===t&&(43===n.charCodeAt(i)?(t="+",i++):(t=null,0===o&&a('"+"')),null===t&&(96===n.charCodeAt(i)?(t="`",i++):(t=null,0===o&&a('"`"')),null===t&&(39===n.charCodeAt(i)?(t="'",i++):(t=null,0===o&&a('"\'"')),null===t&&(126===n.charCodeAt(i)?(t="~",i++):(t=null,0===o&&a('"~"')))))))))))),null!==t)for(e=[];null!==t;)e.push(t),null===(t=y())&&(45===n.charCodeAt(i)?(t="-",i++):(t=null,0===o&&a('"-"')),null===t&&(46===n.charCodeAt(i)?(t=".",i++):(t=null,0===o&&a('"."')),null===t&&(33===n.charCodeAt(i)?(t="!",i++):(t=null,0===o&&a('"!"')),null===t&&(37===n.charCodeAt(i)?(t="%",i++):(t=null,0===o&&a('"%"')),null===t&&(42===n.charCodeAt(i)?(t="*",i++):(t=null,0===o&&a('"*"')),null===t&&(95===n.charCodeAt(i)?(t="_",i++):(t=null,0===o&&a('"_"')),null===t&&(43===n.charCodeAt(i)?(t="+",i++):(t=null,0===o&&a('"+"')),null===t&&(96===n.charCodeAt(i)?(t="`",i++):(t=null,0===o&&a('"`"')),null===t&&(39===n.charCodeAt(i)?(t="'",i++):(t=null,0===o&&a('"\'"')),null===t&&(126===n.charCodeAt(i)?(t="~",i++):(t=null,0===o&&a('"~"'))))))))))));else e=null;return null!==e&&(s=r,e=n.substring(i,s)),null===e&&(i=r),e}function D(){var e,t,r,s;if(r=i,null===(t=y())&&(45===n.charCodeAt(i)?(t="-",i++):(t=null,0===o&&a('"-"')),null===t&&(33===n.charCodeAt(i)?(t="!",i++):(t=null,0===o&&a('"!"')),null===t&&(37===n.charCodeAt(i)?(t="%",i++):(t=null,0===o&&a('"%"')),null===t&&(42===n.charCodeAt(i)?(t="*",i++):(t=null,0===o&&a('"*"')),null===t&&(95===n.charCodeAt(i)?(t="_",i++):(t=null,0===o&&a('"_"')),null===t&&(43===n.charCodeAt(i)?(t="+",i++):(t=null,0===o&&a('"+"')),null===t&&(96===n.charCodeAt(i)?(t="`",i++):(t=null,0===o&&a('"`"')),null===t&&(39===n.charCodeAt(i)?(t="'",i++):(t=null,0===o&&a('"\'"')),null===t&&(126===n.charCodeAt(i)?(t="~",i++):(t=null,0===o&&a('"~"'))))))))))),null!==t)for(e=[];null!==t;)e.push(t),null===(t=y())&&(45===n.charCodeAt(i)?(t="-",i++):(t=null,0===o&&a('"-"')),null===t&&(33===n.charCodeAt(i)?(t="!",i++):(t=null,0===o&&a('"!"')),null===t&&(37===n.charCodeAt(i)?(t="%",i++):(t=null,0===o&&a('"%"')),null===t&&(42===n.charCodeAt(i)?(t="*",i++):(t=null,0===o&&a('"*"')),null===t&&(95===n.charCodeAt(i)?(t="_",i++):(t=null,0===o&&a('"_"')),null===t&&(43===n.charCodeAt(i)?(t="+",i++):(t=null,0===o&&a('"+"')),null===t&&(96===n.charCodeAt(i)?(t="`",i++):(t=null,0===o&&a('"`"')),null===t&&(39===n.charCodeAt(i)?(t="'",i++):(t=null,0===o&&a('"\'"')),null===t&&(126===n.charCodeAt(i)?(t="~",i++):(t=null,0===o&&a('"~"')))))))))));else e=null;return null!==e&&(s=r,e=n.substring(i,s)),null===e&&(i=r),e}function U(){var e,t,r,s;if(r=i,null===(t=y())&&(45===n.charCodeAt(i)?(t="-",i++):(t=null,0===o&&a('"-"')),null===t&&(46===n.charCodeAt(i)?(t=".",i++):(t=null,0===o&&a('"."')),null===t&&(33===n.charCodeAt(i)?(t="!",i++):(t=null,0===o&&a('"!"')),null===t&&(37===n.charCodeAt(i)?(t="%",i++):(t=null,0===o&&a('"%"')),null===t&&(42===n.charCodeAt(i)?(t="*",i++):(t=null,0===o&&a('"*"')),null===t&&(95===n.charCodeAt(i)?(t="_",i++):(t=null,0===o&&a('"_"')),null===t&&(43===n.charCodeAt(i)?(t="+",i++):(t=null,0===o&&a('"+"')),null===t&&(96===n.charCodeAt(i)?(t="`",i++):(t=null,0===o&&a('"`"')),null===t&&(39===n.charCodeAt(i)?(t="'",i++):(t=null,0===o&&a('"\'"')),null===t&&(126===n.charCodeAt(i)?(t="~",i++):(t=null,0===o&&a('"~"')),null===t&&(40===n.charCodeAt(i)?(t="(",i++):(t=null,0===o&&a('"("')),null===t&&(41===n.charCodeAt(i)?(t=")",i++):(t=null,0===o&&a('")"')),null===t&&(60===n.charCodeAt(i)?(t="<",i++):(t=null,0===o&&a('"<"')),null===t&&(62===n.charCodeAt(i)?(t=">",i++):(t=null,0===o&&a('">"')),null===t&&(58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null===t&&(92===n.charCodeAt(i)?(t="\\",i++):(t=null,0===o&&a('"\\\\"')),null===t&&null===(t=m())&&(47===n.charCodeAt(i)?(t="/",i++):(t=null,0===o&&a('"/"')),null===t&&(91===n.charCodeAt(i)?(t="[",i++):(t=null,0===o&&a('"["')),null===t&&(93===n.charCodeAt(i)?(t="]",i++):(t=null,0===o&&a('"]"')),null===t&&(63===n.charCodeAt(i)?(t="?",i++):(t=null,0===o&&a('"?"')),null===t&&(123===n.charCodeAt(i)?(t="{",i++):(t=null,0===o&&a('"{"')),null===t&&(125===n.charCodeAt(i)?(t="}",i++):(t=null,0===o&&a('"}"')))))))))))))))))))))))),null!==t)for(e=[];null!==t;)e.push(t),null===(t=y())&&(45===n.charCodeAt(i)?(t="-",i++):(t=null,0===o&&a('"-"')),null===t&&(46===n.charCodeAt(i)?(t=".",i++):(t=null,0===o&&a('"."')),null===t&&(33===n.charCodeAt(i)?(t="!",i++):(t=null,0===o&&a('"!"')),null===t&&(37===n.charCodeAt(i)?(t="%",i++):(t=null,0===o&&a('"%"')),null===t&&(42===n.charCodeAt(i)?(t="*",i++):(t=null,0===o&&a('"*"')),null===t&&(95===n.charCodeAt(i)?(t="_",i++):(t=null,0===o&&a('"_"')),null===t&&(43===n.charCodeAt(i)?(t="+",i++):(t=null,0===o&&a('"+"')),null===t&&(96===n.charCodeAt(i)?(t="`",i++):(t=null,0===o&&a('"`"')),null===t&&(39===n.charCodeAt(i)?(t="'",i++):(t=null,0===o&&a('"\'"')),null===t&&(126===n.charCodeAt(i)?(t="~",i++):(t=null,0===o&&a('"~"')),null===t&&(40===n.charCodeAt(i)?(t="(",i++):(t=null,0===o&&a('"("')),null===t&&(41===n.charCodeAt(i)?(t=")",i++):(t=null,0===o&&a('")"')),null===t&&(60===n.charCodeAt(i)?(t="<",i++):(t=null,0===o&&a('"<"')),null===t&&(62===n.charCodeAt(i)?(t=">",i++):(t=null,0===o&&a('">"')),null===t&&(58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null===t&&(92===n.charCodeAt(i)?(t="\\",i++):(t=null,0===o&&a('"\\\\"')),null===t&&null===(t=m())&&(47===n.charCodeAt(i)?(t="/",i++):(t=null,0===o&&a('"/"')),null===t&&(91===n.charCodeAt(i)?(t="[",i++):(t=null,0===o&&a('"["')),null===t&&(93===n.charCodeAt(i)?(t="]",i++):(t=null,0===o&&a('"]"')),null===t&&(63===n.charCodeAt(i)?(t="?",i++):(t=null,0===o&&a('"?"')),null===t&&(123===n.charCodeAt(i)?(t="{",i++):(t=null,0===o&&a('"{"')),null===t&&(125===n.charCodeAt(i)?(t="}",i++):(t=null,0===o&&a('"}"'))))))))))))))))))))))));else e=null;return null!==e&&(s=r,e=n.substring(i,s)),null===e&&(i=r),e}function x(){var e,t,r,s,l;return s=i,l=i,null!==(e=A())?(42===n.charCodeAt(i)?(t="*",i++):(t=null,0===o&&a('"*"')),null!==t&&null!==(r=A())?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(e="*"),null===e&&(i=s),e}function P(){var e,t,r,s,l;return s=i,l=i,null!==(e=A())?(47===n.charCodeAt(i)?(t="/",i++):(t=null,0===o&&a('"/"')),null!==t&&null!==(r=A())?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(e="/"),null===e&&(i=s),e}function M(){var e,t,r,s,l;return s=i,l=i,null!==(e=A())?(61===n.charCodeAt(i)?(t="=",i++):(t=null,0===o&&a('"="')),null!==t&&null!==(r=A())?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(e="="),null===e&&(i=s),e}function q(){var e,t,r,s,l;return s=i,l=i,null!==(e=A())?(40===n.charCodeAt(i)?(t="(",i++):(t=null,0===o&&a('"("')),null!==t&&null!==(r=A())?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(e="("),null===e&&(i=s),e}function L(){var e,t,r,s,l;return s=i,l=i,null!==(e=A())?(41===n.charCodeAt(i)?(t=")",i++):(t=null,0===o&&a('")"')),null!==t&&null!==(r=A())?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(e=")"),null===e&&(i=s),e}function H(){var e,t,r,s;return r=i,s=i,62===n.charCodeAt(i)?(e=">",i++):(e=null,0===o&&a('">"')),null!==e&&null!==(t=A())?e=[e,t]:(e=null,i=s),null!==e&&(e=">"),null===e&&(i=r),e}function F(){var e,t,r,s;return r=i,s=i,null!==(e=A())?(60===n.charCodeAt(i)?(t="<",i++):(t=null,0===o&&a('"<"')),null!==t?e=[e,t]:(e=null,i=s)):(e=null,i=s),null!==e&&(e="<"),null===e&&(i=r),e}function j(){var e,t,r,s,l;return s=i,l=i,null!==(e=A())?(44===n.charCodeAt(i)?(t=",",i++):(t=null,0===o&&a('","')),null!==t&&null!==(r=A())?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(e=","),null===e&&(i=s),e}function G(){var e,t,r,s,l;return s=i,l=i,null!==(e=A())?(59===n.charCodeAt(i)?(t=";",i++):(t=null,0===o&&a('";"')),null!==t&&null!==(r=A())?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(e=";"),null===e&&(i=s),e}function W(){var e,t,r,s,l;return s=i,l=i,null!==(e=A())?(58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t&&null!==(r=A())?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(e=":"),null===e&&(i=s),e}function V(){var e,t,n,r;return n=i,r=i,null!==(e=A())&&null!==(t=m())?e=[e,t]:(e=null,i=r),null!==e&&(e='"'),null===e&&(i=n),e}function B(){var e,t,n,r;return n=i,r=i,null!==(e=m())&&null!==(t=A())?e=[e,t]:(e=null,i=r),null!==e&&(e='"'),null===e&&(i=n),e}function K(){var e;return/^[!-']/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[!-']")),null===e&&(/^[*-[]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[*-[]")),null===e&&(/^[\]-~]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[\\]-~]")),null===e&&null===(e=O())&&(e=E()))),e}function z(){var e,t,r,s,o,l,u;if(o=i,l=i,null!==(e=A()))if(null!==(t=m())){for(r=[],null===(s=$())&&(s=X());null!==s;)r.push(s),null===(s=$())&&(s=X());null!==r&&null!==(s=m())?e=[e,t,r,s]:(e=null,i=l)}else e=null,i=l;else e=null,i=l;return null!==e&&(u=o,e=n.substring(i,u)),null===e&&(i=o),e}function Y(){var e,t,r,s,o,l,u,a;if(o=i,l=i,null!==(e=A()))if(null!==(t=m())){for(r=[],null===(s=$())&&(s=X());null!==s;)r.push(s),null===(s=$())&&(s=X());null!==r&&null!==(s=m())?e=[e,t,r,s]:(e=null,i=l)}else e=null,i=l;else e=null,i=l;return null!==e&&(u=o,e=(a=n.substring(i,u).trim()).substring(1,a.length-1).replace(/\\([\x00-\x09\x0b-\x0c\x0e-\x7f])/g,"$1")),null===e&&(i=o),e}function $(){var e;return null===(e=E())&&(33===n.charCodeAt(i)?(e="!",i++):(e=null,0===o&&a('"!"')),null===e&&(/^[#-[]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[#-[]")),null===e&&(/^[\]-~]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[\\]-~]")),null===e&&(e=O())))),e}function X(){var e,t,r;return r=i,92===n.charCodeAt(i)?(e="\\",i++):(e=null,0===o&&a('"\\\\"')),null!==e?(/^[\0-\t]/.test(n.charAt(i))?(t=n.charAt(i),i++):(t=null,0===o&&a("[\\0-\\t]")),null===t&&(/^[\x0B-\f]/.test(n.charAt(i))?(t=n.charAt(i),i++):(t=null,0===o&&a("[\\x0B-\\f]")),null===t&&(/^[\x0E-]/.test(n.charAt(i))?(t=n.charAt(i),i++):(t=null,0===o&&a("[\\x0E-]")))),null!==t?e=[e,t]:(e=null,i=r)):(e=null,i=r),e}function J(){var e,t,r,s,l,u;return l=i,u=i,null!==(e=Z())?(58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t&&null!==(r=null!==(r=ne())?r:"")&&null!==(s=oe())?e=[e,t,r,s]:(e=null,i=u)):(e=null,i=u),null!==e&&(e=function(e){try{jn.uri=new Hn(jn.scheme,jn.user,jn.host,jn.port),delete jn.scheme,delete jn.user,delete jn.host,delete jn.host_type,delete jn.port}catch(e){jn=-1}}()),null===e&&(i=l),e}function Q(){var e,t,s,l,u,c,h,d;return h=i,d=i,null!==(e=Z())?(58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t&&null!==(s=null!==(s=ne())?s:"")&&null!==(l=oe())&&null!==(u=ge())&&null!==(c=null!==(c=Ne())?c:"")?e=[e,t,s,l,u,c]:(e=null,i=d)):(e=null,i=d),null!==e&&(e=function(e){try{jn.uri=new Hn(jn.scheme,jn.user,jn.host,jn.port,jn.uri_params,jn.uri_headers),delete jn.scheme,delete jn.user,delete jn.host,delete jn.host_type,delete jn.port,delete jn.uri_params,"SIP_URI"===r&&(jn=jn.uri)}catch(e){jn=-1}}()),null===e&&(i=h),e}function Z(){var e;return null===(e=ee())&&(e=te()),e}function ee(){var e,t,r;return t=i,"sips"===n.substr(i,4).toLowerCase()?(e=n.substr(i,4),i+=4):(e=null,0===o&&a('"sips"')),null!==e&&(r=e,e=void(jn.scheme=r.toLowerCase())),null===e&&(i=t),e}function te(){var e,t,r;return t=i,"sip"===n.substr(i,3).toLowerCase()?(e=n.substr(i,3),i+=3):(e=null,0===o&&a('"sip"')),null!==e&&(r=e,e=void(jn.scheme=r.toLowerCase())),null===e&&(i=t),e}function ne(){var e,t,r,s,l,u,c;return s=i,l=i,null!==(e=re())?(u=i,58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t&&null!==(r=ie())?t=[t,r]:(t=null,i=u),null!==(t=null!==t?t:"")?(64===n.charCodeAt(i)?(r="@",i++):(r=null,0===o&&a('"@"')),null!==r?e=[e,t,r]:(e=null,i=l)):(e=null,i=l)):(e=null,i=l),null!==e&&(c=s,e=void(jn.user=decodeURIComponent(n.substring(i-1,c)))),null===e&&(i=s),e}function re(){var e,t;if(null===(t=C())&&null===(t=S())&&(t=se()),null!==t)for(e=[];null!==t;)e.push(t),null===(t=C())&&null===(t=S())&&(t=se());else e=null;return e}function se(){var e;return 38===n.charCodeAt(i)?(e="&",i++):(e=null,0===o&&a('"&"')),null===e&&(61===n.charCodeAt(i)?(e="=",i++):(e=null,0===o&&a('"="')),null===e&&(43===n.charCodeAt(i)?(e="+",i++):(e=null,0===o&&a('"+"')),null===e&&(36===n.charCodeAt(i)?(e="$",i++):(e=null,0===o&&a('"$"')),null===e&&(44===n.charCodeAt(i)?(e=",",i++):(e=null,0===o&&a('","')),null===e&&(59===n.charCodeAt(i)?(e=";",i++):(e=null,0===o&&a('";"')),null===e&&(63===n.charCodeAt(i)?(e="?",i++):(e=null,0===o&&a('"?"')),null===e&&(47===n.charCodeAt(i)?(e="/",i++):(e=null,0===o&&a('"/"'))))))))),e}function ie(){var e,t,r,s;for(r=i,e=[],null===(t=C())&&null===(t=S())&&(38===n.charCodeAt(i)?(t="&",i++):(t=null,0===o&&a('"&"')),null===t&&(61===n.charCodeAt(i)?(t="=",i++):(t=null,0===o&&a('"="')),null===t&&(43===n.charCodeAt(i)?(t="+",i++):(t=null,0===o&&a('"+"')),null===t&&(36===n.charCodeAt(i)?(t="$",i++):(t=null,0===o&&a('"$"')),null===t&&(44===n.charCodeAt(i)?(t=",",i++):(t=null,0===o&&a('","')))))));null!==t;)e.push(t),null===(t=C())&&null===(t=S())&&(38===n.charCodeAt(i)?(t="&",i++):(t=null,0===o&&a('"&"')),null===t&&(61===n.charCodeAt(i)?(t="=",i++):(t=null,0===o&&a('"="')),null===t&&(43===n.charCodeAt(i)?(t="+",i++):(t=null,0===o&&a('"+"')),null===t&&(36===n.charCodeAt(i)?(t="$",i++):(t=null,0===o&&a('"$"')),null===t&&(44===n.charCodeAt(i)?(t=",",i++):(t=null,0===o&&a('","')))))));return null!==e&&(s=r,e=void(jn.password=n.substring(i,s))),null===e&&(i=r),e}function oe(){var e,t,r,s,l;return s=i,null!==(e=le())?(l=i,58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t&&null!==(r=ve())?t=[t,r]:(t=null,i=l),null!==(t=null!==t?t:"")?e=[e,t]:(e=null,i=s)):(e=null,i=s),e}function le(){var e,t,r;return t=i,null===(e=ue())&&null===(e=pe())&&(e=he()),null!==e&&(r=t,jn.host=n.substring(i,r).toLowerCase(),e=jn.host),null===e&&(i=t),e}function ue(){var e,t,r,s,l,u,c;for(s=i,l=i,e=[],u=i,null!==(t=ae())?(46===n.charCodeAt(i)?(r=".",i++):(r=null,0===o&&a('"."')),null!==r?t=[t,r]:(t=null,i=u)):(t=null,i=u);null!==t;)e.push(t),u=i,null!==(t=ae())?(46===n.charCodeAt(i)?(r=".",i++):(r=null,0===o&&a('"."')),null!==r?t=[t,r]:(t=null,i=u)):(t=null,i=u);return null!==e&&null!==(t=ce())?(46===n.charCodeAt(i)?(r=".",i++):(r=null,0===o&&a('"."')),null!==(r=null!==r?r:"")?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(c=s,jn.host_type="domain",e=n.substring(i,c)),null===e&&(i=s),e}function ae(){var e,t,r,s;if(s=i,null!==(e=y())){for(t=[],null===(r=y())&&(45===n.charCodeAt(i)?(r="-",i++):(r=null,0===o&&a('"-"')),null===r&&(95===n.charCodeAt(i)?(r="_",i++):(r=null,0===o&&a('"_"'))));null!==r;)t.push(r),null===(r=y())&&(45===n.charCodeAt(i)?(r="-",i++):(r=null,0===o&&a('"-"')),null===r&&(95===n.charCodeAt(i)?(r="_",i++):(r=null,0===o&&a('"_"'))));null!==t?e=[e,t]:(e=null,i=s)}else e=null,i=s;return e}function ce(){var e,t,r,s;if(s=i,null!==(e=d())){for(t=[],null===(r=y())&&(45===n.charCodeAt(i)?(r="-",i++):(r=null,0===o&&a('"-"')),null===r&&(95===n.charCodeAt(i)?(r="_",i++):(r=null,0===o&&a('"_"'))));null!==r;)t.push(r),null===(r=y())&&(45===n.charCodeAt(i)?(r="-",i++):(r=null,0===o&&a('"-"')),null===r&&(95===n.charCodeAt(i)?(r="_",i++):(r=null,0===o&&a('"_"'))));null!==t?e=[e,t]:(e=null,i=s)}else e=null,i=s;return e}function he(){var e,t,r,s,l,u;return s=i,l=i,91===n.charCodeAt(i)?(e="[",i++):(e=null,0===o&&a('"["')),null!==e&&null!==(t=de())?(93===n.charCodeAt(i)?(r="]",i++):(r=null,0===o&&a('"]"')),null!==r?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(u=s,jn.host_type="IPv6",e=n.substring(i,u)),null===e&&(i=s),e}function de(){var e,t,r,s,l,u,c,h,d,f,_,p,m,v,g,y,T;return v=i,g=i,null!==(e=fe())?(58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t&&null!==(r=fe())?(58===n.charCodeAt(i)?(s=":",i++):(s=null,0===o&&a('":"')),null!==s&&null!==(l=fe())?(58===n.charCodeAt(i)?(u=":",i++):(u=null,0===o&&a('":"')),null!==u&&null!==(c=fe())?(58===n.charCodeAt(i)?(h=":",i++):(h=null,0===o&&a('":"')),null!==h&&null!==(d=fe())?(58===n.charCodeAt(i)?(f=":",i++):(f=null,0===o&&a('":"')),null!==f&&null!==(_=fe())?(58===n.charCodeAt(i)?(p=":",i++):(p=null,0===o&&a('":"')),null!==p&&null!==(m=_e())?e=[e,t,r,s,l,u,c,h,d,f,_,p,m]:(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g),null===e&&(g=i,"::"===n.substr(i,2)?(e="::",i+=2):(e=null,0===o&&a('"::"')),null!==e&&null!==(t=fe())?(58===n.charCodeAt(i)?(r=":",i++):(r=null,0===o&&a('":"')),null!==r&&null!==(s=fe())?(58===n.charCodeAt(i)?(l=":",i++):(l=null,0===o&&a('":"')),null!==l&&null!==(u=fe())?(58===n.charCodeAt(i)?(c=":",i++):(c=null,0===o&&a('":"')),null!==c&&null!==(h=fe())?(58===n.charCodeAt(i)?(d=":",i++):(d=null,0===o&&a('":"')),null!==d&&null!==(f=fe())?(58===n.charCodeAt(i)?(_=":",i++):(_=null,0===o&&a('":"')),null!==_&&null!==(p=_e())?e=[e,t,r,s,l,u,c,h,d,f,_,p]:(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g),null===e&&(g=i,"::"===n.substr(i,2)?(e="::",i+=2):(e=null,0===o&&a('"::"')),null!==e&&null!==(t=fe())?(58===n.charCodeAt(i)?(r=":",i++):(r=null,0===o&&a('":"')),null!==r&&null!==(s=fe())?(58===n.charCodeAt(i)?(l=":",i++):(l=null,0===o&&a('":"')),null!==l&&null!==(u=fe())?(58===n.charCodeAt(i)?(c=":",i++):(c=null,0===o&&a('":"')),null!==c&&null!==(h=fe())?(58===n.charCodeAt(i)?(d=":",i++):(d=null,0===o&&a('":"')),null!==d&&null!==(f=_e())?e=[e,t,r,s,l,u,c,h,d,f]:(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g),null===e&&(g=i,"::"===n.substr(i,2)?(e="::",i+=2):(e=null,0===o&&a('"::"')),null!==e&&null!==(t=fe())?(58===n.charCodeAt(i)?(r=":",i++):(r=null,0===o&&a('":"')),null!==r&&null!==(s=fe())?(58===n.charCodeAt(i)?(l=":",i++):(l=null,0===o&&a('":"')),null!==l&&null!==(u=fe())?(58===n.charCodeAt(i)?(c=":",i++):(c=null,0===o&&a('":"')),null!==c&&null!==(h=_e())?e=[e,t,r,s,l,u,c,h]:(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g),null===e&&(g=i,"::"===n.substr(i,2)?(e="::",i+=2):(e=null,0===o&&a('"::"')),null!==e&&null!==(t=fe())?(58===n.charCodeAt(i)?(r=":",i++):(r=null,0===o&&a('":"')),null!==r&&null!==(s=fe())?(58===n.charCodeAt(i)?(l=":",i++):(l=null,0===o&&a('":"')),null!==l&&null!==(u=_e())?e=[e,t,r,s,l,u]:(e=null,i=g)):(e=null,i=g)):(e=null,i=g),null===e&&(g=i,"::"===n.substr(i,2)?(e="::",i+=2):(e=null,0===o&&a('"::"')),null!==e&&null!==(t=fe())?(58===n.charCodeAt(i)?(r=":",i++):(r=null,0===o&&a('":"')),null!==r&&null!==(s=_e())?e=[e,t,r,s]:(e=null,i=g)):(e=null,i=g),null===e&&(g=i,"::"===n.substr(i,2)?(e="::",i+=2):(e=null,0===o&&a('"::"')),null!==e&&null!==(t=_e())?e=[e,t]:(e=null,i=g),null===e&&(g=i,"::"===n.substr(i,2)?(e="::",i+=2):(e=null,0===o&&a('"::"')),null!==e&&null!==(t=fe())?e=[e,t]:(e=null,i=g),null===e&&(g=i,null!==(e=fe())?("::"===n.substr(i,2)?(t="::",i+=2):(t=null,0===o&&a('"::"')),null!==t&&null!==(r=fe())?(58===n.charCodeAt(i)?(s=":",i++):(s=null,0===o&&a('":"')),null!==s&&null!==(l=fe())?(58===n.charCodeAt(i)?(u=":",i++):(u=null,0===o&&a('":"')),null!==u&&null!==(c=fe())?(58===n.charCodeAt(i)?(h=":",i++):(h=null,0===o&&a('":"')),null!==h&&null!==(d=fe())?(58===n.charCodeAt(i)?(f=":",i++):(f=null,0===o&&a('":"')),null!==f&&null!==(_=_e())?e=[e,t,r,s,l,u,c,h,d,f,_]:(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g),null===e&&(g=i,null!==(e=fe())?(y=i,58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t&&null!==(r=fe())?t=[t,r]:(t=null,i=y),null!==(t=null!==t?t:"")?("::"===n.substr(i,2)?(r="::",i+=2):(r=null,0===o&&a('"::"')),null!==r&&null!==(s=fe())?(58===n.charCodeAt(i)?(l=":",i++):(l=null,0===o&&a('":"')),null!==l&&null!==(u=fe())?(58===n.charCodeAt(i)?(c=":",i++):(c=null,0===o&&a('":"')),null!==c&&null!==(h=fe())?(58===n.charCodeAt(i)?(d=":",i++):(d=null,0===o&&a('":"')),null!==d&&null!==(f=_e())?e=[e,t,r,s,l,u,c,h,d,f]:(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g),null===e&&(g=i,null!==(e=fe())?(y=i,58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t&&null!==(r=fe())?t=[t,r]:(t=null,i=y),null!==(t=null!==t?t:"")?(y=i,58===n.charCodeAt(i)?(r=":",i++):(r=null,0===o&&a('":"')),null!==r&&null!==(s=fe())?r=[r,s]:(r=null,i=y),null!==(r=null!==r?r:"")?("::"===n.substr(i,2)?(s="::",i+=2):(s=null,0===o&&a('"::"')),null!==s&&null!==(l=fe())?(58===n.charCodeAt(i)?(u=":",i++):(u=null,0===o&&a('":"')),null!==u&&null!==(c=fe())?(58===n.charCodeAt(i)?(h=":",i++):(h=null,0===o&&a('":"')),null!==h&&null!==(d=_e())?e=[e,t,r,s,l,u,c,h,d]:(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g),null===e&&(g=i,null!==(e=fe())?(y=i,58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t&&null!==(r=fe())?t=[t,r]:(t=null,i=y),null!==(t=null!==t?t:"")?(y=i,58===n.charCodeAt(i)?(r=":",i++):(r=null,0===o&&a('":"')),null!==r&&null!==(s=fe())?r=[r,s]:(r=null,i=y),null!==(r=null!==r?r:"")?(y=i,58===n.charCodeAt(i)?(s=":",i++):(s=null,0===o&&a('":"')),null!==s&&null!==(l=fe())?s=[s,l]:(s=null,i=y),null!==(s=null!==s?s:"")?("::"===n.substr(i,2)?(l="::",i+=2):(l=null,0===o&&a('"::"')),null!==l&&null!==(u=fe())?(58===n.charCodeAt(i)?(c=":",i++):(c=null,0===o&&a('":"')),null!==c&&null!==(h=_e())?e=[e,t,r,s,l,u,c,h]:(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g),null===e&&(g=i,null!==(e=fe())?(y=i,58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t&&null!==(r=fe())?t=[t,r]:(t=null,i=y),null!==(t=null!==t?t:"")?(y=i,58===n.charCodeAt(i)?(r=":",i++):(r=null,0===o&&a('":"')),null!==r&&null!==(s=fe())?r=[r,s]:(r=null,i=y),null!==(r=null!==r?r:"")?(y=i,58===n.charCodeAt(i)?(s=":",i++):(s=null,0===o&&a('":"')),null!==s&&null!==(l=fe())?s=[s,l]:(s=null,i=y),null!==(s=null!==s?s:"")?(y=i,58===n.charCodeAt(i)?(l=":",i++):(l=null,0===o&&a('":"')),null!==l&&null!==(u=fe())?l=[l,u]:(l=null,i=y),null!==(l=null!==l?l:"")?("::"===n.substr(i,2)?(u="::",i+=2):(u=null,0===o&&a('"::"')),null!==u&&null!==(c=_e())?e=[e,t,r,s,l,u,c]:(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g),null===e&&(g=i,null!==(e=fe())?(y=i,58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t&&null!==(r=fe())?t=[t,r]:(t=null,i=y),null!==(t=null!==t?t:"")?(y=i,58===n.charCodeAt(i)?(r=":",i++):(r=null,0===o&&a('":"')),null!==r&&null!==(s=fe())?r=[r,s]:(r=null,i=y),null!==(r=null!==r?r:"")?(y=i,58===n.charCodeAt(i)?(s=":",i++):(s=null,0===o&&a('":"')),null!==s&&null!==(l=fe())?s=[s,l]:(s=null,i=y),null!==(s=null!==s?s:"")?(y=i,58===n.charCodeAt(i)?(l=":",i++):(l=null,0===o&&a('":"')),null!==l&&null!==(u=fe())?l=[l,u]:(l=null,i=y),null!==(l=null!==l?l:"")?(y=i,58===n.charCodeAt(i)?(u=":",i++):(u=null,0===o&&a('":"')),null!==u&&null!==(c=fe())?u=[u,c]:(u=null,i=y),null!==(u=null!==u?u:"")?("::"===n.substr(i,2)?(c="::",i+=2):(c=null,0===o&&a('"::"')),null!==c&&null!==(h=fe())?e=[e,t,r,s,l,u,c,h]:(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g),null===e&&(g=i,null!==(e=fe())?(y=i,58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t&&null!==(r=fe())?t=[t,r]:(t=null,i=y),null!==(t=null!==t?t:"")?(y=i,58===n.charCodeAt(i)?(r=":",i++):(r=null,0===o&&a('":"')),null!==r&&null!==(s=fe())?r=[r,s]:(r=null,i=y),null!==(r=null!==r?r:"")?(y=i,58===n.charCodeAt(i)?(s=":",i++):(s=null,0===o&&a('":"')),null!==s&&null!==(l=fe())?s=[s,l]:(s=null,i=y),null!==(s=null!==s?s:"")?(y=i,58===n.charCodeAt(i)?(l=":",i++):(l=null,0===o&&a('":"')),null!==l&&null!==(u=fe())?l=[l,u]:(l=null,i=y),null!==(l=null!==l?l:"")?(y=i,58===n.charCodeAt(i)?(u=":",i++):(u=null,0===o&&a('":"')),null!==u&&null!==(c=fe())?u=[u,c]:(u=null,i=y),null!==(u=null!==u?u:"")?(y=i,58===n.charCodeAt(i)?(c=":",i++):(c=null,0===o&&a('":"')),null!==c&&null!==(h=fe())?c=[c,h]:(c=null,i=y),null!==(c=null!==c?c:"")?("::"===n.substr(i,2)?(h="::",i+=2):(h=null,0===o&&a('"::"')),null!==h?e=[e,t,r,s,l,u,c,h]:(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g)):(e=null,i=g))))))))))))))),null!==e&&(T=v,jn.host_type="IPv6",e=n.substring(i,T)),null===e&&(i=v),e}function fe(){var e,t,n,r,s;return s=i,null!==(e=f())&&null!==(t=null!==(t=f())?t:"")&&null!==(n=null!==(n=f())?n:"")&&null!==(r=null!==(r=f())?r:"")?e=[e,t,n,r]:(e=null,i=s),e}function _e(){var e,t,r,s;return s=i,null!==(e=fe())?(58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t&&null!==(r=fe())?e=[e,t,r]:(e=null,i=s)):(e=null,i=s),null===e&&(e=pe()),e}function pe(){var e,t,r,s,l,u,c,h,d,f;return h=i,d=i,null!==(e=me())?(46===n.charCodeAt(i)?(t=".",i++):(t=null,0===o&&a('"."')),null!==t&&null!==(r=me())?(46===n.charCodeAt(i)?(s=".",i++):(s=null,0===o&&a('"."')),null!==s&&null!==(l=me())?(46===n.charCodeAt(i)?(u=".",i++):(u=null,0===o&&a('"."')),null!==u&&null!==(c=me())?e=[e,t,r,s,l,u,c]:(e=null,i=d)):(e=null,i=d)):(e=null,i=d)):(e=null,i=d),null!==e&&(f=h,jn.host_type="IPv4",e=n.substring(i,f)),null===e&&(i=h),e}function me(){var e,t,r,s;return s=i,"25"===n.substr(i,2)?(e="25",i+=2):(e=null,0===o&&a('"25"')),null!==e?(/^[0-5]/.test(n.charAt(i))?(t=n.charAt(i),i++):(t=null,0===o&&a("[0-5]")),null!==t?e=[e,t]:(e=null,i=s)):(e=null,i=s),null===e&&(s=i,50===n.charCodeAt(i)?(e="2",i++):(e=null,0===o&&a('"2"')),null!==e?(/^[0-4]/.test(n.charAt(i))?(t=n.charAt(i),i++):(t=null,0===o&&a("[0-4]")),null!==t&&null!==(r=h())?e=[e,t,r]:(e=null,i=s)):(e=null,i=s),null===e&&(s=i,49===n.charCodeAt(i)?(e="1",i++):(e=null,0===o&&a('"1"')),null!==e&&null!==(t=h())&&null!==(r=h())?e=[e,t,r]:(e=null,i=s),null===e&&(s=i,/^[1-9]/.test(n.charAt(i))?(e=n.charAt(i),i++):(e=null,0===o&&a("[1-9]")),null!==e&&null!==(t=h())?e=[e,t]:(e=null,i=s),null===e&&(e=h())))),e}function ve(){var e,t,n,r,s,o,l,u;return o=i,l=i,null!==(e=null!==(e=h())?e:"")&&null!==(t=null!==(t=h())?t:"")&&null!==(n=null!==(n=h())?n:"")&&null!==(r=null!==(r=h())?r:"")&&null!==(s=null!==(s=h())?s:"")?e=[e,t,n,r,s]:(e=null,i=l),null!==e&&(u=e,u=parseInt(u.join("")),jn.port=u,e=u),null===e&&(i=o),e}function ge(){var e,t,r,s;for(e=[],s=i,59===n.charCodeAt(i)?(t=";",i++):(t=null,0===o&&a('";"')),null!==t&&null!==(r=ye())?t=[t,r]:(t=null,i=s);null!==t;)e.push(t),s=i,59===n.charCodeAt(i)?(t=";",i++):(t=null,0===o&&a('";"')),null!==t&&null!==(r=ye())?t=[t,r]:(t=null,i=s);return e}function ye(){var e;return null===(e=Te())&&null===(e=Ce())&&null===(e=be())&&null===(e=Se())&&null===(e=Ee())&&null===(e=Ae())&&(e=Re()),e}function Te(){var e,t,r,s,l;return r=i,s=i,"transport="===n.substr(i,10).toLowerCase()?(e=n.substr(i,10),i+=10):(e=null,0===o&&a('"transport="')),null!==e?("udp"===n.substr(i,3).toLowerCase()?(t=n.substr(i,3),i+=3):(t=null,0===o&&a('"udp"')),null===t&&("tcp"===n.substr(i,3).toLowerCase()?(t=n.substr(i,3),i+=3):(t=null,0===o&&a('"tcp"')),null===t&&("sctp"===n.substr(i,4).toLowerCase()?(t=n.substr(i,4),i+=4):(t=null,0===o&&a('"sctp"')),null===t&&("tls"===n.substr(i,3).toLowerCase()?(t=n.substr(i,3),i+=3):(t=null,0===o&&a('"tls"')),null===t&&(t=N())))),null!==t?e=[e,t]:(e=null,i=s)):(e=null,i=s),null!==e&&(l=e[1],jn.uri_params||(jn.uri_params={}),e=void(jn.uri_params.transport=l.toLowerCase())),null===e&&(i=r),e}function Ce(){var e,t,r,s,l;return r=i,s=i,"user="===n.substr(i,5).toLowerCase()?(e=n.substr(i,5),i+=5):(e=null,0===o&&a('"user="')),null!==e?("phone"===n.substr(i,5).toLowerCase()?(t=n.substr(i,5),i+=5):(t=null,0===o&&a('"phone"')),null===t&&("ip"===n.substr(i,2).toLowerCase()?(t=n.substr(i,2),i+=2):(t=null,0===o&&a('"ip"')),null===t&&(t=N())),null!==t?e=[e,t]:(e=null,i=s)):(e=null,i=s),null!==e&&(l=e[1],jn.uri_params||(jn.uri_params={}),e=void(jn.uri_params.user=l.toLowerCase())),null===e&&(i=r),e}function be(){var e,t,r,s,l;return r=i,s=i,"method="===n.substr(i,7).toLowerCase()?(e=n.substr(i,7),i+=7):(e=null,0===o&&a('"method="')),null!==e&&null!==(t=ct())?e=[e,t]:(e=null,i=s),null!==e&&(l=e[1],jn.uri_params||(jn.uri_params={}),e=void(jn.uri_params.method=l)),null===e&&(i=r),e}function Se(){var e,t,r,s,l;return r=i,s=i,"ttl="===n.substr(i,4).toLowerCase()?(e=n.substr(i,4),i+=4):(e=null,0===o&&a('"ttl="')),null!==e&&null!==(t=An())?e=[e,t]:(e=null,i=s),null!==e&&(l=e[1],jn.params||(jn.params={}),e=void(jn.params.ttl=l)),null===e&&(i=r),e}function Ee(){var e,t,r,s,l;return r=i,s=i,"maddr="===n.substr(i,6).toLowerCase()?(e=n.substr(i,6),i+=6):(e=null,0===o&&a('"maddr="')),null!==e&&null!==(t=le())?e=[e,t]:(e=null,i=s),null!==e&&(l=e[1],jn.uri_params||(jn.uri_params={}),e=void(jn.uri_params.maddr=l)),null===e&&(i=r),e}function Ae(){var e,t,r,s,l,u;return s=i,l=i,"lr"===n.substr(i,2).toLowerCase()?(e=n.substr(i,2),i+=2):(e=null,0===o&&a('"lr"')),null!==e?(u=i,61===n.charCodeAt(i)?(t="=",i++):(t=null,0===o&&a('"="')),null!==t&&null!==(r=N())?t=[t,r]:(t=null,i=u),null!==(t=null!==t?t:"")?e=[e,t]:(e=null,i=l)):(e=null,i=l),null!==e&&(jn.uri_params||(jn.uri_params={}),e=void(jn.uri_params.lr=void 0)),null===e&&(i=s),e}function Re(){var e,t,r,s,l,u,c,h;return s=i,l=i,null!==(e=we())?(u=i,61===n.charCodeAt(i)?(t="=",i++):(t=null,0===o&&a('"="')),null!==t&&null!==(r=Ie())?t=[t,r]:(t=null,i=u),null!==(t=null!==t?t:"")?e=[e,t]:(e=null,i=l)):(e=null,i=l),null!==e&&(c=e[0],h=e[1],jn.uri_params||(jn.uri_params={}),h=void 0===h?void 0:h[1],e=void(jn.uri_params[c.toLowerCase()]=h)),null===e&&(i=s),e}function we(){var e,t,n;if(n=i,null!==(t=Oe()))for(e=[];null!==t;)e.push(t),t=Oe();else e=null;return null!==e&&(e=e.join("")),null===e&&(i=n),e}function Ie(){var e,t,n;if(n=i,null!==(t=Oe()))for(e=[];null!==t;)e.push(t),t=Oe();else e=null;return null!==e&&(e=e.join("")),null===e&&(i=n),e}function Oe(){var e;return null===(e=ke())&&null===(e=C())&&(e=S()),e}function ke(){var e;return 91===n.charCodeAt(i)?(e="[",i++):(e=null,0===o&&a('"["')),null===e&&(93===n.charCodeAt(i)?(e="]",i++):(e=null,0===o&&a('"]"')),null===e&&(47===n.charCodeAt(i)?(e="/",i++):(e=null,0===o&&a('"/"')),null===e&&(58===n.charCodeAt(i)?(e=":",i++):(e=null,0===o&&a('":"')),null===e&&(38===n.charCodeAt(i)?(e="&",i++):(e=null,0===o&&a('"&"')),null===e&&(43===n.charCodeAt(i)?(e="+",i++):(e=null,0===o&&a('"+"')),null===e&&(36===n.charCodeAt(i)?(e="$",i++):(e=null,0===o&&a('"$"')))))))),e}function Ne(){var e,t,r,s,l,u,c;if(u=i,63===n.charCodeAt(i)?(e="?",i++):(e=null,0===o&&a('"?"')),null!==e)if(null!==(t=De())){for(r=[],c=i,38===n.charCodeAt(i)?(s="&",i++):(s=null,0===o&&a('"&"')),null!==s&&null!==(l=De())?s=[s,l]:(s=null,i=c);null!==s;)r.push(s),c=i,38===n.charCodeAt(i)?(s="&",i++):(s=null,0===o&&a('"&"')),null!==s&&null!==(l=De())?s=[s,l]:(s=null,i=c);null!==r?e=[e,t,r]:(e=null,i=u)}else e=null,i=u;else e=null,i=u;return e}function De(){var e,t,r,s,l,u,c;return s=i,l=i,null!==(e=Ue())?(61===n.charCodeAt(i)?(t="=",i++):(t=null,0===o&&a('"="')),null!==t&&null!==(r=xe())?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(u=e[0],c=e[2],u=u.join("").toLowerCase(),c=c.join(""),jn.uri_headers||(jn.uri_headers={}),e=void(jn.uri_headers[u]?jn.uri_headers[u].push(c):jn.uri_headers[u]=[c])),null===e&&(i=s),e}function Ue(){var e,t;if(null===(t=Pe())&&null===(t=C())&&(t=S()),null!==t)for(e=[];null!==t;)e.push(t),null===(t=Pe())&&null===(t=C())&&(t=S());else e=null;return e}function xe(){var e,t;for(e=[],null===(t=Pe())&&null===(t=C())&&(t=S());null!==t;)e.push(t),null===(t=Pe())&&null===(t=C())&&(t=S());return e}function Pe(){var e;return 91===n.charCodeAt(i)?(e="[",i++):(e=null,0===o&&a('"["')),null===e&&(93===n.charCodeAt(i)?(e="]",i++):(e=null,0===o&&a('"]"')),null===e&&(47===n.charCodeAt(i)?(e="/",i++):(e=null,0===o&&a('"/"')),null===e&&(63===n.charCodeAt(i)?(e="?",i++):(e=null,0===o&&a('"?"')),null===e&&(58===n.charCodeAt(i)?(e=":",i++):(e=null,0===o&&a('":"')),null===e&&(43===n.charCodeAt(i)?(e="+",i++):(e=null,0===o&&a('"+"')),null===e&&(36===n.charCodeAt(i)?(e="$",i++):(e=null,0===o&&a('"$"')))))))),e}function Me(){var e,t,n,r,s,o;return o=i,null!==(e=ct())&&null!==(t=v())&&null!==(n=qe())&&null!==(r=v())&&null!==(s=et())?e=[e,t,n,r,s]:(e=null,i=o),e}function qe(){var e;return null===(e=Q())&&(e=Le()),e}function Le(){var e,t,r,s;return s=i,null!==(e=$e())?(58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null!==t?(null===(r=He())&&(r=Ge()),null!==r?e=[e,t,r]:(e=null,i=s)):(e=null,i=s)):(e=null,i=s),e}function He(){var e,t,r,s,l;return s=i,null===(e=Fe())&&(e=je()),null!==e?(l=i,63===n.charCodeAt(i)?(t="?",i++):(t=null,0===o&&a('"?"')),null!==t&&null!==(r=Ze())?t=[t,r]:(t=null,i=l),null!==(t=null!==t?t:"")?e=[e,t]:(e=null,i=s)):(e=null,i=s),e}function Fe(){var e,t,r,s;return s=i,"//"===n.substr(i,2)?(e="//",i+=2):(e=null,0===o&&a('"//"')),null!==e&&null!==(t=Xe())&&null!==(r=null!==(r=je())?r:"")?e=[e,t,r]:(e=null,i=s),e}function je(){var e,t,r;return r=i,47===n.charCodeAt(i)?(e="/",i++):(e=null,0===o&&a('"/"')),null!==e&&null!==(t=Be())?e=[e,t]:(e=null,i=r),e}function Ge(){var e,t,n,r;if(r=i,null!==(e=Ve())){for(t=[],n=We();null!==n;)t.push(n),n=We();null!==t?e=[e,t]:(e=null,i=r)}else e=null,i=r;return e}function We(){var e;return null===(e=T())&&null===(e=C())&&(e=S()),e}function Ve(){var e;return null===(e=C())&&null===(e=S())&&(59===n.charCodeAt(i)?(e=";",i++):(e=null,0===o&&a('";"')),null===e&&(63===n.charCodeAt(i)?(e="?",i++):(e=null,0===o&&a('"?"')),null===e&&(58===n.charCodeAt(i)?(e=":",i++):(e=null,0===o&&a('":"')),null===e&&(64===n.charCodeAt(i)?(e="@",i++):(e=null,0===o&&a('"@"')),null===e&&(38===n.charCodeAt(i)?(e="&",i++):(e=null,0===o&&a('"&"')),null===e&&(61===n.charCodeAt(i)?(e="=",i++):(e=null,0===o&&a('"="')),null===e&&(43===n.charCodeAt(i)?(e="+",i++):(e=null,0===o&&a('"+"')),null===e&&(36===n.charCodeAt(i)?(e="$",i++):(e=null,0===o&&a('"$"')),null===e&&(44===n.charCodeAt(i)?(e=",",i++):(e=null,0===o&&a('","'))))))))))),e}function Be(){var e,t,r,s,l,u;if(l=i,null!==(e=Ke())){for(t=[],u=i,47===n.charCodeAt(i)?(r="/",i++):(r=null,0===o&&a('"/"')),null!==r&&null!==(s=Ke())?r=[r,s]:(r=null,i=u);null!==r;)t.push(r),u=i,47===n.charCodeAt(i)?(r="/",i++):(r=null,0===o&&a('"/"')),null!==r&&null!==(s=Ke())?r=[r,s]:(r=null,i=u);null!==t?e=[e,t]:(e=null,i=l)}else e=null,i=l;return e}function Ke(){var e,t,r,s,l,u;for(l=i,e=[],t=Ye();null!==t;)e.push(t),t=Ye();if(null!==e){for(t=[],u=i,59===n.charCodeAt(i)?(r=";",i++):(r=null,0===o&&a('";"')),null!==r&&null!==(s=ze())?r=[r,s]:(r=null,i=u);null!==r;)t.push(r),u=i,59===n.charCodeAt(i)?(r=";",i++):(r=null,0===o&&a('";"')),null!==r&&null!==(s=ze())?r=[r,s]:(r=null,i=u);null!==t?e=[e,t]:(e=null,i=l)}else e=null,i=l;return e}function ze(){var e,t;for(e=[],t=Ye();null!==t;)e.push(t),t=Ye();return e}function Ye(){var e;return null===(e=C())&&null===(e=S())&&(58===n.charCodeAt(i)?(e=":",i++):(e=null,0===o&&a('":"')),null===e&&(64===n.charCodeAt(i)?(e="@",i++):(e=null,0===o&&a('"@"')),null===e&&(38===n.charCodeAt(i)?(e="&",i++):(e=null,0===o&&a('"&"')),null===e&&(61===n.charCodeAt(i)?(e="=",i++):(e=null,0===o&&a('"="')),null===e&&(43===n.charCodeAt(i)?(e="+",i++):(e=null,0===o&&a('"+"')),null===e&&(36===n.charCodeAt(i)?(e="$",i++):(e=null,0===o&&a('"$"')),null===e&&(44===n.charCodeAt(i)?(e=",",i++):(e=null,0===o&&a('","'))))))))),e}function $e(){var e,t,r,s,l,u;if(s=i,l=i,null!==(e=d())){for(t=[],null===(r=d())&&null===(r=h())&&(43===n.charCodeAt(i)?(r="+",i++):(r=null,0===o&&a('"+"')),null===r&&(45===n.charCodeAt(i)?(r="-",i++):(r=null,0===o&&a('"-"')),null===r&&(46===n.charCodeAt(i)?(r=".",i++):(r=null,0===o&&a('"."')))));null!==r;)t.push(r),null===(r=d())&&null===(r=h())&&(43===n.charCodeAt(i)?(r="+",i++):(r=null,0===o&&a('"+"')),null===r&&(45===n.charCodeAt(i)?(r="-",i++):(r=null,0===o&&a('"-"')),null===r&&(46===n.charCodeAt(i)?(r=".",i++):(r=null,0===o&&a('"."')))));null!==t?e=[e,t]:(e=null,i=l)}else e=null,i=l;return null!==e&&(u=s,e=void(jn.scheme=n.substring(i,u))),null===e&&(i=s),e}function Xe(){var e;return null===(e=Je())&&(e=Qe()),e}function Je(){var e,t,r,s;return r=i,s=i,null!==(e=ne())?(64===n.charCodeAt(i)?(t="@",i++):(t=null,0===o&&a('"@"')),null!==t?e=[e,t]:(e=null,i=s)):(e=null,i=s),null!==(e=null!==e?e:"")&&null!==(t=oe())?e=[e,t]:(e=null,i=r),e=null!==e?e:""}function Qe(){var e,t;if(null===(t=C())&&null===(t=S())&&(36===n.charCodeAt(i)?(t="$",i++):(t=null,0===o&&a('"$"')),null===t&&(44===n.charCodeAt(i)?(t=",",i++):(t=null,0===o&&a('","')),null===t&&(59===n.charCodeAt(i)?(t=";",i++):(t=null,0===o&&a('";"')),null===t&&(58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null===t&&(64===n.charCodeAt(i)?(t="@",i++):(t=null,0===o&&a('"@"')),null===t&&(38===n.charCodeAt(i)?(t="&",i++):(t=null,0===o&&a('"&"')),null===t&&(61===n.charCodeAt(i)?(t="=",i++):(t=null,0===o&&a('"="')),null===t&&(43===n.charCodeAt(i)?(t="+",i++):(t=null,0===o&&a('"+"')))))))))),null!==t)for(e=[];null!==t;)e.push(t),null===(t=C())&&null===(t=S())&&(36===n.charCodeAt(i)?(t="$",i++):(t=null,0===o&&a('"$"')),null===t&&(44===n.charCodeAt(i)?(t=",",i++):(t=null,0===o&&a('","')),null===t&&(59===n.charCodeAt(i)?(t=";",i++):(t=null,0===o&&a('";"')),null===t&&(58===n.charCodeAt(i)?(t=":",i++):(t=null,0===o&&a('":"')),null===t&&(64===n.charCodeAt(i)?(t="@",i++):(t=null,0===o&&a('"@"')),null===t&&(38===n.charCodeAt(i)?(t="&",i++):(t=null,0===o&&a('"&"')),null===t&&(61===n.charCodeAt(i)?(t="=",i++):(t=null,0===o&&a('"="')),null===t&&(43===n.charCodeAt(i)?(t="+",i++):(t=null,0===o&&a('"+"'))))))))));else e=null;return e}function Ze(){var e,t;for(e=[],t=We();null!==t;)e.push(t),t=We();return e}function et(){var e,t,r,s,l,u,c,d,f;if(c=i,d=i,"sip"===n.substr(i,3).toLowerCase()?(e=n.substr(i,3),i+=3):(e=null,0===o&&a('"SIP"')),null!==e)if(47===n.charCodeAt(i)?(t="/",i++):(t=null,0===o&&a('"/"')),null!==t){if(null!==(s=h()))for(r=[];null!==s;)r.push(s),s=h();else r=null;if(null!==r)if(46===n.charCodeAt(i)?(s=".",i++):(s=null,0===o&&a('"."')),null!==s){if(null!==(u=h()))for(l=[];null!==u;)l.push(u),u=h();else l=null;null!==l?e=[e,t,r,s,l]:(e=null,i=d)}else e=null,i=d;else e=null,i=d}else e=null,i=d;else e=null,i=d;return null!==e&&(f=c,e=void(jn.sip_version=n.substring(i,f))),null===e&&(i=c),e}function tt(){var e;return"INVITE"===n.substr(i,6)?(e="INVITE",i+=6):(e=null,0===o&&a('"INVITE"')),e}function nt(){var e;return"ACK"===n.substr(i,3)?(e="ACK",i+=3):(e=null,0===o&&a('"ACK"')),e}function rt(){var e;return"OPTIONS"===n.substr(i,7)?(e="OPTIONS",i+=7):(e=null,0===o&&a('"OPTIONS"')),e}function st(){var e;return"BYE"===n.substr(i,3)?(e="BYE",i+=3):(e=null,0===o&&a('"BYE"')),e}function it(){var e;return"CANCEL"===n.substr(i,6)?(e="CANCEL",i+=6):(e=null,0===o&&a('"CANCEL"')),e}function ot(){var e;return"REGISTER"===n.substr(i,8)?(e="REGISTER",i+=8):(e=null,0===o&&a('"REGISTER"')),e}function lt(){var e;return"SUBSCRIBE"===n.substr(i,9)?(e="SUBSCRIBE",i+=9):(e=null,0===o&&a('"SUBSCRIBE"')),e}function ut(){var e;return"NOTIFY"===n.substr(i,6)?(e="NOTIFY",i+=6):(e=null,0===o&&a('"NOTIFY"')),e}function at(){var e;return"REFER"===n.substr(i,5)?(e="REFER",i+=5):(e=null,0===o&&a('"REFER"')),e}function ct(){var e,t,r;return t=i,null===(e=tt())&&null===(e=nt())&&null===(e=rt())&&null===(e=st())&&null===(e=it())&&null===(e=ot())&&null===(e=lt())&&null===(e=ut())&&null===(e=at())&&(e=N()),null!==e&&(r=t,jn.method=n.substring(i,r),e=jn.method),null===e&&(i=t),e}function ht(){var e,t,n,r,s,o;return o=i,null!==(e=et())&&null!==(t=v())&&null!==(n=dt())&&null!==(r=v())&&null!==(s=_t())?e=[e,t,n,r,s]:(e=null,i=o),e}function dt(){var e,t,n;return t=i,null!==(e=ft())&&(n=e,e=void(jn.status_code=parseInt(n.join("")))),null===e&&(i=t),e}function ft(){var e,t,n,r;return r=i,null!==(e=h())&&null!==(t=h())&&null!==(n=h())?e=[e,t,n]:(e=null,i=r),e}function _t(){var e,t,r,s;for(r=i,e=[],null===(t=T())&&null===(t=C())&&null===(t=S())&&null===(t=O())&&null===(t=k())&&null===(t=v())&&(t=g());null!==t;)e.push(t),null===(t=T())&&null===(t=C())&&null===(t=S())&&null===(t=O())&&null===(t=k())&&null===(t=v())&&(t=g());return null!==e&&(s=r,e=void(jn.reason_phrase=n.substring(i,s))),null===e&&(i=r),e}function pt(){var e,t,n,r,s,o,l;if(s=i,o=i,null===(e=J())&&(e=mt()),null!==e){for(t=[],l=i,null!==(n=G())&&null!==(r=gt())?n=[n,r]:(n=null,i=l);null!==n;)t.push(n),l=i,null!==(n=G())&&null!==(r=gt())?n=[n,r]:(n=null,i=l);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return null!==e&&(e=function(e){var t;jn.multi_header||(jn.multi_header=[]);try{t=new Fn(jn.uri,jn.display_name,jn.params),delete jn.uri,delete jn.display_name,delete jn.params}catch(e){t=null}jn.multi_header.push({possition:i,offset:e,parsed:t})}(s)),null===e&&(i=s),e}function mt(){var e,t,n,r,s;return s=i,null!==(e=null!==(e=vt())?e:"")&&null!==(t=F())&&null!==(n=Q())&&null!==(r=H())?e=[e,t,n,r]:(e=null,i=s),e}function vt(){var e,t,n,r,s,o,l,u;if(s=i,o=i,null!==(e=N())){for(t=[],l=i,null!==(n=E())&&null!==(r=N())?n=[n,r]:(n=null,i=l);null!==n;)t.push(n),l=i,null!==(n=E())&&null!==(r=N())?n=[n,r]:(n=null,i=l);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return null===e&&(e=Y()),null!==e&&(u=e,e=void(jn.display_name="string"==typeof u?u:u[1].reduce(function(e,t){return e+t[0]+t[1]},u[0]))),null===e&&(i=s),e}function gt(){var e;return null===(e=yt())&&null===(e=Tt())&&(e=St()),e}function yt(){var e,t,r,s,l,u;return s=i,l=i,"q"===n.substr(i,1).toLowerCase()?(e=n.substr(i,1),i++):(e=null,0===o&&a('"q"')),null!==e&&null!==(t=M())&&null!==(r=bt())?e=[e,t,r]:(e=null,i=l),null!==e&&(u=e[2],jn.params||(jn.params={}),e=void(jn.params.q=u)),null===e&&(i=s),e}function Tt(){var e,t,r,s,l,u;return s=i,l=i,"expires"===n.substr(i,7).toLowerCase()?(e=n.substr(i,7),i+=7):(e=null,0===o&&a('"expires"')),null!==e&&null!==(t=M())&&null!==(r=Ct())?e=[e,t,r]:(e=null,i=l),null!==e&&(u=e[2],jn.params||(jn.params={}),e=void(jn.params.expires=u)),null===e&&(i=s),e}function Ct(){var e,t,n;if(n=i,null!==(t=h()))for(e=[];null!==t;)e.push(t),t=h();else e=null;return null!==e&&(e=parseInt(e.join(""))),null===e&&(i=n),e}function bt(){var e,t,r,s,l,u,c,d,f;return u=i,c=i,48===n.charCodeAt(i)?(e="0",i++):(e=null,0===o&&a('"0"')),null!==e?(d=i,46===n.charCodeAt(i)?(t=".",i++):(t=null,0===o&&a('"."')),null!==t&&null!==(r=null!==(r=h())?r:"")&&null!==(s=null!==(s=h())?s:"")&&null!==(l=null!==(l=h())?l:"")?t=[t,r,s,l]:(t=null,i=d),null!==(t=null!==t?t:"")?e=[e,t]:(e=null,i=c)):(e=null,i=c),null!==e&&(f=u,e=parseFloat(n.substring(i,f))),null===e&&(i=u),e}function St(){var e,t,n,r,s,o,l,u;return r=i,s=i,null!==(e=N())?(o=i,null!==(t=M())&&null!==(n=Et())?t=[t,n]:(t=null,i=o),null!==(t=null!==t?t:"")?e=[e,t]:(e=null,i=s)):(e=null,i=s),null!==e&&(l=e[0],u=e[1],jn.params||(jn.params={}),u=void 0===u?void 0:u[1],e=void(jn.params[l.toLowerCase()]=u)),null===e&&(i=r),e}function Et(){var e;return null===(e=N())&&null===(e=le())&&(e=z()),e}function At(){var e;return"render"===n.substr(i,6).toLowerCase()?(e=n.substr(i,6),i+=6):(e=null,0===o&&a('"render"')),null===e&&("session"===n.substr(i,7).toLowerCase()?(e=n.substr(i,7),i+=7):(e=null,0===o&&a('"session"')),null===e&&("icon"===n.substr(i,4).toLowerCase()?(e=n.substr(i,4),i+=4):(e=null,0===o&&a('"icon"')),null===e&&("alert"===n.substr(i,5).toLowerCase()?(e=n.substr(i,5),i+=5):(e=null,0===o&&a('"alert"')),null===e&&(e=N())))),e}function Rt(){var e;return null===(e=wt())&&(e=St()),e}function wt(){var e,t,r,s;return s=i,"handling"===n.substr(i,8).toLowerCase()?(e=n.substr(i,8),i+=8):(e=null,0===o&&a('"handling"')),null!==e&&null!==(t=M())?("optional"===n.substr(i,8).toLowerCase()?(r=n.substr(i,8),i+=8):(r=null,0===o&&a('"optional"')),null===r&&("required"===n.substr(i,8).toLowerCase()?(r=n.substr(i,8),i+=8):(r=null,0===o&&a('"required"')),null===r&&(r=N())),null!==r?e=[e,t,r]:(e=null,i=s)):(e=null,i=s),e}function It(){var e,t,n,r,s,o,l,u;if(l=i,null!==(e=Ot()))if(null!==(t=P()))if(null!==(n=xt())){for(r=[],u=i,null!==(s=G())&&null!==(o=Pt())?s=[s,o]:(s=null,i=u);null!==s;)r.push(s),u=i,null!==(s=G())&&null!==(o=Pt())?s=[s,o]:(s=null,i=u);null!==r?e=[e,t,n,r]:(e=null,i=l)}else e=null,i=l;else e=null,i=l;else e=null,i=l;return e}function Ot(){var e;return null===(e=kt())&&(e=Nt()),e}function kt(){var e;return"text"===n.substr(i,4).toLowerCase()?(e=n.substr(i,4),i+=4):(e=null,0===o&&a('"text"')),null===e&&("image"===n.substr(i,5).toLowerCase()?(e=n.substr(i,5),i+=5):(e=null,0===o&&a('"image"')),null===e&&("audio"===n.substr(i,5).toLowerCase()?(e=n.substr(i,5),i+=5):(e=null,0===o&&a('"audio"')),null===e&&("video"===n.substr(i,5).toLowerCase()?(e=n.substr(i,5),i+=5):(e=null,0===o&&a('"video"')),null===e&&("application"===n.substr(i,11).toLowerCase()?(e=n.substr(i,11),i+=11):(e=null,0===o&&a('"application"')),null===e&&(e=Dt()))))),e}function Nt(){var e;return"message"===n.substr(i,7).toLowerCase()?(e=n.substr(i,7),i+=7):(e=null,0===o&&a('"message"')),null===e&&("multipart"===n.substr(i,9).toLowerCase()?(e=n.substr(i,9),i+=9):(e=null,0===o&&a('"multipart"')),null===e&&(e=Dt())),e}function Dt(){var e;return null===(e=N())&&(e=Ut()),e}function Ut(){var e,t,r;return r=i,"x-"===n.substr(i,2).toLowerCase()?(e=n.substr(i,2),i+=2):(e=null,0===o&&a('"x-"')),null!==e&&null!==(t=N())?e=[e,t]:(e=null,i=r),e}function xt(){var e;return null===(e=Dt())&&(e=N()),e}function Pt(){var e,t,n,r;return r=i,null!==(e=N())&&null!==(t=M())&&null!==(n=Mt())?e=[e,t,n]:(e=null,i=r),e}function Mt(){var e;return null===(e=N())&&(e=z()),e}function qt(){var e,t,n,r;if(n=i,null!==(t=h()))for(e=[];null!==t;)e.push(t),t=h();else e=null;return null!==e&&(r=e,e=void(jn.value=parseInt(r.join("")))),null===e&&(i=n),e}function Lt(){var e,t,r,s,l,u;if(l=i,null!==(e=D())){for(t=[],u=i,46===n.charCodeAt(i)?(r=".",i++):(r=null,0===o&&a('"."')),null!==r&&null!==(s=D())?r=[r,s]:(r=null,i=u);null!==r;)t.push(r),u=i,46===n.charCodeAt(i)?(r=".",i++):(r=null,0===o&&a('"."')),null!==r&&null!==(s=D())?r=[r,s]:(r=null,i=u);null!==t?e=[e,t]:(e=null,i=l)}else e=null,i=l;return e}function Ht(){var e;return null===(e=Ft())&&(e=St()),e}function Ft(){var e,t,r,s,l,u;return s=i,l=i,"tag"===n.substr(i,3).toLowerCase()?(e=n.substr(i,3),i+=3):(e=null,0===o&&a('"tag"')),null!==e&&null!==(t=M())&&null!==(r=N())?e=[e,t,r]:(e=null,i=l),null!==e&&(u=e[2],e=void(jn.tag=u)),null===e&&(i=s),e}function jt(){var e,t,r,s,l,u,c,h;if(c=i,"digest"===n.substr(i,6).toLowerCase()?(e=n.substr(i,6),i+=6):(e=null,0===o&&a('"Digest"')),null!==e)if(null!==(t=E()))if(null!==(r=Vt())){for(s=[],h=i,null!==(l=j())&&null!==(u=Vt())?l=[l,u]:(l=null,i=h);null!==l;)s.push(l),h=i,null!==(l=j())&&null!==(u=Vt())?l=[l,u]:(l=null,i=h);null!==s?e=[e,t,r,s]:(e=null,i=c)}else e=null,i=c;else e=null,i=c;else e=null,i=c;return null===e&&(e=Gt()),e}function Gt(){var e,t,n,r,s,o,l,u;if(l=i,null!==(e=N()))if(null!==(t=E()))if(null!==(n=Wt())){for(r=[],u=i,null!==(s=j())&&null!==(o=Wt())?s=[s,o]:(s=null,i=u);null!==s;)r.push(s),u=i,null!==(s=j())&&null!==(o=Wt())?s=[s,o]:(s=null,i=u);null!==r?e=[e,t,n,r]:(e=null,i=l)}else e=null,i=l;else e=null,i=l;else e=null,i=l;return e}function Wt(){var e,t,n,r;return r=i,null!==(e=N())&&null!==(t=M())?(null===(n=N())&&(n=z()),null!==n?e=[e,t,n]:(e=null,i=r)):(e=null,i=r),e}function Vt(){var e;return null===(e=Bt())&&null===(e=zt())&&null===(e=$t())&&null===(e=Jt())&&null===(e=Qt())&&null===(e=Zt())&&null===(e=en())&&(e=Wt()),e}function Bt(){var e,t,r,s;return s=i,"realm"===n.substr(i,5).toLowerCase()?(e=n.substr(i,5),i+=5):(e=null,0===o&&a('"realm"')),null!==e&&null!==(t=M())&&null!==(r=Kt())?e=[e,t,r]:(e=null,i=s),e}function Kt(){var e,t,n;return t=i,null!==(e=Y())&&(n=e,e=void(jn.realm=n)),null===e&&(i=t),e}function zt(){var e,t,r,s,l,u,c,h,d;if(h=i,"domain"===n.substr(i,6).toLowerCase()?(e=n.substr(i,6),i+=6):(e=null,0===o&&a('"domain"')),null!==e)if(null!==(t=M()))if(null!==(r=V()))if(null!==(s=Yt())){if(l=[],d=i,null!==(c=v()))for(u=[];null!==c;)u.push(c),c=v();else u=null;for(null!==u&&null!==(c=Yt())?u=[u,c]:(u=null,i=d);null!==u;){if(l.push(u),d=i,null!==(c=v()))for(u=[];null!==c;)u.push(c),c=v();else u=null;null!==u&&null!==(c=Yt())?u=[u,c]:(u=null,i=d)}null!==l&&null!==(u=B())?e=[e,t,r,s,l,u]:(e=null,i=h)}else e=null,i=h;else e=null,i=h;else e=null,i=h;else e=null,i=h;return e}function Yt(){var e;return null===(e=Le())&&(e=je()),e}function $t(){var e,t,r,s;return s=i,"nonce"===n.substr(i,5).toLowerCase()?(e=n.substr(i,5),i+=5):(e=null,0===o&&a('"nonce"')),null!==e&&null!==(t=M())&&null!==(r=Xt())?e=[e,t,r]:(e=null,i=s),e}function Xt(){var e,t,n;return t=i,null!==(e=Y())&&(n=e,e=void(jn.nonce=n)),null===e&&(i=t),e}function Jt(){var e,t,r,s,l,u;return s=i,l=i,"opaque"===n.substr(i,6).toLowerCase()?(e=n.substr(i,6),i+=6):(e=null,0===o&&a('"opaque"')),null!==e&&null!==(t=M())&&null!==(r=Y())?e=[e,t,r]:(e=null,i=l),null!==e&&(u=e[2],e=void(jn.opaque=u)),null===e&&(i=s),e}function Qt(){var e,t,r,s,l;return s=i,"stale"===n.substr(i,5).toLowerCase()?(e=n.substr(i,5),i+=5):(e=null,0===o&&a('"stale"')),null!==e&&null!==(t=M())?(l=i,"true"===n.substr(i,4).toLowerCase()?(r=n.substr(i,4),i+=4):(r=null,0===o&&a('"true"')),null!==r&&(r=void(jn.stale=!0)),null===r&&(i=l),null===r&&(l=i,"false"===n.substr(i,5).toLowerCase()?(r=n.substr(i,5),i+=5):(r=null,0===o&&a('"false"')),null!==r&&(r=void(jn.stale=!1)),null===r&&(i=l)),null!==r?e=[e,t,r]:(e=null,i=s)):(e=null,i=s),e}function Zt(){var e,t,r,s,l,u;return s=i,l=i,"algorithm"===n.substr(i,9).toLowerCase()?(e=n.substr(i,9),i+=9):(e=null,0===o&&a('"algorithm"')),null!==e&&null!==(t=M())?("md5"===n.substr(i,3).toLowerCase()?(r=n.substr(i,3),i+=3):(r=null,0===o&&a('"MD5"')),null===r&&("md5-sess"===n.substr(i,8).toLowerCase()?(r=n.substr(i,8),i+=8):(r=null,0===o&&a('"MD5-sess"')),null===r&&(r=N())),null!==r?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(u=e[2],e=void(jn.algorithm=u.toUpperCase())),null===e&&(i=s),e}function en(){var e,t,r,s,l,u,c,h,d,f;if(h=i,"qop"===n.substr(i,3).toLowerCase()?(e=n.substr(i,3),i+=3):(e=null,0===o&&a('"qop"')),null!==e)if(null!==(t=M()))if(null!==(r=V())){if(d=i,null!==(s=tn())){for(l=[],f=i,44===n.charCodeAt(i)?(u=",",i++):(u=null,0===o&&a('","')),null!==u&&null!==(c=tn())?u=[u,c]:(u=null,i=f);null!==u;)l.push(u),f=i,44===n.charCodeAt(i)?(u=",",i++):(u=null,0===o&&a('","')),null!==u&&null!==(c=tn())?u=[u,c]:(u=null,i=f);null!==l?s=[s,l]:(s=null,i=d)}else s=null,i=d;null!==s&&null!==(l=B())?e=[e,t,r,s,l]:(e=null,i=h)}else e=null,i=h;else e=null,i=h;else e=null,i=h;return e}function tn(){var e,t,r;return t=i,"auth-int"===n.substr(i,8).toLowerCase()?(e=n.substr(i,8),i+=8):(e=null,0===o&&a('"auth-int"')),null===e&&("auth"===n.substr(i,4).toLowerCase()?(e=n.substr(i,4),i+=4):(e=null,0===o&&a('"auth"')),null===e&&(e=N())),null!==e&&(r=e,jn.qop||(jn.qop=[]),e=void jn.qop.push(r.toLowerCase())),null===e&&(i=t),e}function nn(){var e,t,n,r,s,o,l;if(s=i,o=i,null!==(e=mt())){for(t=[],l=i,null!==(n=G())&&null!==(r=St())?n=[n,r]:(n=null,i=l);null!==n;)t.push(n),l=i,null!==(n=G())&&null!==(r=St())?n=[n,r]:(n=null,i=l);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return null!==e&&(e=function(e){var t;jn.multi_header||(jn.multi_header=[]);try{t=new Fn(jn.uri,jn.display_name,jn.params),delete jn.uri,delete jn.display_name,delete jn.params}catch(e){t=null}jn.multi_header.push({possition:i,offset:e,parsed:t})}(s)),null===e&&(i=s),e}function rn(){var e;return null===(e=sn())&&(e=St()),e}function sn(){var e,t,r,s,l,u,c;if(l=i,u=i,"cause"===n.substr(i,5).toLowerCase()?(e=n.substr(i,5),i+=5):(e=null,0===o&&a('"cause"')),null!==e)if(null!==(t=M())){if(null!==(s=h()))for(r=[];null!==s;)r.push(s),s=h();else r=null;null!==r?e=[e,t,r]:(e=null,i=u)}else e=null,i=u;else e=null,i=u;return null!==e&&(c=e[2],e=void(jn.cause=parseInt(c.join("")))),null===e&&(i=l),e}function on(){var e,t,n,r,s,o;if(s=i,null!==(e=mt())){for(t=[],o=i,null!==(n=G())&&null!==(r=St())?n=[n,r]:(n=null,i=o);null!==n;)t.push(n),o=i,null!==(n=G())&&null!==(r=St())?n=[n,r]:(n=null,i=o);null!==t?e=[e,t]:(e=null,i=s)}else e=null,i=s;return e}function ln(){var e,t,r;return t=i,"active"===n.substr(i,6).toLowerCase()?(e=n.substr(i,6),i+=6):(e=null,0===o&&a('"active"')),null===e&&("pending"===n.substr(i,7).toLowerCase()?(e=n.substr(i,7),i+=7):(e=null,0===o&&a('"pending"')),null===e&&("terminated"===n.substr(i,10).toLowerCase()?(e=n.substr(i,10),i+=10):(e=null,0===o&&a('"terminated"')),null===e&&(e=N()))),null!==e&&(r=t,e=void(jn.state=n.substring(i,r))),null===e&&(i=t),e}function un(){var e,t,r,s,l,u,c,h;return s=i,l=i,"reason"===n.substr(i,6).toLowerCase()?(e=n.substr(i,6),i+=6):(e=null,0===o&&a('"reason"')),null!==e&&null!==(t=M())&&null!==(r=an())?e=[e,t,r]:(e=null,i=l),null!==e&&(e=void(void 0!==(u=e[2])&&(jn.reason=u))),null===e&&(i=s),null===e&&(s=i,l=i,"expires"===n.substr(i,7).toLowerCase()?(e=n.substr(i,7),i+=7):(e=null,0===o&&a('"expires"')),null!==e&&null!==(t=M())&&null!==(r=Ct())?e=[e,t,r]:(e=null,i=l),null!==e&&(e=void(void 0!==(h=e[2])&&(jn.expires=h))),null===e&&(i=s),null===e&&(s=i,l=i,"retry_after"===n.substr(i,11).toLowerCase()?(e=n.substr(i,11),i+=11):(e=null,0===o&&a('"retry_after"')),null!==e&&null!==(t=M())&&null!==(r=Ct())?e=[e,t,r]:(e=null,i=l),null!==e&&(e=void(void 0!==(c=e[2])&&(jn.retry_after=c))),null===e&&(i=s),null===e&&(e=St()))),e}function an(){var e;return"deactivated"===n.substr(i,11).toLowerCase()?(e=n.substr(i,11),i+=11):(e=null,0===o&&a('"deactivated"')),null===e&&("probation"===n.substr(i,9).toLowerCase()?(e=n.substr(i,9),i+=9):(e=null,0===o&&a('"probation"')),null===e&&("rejected"===n.substr(i,8).toLowerCase()?(e=n.substr(i,8),i+=8):(e=null,0===o&&a('"rejected"')),null===e&&("timeout"===n.substr(i,7).toLowerCase()?(e=n.substr(i,7),i+=7):(e=null,0===o&&a('"timeout"')),null===e&&("giveup"===n.substr(i,6).toLowerCase()?(e=n.substr(i,6),i+=6):(e=null,0===o&&a('"giveup"')),null===e&&("noresource"===n.substr(i,10).toLowerCase()?(e=n.substr(i,10),i+=10):(e=null,0===o&&a('"noresource"')),null===e&&("invariant"===n.substr(i,9).toLowerCase()?(e=n.substr(i,9),i+=9):(e=null,0===o&&a('"invariant"')),null===e&&(e=N()))))))),e}function cn(){var e;return null===(e=Ft())&&(e=St()),e}function hn(){var e,t,n,r,s,o,l,u;if(l=i,null!==(e=yn()))if(null!==(t=E()))if(null!==(n=bn())){for(r=[],u=i,null!==(s=G())&&null!==(o=dn())?s=[s,o]:(s=null,i=u);null!==s;)r.push(s),u=i,null!==(s=G())&&null!==(o=dn())?s=[s,o]:(s=null,i=u);null!==r?e=[e,t,n,r]:(e=null,i=l)}else e=null,i=l;else e=null,i=l;else e=null,i=l;return e}function dn(){var e;return null===(e=fn())&&null===(e=_n())&&null===(e=pn())&&null===(e=mn())&&null===(e=vn())&&(e=St()),e}function fn(){var e,t,r,s,l,u;return s=i,l=i,"ttl"===n.substr(i,3).toLowerCase()?(e=n.substr(i,3),i+=3):(e=null,0===o&&a('"ttl"')),null!==e&&null!==(t=M())&&null!==(r=An())?e=[e,t,r]:(e=null,i=l),null!==e&&(u=e[2],e=void(jn.ttl=u)),null===e&&(i=s),e}function _n(){var e,t,r,s,l,u;return s=i,l=i,"maddr"===n.substr(i,5).toLowerCase()?(e=n.substr(i,5),i+=5):(e=null,0===o&&a('"maddr"')),null!==e&&null!==(t=M())&&null!==(r=le())?e=[e,t,r]:(e=null,i=l),null!==e&&(u=e[2],e=void(jn.maddr=u)),null===e&&(i=s),e}function pn(){var e,t,r,s,l,u;return s=i,l=i,"received"===n.substr(i,8).toLowerCase()?(e=n.substr(i,8),i+=8):(e=null,0===o&&a('"received"')),null!==e&&null!==(t=M())?(null===(r=pe())&&(r=de()),null!==r?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(u=e[2],e=void(jn.received=u)),null===e&&(i=s),e}function mn(){var e,t,r,s,l,u;return s=i,l=i,"branch"===n.substr(i,6).toLowerCase()?(e=n.substr(i,6),i+=6):(e=null,0===o&&a('"branch"')),null!==e&&null!==(t=M())&&null!==(r=N())?e=[e,t,r]:(e=null,i=l),null!==e&&(u=e[2],e=void(jn.branch=u)),null===e&&(i=s),e}function vn(){var e,t,r,s,l;return s=i,"rport"===n.substr(i,5).toLowerCase()?(e=n.substr(i,5),i+=5):(e=null,0===o&&a('"rport"')),null!==e?(l=i,null!==(t=M())&&null!==(r=gn())?t=[t,r]:(t=null,i=l),null!==(t=null!==t?t:"")?e=[e,t]:(e=null,i=s)):(e=null,i=s),e}function gn(){var e,t,n,r,s,o,l,u;return o=i,l=i,null!==(e=null!==(e=h())?e:"")&&null!==(t=null!==(t=h())?t:"")&&null!==(n=null!==(n=h())?n:"")&&null!==(r=null!==(r=h())?r:"")&&null!==(s=null!==(s=h())?s:"")?e=[e,t,n,r,s]:(e=null,i=l),null!==e&&(u=e,e=void(jn.rport=parseInt(u.join("")))),null===e&&(i=o),e}function yn(){var e,t,n,r,s,o;return o=i,null!==(e=Tn())&&null!==(t=P())&&null!==(n=N())&&null!==(r=P())&&null!==(s=Cn())?e=[e,t,n,r,s]:(e=null,i=o),e}function Tn(){var e,t,r;return t=i,"sip"===n.substr(i,3).toLowerCase()?(e=n.substr(i,3),i+=3):(e=null,0===o&&a('"SIP"')),null===e&&(e=N()),null!==e&&(r=e,e=void(jn.protocol=r)),null===e&&(i=t),e}function Cn(){var e,t,r;return t=i,"udp"===n.substr(i,3).toLowerCase()?(e=n.substr(i,3),i+=3):(e=null,0===o&&a('"UDP"')),null===e&&("tcp"===n.substr(i,3).toLowerCase()?(e=n.substr(i,3),i+=3):(e=null,0===o&&a('"TCP"')),null===e&&("tls"===n.substr(i,3).toLowerCase()?(e=n.substr(i,3),i+=3):(e=null,0===o&&a('"TLS"')),null===e&&("sctp"===n.substr(i,4).toLowerCase()?(e=n.substr(i,4),i+=4):(e=null,0===o&&a('"SCTP"')),null===e&&(e=N())))),null!==e&&(r=e,e=void(jn.transport=r)),null===e&&(i=t),e}function bn(){var e,t,n,r,s;return r=i,null!==(e=Sn())?(s=i,null!==(t=W())&&null!==(n=En())?t=[t,n]:(t=null,i=s),null!==(t=null!==t?t:"")?e=[e,t]:(e=null,i=r)):(e=null,i=r),e}function Sn(){var e,t,r;return t=i,null===(e=pe())&&null===(e=he())&&(e=ue()),null!==e&&(r=t,e=void(jn.host=n.substring(i,r))),null===e&&(i=t),e}function En(){var e,t,n,r,s,o,l,u;return o=i,l=i,null!==(e=null!==(e=h())?e:"")&&null!==(t=null!==(t=h())?t:"")&&null!==(n=null!==(n=h())?n:"")&&null!==(r=null!==(r=h())?r:"")&&null!==(s=null!==(s=h())?s:"")?e=[e,t,n,r,s]:(e=null,i=l),null!==e&&(u=e,e=void(jn.port=parseInt(u.join("")))),null===e&&(i=o),e}function An(){var e,t,n,r,s;return r=i,s=i,null!==(e=h())&&null!==(t=null!==(t=h())?t:"")&&null!==(n=null!==(n=h())?n:"")?e=[e,t,n]:(e=null,i=s),null!==e&&(e=parseInt(e.join(""))),null===e&&(i=r),e}function Rn(){var e,t,n;return t=i,null!==(e=Ct())&&(n=e,e=void(jn.expires=n)),null===e&&(i=t),e}function wn(){var e;return null===(e=In())&&(e=St()),e}function In(){var e,t,r,s,l,u;return s=i,l=i,"refresher"===n.substr(i,9).toLowerCase()?(e=n.substr(i,9),i+=9):(e=null,0===o&&a('"refresher"')),null!==e&&null!==(t=M())?("uac"===n.substr(i,3).toLowerCase()?(r=n.substr(i,3),i+=3):(r=null,0===o&&a('"uac"')),null===r&&("uas"===n.substr(i,3).toLowerCase()?(r=n.substr(i,3),i+=3):(r=null,0===o&&a('"uas"'))),null!==r?e=[e,t,r]:(e=null,i=l)):(e=null,i=l),null!==e&&(u=e[2],e=void(jn.refresher=u.toLowerCase())),null===e&&(i=s),e}function On(){var e,t;for(e=[],null===(t=I())&&null===(t=k())&&(t=E());null!==t;)e.push(t),null===(t=I())&&null===(t=k())&&(t=E());return e}function kn(){var e,t,r,s,l,u,c,h,d,f,_,p;return f=i,_=i,null!==(e=Dn())?(45===n.charCodeAt(i)?(t="-",i++):(t=null,0===o&&a('"-"')),null!==t&&null!==(r=Nn())?(45===n.charCodeAt(i)?(s="-",i++):(s=null,0===o&&a('"-"')),null!==s&&null!==(l=Nn())?(45===n.charCodeAt(i)?(u="-",i++):(u=null,0===o&&a('"-"')),null!==u&&null!==(c=Nn())?(45===n.charCodeAt(i)?(h="-",i++):(h=null,0===o&&a('"-"')),null!==h&&null!==(d=Un())?e=[e,t,r,s,l,u,c,h,d]:(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_),null!==e&&(p=f,e[0],e=void(jn=n.substring(i+5,p))),null===e&&(i=f),e}function Nn(){var e,t,n,r,s;return s=i,null!==(e=f())&&null!==(t=f())&&null!==(n=f())&&null!==(r=f())?e=[e,t,n,r]:(e=null,i=s),e}function Dn(){var e,t,n;return n=i,null!==(e=Nn())&&null!==(t=Nn())?e=[e,t]:(e=null,i=n),e}function Un(){var e,t,n,r;return r=i,null!==(e=Nn())&&null!==(t=Nn())&&null!==(n=Nn())?e=[e,t,n]:(e=null,i=r),e}function xn(){var e,t,r,s,l,u,c;return s=i,l=i,null!==(e=U())?(u=i,64===n.charCodeAt(i)?(t="@",i++):(t=null,0===o&&a('"@"')),null!==t&&null!==(r=U())?t=[t,r]:(t=null,i=u),null!==(t=null!==t?t:"")?e=[e,t]:(e=null,i=l)):(e=null,i=l),null!==e&&(c=s,e=void(jn.call_id=n.substring(i,c))),null===e&&(i=s),e}function Pn(){var e;return null===(e=Mn())&&null===(e=qn())&&null===(e=Ln())&&(e=St()),e}function Mn(){var e,t,r,s,l,u;return s=i,l=i,"to-tag"===n.substr(i,6)?(e="to-tag",i+=6):(e=null,0===o&&a('"to-tag"')),null!==e&&null!==(t=M())&&null!==(r=N())?e=[e,t,r]:(e=null,i=l),null!==e&&(u=e[2],e=void(jn.to_tag=u)),null===e&&(i=s),e}function qn(){var e,t,r,s,l,u;return s=i,l=i,"from-tag"===n.substr(i,8)?(e="from-tag",i+=8):(e=null,0===o&&a('"from-tag"')),null!==e&&null!==(t=M())&&null!==(r=N())?e=[e,t,r]:(e=null,i=l),null!==e&&(u=e[2],e=void(jn.from_tag=u)),null===e&&(i=s),e}function Ln(){var e,t;return t=i,"early-only"===n.substr(i,10)?(e="early-only",i+=10):(e=null,0===o&&a('"early-only"')),null!==e&&(e=void(jn.early_only=!0)),null===e&&(i=t),e}var Hn=e("./URI"),Fn=e("./NameAddrHeader"),jn={};if(null===s[r]()||i!==n.length){var Gn=Math.max(i,l),Wn=Gn2&&void 0!==arguments[2]?arguments[2]:{},s=e;if(void 0===e||void 0===t)throw new TypeError("Not enough arguments");if(!(e=this._ua.normalizeTarget(e)))throw new TypeError("Invalid target: ".concat(s));var i=d.cloneArray(r.extraHeaders),o=d.cloneObject(r.eventHandlers),l=r.contentType||"text/plain";for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&this.on(u,o[u]);i.push("Content-Type: ".concat(l)),this._request=new h.OutgoingRequest(c.MESSAGE,e,this._ua,null,i),t&&(this._request.body=t);var a=new f(this._ua,this._request,{onRequestTimeout:function(){n._onRequestTimeout()},onTransportError:function(){n._onTransportError()},onReceiveResponse:function(e){n._receiveResponse(e)}});this._newMessage("local",this._request),a.send()}},{key:"init_incoming",value:function(e){this._request=e,this._newMessage("remote",e),this._is_replied||(this._is_replied=!0,e.reply(200)),this._close()}},{key:"accept",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=d.cloneArray(e.extraHeaders),n=e.body;if("incoming"!==this._direction)throw new _.NotSupportedError('"accept" not supported for outgoing Message');if(this._is_replied)throw new Error("incoming Message already replied");this._is_replied=!0,this._request.reply(200,null,t,n)}},{key:"reject",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.status_code||480,n=e.reason_phrase,r=d.cloneArray(e.extraHeaders),s=e.body;if("incoming"!==this._direction)throw new _.NotSupportedError('"reject" not supported for outgoing Message');if(this._is_replied)throw new Error("incoming Message already replied");if(t<300||t>=700)throw new TypeError("Invalid status_code: ".concat(t));this._is_replied=!0,this._request.reply(t,n,r,s)}},{key:"_receiveResponse",value:function(e){if(!this._closed)switch(!0){case/^1[0-9]{2}$/.test(e.status_code):break;case/^2[0-9]{2}$/.test(e.status_code):this._succeeded("remote",e);break;default:var t=d.sipErrorCause(e.status_code);this._failed("remote",e,t)}}},{key:"_onRequestTimeout",value:function(){this._closed||this._failed("system",null,c.causes.REQUEST_TIMEOUT)}},{key:"_onTransportError",value:function(){this._closed||this._failed("system",null,c.causes.CONNECTION_ERROR)}},{key:"_close",value:function(){this._closed=!0,this._ua.destroyMessage(this)}},{key:"_newMessage",value:function(e,t){"remote"===e?(this._direction="incoming",this._local_identity=t.to,this._remote_identity=t.from):"local"===e&&(this._direction="outgoing",this._local_identity=t.from,this._remote_identity=t.to),this._ua.newMessage(this,{originator:e,message:this,request:t})}},{key:"_failed",value:function(e,t,n){p.debug("MESSAGE failed"),this._close(),p.debug('emit "failed"'),this.emit("failed",{originator:e,response:t||null,cause:n})}},{key:"_succeeded",value:function(e,t){p.debug("MESSAGE succeeded"),this._close(),p.debug('emit "succeeded"'),this.emit("succeeded",{originator:e,response:t})}},{key:"direction",get:function(){return this._direction}},{key:"local_identity",get:function(){return this._local_identity}},{key:"remote_identity",get:function(){return this._remote_identity}}])&&s(t.prototype,n),r&&s(t,r),a}()},{"./Constants":2,"./Exceptions":6,"./Logger":9,"./RequestSender":20,"./SIPMessage":21,"./Utils":28,events:31}],11:[function(e,t,n){"use strict";function r(e,t){for(var n=0;n"),this._parameters)Object.prototype.hasOwnProperty.call(this._parameters,t)&&(e+=";".concat(t),null!==this._parameters[t]&&(e+="=".concat(this._parameters[t])));return e}},{key:"uri",get:function(){return this._uri}},{key:"display_name",get:function(){return this._display_name},set:function(e){this._display_name=0===e?"0":e}}]),e}()},{"./Grammar":7,"./URI":27}],12:[function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},s=e;if(void 0===e)throw new TypeError("A target is required for OPTIONS");if(!(e=this._ua.normalizeTarget(e)))throw new TypeError("Invalid target: ".concat(s));var i=d.cloneArray(r.extraHeaders),o=d.cloneObject(r.eventHandlers),l=r.contentType||"application/sdp";for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&this.on(u,o[u]);i.push("Content-Type: ".concat(l)),this._request=new h.OutgoingRequest(c.OPTIONS,e,this._ua,null,i),t&&(this._request.body=t);var a=new f(this._ua,this._request,{onRequestTimeout:function(){n._onRequestTimeout()},onTransportError:function(){n._onTransportError()},onReceiveResponse:function(e){n._receiveResponse(e)}});this._newOptions("local",this._request),a.send()}},{key:"init_incoming",value:function(e){this._request=e,this._newOptions("remote",e),this._is_replied||(this._is_replied=!0,e.reply(200)),this._close()}},{key:"accept",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=d.cloneArray(e.extraHeaders),n=e.body;if("incoming"!==this._direction)throw new _.NotSupportedError('"accept" not supported for outgoing Options');if(this._is_replied)throw new Error("incoming Options already replied");this._is_replied=!0,this._request.reply(200,null,t,n)}},{key:"reject",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.status_code||480,n=e.reason_phrase,r=d.cloneArray(e.extraHeaders),s=e.body;if("incoming"!==this._direction)throw new _.NotSupportedError('"reject" not supported for outgoing Options');if(this._is_replied)throw new Error("incoming Options already replied");if(t<300||t>=700)throw new TypeError("Invalid status_code: ".concat(t));this._is_replied=!0,this._request.reply(t,n,r,s)}},{key:"_receiveResponse",value:function(e){if(!this._closed)switch(!0){case/^1[0-9]{2}$/.test(e.status_code):break;case/^2[0-9]{2}$/.test(e.status_code):this._succeeded("remote",e);break;default:var t=d.sipErrorCause(e.status_code);this._failed("remote",e,t)}}},{key:"_onRequestTimeout",value:function(){this._closed||this._failed("system",null,c.causes.REQUEST_TIMEOUT)}},{key:"_onTransportError",value:function(){this._closed||this._failed("system",null,c.causes.CONNECTION_ERROR)}},{key:"_close",value:function(){this._closed=!0,this._ua.destroyMessage(this)}},{key:"_newOptions",value:function(e,t){"remote"===e?(this._direction="incoming",this._local_identity=t.to,this._remote_identity=t.from):"local"===e&&(this._direction="outgoing",this._local_identity=t.from,this._remote_identity=t.to),this._ua.newOptions(this,{originator:e,message:this,request:t})}},{key:"_failed",value:function(e,t,n){p.debug("OPTIONS failed"),this._close(),p.debug('emit "failed"'),this.emit("failed",{originator:e,response:t||null,cause:n})}},{key:"_succeeded",value:function(e,t){p.debug("OPTIONS succeeded"),this._close(),p.debug('emit "succeeded"'),this.emit("succeeded",{originator:e,response:t})}},{key:"direction",get:function(){return this._direction}},{key:"local_identity",get:function(){return this._local_identity}},{key:"remote_identity",get:function(){return this._remote_identity}}])&&s(t.prototype,n),r&&s(t,r),a}()},{"./Constants":2,"./Exceptions":6,"./Logger":9,"./RequestSender":20,"./SIPMessage":21,"./Utils":28,events:31}],13:[function(e,t,n){"use strict";function r(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return l=e.done,e},e:function(e){u=!0,o=e},f:function(){try{l||null==n.return||n.return()}finally{if(u)throw o}}}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return l=e.done,e},e:function(e){u=!0,o=e},f:function(){try{l||null==n.return||n.return()}finally{if(u)throw o}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;w.debug("connect()");var r=e,s=v.cloneObject(t.eventHandlers),i=v.cloneArray(t.extraHeaders),o=v.cloneObject(t.mediaConstraints,{audio:!0,video:!0}),l=t.mediaStream||null,u=v.cloneObject(t.pcConfig,{iceServers:[]}),a=t.rtcConstraints||null,c=t.rtcOfferConstraints||null;if(this._rtcOfferConstraints=c,this._rtcAnswerConstraints=t.rtcAnswerConstraints||null,this._data=t.data||this._data,void 0===e)throw new TypeError("Not enough arguments");if(this._status!==I.STATUS_NULL)throw new p.InvalidStateError(this._status);if(!window.RTCPeerConnection)throw new p.NotSupportedError("WebRTC not supported");if(!(e=this._ua.normalizeTarget(e)))throw new TypeError("Invalid target: ".concat(r));for(var h in this._sessionTimers.enabled&&v.isDecimal(t.sessionTimersExpires)&&(t.sessionTimersExpires>=_.MIN_SESSION_EXPIRES?this._sessionTimers.defaultExpires=t.sessionTimersExpires:this._sessionTimers.defaultExpires=_.SESSION_EXPIRES),s)Object.prototype.hasOwnProperty.call(s,h)&&this.on(h,s[h]);this._from_tag=v.newTag();var d=t.anonymous||!1,f={from_tag:this._from_tag};this._contact=this._ua.contact.toString({anonymous:d,outbound:!0}),d?(f.from_display_name="Anonymous",f.from_uri=new R("sip","anonymous","anonymous.invalid"),i.push("P-Preferred-Identity: ".concat(this._ua.configuration.uri.toString())),i.push("Privacy: id")):t.fromUserName&&(f.from_uri=new R("sip",t.fromUserName,this._ua.configuration.uri.host),i.push("P-Preferred-Identity: ".concat(this._ua.configuration.uri.toString()))),t.fromDisplayName&&(f.from_display_name=t.fromDisplayName),i.push("Contact: ".concat(this._contact)),i.push("Content-Type: application/sdp"),this._sessionTimers.enabled&&i.push("Session-Expires: ".concat(this._sessionTimers.defaultExpires).concat(this._ua.configuration.session_timers_force_refresher?";refresher=uac":"")),this._request=new y.InitialOutgoingInviteRequest(e,this._ua,f,i),this._id=this._request.call_id+this._from_tag,this._createRTCConnection(u,a),this._direction="outgoing",this._local_identity=this._request.from,this._remote_identity=this._request.to,n&&n(this),this._newRTCSession("local",this._request),this._sendInitialRequest(o,c,l)}},{key:"init_incoming",value:function(e,t){var n,r=this;w.debug("init_incoming()");var s=e.hasHeader("Content-Type")?e.getHeader("Content-Type").toLowerCase():void 0;e.body&&"application/sdp"!==s?e.reply(415):(this._status=I.STATUS_INVITE_RECEIVED,this._from_tag=e.from_tag,this._id=e.call_id+this._from_tag,this._request=e,this._contact=this._ua.contact.toString(),e.hasHeader("expires")&&(n=1e3*e.getHeader("expires")),e.to_tag=v.newTag(),this._createDialog(e,"UAS",!0)?(e.body?this._late_sdp=!1:this._late_sdp=!0,this._status=I.STATUS_WAITING_FOR_ANSWER,this._timers.userNoAnswerTimer=setTimeout(function(){e.reply(408),r._failed("local",null,_.causes.NO_ANSWER)},this._ua.configuration.no_answer_timeout),n&&(this._timers.expiresTimer=setTimeout(function(){r._status===I.STATUS_WAITING_FOR_ANSWER&&(e.reply(487),r._failed("system",null,_.causes.EXPIRES))},n)),this._direction="incoming",this._local_identity=e.to,this._remote_identity=e.from,t&&t(this),this._newRTCSession("remote",e),this._status!==I.STATUS_TERMINATED&&(e.reply(180,null,["Contact: ".concat(this._contact)]),this._progress("local",null))):e.reply(500,"Missing Contact header field"))}},{key:"answer",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};w.debug("answer()");var n=this._request,r=v.cloneArray(t.extraHeaders),i=v.cloneObject(t.mediaConstraints),o=t.mediaStream||null,l=v.cloneObject(t.pcConfig,{iceServers:[]}),u=t.rtcConstraints||null,a=t.rtcAnswerConstraints||null,c=v.cloneObject(t.rtcOfferConstraints),h=!1,d=!1,f=!1,m=!1;if(this._rtcAnswerConstraints=a,this._rtcOfferConstraints=t.rtcOfferConstraints||null,this._data=t.data||this._data,"incoming"!==this._direction)throw new p.NotSupportedError('"answer" not supported for outgoing RTCSession');if(this._status!==I.STATUS_WAITING_FOR_ANSWER)throw new p.InvalidStateError(this._status);if(this._sessionTimers.enabled&&v.isDecimal(t.sessionTimersExpires)&&(t.sessionTimersExpires>=_.MIN_SESSION_EXPIRES?this._sessionTimers.defaultExpires=t.sessionTimersExpires:this._sessionTimers.defaultExpires=_.SESSION_EXPIRES),this._status=I.STATUS_ANSWERED,this._createDialog(n,"UAS")){clearTimeout(this._timers.userNoAnswerTimer),r.unshift("Contact: ".concat(this._contact));var g=n.parseSDP();Array.isArray(g.media)||(g.media=[g.media]);var y,T=s(g.media);try{for(T.s();!(y=T.n()).done;){var C=y.value;"audio"===C.type&&(h=!0,C.direction&&"sendrecv"!==C.direction||(f=!0)),"video"===C.type&&(d=!0,C.direction&&"sendrecv"!==C.direction||(m=!0))}}catch(e){T.e(e)}finally{T.f()}if(o&&!1===i.audio){var b,S=s(o.getAudioTracks());try{for(S.s();!(b=S.n()).done;){var E=b.value;o.removeTrack(E)}}catch(e){S.e(e)}finally{S.f()}}if(o&&!1===i.video){var A,R=s(o.getVideoTracks());try{for(R.s();!(A=R.n()).done;){var O=A.value;o.removeTrack(O)}}catch(e){R.e(e)}finally{R.f()}}o||void 0!==i.audio||(i.audio=f),o||void 0!==i.video||(i.video=m),o||h||c.offerToReceiveAudio||(i.audio=!1),o||d||c.offerToReceiveVideo||(i.video=!1),this._createRTCConnection(l,u),Promise.resolve().then(function(){return o||(i.audio||i.video?(e._localMediaStreamLocallyGenerated=!0,navigator.mediaDevices.getUserMedia(i).catch(function(t){if(e._status===I.STATUS_TERMINATED)throw new Error("terminated");throw n.reply(480),e._failed("local",null,_.causes.USER_DENIED_MEDIA_ACCESS),w.warn('emit "getusermediafailed" [error:%o]',t),e.emit("getusermediafailed",t),new Error("getUserMedia() failed")})):void 0)}).then(function(t){if(e._status===I.STATUS_TERMINATED)throw new Error("terminated");e._localMediaStream=t,t&&t.getTracks().forEach(function(n){e._connection.addTrack(n,t)})}).then(function(){if(!e._late_sdp){var t={originator:"remote",type:"offer",sdp:n.body};w.debug('emit "sdp"'),e.emit("sdp",t);var r=new RTCSessionDescription({type:"offer",sdp:t.sdp});return e._connectionPromiseQueue=e._connectionPromiseQueue.then(function(){return e._connection.setRemoteDescription(r)}).catch(function(t){throw n.reply(488),e._failed("system",null,_.causes.WEBRTC_ERROR),w.warn('emit "peerconnection:setremotedescriptionfailed" [error:%o]',t),e.emit("peerconnection:setremotedescriptionfailed",t),new Error("peerconnection.setRemoteDescription() failed")}),e._connectionPromiseQueue}}).then(function(){if(e._status===I.STATUS_TERMINATED)throw new Error("terminated");return e._connecting(n),e._late_sdp?e._createLocalDescription("offer",e._rtcOfferConstraints).catch(function(){throw n.reply(500),new Error("_createLocalDescription() failed")}):e._createLocalDescription("answer",a).catch(function(){throw n.reply(500),new Error("_createLocalDescription() failed")})}).then(function(t){if(e._status===I.STATUS_TERMINATED)throw new Error("terminated");e._handleSessionTimersInIncomingRequest(n,r),n.reply(200,null,r,t,function(){e._status=I.STATUS_WAITING_FOR_ACK,e._setInvite2xxTimer(n,t),e._setACKTimer(),e._accepted("local")},function(){e._failed("system",null,_.causes.CONNECTION_ERROR)})}).catch(function(t){e._status!==I.STATUS_TERMINATED&&w.warn(t)})}else n.reply(500,"Error creating dialog")}},{key:"terminate",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};w.debug("terminate()");var n,r=t.cause||_.causes.BYE,s=v.cloneArray(t.extraHeaders),i=t.body,o=t.status_code,l=t.reason_phrase;if(this._status===I.STATUS_TERMINATED)throw new p.InvalidStateError(this._status);switch(this._status){case I.STATUS_NULL:case I.STATUS_INVITE_SENT:case I.STATUS_1XX_RECEIVED:if(w.debug("canceling session"),o&&(o<200||o>=700))throw new TypeError("Invalid status_code: ".concat(o));o&&(l=l||_.REASON_PHRASE[o]||"",n="SIP ;cause=".concat(o,' ;text="').concat(l,'"')),this._status===I.STATUS_NULL||this._status===I.STATUS_INVITE_SENT?(this._is_canceled=!0,this._cancel_reason=n):this._status===I.STATUS_1XX_RECEIVED&&this._request.cancel(n),this._status=I.STATUS_CANCELED,this._failed("local",null,_.causes.CANCELED);break;case I.STATUS_WAITING_FOR_ANSWER:case I.STATUS_ANSWERED:if(w.debug("rejecting session"),(o=o||480)<300||o>=700)throw new TypeError("Invalid status_code: ".concat(o));this._request.reply(o,l,s,i),this._failed("local",null,_.causes.REJECTED);break;case I.STATUS_WAITING_FOR_ACK:case I.STATUS_CONFIRMED:if(w.debug("terminating session"),l=t.reason_phrase||_.REASON_PHRASE[o]||"",o&&(o<200||o>=700))throw new TypeError("Invalid status_code: ".concat(o));if(o&&s.push("Reason: SIP ;cause=".concat(o,'; text="').concat(l,'"')),this._status===I.STATUS_WAITING_FOR_ACK&&"incoming"===this._direction&&this._request.server_transaction.state!==m.C.STATUS_TERMINATED){var u=this._dialog;this.receiveRequest=function(t){t.method===_.ACK&&(e.sendRequest(_.BYE,{extraHeaders:s,body:i}),u.terminate())},this._request.server_transaction.on("stateChanged",function(){e._request.server_transaction.state===m.C.STATUS_TERMINATED&&(e.sendRequest(_.BYE,{extraHeaders:s,body:i}),u.terminate())}),this._ended("local",null,r),this._dialog=u,this._ua.newDialog(u)}else this.sendRequest(_.BYE,{extraHeaders:s,body:i}),this._ended("local",null,r)}}},{key:"sendDTMF",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};w.debug("sendDTMF() | tones: %s",e);var n=0,r=t.duration||null,s=t.interToneGap||null,i=t.transportType||_.DTMF_TRANSPORT.INFO;if(void 0===e)throw new TypeError("Not enough arguments");if(this._status!==I.STATUS_CONFIRMED&&this._status!==I.STATUS_WAITING_FOR_ACK&&this._status!==I.STATUS_1XX_RECEIVED)throw new p.InvalidStateError(this._status);if(i!==_.DTMF_TRANSPORT.INFO&&i!==_.DTMF_TRANSPORT.RFC2833)throw new TypeError("invalid transportType: ".concat(i));if("number"==typeof e&&(e=e.toString()),!e||"string"!=typeof e||!e.match(/^[0-9A-DR#*,]+$/i))throw new TypeError("Invalid tones: ".concat(e));if(r&&!v.isDecimal(r))throw new TypeError("Invalid tone duration: ".concat(r));if(r?rb.C.MAX_DURATION?(w.debug('"duration" value is greater than the maximum allowed, setting it to '.concat(b.C.MAX_DURATION," milliseconds")),r=b.C.MAX_DURATION):r=Math.abs(r):r=b.C.DEFAULT_DURATION,t.duration=r,s&&!v.isDecimal(s))throw new TypeError("Invalid interToneGap: ".concat(s));if(s?s=this._tones.length)return void(this._tones=null);var l=this._tones[n];n+=1;if(","===l)o=2e3;else{var u=new b(this);t.eventHandlers={onFailed:function(){i._tones=null}},u.send(l,t),o=r+s}setTimeout(e.bind(this),o)}.call(this));else{var o=this._getDTMFRTPSender();o&&(e=o.toneBuffer+e,o.insertDTMF(e,r,s))}}},{key:"sendInfo",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(w.debug("sendInfo()"),this._status!==I.STATUS_CONFIRMED&&this._status!==I.STATUS_WAITING_FOR_ACK&&this._status!==I.STATUS_1XX_RECEIVED)throw new p.InvalidStateError(this._status);new S(this).send(e,t,n)}},{key:"mute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{audio:!0,video:!1};w.debug("mute()");var t=!1,n=!1;!1===this._audioMuted&&e.audio&&(t=!0,this._audioMuted=!0,this._toggleMuteAudio(!0)),!1===this._videoMuted&&e.video&&(n=!0,this._videoMuted=!0,this._toggleMuteVideo(!0)),!0!==t&&!0!==n||this._onmute({audio:t,video:n})}},{key:"unmute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{audio:!0,video:!0};w.debug("unmute()");var t=!1,n=!1;!0===this._audioMuted&&e.audio&&(t=!0,this._audioMuted=!1,!1===this._localHold&&this._toggleMuteAudio(!1)),!0===this._videoMuted&&e.video&&(n=!0,this._videoMuted=!1,!1===this._localHold&&this._toggleMuteVideo(!1)),!0!==t&&!0!==n||this._onunmute({audio:t,video:n})}},{key:"hold",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(w.debug("hold()"),this._status!==I.STATUS_WAITING_FOR_ACK&&this._status!==I.STATUS_CONFIRMED)return!1;if(!0===this._localHold)return!1;if(!this._isReadyToReOffer())return!1;this._localHold=!0,this._onhold("local");var r={succeeded:function(){n&&n()},failed:function(){e.terminate({cause:_.causes.WEBRTC_ERROR,status_code:500,reason_phrase:"Hold Failed"})}};return t.useUpdate?this._sendUpdate({sdpOffer:!0,eventHandlers:r,extraHeaders:t.extraHeaders}):this._sendReinvite({eventHandlers:r,extraHeaders:t.extraHeaders}),!0}},{key:"unhold",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(w.debug("unhold()"),this._status!==I.STATUS_WAITING_FOR_ACK&&this._status!==I.STATUS_CONFIRMED)return!1;if(!1===this._localHold)return!1;if(!this._isReadyToReOffer())return!1;this._localHold=!1,this._onunhold("local");var r={succeeded:function(){n&&n()},failed:function(){e.terminate({cause:_.causes.WEBRTC_ERROR,status_code:500,reason_phrase:"Unhold Failed"})}};return t.useUpdate?this._sendUpdate({sdpOffer:!0,eventHandlers:r,extraHeaders:t.extraHeaders}):this._sendReinvite({eventHandlers:r,extraHeaders:t.extraHeaders}),!0}},{key:"renegotiate",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;w.debug("renegotiate()");var r=t.rtcOfferConstraints||null;if(this._status!==I.STATUS_WAITING_FOR_ACK&&this._status!==I.STATUS_CONFIRMED)return!1;if(!this._isReadyToReOffer())return!1;var s={succeeded:function(){n&&n()},failed:function(){e.terminate({cause:_.causes.WEBRTC_ERROR,status_code:500,reason_phrase:"Media Renegotiation Failed"})}};return this._setLocalMediaStatus(),t.useUpdate?this._sendUpdate({sdpOffer:!0,eventHandlers:s,rtcOfferConstraints:r,extraHeaders:t.extraHeaders}):this._sendReinvite({eventHandlers:s,rtcOfferConstraints:r,extraHeaders:t.extraHeaders}),!0}},{key:"refer",value:function(e,t){var n=this;w.debug("refer()");var r=e;if(this._status!==I.STATUS_WAITING_FOR_ACK&&this._status!==I.STATUS_CONFIRMED)return!1;if(!(e=this._ua.normalizeTarget(e)))throw new TypeError("Invalid target: ".concat(r));var s=new A(this);s.sendRefer(e,t);var i=s.id;return this._referSubscribers[i]=s,s.on("requestFailed",function(){delete n._referSubscribers[i]}),s.on("accepted",function(){delete n._referSubscribers[i]}),s.on("failed",function(){delete n._referSubscribers[i]}),s}},{key:"sendRequest",value:function(e,t){return w.debug("sendRequest()"),this._dialog.sendRequest(e,t)}},{key:"receiveRequest",value:function(e){var t=this;if(w.debug("receiveRequest()"),e.method===_.CANCEL)this._status!==I.STATUS_WAITING_FOR_ANSWER&&this._status!==I.STATUS_ANSWERED||(this._status=I.STATUS_CANCELED,this._request.reply(487),this._failed("remote",e,_.causes.CANCELED));else switch(e.method){case _.ACK:if(this._status!==I.STATUS_WAITING_FOR_ACK)return;if(this._status=I.STATUS_CONFIRMED,clearTimeout(this._timers.ackTimer),clearTimeout(this._timers.invite2xxTimer),this._late_sdp){if(!e.body){this.terminate({cause:_.causes.MISSING_SDP,status_code:400});break}var n={originator:"remote",type:"answer",sdp:e.body};w.debug('emit "sdp"'),this.emit("sdp",n);var r=new RTCSessionDescription({type:"answer",sdp:n.sdp});this._connectionPromiseQueue=this._connectionPromiseQueue.then(function(){return t._connection.setRemoteDescription(r)}).then(function(){t._is_confirmed||t._confirmed("remote",e)}).catch(function(e){t.terminate({cause:_.causes.BAD_MEDIA_DESCRIPTION,status_code:488}),w.warn('emit "peerconnection:setremotedescriptionfailed" [error:%o]',e),t.emit("peerconnection:setremotedescriptionfailed",e)})}else this._is_confirmed||this._confirmed("remote",e);break;case _.BYE:this._status===I.STATUS_CONFIRMED||this._status===I.STATUS_WAITING_FOR_ACK?(e.reply(200),this._ended("remote",e,_.causes.BYE)):this._status===I.STATUS_INVITE_RECEIVED||this._status===I.STATUS_WAITING_FOR_ANSWER?(e.reply(200),this._request.reply(487,"BYE Received"),this._ended("remote",e,_.causes.BYE)):e.reply(403,"Wrong Status");break;case _.INVITE:this._status===I.STATUS_CONFIRMED?e.hasHeader("replaces")?this._receiveReplaces(e):this._receiveReinvite(e):e.reply(403,"Wrong Status");break;case _.INFO:if(this._status===I.STATUS_1XX_RECEIVED||this._status===I.STATUS_WAITING_FOR_ANSWER||this._status===I.STATUS_ANSWERED||this._status===I.STATUS_WAITING_FOR_ACK||this._status===I.STATUS_CONFIRMED){var s=e.hasHeader("Content-Type")?e.getHeader("Content-Type").toLowerCase():void 0;s&&s.match(/^application\/dtmf-relay/i)?new b(this).init_incoming(e):void 0!==s?new S(this).init_incoming(e):e.reply(415)}else e.reply(403,"Wrong Status");break;case _.UPDATE:this._status===I.STATUS_CONFIRMED?this._receiveUpdate(e):e.reply(403,"Wrong Status");break;case _.REFER:this._status===I.STATUS_CONFIRMED?this._receiveRefer(e):e.reply(403,"Wrong Status");break;case _.NOTIFY:this._status===I.STATUS_CONFIRMED?this._receiveNotify(e):e.reply(403,"Wrong Status");break;default:e.reply(501)}}},{key:"onTransportError",value:function(){w.warn("onTransportError()"),this._status!==I.STATUS_TERMINATED&&this.terminate({status_code:500,reason_phrase:_.causes.CONNECTION_ERROR,cause:_.causes.CONNECTION_ERROR})}},{key:"onRequestTimeout",value:function(){w.warn("onRequestTimeout()"),this._status!==I.STATUS_TERMINATED&&this.terminate({status_code:408,reason_phrase:_.causes.REQUEST_TIMEOUT,cause:_.causes.REQUEST_TIMEOUT})}},{key:"onDialogError",value:function(){w.warn("onDialogError()"),this._status!==I.STATUS_TERMINATED&&this.terminate({status_code:500,reason_phrase:_.causes.DIALOG_ERROR,cause:_.causes.DIALOG_ERROR})}},{key:"newDTMF",value:function(e){w.debug("newDTMF()"),this.emit("newDTMF",e)}},{key:"newInfo",value:function(e){w.debug("newInfo()"),this.emit("newInfo",e)}},{key:"_isReadyToReOffer",value:function(){return this._rtcReady?this._dialog?!0!==this._dialog.uac_pending_reply&&!0!==this._dialog.uas_pending_reply||(w.debug("_isReadyToReOffer() | there is another INVITE/UPDATE transaction in progress"),!1):(w.debug("_isReadyToReOffer() | session not established yet"),!1):(w.debug("_isReadyToReOffer() | internal WebRTC status not ready"),!1)}},{key:"_close",value:function(){if(w.debug("close()"),this._localMediaStream&&this._localMediaStreamLocallyGenerated&&(w.debug("close() | closing local MediaStream"),v.closeMediaStream(this._localMediaStream)),this._status!==I.STATUS_TERMINATED){if(this._status=I.STATUS_TERMINATED,this._connection)try{this._connection.close()}catch(e){w.warn("close() | error closing the RTCPeerConnection: %o",e)}for(var e in this._timers)Object.prototype.hasOwnProperty.call(this._timers,e)&&clearTimeout(this._timers[e]);for(var t in clearTimeout(this._sessionTimers.timer),this._dialog&&(this._dialog.terminate(),delete this._dialog),this._earlyDialogs)Object.prototype.hasOwnProperty.call(this._earlyDialogs,t)&&(this._earlyDialogs[t].terminate(),delete this._earlyDialogs[t]);for(var n in this._referSubscribers)Object.prototype.hasOwnProperty.call(this._referSubscribers,n)&&delete this._referSubscribers[n];this._ua.destroyRTCSession(this)}}},{key:"_setInvite2xxTimer",value:function(e,t){var n=g.T1;this._timers.invite2xxTimer=setTimeout(function r(){this._status===I.STATUS_WAITING_FOR_ACK&&(e.reply(200,null,["Contact: ".concat(this._contact)],t),ng.T2&&(n=g.T2),this._timers.invite2xxTimer=setTimeout(r.bind(this),n))}.bind(this),n)}},{key:"_setACKTimer",value:function(){var e=this;this._timers.ackTimer=setTimeout(function(){e._status===I.STATUS_WAITING_FOR_ACK&&(w.debug("no ACK received, terminating the session"),clearTimeout(e._timers.invite2xxTimer),e.sendRequest(_.BYE),e._ended("remote",null,_.causes.NO_ACK))},g.TIMER_H)}},{key:"_createRTCConnection",value:function(e,t){var n=this;this._connection=new RTCPeerConnection(e,t),this._connection.addEventListener("iceconnectionstatechange",function(){"failed"===n._connection.iceConnectionState&&n.terminate({cause:_.causes.RTP_TIMEOUT,status_code:408,reason_phrase:_.causes.RTP_TIMEOUT})}),w.debug('emit "peerconnection"'),this.emit("peerconnection",{peerconnection:this._connection})}},{key:"_createLocalDescription",value:function(e,t){var n=this;if(w.debug("createLocalDescription()"),"offer"!==e&&"answer"!==e)throw new Error('createLocalDescription() | invalid type "'.concat(e,'"'));var r=this._connection;return this._rtcReady=!1,Promise.resolve().then(function(){return"offer"===e?r.createOffer(t).catch(function(e){return w.warn('emit "peerconnection:createofferfailed" [error:%o]',e),n.emit("peerconnection:createofferfailed",e),Promise.reject(e)}):r.createAnswer(t).catch(function(e){return w.warn('emit "peerconnection:createanswerfailed" [error:%o]',e),n.emit("peerconnection:createanswerfailed",e),Promise.reject(e)})}).then(function(e){return r.setLocalDescription(e).catch(function(e){return n._rtcReady=!0,w.warn('emit "peerconnection:setlocaldescriptionfailed" [error:%o]',e),n.emit("peerconnection:setlocaldescriptionfailed",e),Promise.reject(e)})}).then(function(){var s=t&&t.iceRestart;if("complete"===r.iceGatheringState&&!s||"gathering"===r.iceGatheringState&&n._iceReady){n._rtcReady=!0;var i={originator:"local",type:e,sdp:r.localDescription.sdp};return w.debug('emit "sdp"'),n.emit("sdp",i),Promise.resolve(i.sdp)}return new Promise(function(t){var s,i,o=!1;n._iceReady=!1;var l=function(){r.removeEventListener("icecandidate",s),r.removeEventListener("icegatheringstatechange",i),o=!0,n._rtcReady=!0,n._iceReady=!0;var l={originator:"local",type:e,sdp:r.localDescription.sdp};w.debug('emit "sdp"'),n.emit("sdp",l),t(l.sdp)};r.addEventListener("icecandidate",s=function(e){var t=e.candidate;t?n.emit("icecandidate",{candidate:t,ready:l}):o||l()}),r.addEventListener("icegatheringstatechange",i=function(){"complete"!==r.iceGatheringState||o||l()})})})}},{key:"_createDialog",value:function(e,t,n){var r="UAS"===t?e.to_tag:e.from_tag,s="UAS"===t?e.from_tag:e.to_tag,i=e.call_id+r+s,o=this._earlyDialogs[i];if(n)return!!o||((o=new T(this,e,t,T.C.STATUS_EARLY)).error?(w.debug(o.error),this._failed("remote",e,_.causes.INTERNAL_ERROR),!1):(this._earlyDialogs[i]=o,!0));if(this._from_tag=e.from_tag,this._to_tag=e.to_tag,o)return o.update(e,t),this._dialog=o,delete this._earlyDialogs[i],!0;var l=new T(this,e,t);return l.error?(w.debug(l.error),this._failed("remote",e,_.causes.INTERNAL_ERROR),!1):(this._dialog=l,!0)}},{key:"_receiveReinvite",value:function(e){var t=this;w.debug("receiveReinvite()");var n=e.hasHeader("Content-Type")?e.getHeader("Content-Type").toLowerCase():void 0,r={request:e,callback:void 0,reject:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s=!0;var n=t.status_code||403,r=t.reason_phrase||"",i=v.cloneArray(t.extraHeaders);if(this._status!==I.STATUS_CONFIRMED)return!1;if(n<300||n>=700)throw new TypeError("Invalid status_code: ".concat(n));e.reply(n,r,i)}.bind(this)},s=!1;if(this.emit("reinvite",r),!s){if(this._late_sdp=!1,!e.body)return this._late_sdp=!0,this._remoteHold&&(this._remoteHold=!1,this._onunhold("remote")),void(this._connectionPromiseQueue=this._connectionPromiseQueue.then(function(){return t._createLocalDescription("offer",t._rtcOfferConstraints)}).then(function(e){i.call(t,e)}).catch(function(){e.reply(500)}));if("application/sdp"!==n)return w.debug("invalid Content-Type"),void e.reply(415);this._processInDialogSdpOffer(e).then(function(e){t._status!==I.STATUS_TERMINATED&&i.call(t,e)}).catch(function(e){w.warn(e)})}function i(t){var n=this,s=["Contact: ".concat(this._contact)];this._handleSessionTimersInIncomingRequest(e,s),this._late_sdp&&(t=this._mangleOffer(t)),e.reply(200,null,s,t,function(){n._status=I.STATUS_WAITING_FOR_ACK,n._setInvite2xxTimer(e,t),n._setACKTimer()}),"function"==typeof r.callback&&r.callback()}}},{key:"_receiveUpdate",value:function(e){var t=this;w.debug("receiveUpdate()");var n=e.hasHeader("Content-Type")?e.getHeader("Content-Type").toLowerCase():void 0,r={request:e,callback:void 0,reject:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s=!0;var n=t.status_code||403,r=t.reason_phrase||"",i=v.cloneArray(t.extraHeaders);if(this._status!==I.STATUS_CONFIRMED)return!1;if(n<300||n>=700)throw new TypeError("Invalid status_code: ".concat(n));e.reply(n,r,i)}.bind(this)},s=!1;if(this.emit("update",r),!s)if(e.body){if("application/sdp"!==n)return w.debug("invalid Content-Type"),void e.reply(415);this._processInDialogSdpOffer(e).then(function(e){t._status!==I.STATUS_TERMINATED&&i.call(t,e)}).catch(function(e){w.warn(e)})}else i.call(this,null);function i(t){var n=["Contact: ".concat(this._contact)];this._handleSessionTimersInIncomingRequest(e,n),e.reply(200,null,n,t),"function"==typeof r.callback&&r.callback()}}},{key:"_processInDialogSdpOffer",value:function(e){var t=this;w.debug("_processInDialogSdpOffer()");var n,r=e.parseSDP(),i=!1,o=s(r.media);try{for(o.s();!(n=o.n()).done;){var l=n.value;if(-1!==O.indexOf(l.type)){var u=l.direction||r.direction||"sendrecv";if("sendonly"!==u&&"inactive"!==u){i=!1;break}i=!0}}}catch(e){o.e(e)}finally{o.f()}var a={originator:"remote",type:"offer",sdp:e.body};w.debug('emit "sdp"'),this.emit("sdp",a);var c=new RTCSessionDescription({type:"offer",sdp:a.sdp});return this._connectionPromiseQueue=this._connectionPromiseQueue.then(function(){if(t._status===I.STATUS_TERMINATED)throw new Error("terminated");return t._connection.setRemoteDescription(c).catch(function(n){throw e.reply(488),w.warn('emit "peerconnection:setremotedescriptionfailed" [error:%o]',n),t.emit("peerconnection:setremotedescriptionfailed",n),n})}).then(function(){if(t._status===I.STATUS_TERMINATED)throw new Error("terminated");!0===t._remoteHold&&!1===i?(t._remoteHold=!1,t._onunhold("remote")):!1===t._remoteHold&&!0===i&&(t._remoteHold=!0,t._onhold("remote"))}).then(function(){if(t._status===I.STATUS_TERMINATED)throw new Error("terminated");return t._createLocalDescription("answer",t._rtcAnswerConstraints).catch(function(t){throw e.reply(500),w.warn('emit "peerconnection:createtelocaldescriptionfailed" [error:%o]',t),t})}).catch(function(e){w.warn("_processInDialogSdpOffer() failed [error: %o]",e)}),this._connectionPromiseQueue}},{key:"_receiveRefer",value:function(e){var t=this;if(w.debug("receiveRefer()"),!e.refer_to)return w.debug("no Refer-To header field present in REFER"),void e.reply(400);if(e.refer_to.uri.scheme!==_.SIP)return w.debug("Refer-To header field points to a non-SIP URI scheme"),void e.reply(416);e.reply(202);var r=new E(this,e.cseq);w.debug('emit "refer"'),this.emit("refer",{request:e,accept:function(s,i){(function(t){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t="function"==typeof t?t:null,this._status!==I.STATUS_WAITING_FOR_ACK&&this._status!==I.STATUS_CONFIRMED)return!1;var i=new n(this._ua);if(i.on("progress",function(e){var t=e.response;r.notify(t.status_code,t.reason_phrase)}),i.on("accepted",function(e){var t=e.response;r.notify(t.status_code,t.reason_phrase)}),i.on("_failed",function(e){var t=e.message,n=e.cause;t?r.notify(t.status_code,t.reason_phrase):r.notify(487,n)}),e.refer_to.uri.hasHeader("replaces")){var o=decodeURIComponent(e.refer_to.uri.getHeader("replaces"));s.extraHeaders=v.cloneArray(s.extraHeaders),s.extraHeaders.push("Replaces: ".concat(o))}i.connect(e.refer_to.uri.toAor(),s,t)}).call(t,s,i)},reject:function(){(function(){r.notify(603)}).call(t)}})}},{key:"_receiveNotify",value:function(e){switch(w.debug("receiveNotify()"),e.event||e.reply(400),e.event.event){case"refer":var t,n;if(e.event.params&&e.event.params.id)t=e.event.params.id,n=this._referSubscribers[t];else{if(1!==Object.keys(this._referSubscribers).length)return void e.reply(400,"Missing event id parameter");n=this._referSubscribers[Object.keys(this._referSubscribers)[0]]}if(!n)return void e.reply(481,"Subscription does not exist");n.receiveNotify(e),e.reply(200);break;default:e.reply(489)}}},{key:"_receiveReplaces",value:function(e){var t=this;w.debug("receiveReplaces()"),this.emit("replaces",{request:e,accept:function(r){(function(t){var r=this;if(this._status!==I.STATUS_WAITING_FOR_ACK&&this._status!==I.STATUS_CONFIRMED)return!1;var s=new n(this._ua);s.on("confirmed",function(){r.terminate()}),s.init_incoming(e,t)}).call(t,r)},reject:function(){(function(){w.debug("Replaced INVITE rejected by the user"),e.reply(486)}).call(t)}})}},{key:"_sendInitialRequest",value:function(e,t,n){var r=this,s=new C(this._ua,this._request,{onRequestTimeout:function(){r.onRequestTimeout()},onTransportError:function(){r.onTransportError()},onAuthenticated:function(e){r._request=e},onReceiveResponse:function(e){r._receiveInviteResponse(e)}});Promise.resolve().then(function(){return n||(e.audio||e.video?(r._localMediaStreamLocallyGenerated=!0,navigator.mediaDevices.getUserMedia(e).catch(function(e){if(r._status===I.STATUS_TERMINATED)throw new Error("terminated");throw r._failed("local",null,_.causes.USER_DENIED_MEDIA_ACCESS),w.warn('emit "getusermediafailed" [error:%o]',e),r.emit("getusermediafailed",e),e})):void 0)}).then(function(e){if(r._status===I.STATUS_TERMINATED)throw new Error("terminated");return r._localMediaStream=e,e&&e.getTracks().forEach(function(t){r._connection.addTrack(t,e)}),r._connecting(r._request),r._createLocalDescription("offer",t).catch(function(e){throw r._failed("local",null,_.causes.WEBRTC_ERROR),e})}).then(function(e){if(r._is_canceled||r._status===I.STATUS_TERMINATED)throw new Error("terminated");r._request.body=e,r._status=I.STATUS_INVITE_SENT,w.debug('emit "sending" [request:%o]',r._request),r.emit("sending",{request:r._request}),s.send()}).catch(function(e){r._status!==I.STATUS_TERMINATED&&w.warn(e)})}},{key:"_getDTMFRTPSender",value:function(){var e=this._connection.getSenders().find(function(e){return e.track&&"audio"===e.track.kind});if(e&&e.dtmf)return e.dtmf;w.warn("sendDTMF() | no local audio track to send DTMF with")}},{key:"_receiveInviteResponse",value:function(e){var t=this;if(w.debug("receiveInviteResponse()"),this._dialog&&e.status_code>=200&&e.status_code<=299){if(this._dialog.id.call_id===e.call_id&&this._dialog.id.local_tag===e.from_tag&&this._dialog.id.remote_tag===e.to_tag)return void this.sendRequest(_.ACK);var n=new T(this,e,"UAC");return void 0!==n.error?void w.debug(n.error):(this.sendRequest(_.ACK),void this.sendRequest(_.BYE))}if(this._is_canceled)e.status_code>=100&&e.status_code<200?this._request.cancel(this._cancel_reason):e.status_code>=200&&e.status_code<299&&this._acceptAndTerminate(e);else if(this._status===I.STATUS_INVITE_SENT||this._status===I.STATUS_1XX_RECEIVED)switch(!0){case/^100$/.test(e.status_code):this._status=I.STATUS_1XX_RECEIVED;break;case/^1[0-9]{2}$/.test(e.status_code):if(!e.to_tag){w.debug("1xx response received without to tag");break}if(e.hasHeader("contact")&&!this._createDialog(e,"UAC",!0))break;if(this._status=I.STATUS_1XX_RECEIVED,!e.body){this._progress("remote",e);break}var r={originator:"remote",type:"answer",sdp:e.body};w.debug('emit "sdp"'),this.emit("sdp",r);var s=new RTCSessionDescription({type:"answer",sdp:r.sdp});this._connectionPromiseQueue=this._connectionPromiseQueue.then(function(){return t._connection.setRemoteDescription(s)}).then(function(){return t._progress("remote",e)}).catch(function(e){w.warn('emit "peerconnection:setremotedescriptionfailed" [error:%o]',e),t.emit("peerconnection:setremotedescriptionfailed",e)});break;case/^2[0-9]{2}$/.test(e.status_code):if(this._status=I.STATUS_CONFIRMED,!e.body){this._acceptAndTerminate(e,400,_.causes.MISSING_SDP),this._failed("remote",e,_.causes.BAD_MEDIA_DESCRIPTION);break}if(!this._createDialog(e,"UAC"))break;var i={originator:"remote",type:"answer",sdp:e.body};w.debug('emit "sdp"'),this.emit("sdp",i);var o=new RTCSessionDescription({type:"answer",sdp:i.sdp});this._connectionPromiseQueue=this._connectionPromiseQueue.then(function(){if("stable"===t._connection.signalingState)return t._connection.createOffer(t._rtcOfferConstraints).then(function(e){return t._connection.setLocalDescription(e)}).catch(function(n){t._acceptAndTerminate(e,500,n.toString()),t._failed("local",e,_.causes.WEBRTC_ERROR)})}).then(function(){t._connection.setRemoteDescription(o).then(function(){t._handleSessionTimersInIncomingResponse(e),t._accepted("remote",e),t.sendRequest(_.ACK),t._confirmed("local",null)}).catch(function(n){t._acceptAndTerminate(e,488,"Not Acceptable Here"),t._failed("remote",e,_.causes.BAD_MEDIA_DESCRIPTION),w.warn('emit "peerconnection:setremotedescriptionfailed" [error:%o]',n),t.emit("peerconnection:setremotedescriptionfailed",n)})});break;default:var l=v.sipErrorCause(e.status_code);this._failed("remote",e,l)}}},{key:"_sendReinvite",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};w.debug("sendReinvite()");var n=v.cloneArray(t.extraHeaders),r=v.cloneObject(t.eventHandlers),s=t.rtcOfferConstraints||this._rtcOfferConstraints||null,i=!1;function o(e){r.failed&&r.failed(e)}n.push("Contact: ".concat(this._contact)),n.push("Content-Type: application/sdp"),this._sessionTimers.running&&n.push("Session-Expires: ".concat(this._sessionTimers.currentExpires,";refresher=").concat(this._sessionTimers.refresher?"uac":"uas")),this._connectionPromiseQueue=this._connectionPromiseQueue.then(function(){return e._createLocalDescription("offer",s)}).then(function(t){var s={originator:"local",type:"offer",sdp:t=e._mangleOffer(t)};w.debug('emit "sdp"'),e.emit("sdp",s),e.sendRequest(_.INVITE,{extraHeaders:n,body:t,eventHandlers:{onSuccessResponse:function(t){(function(e){var t=this;if(this._status===I.STATUS_TERMINATED)return;if(this.sendRequest(_.ACK),i)return;if(this._handleSessionTimersInIncomingResponse(e),!e.body)return void o.call(this);if(!e.hasHeader("Content-Type")||"application/sdp"!==e.getHeader("Content-Type").toLowerCase())return void o.call(this);var n={originator:"remote",type:"answer",sdp:e.body};w.debug('emit "sdp"'),this.emit("sdp",n);var s=new RTCSessionDescription({type:"answer",sdp:n.sdp});this._connectionPromiseQueue=this._connectionPromiseQueue.then(function(){return t._connection.setRemoteDescription(s)}).then(function(){r.succeeded&&r.succeeded(e)}).catch(function(e){o.call(t),w.warn('emit "peerconnection:setremotedescriptionfailed" [error:%o]',e),t.emit("peerconnection:setremotedescriptionfailed",e)})}).call(e,t),i=!0},onErrorResponse:function(t){o.call(e,t)},onTransportError:function(){e.onTransportError()},onRequestTimeout:function(){e.onRequestTimeout()},onDialogError:function(){e.onDialogError()}}})}).catch(function(){o()})}},{key:"_sendUpdate",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};w.debug("sendUpdate()");var n=v.cloneArray(t.extraHeaders),r=v.cloneObject(t.eventHandlers),s=t.rtcOfferConstraints||this._rtcOfferConstraints||null,i=t.sdpOffer||!1,o=!1;function l(e){var t=this;if(this._status!==I.STATUS_TERMINATED&&!o)if(this._handleSessionTimersInIncomingResponse(e),i){if(!e.body)return void u.call(this);if(!e.hasHeader("Content-Type")||"application/sdp"!==e.getHeader("Content-Type").toLowerCase())return void u.call(this);var n={originator:"remote",type:"answer",sdp:e.body};w.debug('emit "sdp"'),this.emit("sdp",n);var s=new RTCSessionDescription({type:"answer",sdp:n.sdp});this._connectionPromiseQueue=this._connectionPromiseQueue.then(function(){return t._connection.setRemoteDescription(s)}).then(function(){r.succeeded&&r.succeeded(e)}).catch(function(e){u.call(t),w.warn('emit "peerconnection:setremotedescriptionfailed" [error:%o]',e),t.emit("peerconnection:setremotedescriptionfailed",e)})}else r.succeeded&&r.succeeded(e)}function u(e){r.failed&&r.failed(e)}n.push("Contact: ".concat(this._contact)),this._sessionTimers.running&&n.push("Session-Expires: ".concat(this._sessionTimers.currentExpires,";refresher=").concat(this._sessionTimers.refresher?"uac":"uas")),i?(n.push("Content-Type: application/sdp"),this._connectionPromiseQueue=this._connectionPromiseQueue.then(function(){return e._createLocalDescription("offer",s)}).then(function(t){var r={originator:"local",type:"offer",sdp:t=e._mangleOffer(t)};w.debug('emit "sdp"'),e.emit("sdp",r),e.sendRequest(_.UPDATE,{extraHeaders:n,body:t,eventHandlers:{onSuccessResponse:function(t){l.call(e,t),o=!0},onErrorResponse:function(t){u.call(e,t)},onTransportError:function(){e.onTransportError()},onRequestTimeout:function(){e.onRequestTimeout()},onDialogError:function(){e.onDialogError()}}})}).catch(function(){u.call(e)})):this.sendRequest(_.UPDATE,{extraHeaders:n,eventHandlers:{onSuccessResponse:function(t){l.call(e,t)},onErrorResponse:function(t){u.call(e,t)},onTransportError:function(){e.onTransportError()},onRequestTimeout:function(){e.onRequestTimeout()},onDialogError:function(){e.onDialogError()}}})}},{key:"_acceptAndTerminate",value:function(e,t,n){w.debug("acceptAndTerminate()");var r=[];t&&(n=n||_.REASON_PHRASE[t]||"",r.push("Reason: SIP ;cause=".concat(t,'; text="').concat(n,'"'))),(this._dialog||this._createDialog(e,"UAC"))&&(this.sendRequest(_.ACK),this.sendRequest(_.BYE,{extraHeaders:r})),this._status=I.STATUS_TERMINATED}},{key:"_mangleOffer",value:function(e){if(!this._localHold&&!this._remoteHold)return e;if(e=d.parse(e),this._localHold&&!this._remoteHold){w.debug("mangleOffer() | me on hold, mangling offer");var t,n=s(e.media);try{for(n.s();!(t=n.n()).done;){var r=t.value;-1!==O.indexOf(r.type)&&(r.direction?"sendrecv"===r.direction?r.direction="sendonly":"recvonly"===r.direction&&(r.direction="inactive"):r.direction="sendonly")}}catch(e){n.e(e)}finally{n.f()}}else if(this._localHold&&this._remoteHold){w.debug("mangleOffer() | both on hold, mangling offer");var i,o=s(e.media);try{for(o.s();!(i=o.n()).done;){var l=i.value;-1!==O.indexOf(l.type)&&(l.direction="inactive")}}catch(e){o.e(e)}finally{o.f()}}else if(this._remoteHold){w.debug("mangleOffer() | remote on hold, mangling offer");var u,a=s(e.media);try{for(a.s();!(u=a.n()).done;){var c=u.value;-1!==O.indexOf(c.type)&&(c.direction?"sendrecv"===c.direction?c.direction="recvonly":"recvonly"===c.direction&&(c.direction="inactive"):c.direction="recvonly")}}catch(e){a.e(e)}finally{a.f()}}return d.write(e)}},{key:"_setLocalMediaStatus",value:function(){var e=!0,t=!0;(this._localHold||this._remoteHold)&&(e=!1,t=!1),this._audioMuted&&(e=!1),this._videoMuted&&(t=!1),this._toggleMuteAudio(!e),this._toggleMuteVideo(!t)}},{key:"_handleSessionTimersInIncomingRequest",value:function(e,t){var n;this._sessionTimers.enabled&&(e.session_expires&&e.session_expires>=_.MIN_SESSION_EXPIRES?(this._sessionTimers.currentExpires=e.session_expires,n=e.session_expires_refresher||"uas"):(this._sessionTimers.currentExpires=this._sessionTimers.defaultExpires,n="uas"),t.push("Session-Expires: ".concat(this._sessionTimers.currentExpires,";refresher=").concat(n)),this._sessionTimers.refresher="uas"===n,this._runSessionTimer())}},{key:"_handleSessionTimersInIncomingResponse",value:function(e){var t;this._sessionTimers.enabled&&(e.session_expires&&e.session_expires>=_.MIN_SESSION_EXPIRES?(this._sessionTimers.currentExpires=e.session_expires,t=e.session_expires_refresher||"uac"):(this._sessionTimers.currentExpires=this._sessionTimers.defaultExpires,t="uac"),this._sessionTimers.refresher="uac"===t,this._runSessionTimer())}},{key:"_runSessionTimer",value:function(){var e=this,t=this._sessionTimers.currentExpires;this._sessionTimers.running=!0,clearTimeout(this._sessionTimers.timer),this._sessionTimers.refresher?this._sessionTimers.timer=setTimeout(function(){e._status!==I.STATUS_TERMINATED&&e._isReadyToReOffer()&&(w.debug("runSessionTimer() | sending session refresh request"),e._sessionTimers.refreshMethod===_.UPDATE?e._sendUpdate():e._sendReinvite())},500*t):this._sessionTimers.timer=setTimeout(function(){e._status!==I.STATUS_TERMINATED&&(w.warn("runSessionTimer() | timer expired, terminating the session"),e.terminate({cause:_.causes.REQUEST_TIMEOUT,status_code:408,reason_phrase:"Session Timer Expired"}))},1100*t)}},{key:"_toggleMuteAudio",value:function(e){var t,n=s(this._connection.getSenders().filter(function(e){return e.track&&"audio"===e.track.kind}));try{for(n.s();!(t=n.n()).done;){t.value.track.enabled=!e}}catch(e){n.e(e)}finally{n.f()}}},{key:"_toggleMuteVideo",value:function(e){var t,n=s(this._connection.getSenders().filter(function(e){return e.track&&"video"===e.track.kind}));try{for(n.s();!(t=n.n()).done;){t.value.track.enabled=!e}}catch(e){n.e(e)}finally{n.f()}}},{key:"_newRTCSession",value:function(e,t){w.debug("newRTCSession()"),this._ua.newRTCSession(this,{originator:e,session:this,request:t})}},{key:"_connecting",value:function(e){w.debug("session connecting"),w.debug('emit "connecting"'),this.emit("connecting",{request:e})}},{key:"_progress",value:function(e,t){w.debug("session progress"),w.debug('emit "progress"'),this.emit("progress",{originator:e,response:t||null})}},{key:"_accepted",value:function(e,t){w.debug("session accepted"),this._start_time=new Date,w.debug('emit "accepted"'),this.emit("accepted",{originator:e,response:t||null})}},{key:"_confirmed",value:function(e,t){w.debug("session confirmed"),this._is_confirmed=!0,w.debug('emit "confirmed"'),this.emit("confirmed",{originator:e,ack:t||null})}},{key:"_ended",value:function(e,t,n){w.debug("session ended"),this._end_time=new Date,this._close(),w.debug('emit "ended"'),this.emit("ended",{originator:e,message:t||null,cause:n})}},{key:"_failed",value:function(e,t,n){w.debug("session failed"),w.debug('emit "_failed"'),this.emit("_failed",{originator:e,message:t||null,cause:n}),this._close(),w.debug('emit "failed"'),this.emit("failed",{originator:e,message:t||null,cause:n})}},{key:"_onhold",value:function(e){w.debug("session onhold"),this._setLocalMediaStatus(),w.debug('emit "hold"'),this.emit("hold",{originator:e})}},{key:"_onunhold",value:function(e){w.debug("session onunhold"),this._setLocalMediaStatus(),w.debug('emit "unhold"'),this.emit("unhold",{originator:e})}},{key:"_onmute",value:function(e){var t=e.audio,n=e.video;w.debug("session onmute"),this._setLocalMediaStatus(),w.debug('emit "muted"'),this.emit("muted",{audio:t,video:n})}},{key:"_onunmute",value:function(e){var t=e.audio,n=e.video;w.debug("session onunmute"),this._setLocalMediaStatus(),w.debug('emit "unmuted"'),this.emit("unmuted",{audio:t,video:n})}},{key:"C",get:function(){return I}},{key:"causes",get:function(){return _.causes}},{key:"id",get:function(){return this._id}},{key:"connection",get:function(){return this._connection}},{key:"contact",get:function(){return this._contact}},{key:"direction",get:function(){return this._direction}},{key:"local_identity",get:function(){return this._local_identity}},{key:"remote_identity",get:function(){return this._remote_identity}},{key:"start_time",get:function(){return this._start_time}},{key:"end_time",get:function(){return this._end_time}},{key:"data",get:function(){return this._data},set:function(e){this._data=e}},{key:"status",get:function(){return this._status}}]),n}()},{"./Constants":2,"./Dialog":3,"./Exceptions":6,"./Logger":9,"./RTCSession/DTMF":15,"./RTCSession/Info":16,"./RTCSession/ReferNotifier":17,"./RTCSession/ReferSubscriber":18,"./RequestSender":20,"./SIPMessage":21,"./Timers":23,"./Transactions":24,"./URI":27,"./Utils":28,events:31,"sdp-transform":37}],15:[function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(void 0===e)throw new TypeError("Not enough arguments");if(this._direction="outgoing",this._session.status!==this._session.C.STATUS_CONFIRMED&&this._session.status!==this._session.C.STATUS_WAITING_FOR_ACK)throw new h.InvalidStateError(this._session.status);var r=d.cloneArray(n.extraHeaders);if(this.eventHandlers=d.cloneObject(n.eventHandlers),"string"==typeof e)e=e.toUpperCase();else{if("number"!=typeof e)throw new TypeError("Invalid tone: ".concat(e));e=e.toString()}if(!e.match(/^[0-9A-DR#*]$/))throw new TypeError("Invalid tone: ".concat(e));this._tone=e,this._duration=n.duration,r.push("Content-Type: application/dtmf-relay");var s="Signal=".concat(this._tone,"\r\n");s+="Duration=".concat(this._duration),this._session.newDTMF({originator:"local",dtmf:this,request:this._request}),this._session.sendRequest(c.INFO,{extraHeaders:r,eventHandlers:{onSuccessResponse:function(e){t.emit("succeeded",{originator:"remote",response:e})},onErrorResponse:function(e){t.eventHandlers.onFailed&&t.eventHandlers.onFailed(),t.emit("failed",{originator:"remote",response:e})},onRequestTimeout:function(){t._session.onRequestTimeout()},onTransportError:function(){t._session.onTransportError()},onDialogError:function(){t._session.onDialogError()}},body:s})}},{key:"init_incoming",value:function(e){var t=/^(Signal\s*?=\s*?)([0-9A-D#*]{1})(\s)?.*/,n=/^(Duration\s?=\s?)([0-9]{1,4})(\s)?.*/;if(this._direction="incoming",this._request=e,e.reply(200),e.body){var r=e.body.split("\n");r.length>=1&&t.test(r[0])&&(this._tone=r[0].replace(t,"$2")),r.length>=2&&n.test(r[1])&&(this._duration=parseInt(r[1].replace(n,"$2"),10))}this._duration||(this._duration=_.DEFAULT_DURATION),this._tone?this._session.newDTMF({originator:"remote",dtmf:this,request:e}):f.debug("invalid INFO DTMF received, discarded")}},{key:"tone",get:function(){return this._tone}},{key:"duration",get:function(){return this._duration}}])&&s(t.prototype,n),r&&s(t,r),a}(),t.exports.C=_},{"../Constants":2,"../Exceptions":6,"../Logger":9,"../Utils":28,events:31}],16:[function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};if(this._direction="outgoing",void 0===e)throw new TypeError("Not enough arguments");if(this._session.status!==this._session.C.STATUS_CONFIRMED&&this._session.status!==this._session.C.STATUS_WAITING_FOR_ACK)throw new c.InvalidStateError(this._session.status);this._contentType=e,this._body=t;var s=h.cloneArray(r.extraHeaders);s.push("Content-Type: ".concat(e)),this._session.newInfo({originator:"local",info:this,request:this.request}),this._session.sendRequest(a.INFO,{extraHeaders:s,eventHandlers:{onSuccessResponse:function(e){n.emit("succeeded",{originator:"remote",response:e})},onErrorResponse:function(e){n.emit("failed",{originator:"remote",response:e})},onTransportError:function(){n._session.onTransportError()},onRequestTimeout:function(){n._session.onRequestTimeout()},onDialogError:function(){n._session.onDialogError()}},body:t})}},{key:"init_incoming",value:function(e){this._direction="incoming",this.request=e,e.reply(200),this._contentType=e.hasHeader("Content-Type")?e.getHeader("Content-Type").toLowerCase():void 0,this._body=e.body,this._session.newInfo({originator:"remote",info:this,request:e})}},{key:"contentType",get:function(){return this._contentType}},{key:"body",get:function(){return this._body}}])&&s(t.prototype,n),r&&s(t,r),d}()},{"../Constants":2,"../Exceptions":6,"../Utils":28,events:31}],17:[function(e,t,n){"use strict";function r(e,t){for(var n=0;n=200?"terminated;reason=noresource":"active;expires=".concat(this._expires),this._session.sendRequest(i.NOTIFY,{extraHeaders:["Event: ".concat(l.event_type,";id=").concat(this._id),"Subscription-State: ".concat(n),"Content-Type: ".concat(l.body_type)],body:"SIP/2.0 ".concat(e," ").concat(t),eventHandlers:{onErrorResponse:function(){this._active=!1}}}))}}])&&r(t.prototype,n),s&&r(t,s),e}()},{"../Constants":2,"../Logger":9}],18:[function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};f.debug("sendRefer()");var r=d.cloneArray(n.extraHeaders),s=d.cloneObject(n.eventHandlers);for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&this.on(i,s[i]);var o=null;n.replaces&&(o=n.replaces._request.call_id,o+=";to-tag=".concat(n.replaces._to_tag),o+=";from-tag=".concat(n.replaces._from_tag),o=encodeURIComponent(o));var l="Refer-To: <".concat(e).concat(o?"?Replaces=".concat(o):"",">");if(r.push(l),!r.some(function(e){return e.toLowerCase().startsWith("referred-by:")})){var u="Referred-By: <".concat(this._session._ua._configuration.uri._scheme,":").concat(this._session._ua._configuration.uri._user,"@").concat(this._session._ua._configuration.uri._host,">");r.push(u)}r.push("Contact: ".concat(this._session.contact));var a=this._session.sendRequest(c.REFER,{extraHeaders:r,eventHandlers:{onSuccessResponse:function(e){t._requestSucceeded(e)},onErrorResponse:function(e){t._requestFailed(e,c.causes.REJECTED)},onTransportError:function(){t._requestFailed(null,c.causes.CONNECTION_ERROR)},onRequestTimeout:function(){t._requestFailed(null,c.causes.REQUEST_TIMEOUT)},onDialogError:function(){t._requestFailed(null,c.causes.DIALOG_ERROR)}}});this._id=a.cseq}},{key:"receiveNotify",value:function(e){if(f.debug("receiveNotify()"),e.body){var t=h.parse(e.body.trim(),"Status_Line");if(-1!==t)switch(!0){case/^100$/.test(t.status_code):this.emit("trying",{request:e,status_line:t});break;case/^1[0-9]{2}$/.test(t.status_code):this.emit("progress",{request:e,status_line:t});break;case/^2[0-9]{2}$/.test(t.status_code):this.emit("accepted",{request:e,status_line:t});break;default:this.emit("failed",{request:e,status_line:t})}else f.debug('receiveNotify() | error parsing NOTIFY body: "'.concat(e.body,'"'))}}},{key:"_requestSucceeded",value:function(e){f.debug("REFER succeeded"),f.debug('emit "requestSucceeded"'),this.emit("requestSucceeded",{response:e})}},{key:"_requestFailed",value:function(e,t){f.debug("REFER failed"),f.debug('emit "requestFailed"'),this.emit("requestFailed",{response:e||null,cause:t})}},{key:"id",get:function(){return this._id}}])&&s(t.prototype,n),r&&s(t,r),a}()},{"../Constants":2,"../Grammar":7,"../Logger":9,"../Utils":28,events:31}],19:[function(e,t,n){"use strict";function r(e,t){for(var n=0;n"'),this._contact+=";reg-id=".concat(this._reg_id),this._contact+=";+sip.instance=".concat(this._sipInstance)}var t,n,s;return t=e,(n=[{key:"setExtraHeaders",value:function(e){Array.isArray(e)||(e=[]),this._extraHeaders=e.slice()}},{key:"setExtraContactParams",value:function(e){for(var t in e instanceof Object||(e={}),this._extraContactParams="",e)if(Object.prototype.hasOwnProperty.call(e,t)){var n=e[t];this._extraContactParams+=";".concat(t),n&&(this._extraContactParams+="=".concat(n))}}},{key:"register",value:function(){var e=this;if(this._registering)a.debug("Register request in progress...");else{var t=this._extraHeaders.slice();t.push("Contact: ".concat(this._contact,";expires=").concat(this._expires).concat(this._extraContactParams)),t.push("Expires: ".concat(this._expires));var n=new l.OutgoingRequest(o.REGISTER,this._registrar,this._ua,{to_uri:this._to_uri,call_id:this._call_id,cseq:this._cseq+=1},t),r=new u(this._ua,n,{onRequestTimeout:function(){e._registrationFailure(null,o.causes.REQUEST_TIMEOUT)},onTransportError:function(){e._registrationFailure(null,o.causes.CONNECTION_ERROR)},onAuthenticated:function(){e._cseq+=1},onReceiveResponse:function(t){if(t.cseq===e._cseq)switch(null!==e._registrationTimer&&(clearTimeout(e._registrationTimer),e._registrationTimer=null),!0){case/^1[0-9]{2}$/.test(t.status_code):break;case/^2[0-9]{2}$/.test(t.status_code):if(e._registering=!1,!t.hasHeader("Contact")){a.debug("no Contact header in response to REGISTER, response ignored");break}var n=t.headers.Contact.reduce(function(e,t){return e.concat(t.parsed)},[]),r=n.find(function(t){return e._sipInstance===t.getParam("+sip.instance")&&e._reg_id===parseInt(t.getParam("reg-id"))});if(r||(r=n.find(function(t){return t.uri.user===e._ua.contact.uri.user})),!r){a.debug("no Contact header pointing to us, response ignored");break}var s=r.getParam("expires");!s&&t.hasHeader("expires")&&(s=t.getHeader("expires")),s||(s=e._expires),(s=Number(s))<10&&(s=10);var l=s>64?1e3*s/2+Math.floor(1e3*(s/2-32)*Math.random()):1e3*s-5e3;e._registrationTimer=setTimeout(function(){e._registrationTimer=null,0===e._ua.listeners("registrationExpiring").length?e.register():e._ua.emit("registrationExpiring")},l),r.hasParam("temp-gruu")&&(e._ua.contact.temp_gruu=r.getParam("temp-gruu").replace(/"/g,"")),r.hasParam("pub-gruu")&&(e._ua.contact.pub_gruu=r.getParam("pub-gruu").replace(/"/g,"")),e._registered||(e._registered=!0,e._ua.registered({response:t}));break;case/^423$/.test(t.status_code):t.hasHeader("min-expires")?(e._expires=Number(t.getHeader("min-expires")),e._expires<10&&(e._expires=10),e.register()):(a.debug("423 response received for REGISTER without Min-Expires"),e._registrationFailure(t,o.causes.SIP_FAILURE_CODE));break;default:var u=i.sipErrorCause(t.status_code);e._registrationFailure(t,u)}}});this._registering=!0,r.send()}}},{key:"unregister",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._registered){this._registered=!1,null!==this._registrationTimer&&(clearTimeout(this._registrationTimer),this._registrationTimer=null);var n=this._extraHeaders.slice();t.all?n.push("Contact: *".concat(this._extraContactParams)):n.push("Contact: ".concat(this._contact,";expires=0").concat(this._extraContactParams)),n.push("Expires: 0");var r=new l.OutgoingRequest(o.REGISTER,this._registrar,this._ua,{to_uri:this._to_uri,call_id:this._call_id,cseq:this._cseq+=1},n);new u(this._ua,r,{onRequestTimeout:function(){e._unregistered(null,o.causes.REQUEST_TIMEOUT)},onTransportError:function(){e._unregistered(null,o.causes.CONNECTION_ERROR)},onAuthenticated:function(){e._cseq+=1},onReceiveResponse:function(t){switch(!0){case/^1[0-9]{2}$/.test(t.status_code):break;case/^2[0-9]{2}$/.test(t.status_code):e._unregistered(t);break;default:var n=i.sipErrorCause(t.status_code);e._unregistered(t,n)}}}).send()}else a.debug("already unregistered")}},{key:"close",value:function(){this._registered&&this.unregister()}},{key:"onTransportClosed",value:function(){this._registering=!1,null!==this._registrationTimer&&(clearTimeout(this._registrationTimer),this._registrationTimer=null),this._registered&&(this._registered=!1,this._ua.unregistered({}))}},{key:"_registrationFailure",value:function(e,t){this._registering=!1,this._ua.registrationFailed({response:e||null,cause:t}),this._registered&&(this._registered=!1,this._ua.unregistered({response:e||null,cause:t}))}},{key:"_unregistered",value:function(e,t){this._registering=!1,this._registered=!1,this._ua.unregistered({response:e||null,cause:t||null})}},{key:"registered",get:function(){return this._registered}}])&&r(t.prototype,n),s&&r(t,s),e}()},{"./Constants":2,"./Logger":9,"./RequestSender":20,"./SIPMessage":21,"./Utils":28}],20:[function(e,t,n){"use strict";function r(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw i}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n")),this.setHeader("via",""),this.setHeader("max-forwards",p.MAX_FORWARDS);var l=s.to_uri||n,u=s.to_tag?{tag:s.to_tag}:null,a=void 0!==s.to_display_name?s.to_display_name:null;this.to=new v(l,a,u),this.setHeader("to",this.to.toString());var h,d=s.from_uri||r.configuration.uri,f={tag:s.from_tag||m.newTag()};h=void 0!==s.from_display_name?s.from_display_name:r.configuration.display_name?r.configuration.display_name:null,this.from=new v(d,h,f),this.setHeader("from",this.from.toString());var _=s.call_id||r.configuration.jssip_id+m.createRandomToken(15);this.call_id=_,this.setHeader("call-id",_);var g=s.cseq||Math.floor(1e4*Math.random());this.cseq=g,this.setHeader("cseq","".concat(g," ").concat(t))}return d(e,[{key:"setHeader",value:function(e,t){for(var n=new RegExp("^\\s*".concat(e,"\\s*:"),"i"),r=0;r1&&void 0!==arguments[1]?arguments[1]:0;if(e=m.headerize(e),this.headers[e]){if(!(t>=this.headers[e].length)){var n=this.headers[e][t],r=n.raw;if(n.parsed)return n.parsed;var s=g.parse(r,e.replace(/-/g,"_"));return-1===s?(this.headers[e].splice(t,1),void y.debug('error parsing "'.concat(e,'" header field with value "').concat(r,'"'))):(n.parsed=s,s)}y.debug('not so many "'.concat(e,'" headers present'))}else y.debug('header "'.concat(e,'" not present'))}},{key:"s",value:function(e,t){return this.parseHeader(e,t)}},{key:"setHeader",value:function(e,t){var n={raw:t};this.headers[m.headerize(e)]=[n]}},{key:"parseSDP",value:function(e){return!e&&this.sdp?this.sdp:(this.sdp=f.parse(this.body||""),this.sdp)}},{key:"toString",value:function(){return this.data}}]),e}(),S=function(e){s(n,b);var t=o(n);function n(e){var r;return c(this,n),(r=t.call(this)).ua=e,r.headers={},r.ruri=null,r.transport=null,r.server_transaction=null,r}return d(n,[{key:"reply",value:function(e,t,n,r,s,i){var o=[],l=this.getHeader("To");if(t=t||null,!(e=e||null)||e<100||e>699)throw new TypeError("Invalid status_code: ".concat(e));if(t&&"string"!=typeof t&&!(t instanceof String))throw new TypeError("Invalid reason_phrase: ".concat(t));t=t||p.REASON_PHRASE[e]||"",n=m.cloneArray(n);var a="SIP/2.0 ".concat(e," ").concat(t,"\r\n");if(this.method===p.INVITE&&e>100&&e<=200){var c,h=u(this.getHeaders("record-route"));try{for(h.s();!(c=h.n()).done;){var d=c.value;a+="Record-Route: ".concat(d,"\r\n")}}catch(e){h.e(e)}finally{h.f()}}var f,_=u(this.getHeaders("via"));try{for(_.s();!(f=_.n()).done;){var v=f.value;a+="Via: ".concat(v,"\r\n")}}catch(e){_.e(e)}finally{_.f()}!this.to_tag&&e>100?l+=";tag=".concat(m.newTag()):this.to_tag&&!this.s("to").hasParam("tag")&&(l+=";tag=".concat(this.to_tag)),a+="To: ".concat(l,"\r\n"),a+="From: ".concat(this.getHeader("From"),"\r\n"),a+="Call-ID: ".concat(this.call_id,"\r\n"),a+="CSeq: ".concat(this.cseq," ").concat(this.method,"\r\n");var g,y=u(n);try{for(y.s();!(g=y.n()).done;){var T=g.value;a+="".concat(T.trim(),"\r\n")}}catch(e){y.e(e)}finally{y.f()}switch(this.method){case p.INVITE:this.ua.configuration.session_timers&&o.push("timer"),(this.ua.contact.pub_gruu||this.ua.contact.temp_gruu)&&o.push("gruu"),o.push("ice","replaces");break;case p.UPDATE:this.ua.configuration.session_timers&&o.push("timer"),r&&o.push("ice"),o.push("replaces")}if(o.push("outbound"),this.method===p.OPTIONS?(a+="Allow: ".concat(p.ALLOWED_METHODS,"\r\n"),a+="Accept: ".concat(p.ACCEPTED_BODY_TYPES,"\r\n")):405===e?a+="Allow: ".concat(p.ALLOWED_METHODS,"\r\n"):415===e&&(a+="Accept: ".concat(p.ACCEPTED_BODY_TYPES,"\r\n")),a+="Supported: ".concat(o,"\r\n"),r){var C=m.str_utf8_length(r);a+="Content-Type: application/sdp\r\n",a+="Content-Length: ".concat(C,"\r\n\r\n"),a+=r}else a+="Content-Length: ".concat(0,"\r\n\r\n");this.server_transaction.receiveResponse(e,a,s,i)}},{key:"reply_sl",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getHeaders("via");if(!e||e<100||e>699)throw new TypeError("Invalid status_code: ".concat(e));if(t&&"string"!=typeof t&&!(t instanceof String))throw new TypeError("Invalid reason_phrase: ".concat(t));t=t||p.REASON_PHRASE[e]||"";var r,s="SIP/2.0 ".concat(e," ").concat(t,"\r\n"),i=u(n);try{for(i.s();!(r=i.n()).done;){var o=r.value;s+="Via: ".concat(o,"\r\n")}}catch(e){i.e(e)}finally{i.f()}var l=this.getHeader("To");!this.to_tag&&e>100?l+=";tag=".concat(m.newTag()):this.to_tag&&!this.s("to").hasParam("tag")&&(l+=";tag=".concat(this.to_tag)),s+="To: ".concat(l,"\r\n"),s+="From: ".concat(this.getHeader("From"),"\r\n"),s+="Call-ID: ".concat(this.call_id,"\r\n"),s+="CSeq: ".concat(this.cseq," ").concat(this.method,"\r\n"),s+="Content-Length: ".concat(0,"\r\n\r\n"),this.transport.send(s)}}]),n}(),E=function(e){s(n,b);var t=o(n);function n(){var e;return c(this,n),(e=t.call(this)).headers={},e.status_code=null,e.reason_phrase=null,e}return n}();t.exports={OutgoingRequest:T,InitialOutgoingInviteRequest:C,IncomingRequest:S,IncomingResponse:E}},{"./Constants":2,"./Grammar":7,"./Logger":9,"./NameAddrHeader":11,"./Utils":28,"sdp-transform":37}],22:[function(e,t,n){"use strict";var r=e("./Logger"),s=e("./Utils"),i=e("./Grammar"),o=new r("Socket");n.isSocket=function(e){if(Array.isArray(e))return!1;if(void 0===e)return o.warn("undefined JsSIP.Socket instance"),!1;try{if(!s.isString(e.url))throw o.warn("missing or invalid JsSIP.Socket url property"),new Error("Missing or invalid JsSIP.Socket url property");if(!s.isString(e.via_transport))throw o.warn("missing or invalid JsSIP.Socket via_transport property"),new Error("Missing or invalid JsSIP.Socket via_transport property");if(-1===i.parse(e.sip_uri,"SIP_URI"))throw o.warn("missing or invalid JsSIP.Socket sip_uri property"),new Error("missing or invalid JsSIP.Socket sip_uri property")}catch(e){return!1}try{["connect","disconnect","send"].forEach(function(t){if(!s.isFunction(e[t]))throw o.warn("missing or invalid JsSIP.Socket method: ".concat(t)),new Error("Missing or invalid JsSIP.Socket method: ".concat(t))})}catch(e){return!1}return!0}},{"./Grammar":7,"./Logger":9,"./Utils":28}],23:[function(e,t,n){"use strict";var r=500;t.exports={T1:r,T2:4e3,T4:5e3,TIMER_B:32e3,TIMER_D:0,TIMER_F:32e3,TIMER_H:32e3,TIMER_I:0,TIMER_J:0,TIMER_K:0,TIMER_L:32e3,TIMER_M:32e3,PROVISIONAL_RESPONSE_INTERVAL:6e4}},{}],24:[function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n=100&&n<=199)switch(this.state){case b.STATUS_CALLING:this.stateChanged(b.STATUS_PROCEEDING),this.eventHandlers.onReceiveResponse(e);break;case b.STATUS_PROCEEDING:this.eventHandlers.onReceiveResponse(e)}else if(n>=200&&n<=299)switch(this.state){case b.STATUS_CALLING:case b.STATUS_PROCEEDING:this.stateChanged(b.STATUS_ACCEPTED),this.M=setTimeout(function(){t.timer_M()},m.TIMER_M),this.eventHandlers.onReceiveResponse(e);break;case b.STATUS_ACCEPTED:this.eventHandlers.onReceiveResponse(e)}else if(n>=300&&n<=699)switch(this.state){case b.STATUS_CALLING:case b.STATUS_PROCEEDING:this.stateChanged(b.STATUS_COMPLETED),this.sendACK(e),this.eventHandlers.onReceiveResponse(e);break;case b.STATUS_COMPLETED:this.sendACK(e)}}},{key:"C",get:function(){return b}}]),n}(),A=function(e){l(n,d);var t=a(n);function n(e,r,i,o){var l;s(this,n),(l=t.call(this)).id="z9hG4bK".concat(Math.floor(1e7*Math.random())),l.transport=r,l.request=i,l.eventHandlers=o;var u="SIP/2.0/".concat(r.via_transport);return u+=" ".concat(e.configuration.via_host,";branch=").concat(l.id),l.request.setHeader("via",u),l}return o(n,[{key:"send",value:function(){this.transport.send(this.request)||this.onTransportError()}},{key:"onTransportError",value:function(){y.debug("transport error occurred for transaction ".concat(this.id)),this.eventHandlers.onTransportError()}},{key:"C",get:function(){return b}}]),n}(),R=function(e){l(n,d);var t=a(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this)).type=b.NON_INVITE_SERVER,o.id=i.via_branch,o.ua=e,o.transport=r,o.request=i,o.last_response="",i.server_transaction=c(o),o.state=b.STATUS_TRYING,e.newTransaction(c(o)),o}return o(n,[{key:"stateChanged",value:function(e){this.state=e,this.emit("stateChanged")}},{key:"timer_J",value:function(){T.debug("Timer J expired for transaction ".concat(this.id)),this.stateChanged(b.STATUS_TERMINATED),this.ua.destroyTransaction(this)}},{key:"onTransportError",value:function(){this.transportError||(this.transportError=!0,T.debug("transport error occurred, deleting transaction ".concat(this.id)),clearTimeout(this.J),this.stateChanged(b.STATUS_TERMINATED),this.ua.destroyTransaction(this))}},{key:"receiveResponse",value:function(e,t,n,r){var s=this;if(100===e)switch(this.state){case b.STATUS_TRYING:this.stateChanged(b.STATUS_PROCEEDING),this.transport.send(t)||this.onTransportError();break;case b.STATUS_PROCEEDING:this.last_response=t,this.transport.send(t)?n&&n():(this.onTransportError(),r&&r())}else if(e>=200&&e<=699)switch(this.state){case b.STATUS_TRYING:case b.STATUS_PROCEEDING:this.stateChanged(b.STATUS_COMPLETED),this.last_response=t,this.J=setTimeout(function(){s.timer_J()},m.TIMER_J),this.transport.send(t)?n&&n():(this.onTransportError(),r&&r());break;case b.STATUS_COMPLETED:}}},{key:"C",get:function(){return b}}]),n}(),w=function(e){l(n,d);var t=a(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this)).type=b.INVITE_SERVER,o.id=i.via_branch,o.ua=e,o.transport=r,o.request=i,o.last_response="",i.server_transaction=c(o),o.state=b.STATUS_PROCEEDING,e.newTransaction(c(o)),o.resendProvisionalTimer=null,i.reply(100),o}return o(n,[{key:"stateChanged",value:function(e){this.state=e,this.emit("stateChanged")}},{key:"timer_H",value:function(){C.debug("Timer H expired for transaction ".concat(this.id)),this.state===b.STATUS_COMPLETED&&C.debug("ACK not received, dialog will be terminated"),this.stateChanged(b.STATUS_TERMINATED),this.ua.destroyTransaction(this)}},{key:"timer_I",value:function(){this.stateChanged(b.STATUS_TERMINATED),this.ua.destroyTransaction(this)}},{key:"timer_L",value:function(){C.debug("Timer L expired for transaction ".concat(this.id)),this.state===b.STATUS_ACCEPTED&&(this.stateChanged(b.STATUS_TERMINATED),this.ua.destroyTransaction(this))}},{key:"onTransportError",value:function(){this.transportError||(this.transportError=!0,C.debug("transport error occurred, deleting transaction ".concat(this.id)),null!==this.resendProvisionalTimer&&(clearInterval(this.resendProvisionalTimer),this.resendProvisionalTimer=null),clearTimeout(this.L),clearTimeout(this.H),clearTimeout(this.I),this.stateChanged(b.STATUS_TERMINATED),this.ua.destroyTransaction(this))}},{key:"resend_provisional",value:function(){this.transport.send(this.last_response)||this.onTransportError()}},{key:"receiveResponse",value:function(e,t,n,r){var s=this;if(e>=100&&e<=199)switch(this.state){case b.STATUS_PROCEEDING:this.transport.send(t)||this.onTransportError(),this.last_response=t}if(e>100&&e<=199&&this.state===b.STATUS_PROCEEDING)null===this.resendProvisionalTimer&&(this.resendProvisionalTimer=setInterval(function(){s.resend_provisional()},m.PROVISIONAL_RESPONSE_INTERVAL));else if(e>=200&&e<=299)switch(this.state){case b.STATUS_PROCEEDING:this.stateChanged(b.STATUS_ACCEPTED),this.last_response=t,this.L=setTimeout(function(){s.timer_L()},m.TIMER_L),null!==this.resendProvisionalTimer&&(clearInterval(this.resendProvisionalTimer),this.resendProvisionalTimer=null);case b.STATUS_ACCEPTED:this.transport.send(t)?n&&n():(this.onTransportError(),r&&r())}else if(e>=300&&e<=699)switch(this.state){case b.STATUS_PROCEEDING:null!==this.resendProvisionalTimer&&(clearInterval(this.resendProvisionalTimer),this.resendProvisionalTimer=null),this.transport.send(t)?(this.stateChanged(b.STATUS_COMPLETED),this.H=setTimeout(function(){s.timer_H()},m.TIMER_H),n&&n()):(this.onTransportError(),r&&r())}}},{key:"C",get:function(){return b}}]),n}();t.exports={C:b,NonInviteClientTransaction:S,InviteClientTransaction:E,AckClientTransaction:A,NonInviteServerTransaction:R,InviteServerTransaction:w,checkTransaction:function(e,t){var n,r=e._transactions;switch(t.method){case _.INVITE:if(n=r.ist[t.via_branch]){switch(n.state){case b.STATUS_PROCEEDING:n.transport.send(n.last_response);break;case b.STATUS_ACCEPTED:}return!0}break;case _.ACK:if(!(n=r.ist[t.via_branch]))return!1;if(n.state===b.STATUS_ACCEPTED)return!1;if(n.state===b.STATUS_COMPLETED)return n.state=b.STATUS_CONFIRMED,n.I=setTimeout(function(){n.timer_I()},m.TIMER_I),!0;break;case _.CANCEL:return(n=r.ist[t.via_branch])?(t.reply_sl(200),n.state!==b.STATUS_PROCEEDING):(t.reply_sl(481),!0);default:if(n=r.nist[t.via_branch]){switch(n.state){case b.STATUS_TRYING:break;case b.STATUS_PROCEEDING:case b.STATUS_COMPLETED:n.transport.send(n.last_response)}return!0}}}}},{"./Constants":2,"./Logger":9,"./SIPMessage":21,"./Timers":23,events:31}],25:[function(e,t,n){"use strict";function r(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:u.recovery_options;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),l.debug("new()"),this.status=u.STATUS_DISCONNECTED,this.socket=null,this.sockets=[],this.recovery_options=n,this.recover_attempts=0,this.recovery_timer=null,this.close_requested=!1;try{this.textDecoder=new TextDecoder("utf8")}catch(e){l.warn("cannot use TextDecoder: ".concat(e))}if(void 0===t)throw new TypeError("Invalid argument. undefined 'sockets' argument");t instanceof Array||(t=[t]),t.forEach(function(e){if(!i.isSocket(e.socket))throw new TypeError("Invalid argument. invalid 'JsSIP.Socket' instance");if(e.weight&&!Number(e.weight))throw new TypeError("Invalid argument. 'weight' attribute is not a number");this.sockets.push({socket:e.socket,weight:e.weight||0,status:u.SOCKET_STATUS_READY})},this),this._getSocket()}var t,n,s;return t=e,(n=[{key:"connect",value:function(){l.debug("connect()"),this.isConnected()?l.debug("Transport is already connected"):this.isConnecting()?l.debug("Transport is connecting"):(this.close_requested=!1,this.status=u.STATUS_CONNECTING,this.onconnecting({socket:this.socket,attempts:this.recover_attempts}),this.close_requested||(this.socket.onconnect=this._onConnect.bind(this),this.socket.ondisconnect=this._onDisconnect.bind(this),this.socket.ondata=this._onData.bind(this),this.socket.connect()))}},{key:"disconnect",value:function(){l.debug("close()"),this.close_requested=!0,this.recover_attempts=0,this.status=u.STATUS_DISCONNECTED,null!==this.recovery_timer&&(clearTimeout(this.recovery_timer),this.recovery_timer=null),this.socket.onconnect=function(){},this.socket.ondisconnect=function(){},this.socket.ondata=function(){},this.socket.disconnect(),this.ondisconnect({socket:this.socket,error:!1})}},{key:"send",value:function(e){if(l.debug("send()"),!this.isConnected())return l.warn("unable to send message, transport is not connected"),!1;var t=e.toString();return l.debug("sending message:\n\n".concat(t,"\n")),this.socket.send(t)}},{key:"isConnected",value:function(){return this.status===u.STATUS_CONNECTED}},{key:"isConnecting",value:function(){return this.status===u.STATUS_CONNECTING}},{key:"_reconnect",value:function(){var e=this;this.recover_attempts+=1;var t=Math.floor(Math.random()*Math.pow(2,this.recover_attempts)+1);tthis.recovery_options.max_interval&&(t=this.recovery_options.max_interval),l.debug("reconnection attempt: ".concat(this.recover_attempts,". next connection attempt in ").concat(t," seconds")),this.recovery_timer=setTimeout(function(){e.close_requested||e.isConnected()||e.isConnecting()||(e._getSocket(),e.connect())},1e3*t)}},{key:"_getSocket",value:function(){var e=[];if(this.sockets.forEach(function(t){t.status!==u.SOCKET_STATUS_ERROR&&(0===e.length?e.push(t):t.weight>e[0].weight?e=[t]:t.weight===e[0].weight&&e.push(t))}),0===e.length)return this.sockets.forEach(function(e){e.status=u.SOCKET_STATUS_READY}),void this._getSocket();var t=Math.floor(Math.random()*e.length);this.socket=e[t].socket}},{key:"_onConnect",value:function(){this.recover_attempts=0,this.status=u.STATUS_CONNECTED,null!==this.recovery_timer&&(clearTimeout(this.recovery_timer),this.recovery_timer=null),this.onconnect({socket:this})}},{key:"_onDisconnect",value:function(e,t,n){this.status=u.STATUS_DISCONNECTED,this.ondisconnect({socket:this.socket,error:e,code:t,reason:n}),this.close_requested||(this.sockets.forEach(function(e){this.socket===e.socket&&(e.status=u.SOCKET_STATUS_ERROR)},this),this._reconnect(e))}},{key:"_onData",value:function(e){if("\r\n"!==e){if("string"!=typeof e){try{e=this.textDecoder?this.textDecoder.decode(e):String.fromCharCode.apply(null,new Uint8Array(e))}catch(e){return void l.debug("received binary message failed to be converted into string, message discarded")}l.debug("received binary message:\n\n".concat(e,"\n"))}else l.debug("received text message:\n\n".concat(e,"\n"));this.ondata({transport:this,message:e})}else l.debug("received message with CRLF Keep Alive response")}},{key:"via_transport",get:function(){return this.socket.via_transport}},{key:"url",get:function(){return this.socket.url}},{key:"sip_uri",get:function(){return this.socket.sip_uri}}])&&r(t.prototype,n),s&&r(t,s),e}()},{"./Constants":2,"./Logger":9,"./Socket":22}],26:[function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=e.anonymous||null,n=e.outbound||null,r="<";return r+=t?this.temp_gruu||"sip:anonymous@anonymous.invalid;transport=ws":this.pub_gruu||this.uri.toString(),!n||(t?this.temp_gruu:this.pub_gruu)||(r+=";ob"),r+=">"}};var r=["authorization_user","password","realm","ha1","authorization_jwt","display_name","register"];for(var s in this._configuration)Object.prototype.hasOwnProperty.call(this._configuration,s)&&(-1!==r.indexOf(s)?Object.defineProperty(this._configuration,s,{writable:!0,configurable:!1}):Object.defineProperty(this._configuration,s,{writable:!1,configurable:!1}));for(var i in R.debug("configuration parameters after validation:"),this._configuration)if(Object.prototype.hasOwnProperty.call(A.settings,i))switch(i){case"uri":case"registrar_server":R.debug("- ".concat(i,": ").concat(this._configuration[i]));break;case"password":case"ha1":case"authorization_jwt":R.debug("- ".concat(i,": NOT SHOWN"));break;default:R.debug("- ".concat(i,": ").concat(JSON.stringify(this._configuration[i])))}}},{key:"C",get:function(){return w}},{key:"status",get:function(){return this._status}},{key:"contact",get:function(){return this._contact}},{key:"configuration",get:function(){return this._configuration}},{key:"transport",get:function(){return this._transport}}]),n}()},{"./Config":1,"./Constants":2,"./Exceptions":6,"./Logger":9,"./Message":10,"./Options":12,"./Parser":13,"./RTCSession":14,"./Registrator":19,"./SIPMessage":21,"./Transactions":24,"./Transport":25,"./URI":27,"./Utils":28,"./sanityCheck":30,events:31}],27:[function(e,t,n){"use strict";function r(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return l=e.done,e},e:function(e){u=!0,o=e},f:function(){try{l||null==n.return||n.return()}finally{if(u)throw o}}}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n4&&void 0!==arguments[4]?arguments[4]:{},o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!r)throw new TypeError('missing or invalid "host" parameter');for(var u in this._parameters={},this._headers={},this._scheme=t||l.SIP,this._user=n,this._host=r,this._port=s,i)Object.prototype.hasOwnProperty.call(i,u)&&this.setParam(u,i[u]);for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&this.setHeader(a,o[a])}return o(e,null,[{key:"parse",value:function(e){return-1!==(e=a.parse(e,"SIP_URI"))?e:void 0}}]),o(e,[{key:"setParam",value:function(e,t){e&&(this._parameters[e.toLowerCase()]=null==t?null:t.toString())}},{key:"getParam",value:function(e){if(e)return this._parameters[e.toLowerCase()]}},{key:"hasParam",value:function(e){if(e)return!!this._parameters.hasOwnProperty(e.toLowerCase())}},{key:"deleteParam",value:function(e){if(e=e.toLowerCase(),this._parameters.hasOwnProperty(e)){var t=this._parameters[e];return delete this._parameters[e],t}}},{key:"clearParams",value:function(){this._parameters={}}},{key:"setHeader",value:function(e,t){this._headers[u.headerize(e)]=Array.isArray(t)?t:[t]}},{key:"getHeader",value:function(e){if(e)return this._headers[u.headerize(e)]}},{key:"hasHeader",value:function(e){if(e)return!!this._headers.hasOwnProperty(u.headerize(e))}},{key:"deleteHeader",value:function(e){if(e=u.headerize(e),this._headers.hasOwnProperty(e)){var t=this._headers[e];return delete this._headers[e],t}}},{key:"clearHeaders",value:function(){this._headers={}}},{key:"clone",value:function(){return new e(this._scheme,this._user,this._host,this._port,JSON.parse(JSON.stringify(this._parameters)),JSON.parse(JSON.stringify(this._headers)))}},{key:"toString",value:function(){var e=[],t="".concat(this._scheme,":");for(var n in this._user&&(t+="".concat(u.escapeUser(this._user),"@")),t+=this._host,(this._port||0===this._port)&&(t+=":".concat(this._port)),this._parameters)Object.prototype.hasOwnProperty.call(this._parameters,n)&&(t+=";".concat(n),null!==this._parameters[n]&&(t+="=".concat(this._parameters[n])));for(var s in this._headers)if(Object.prototype.hasOwnProperty.call(this._headers,s)){var i,o=r(this._headers[s]);try{for(o.s();!(i=o.n()).done;){var l=i.value;e.push("".concat(s,"=").concat(l))}}catch(e){o.e(e)}finally{o.f()}}return e.length>0&&(t+="?".concat(e.join("&"))),t}},{key:"toAor",value:function(e){var t="".concat(this._scheme,":");return this._user&&(t+="".concat(u.escapeUser(this._user),"@")),t+=this._host,e&&(this._port||0===this._port)&&(t+=":".concat(this._port)),t}},{key:"scheme",get:function(){return this._scheme},set:function(e){this._scheme=e.toLowerCase()}},{key:"user",get:function(){return this._user},set:function(e){this._user=e}},{key:"host",get:function(){return this._host},set:function(e){this._host=e.toLowerCase()}},{key:"port",get:function(){return this._port},set:function(e){this._port=0===e?e:parseInt(e,10)||null}}]),e}()},{"./Constants":2,"./Grammar":7,"./Utils":28}],28:[function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,s=function(){};return{s:s,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return l=e.done,e},e:function(e){u=!0,o=e},f:function(){try{l||null==n.return||n.return()}finally{if(u)throw o}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:32,r="";for(t=0;t>>32-t}function n(e,t){var n=2147483648&e,r=2147483648&t,s=1073741824&e,i=1073741824&t,o=(1073741823&e)+(1073741823&t);return s&i?2147483648^o^n^r:s|i?1073741824&o?3221225472^o^n^r:1073741824^o^n^r:o^n^r}function r(e,r,s,i,o,l,u){return e=n(e,n(n(function(e,t,n){return e&t|~e&n}(r,s,i),o),u)),n(t(e,l),r)}function s(e,r,s,i,o,l,u){return e=n(e,n(n(function(e,t,n){return e&n|t&~n}(r,s,i),o),u)),n(t(e,l),r)}function i(e,r,s,i,o,l,u){return e=n(e,n(n(function(e,t,n){return e^t^n}(r,s,i),o),u)),n(t(e,l),r)}function o(e,r,s,i,o,l,u){return e=n(e,n(n(function(e,t,n){return t^(e|~n)}(r,s,i),o),u)),n(t(e,l),r)}function l(e){var t,n="",r="";for(t=0;t<=3;t++)n+=(r="0".concat((e>>>8*t&255).toString(16))).substr(r.length-2,2);return n}var u,a,c,h,d,f,_,p,m,v;for(u=function(e){for(var t,n=e.length,r=n+8,s=16*((r-r%64)/64+1),i=new Array(s-1),o=0,l=0;l>>29,i}(e=function(e){e=e.replace(/\r\n/g,"\n");for(var t="",n=0;n127&&r<2048?(t+=String.fromCharCode(r>>6|192),t+=String.fromCharCode(63&r|128)):(t+=String.fromCharCode(r>>12|224),t+=String.fromCharCode(r>>6&63|128),t+=String.fromCharCode(63&r|128))}return t}(e)),_=1732584193,p=4023233417,m=2562383102,v=271733878,a=0;a1&&void 0!==arguments[1]?arguments[1]:{};return e&&Object.assign({},e)||t}},{"./Constants":2,"./Grammar":7,"./URI":27}],29:[function(e,t,n){"use strict";function r(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return l=e.done,e},e:function(e){u=!0,o=e},f:function(){try{l||null==n.return||n.return()}finally{if(u)throw o}}}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1)return d.debug("more than one Via header field present in the response, dropping the response"),!1},function(){var e=h.str_utf8_length(i.body),t=i.getHeader("content-length");if(e0&&l.length>i){l.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+l.length+' "'+String(t)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=l.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",u.name,u.message)}}else l=o[t]=n,++e._eventsCount;return e}function d(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var e=new Array(arguments.length),t=0;t1&&(t=arguments[1]),t instanceof Error)throw t;var u=new Error('Unhandled "error" event. ('+t+")");throw u.context=t,u}if(!(n=o[e]))return!1;var a="function"==typeof n;switch(r=arguments.length){case 1:!function(e,t,n){if(t)e.call(n);else for(var r=e.length,s=m(e,r),i=0;i=0;o--)if(n[o]===t||n[o].listener===t){l=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(var n=t,r=n+1,s=e.length;r=0;i--)this.removeListener(e,t[i]);return this},o.prototype.listeners=function(e){return _(this,e,!0)},o.prototype.rawListeners=function(e){return _(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],32:[function(e,t,n){(function(r){n.log=function(...e){return"object"==typeof console&&console.log&&console.log(...e)},n.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,s=0;e[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(s=r))}),e.splice(s,0,n)},n.save=function(e){try{e?n.storage.setItem("debug",e):n.storage.removeItem("debug")}catch(e){}},n.load=function(){let e;try{e=n.storage.getItem("debug")}catch(e){}!e&&void 0!==r&&"env"in r&&(e=r.env.DEBUG);return e},n.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},n.storage=function(){try{return localStorage}catch(e){}}(),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.exports=e("./common")(n);const{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,e("_process"))},{"./common":33,_process:35}],33:[function(e,t,n){t.exports=function(t){function n(e){let t=0;for(let n=0;n{if("%%"===t)return t;l++;const i=r.formatters[s];if("function"==typeof i){const r=e[l];t=i.call(n,r),e.splice(l,1),l--}return t}),r.formatArgs.call(n,e),(n.log||r.log).apply(n,e)}return o.namespace=e,o.enabled=r.enabled(e),o.useColors=r.useColors(),o.color=n(e),o.destroy=s,o.extend=i,"function"==typeof r.init&&r.init(o),r.instances.push(o),o}function s(){const e=r.instances.indexOf(this);return-1!==e&&(r.instances.splice(e,1),!0)}function i(e,t){const n=r(this.namespace+(void 0===t?":":t)+e);return n.log=this.log,n}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return r.debug=r,r.default=r,r.coerce=function(e){return e instanceof Error?e.stack||e.message:e},r.disable=function(){const e=[...r.names.map(o),...r.skips.map(o).map(e=>"-"+e)].join(",");return r.enable(""),e},r.enable=function(e){let t;r.save(e),r.names=[],r.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),s=n.length;for(t=0;t{r[e]=t[e]}),r.instances=[],r.names=[],r.skips=[],r.formatters={},r.selectColor=n,r.enable(r.load()),r}},{ms:34}],34:[function(e,t,n){var r=1e3,s=60*r,i=60*s,o=24*i,l=7*o,u=365.25*o;function a(e,t,n,r){var s=t>=1.5*n;return Math.round(e/n)+" "+r+(s?"s":"")}t.exports=function(e,t){t=t||{};var n=typeof e;if("string"===n&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*u;case"weeks":case"week":case"w":return n*l;case"days":case"day":case"d":return n*o;case"hours":case"hour":case"hrs":case"hr":case"h":return n*i;case"minutes":case"minute":case"mins":case"min":case"m":return n*s;case"seconds":case"second":case"secs":case"sec":case"s":return n*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}(e);if("number"===n&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=o)return a(e,t,o,"day");if(t>=i)return a(e,t,i,"hour");if(t>=s)return a(e,t,s,"minute");if(t>=r)return a(e,t,r,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=o)return Math.round(e/o)+"d";if(t>=i)return Math.round(e/i)+"h";if(t>=s)return Math.round(e/s)+"m";if(t>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],35:[function(e,t,n){var r,s,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function u(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{s="function"==typeof clearTimeout?clearTimeout:l}catch(e){s=l}}();var a,c=[],h=!1,d=-1;function f(){h&&a&&(h=!1,a.length?c=a.concat(c):d=-1,c.length&&_())}function _(){if(!h){var e=u(f);h=!0;for(var t=c.length;t;){for(a=c,c=[];++d1)for(var n=1;n1&&(e[n[0]]=void 0),e};n.parseParams=function(e){return e.split(/;\s?/).reduce(l,{})},n.parseFmtpConfig=n.parseParams,n.parsePayloads=function(e){return e.toString().split(" ").map(Number)},n.parseRemoteCandidates=function(e){for(var t=[],n=e.split(" ").map(r),s=0;s=r)return e;var s=n[t];switch(t+=1,e){case"%%":return"%";case"%s":return String(s);case"%d":return Number(s);case"%v":return""}})}.apply(null,r)},o=["v","o","s","i","u","e","p","c","b","t","r","z","a"],l=["i","c","b","a"];t.exports=function(e,t){t=t||{},null==e.version&&(e.version=0),null==e.name&&(e.name=" "),e.media.forEach(function(e){null==e.payloads&&(e.payloads="")});var n=t.outerOrder||o,s=t.innerOrder||l,u=[];return n.forEach(function(t){r[t].forEach(function(n){n.name in e&&null!=e[n.name]?u.push(i(t,n,e)):n.push in e&&null!=e[n.push]&&e[n.push].forEach(function(e){u.push(i(t,n,e))})})}),e.media.forEach(function(e){u.push(i("m",r.m[0],e)),s.forEach(function(t){r[t].forEach(function(n){n.name in e&&null!=e[n.name]?u.push(i(t,n,e)):n.push in e&&null!=e[n.push]&&e[n.push].forEach(function(e){u.push(i(t,n,e))})})})}),u.join("\r\n")+"\r\n"}},{"./grammar":36}],40:[function(e,t,n){t.exports={name:"jssip",title:"JsSIP",description:"the Javascript SIP library",version:"3.8.2",homepage:"https://jssip.net",contributors:["José Luis Millán (https://github.com/jmillan)","Iñaki Baz Castillo (https://inakibaz.me)"],types:"lib/JsSIP.d.ts",main:"lib-es5/JsSIP.js",keywords:["sip","websocket","webrtc","node","browser","library"],license:"MIT",repository:{type:"git",url:"https://github.com/versatica/JsSIP.git"},bugs:{url:"https://github.com/versatica/JsSIP/issues"},dependencies:{"@types/debug":"^4.1.5","@types/node":"^14.14.34",debug:"^4.3.1",events:"^3.3.0","sdp-transform":"^2.14.1"},devDependencies:{"@babel/core":"^7.13.10","@babel/preset-env":"^7.13.10","ansi-colors":"^3.2.4",browserify:"^16.5.1",eslint:"^5.16.0","fancy-log":"^1.3.3",gulp:"^4.0.2","gulp-babel":"^8.0.0","gulp-eslint":"^5.0.0","gulp-expect-file":"^1.0.2","gulp-header":"^2.0.9","gulp-nodeunit-runner":"^0.2.2","gulp-plumber":"^1.2.1","gulp-rename":"^1.4.0","gulp-uglify-es":"^1.0.4",pegjs:"^0.7.0","vinyl-buffer":"^1.0.1","vinyl-source-stream":"^2.0.0"},scripts:{lint:"gulp lint",test:"gulp test",prepublishOnly:"gulp babel"}}},{}]},{},[8])(8)}); \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 8fe455cd..8b013503 100755 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1,5 @@ rootProject.name = "ari4java" include "codegen" +if (file(".inc-examples").exists()) { + include "examples" +} From 136b3edb1624502eb9322d96f099ddcc1ad3bd6b Mon Sep 17 00:00:00 2001 From: Graham Brown Date: Mon, 26 Jan 2026 17:03:50 +0200 Subject: [PATCH 15/17] spotbug corrections --- build.gradle | 3 ++- spotbugs-exclude.xml | 14 ++++++++++++++ src/main/java/ch/loway/oss/ari4java/ARI.java | 6 +++--- .../loway/oss/ari4java/tools/http/HTTPLogger.java | 2 +- .../oss/ari4java/tools/http/NettyHttpClient.java | 13 +++++++------ 5 files changed, 27 insertions(+), 11 deletions(-) create mode 100644 spotbugs-exclude.xml diff --git a/build.gradle b/build.gradle index 41566a8a..937934e3 100755 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ plugins { id "jacoco" id "maven-publish" id "signing" - id "com.github.spotbugs" version "5.0.0" + id "com.github.spotbugs" version "6.4.8" id "org.sonarqube" version "2.7.1" } @@ -177,6 +177,7 @@ signing { } spotbugsMain { + excludeFilter = file("spotbugs-exclude.xml") reports { xml.required.set(true) html.required.set(true) diff --git a/spotbugs-exclude.xml b/spotbugs-exclude.xml new file mode 100644 index 00000000..621edacb --- /dev/null +++ b/spotbugs-exclude.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/main/java/ch/loway/oss/ari4java/ARI.java b/src/main/java/ch/loway/oss/ari4java/ARI.java index 02557e8b..8ccec0a0 100755 --- a/src/main/java/ch/loway/oss/ari4java/ARI.java +++ b/src/main/java/ch/loway/oss/ari4java/ARI.java @@ -30,9 +30,10 @@ public class ARI { private HttpClient httpClient; private WsClient wsClient; private ActionEvents liveActionEvent = null; - private AriSubscriber subscriptions = new AriSubscriber(); + private final AriSubscriber subscriptions = new AriSubscriber(); private final CopyOnWriteArrayList liveActionList = new CopyOnWriteArrayList<>(); - private static Logger logger = LoggerFactory.getLogger(ARI.class); + private static final Logger logger = LoggerFactory.getLogger(ARI.class); + private static final SecureRandom random = new SecureRandom(); /** * Sets the client @@ -469,7 +470,6 @@ public static void sleep(long ms) { public static String getUID() { StringBuilder sb = new StringBuilder(20); sb.append("a4j"); - SecureRandom random = new SecureRandom(); for (int n = 0; n < 15; n++) { if ((n % 5) == 0) { sb.append("."); diff --git a/src/main/java/ch/loway/oss/ari4java/tools/http/HTTPLogger.java b/src/main/java/ch/loway/oss/ari4java/tools/http/HTTPLogger.java index f17ee670..483db4cc 100755 --- a/src/main/java/ch/loway/oss/ari4java/tools/http/HTTPLogger.java +++ b/src/main/java/ch/loway/oss/ari4java/tools/http/HTTPLogger.java @@ -9,7 +9,7 @@ import java.util.Arrays; import java.util.Map; -public class HTTPLogger { +public final class HTTPLogger { private HTTPLogger() { throw new IllegalStateException("Utility class"); diff --git a/src/main/java/ch/loway/oss/ari4java/tools/http/NettyHttpClient.java b/src/main/java/ch/loway/oss/ari4java/tools/http/NettyHttpClient.java index 65246b6e..7626383a 100755 --- a/src/main/java/ch/loway/oss/ari4java/tools/http/NettyHttpClient.java +++ b/src/main/java/ch/loway/oss/ari4java/tools/http/NettyHttpClient.java @@ -35,6 +35,7 @@ import java.net.URISyntaxException; import java.util.List; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; /** * HTTP and WebSocket client implementation based on netty.io. @@ -71,7 +72,7 @@ public class NettyHttpClient implements HttpClient, WsClient { private String wsEventsUrl; private List wsEventsParamQuery; private WsClientConnection wsClientConnection; - private int reconnectCount = 0; + private final AtomicInteger reconnectCount = new AtomicInteger(0); private int maxReconnectCount = 10; // -1 = infinite reconnect attempts private ChannelFuture wsChannelFuture; private ScheduledFuture wsPingTimer = null; @@ -481,7 +482,7 @@ public void operationComplete(ChannelFuture future) throws Exception { logger.debug("WS connected..."); // start a ping and reset reconnect counter startPing(); - reconnectCount = 0; + reconnectCount.set(0); if (!group.isShuttingDown()) { group.execute(callback::onChReadyToWrite); } @@ -612,7 +613,7 @@ public void reconnectWs(Throwable cause) { wsPingTimer = null; } - if (!autoReconnect || (maxReconnectCount > -1 && reconnectCount >= maxReconnectCount)) { + if (!autoReconnect || (maxReconnectCount > -1 && reconnectCount.get() >= maxReconnectCount)) { logger.warn("Cannot connect: {} - executing failure callback", cause.getMessage()); if (!group.isShuttingDown()) { group.execute(() -> wsCallback.onFailure(cause)); @@ -624,9 +625,9 @@ public void reconnectWs(Throwable cause) { if (!group.isShuttingDown()) { // schedule reconnect after a 2,5,10 seconds long[] timeouts = {2L, 5L, 10L}; - long timeout = reconnectCount >= timeouts.length ? timeouts[timeouts.length - 1] : timeouts[reconnectCount]; - reconnectCount++; - logger.error("WS Connect Error: {}, reconnecting in {} seconds... try: {}", cause.getMessage(), timeout, reconnectCount); + long timeout = reconnectCount.get() >= timeouts.length ? timeouts[timeouts.length - 1] : timeouts[reconnectCount.get()]; + reconnectCount.incrementAndGet(); + logger.error("WS Connect Error: {}, reconnecting in {} seconds... try: {}", cause.getMessage(), timeout, reconnectCount.get()); shutDownGroup.schedule(() -> { try { // 1st close up From 7a86af102a864e6d451e768445ece444e3821769 Mon Sep 17 00:00:00 2001 From: Graham Brown Date: Mon, 26 Jan 2026 17:16:26 +0200 Subject: [PATCH 16/17] prepare 0.18.0 --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50b679d7..a84c1136 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ ## [Unreleased] [Unreleased]: https://github.com/ari4java/ari4java/compare/v0.17.0...HEAD +## [0.18.0] +[0.18.0]: https://github.com/ari4java/ari4java/compare/v0.17.0...v0.18.0 + ### Added - Connection Pooling using Netty's FixedChannelPool - Examples have a Docker provider for Vagrant (in order to work around VirtualBox compatibility on Apple Silicon) From 0f100f4c3ef324da64444c5be4de5602c03d4ce7 Mon Sep 17 00:00:00 2001 From: Graham Brown Date: Tue, 27 Jan 2026 14:01:24 +0200 Subject: [PATCH 17/17] add dates to CL, fix badge on README and note groupId change from which version and correct examples groupId, add JReleaser gradle plugin and use it for GH Action publish automation --- .github/workflows/gradle.yml | 6 ++-- .gitignore | 6 ++-- CHANGELOG.md | 22 ++++++------ README.md | 6 ++-- build.gradle | 67 +++++++++++++++++++++--------------- examples/build.gradle | 4 +-- examples/settings.gradle | 2 +- 7 files changed, 62 insertions(+), 51 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index d2f00c59..7ec339f5 100755 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -7,8 +7,8 @@ on: pull_request: branches: - master -# release: -# types: [published] + release: + types: [published] jobs: build: @@ -37,7 +37,7 @@ jobs: BUILD_NUMBER: ${{ env.GITHUB_RUN_NUMBER }} BINTRAY_USER: ${{ secrets.BINTRAY_USER }} BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }} - run: ./gradlew clean :codegen:runCodegen buildProps build bintrayUpload + run: ./gradlew clean :codegen:runCodegen buildProps build publish jreleaserDeploy if: github.event_name == 'release' - name: Archive Reports uses: actions/upload-artifact@v4 diff --git a/.gitignore b/.gitignore index 8d4b371e..c635799c 100755 --- a/.gitignore +++ b/.gitignore @@ -27,14 +27,12 @@ src/main/resources/build.properties codegen/tmp/ codegen/versions.md -.build-local -oss.yaml - # vagrant state folder .vagrant -# local build examples +# local build .inc-examples +oss.yaml # exclude keys examples/vagrant/asterisk/keys/*.key examples/vagrant/asterisk/keys/*.crt diff --git a/CHANGELOG.md b/CHANGELOG.md index a84c1136..12b82415 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## [Unreleased] [Unreleased]: https://github.com/ari4java/ari4java/compare/v0.17.0...HEAD -## [0.18.0] +## [0.18.0] - 2026-01-26 [0.18.0]: https://github.com/ari4java/ari4java/compare/v0.17.0...v0.18.0 ### Added @@ -17,20 +17,20 @@ - Cannot wait for connection close due to using connection keep-alive (aka pooling) - Some methods in the Examples use the async approach -## [0.17.0] +## [0.17.0] - 2024-02-24 [0.17.0]: https://github.com/ari4java/ari4java/compare/v0.16.0...v0.17.0 ### Added - `AriVersion.ARI_8_0_0` - `AriVersion.ARI_9_0_0` -## [0.16.0] +## [0.16.0] - 2022-06-11 [0.16.0]: https://github.com/ari4java/ari4java/compare/v0.15.0...v0.16.0 ### Added - `AriVersion.ARI_4_1_4` - `AriVersion.ARI_6_0_1` - `AriVersion.ARI_7_0_1` -## [0.15.0] +## [0.15.0] - 2021-12-26 [0.15.0]: https://github.com/ari4java/ari4java/compare/v0.14.0...v0.15.0 ### Changed - Library updates @@ -39,12 +39,12 @@ ### Fixed - Map `local_ssrc` & `remote_ssrc` in `RTPstat` model to `Long` instead of `Integer` #180 -## [0.14.0] +## [0.14.0] - 2021-10-24 [0.14.0]: https://github.com/ari4java/ari4java/compare/v0.13.0...v0.14.0 ### Fixed - ARI API resource inconsistency due to using git history on `resource.json`, now git tags (aka released versions) are used -## [0.13.0] +## [0.13.0] - 2021-08-14 [0.13.0]: https://github.com/ari4java/ari4java/compare/v0.12.2...v0.13.0 ### Changed - Library updates @@ -52,18 +52,18 @@ ### Added - `AriVersion.ARI_8_0_0` -## [0.12.2] +## [0.12.2] - 2021-03-25 [0.12.2]: https://github.com/ari4java/ari4java/compare/v0.12.1...v0.12.2 ### Changed - groupId changed from `ch.loway.oss.ari4java` to `io.github.ari4java` ### Added -## [0.12.1] +## [0.12.1] - 2020-09-23 [0.12.1]: https://github.com/ari4java/ari4java/compare/v0.12.0...v0.12.1 ### Added - ARI 4.1.3, 5.1.1 & 7.0.0 -## [0.12.0] +## [0.12.0] - 2020-06-24 [0.12.0]: https://github.com/ari4java/ari4java/compare/v0.11.0...v0.12.0 ### Fixes - onFailure long after WS Connect error #156 @@ -72,13 +72,13 @@ ### Added - WS reconnect count #158 -## [0.11.0] +## [0.11.0] - 2020-03-21 [0.11.0]: https://github.com/ari4java/ari4java/compare/v.0.10.0...v0.11.0 ### Added - Unit tests to increase coverage #11 - New ARI binding -## [0.10.0] +## [0.10.0] - 2020-02-23 [0.10.0]: https://github.com/ari4java/ari4java/compare/v0.9.1...v.0.10.0 ### Fixed - UnsupportedOperationException #15 diff --git a/README.md b/README.md index 41308438..441d6228 100755 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ The Asterisk REST Interface (ARI) bindings for Java. -[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.ari4java/ari4java/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.github.ari4java/ari4java) +![Maven Central](https://img.shields.io/maven-central/v/io.github.ari4java/ari4java) [![javadoc](https://javadoc.io/badge2/io.github.ari4java/ari4java/javadoc.svg)](https://javadoc.io/doc/io.github.ari4java/ari4java) [![Build](https://github.com/ari4java/ari4java/actions/workflows/gradle.yml/badge.svg?branch=master)](https://github.com/ari4java/ari4java/actions?query=workflow%3A%22ARI4Java+Build%22) @@ -26,12 +26,12 @@ repositories { dependencies { implementation 'io.github.ari4java:ari4java:+' - implementation 'ch.qos.logback:logback-classic:1.2.10' + implementation 'ch.qos.logback:logback-classic:1.5.26' } ``` Due to the sun setting of JCenter the jar is now publish through Sonatype to Maven Central but under a new groupId. -The groupId is now `io.github.ari4java` make sure you update your build files if you used `ch.loway.oss.ari4java`. +Since 0.12.2 the groupId is now `io.github.ari4java` make sure you update your build files if you used `ch.loway.oss.ari4java`. ## Documentation - The [CHANGELOG](https://github.com/ari4java/ari4java/blob/master/CHANGELOG.md) diff --git a/build.gradle b/build.gradle index 937934e3..2d69a810 100755 --- a/build.gradle +++ b/build.gradle @@ -5,6 +5,7 @@ plugins { id "signing" id "com.github.spotbugs" version "6.4.8" id "org.sonarqube" version "2.7.1" + id "org.jreleaser" version "1.22.0" } group = "io.github.ari4java" @@ -46,7 +47,7 @@ dependencies { testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2' testImplementation 'org.mockito:mockito-core:4.2.0' - testImplementation 'ch.qos.logback:logback-classic:1.5.25' + testImplementation 'ch.qos.logback:logback-classic:1.5.26' } tasks.register('buildProps', WriteProperties) { @@ -112,6 +113,22 @@ jacocoTestCoverageVerification { } } +spotbugsMain { + excludeFilter = file("spotbugs-exclude.xml") + reports { + xml.required.set(true) + html.required.set(true) + } +} + +spotbugsTest { + ignoreFailures = true + reports { + xml.required.set(false) + html.required.set(true) + } +} + sonarqube { properties { property "sonar.projectKey", "ari4java" @@ -157,37 +174,33 @@ publishing { } repositories { maven { - name = "sonatype" - url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" - credentials { - username = System.getenv("SONATYPE_USER") - password = System.getenv("SONATYPE_PASS") - } + name = "staging-deploy" + url = layout.buildDirectory.dir("staging-deploy") } } } -signing { - def signingKeyId = System.getenv("PGP_ID") - def signingKey = System.getenv("PGP_KEY") - def signingPassword = System.getenv("PGP_PASS") - useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword) - sign publishing.publications -} - -spotbugsMain { - excludeFilter = file("spotbugs-exclude.xml") - reports { - xml.required.set(true) - html.required.set(true) +jreleaser { + signing { + active = "ALWAYS" + armored = true + // Keys via Environment Variables: + // JRELEASER_GPG_SECRET_KEY JRELEASER_GPG_PASSPHRASE JRELEASER_GPG_PUBLIC_KEY } -} - -spotbugsTest { - ignoreFailures = true - reports { - xml.required.set(false) - html.required.set(true) + deploy { + maven { + mavenCentral { + sonatype { + active = "ALWAYS" + url = "https://central.sonatype.com/api/v1/publisher" + authorization = "BASIC" + // user & pass via Environment Variables: + // JRELEASER_MAVENCENTRAL_SONATYPE_USERNAME JRELEASER_MAVENCENTRAL_SONATYPE_PASSWORD + applyMavenCentralRules = true + stagingRepository("build/staging-deploy") + } + } + } } } diff --git a/examples/build.gradle b/examples/build.gradle index 750df1e7..73ea9eec 100755 --- a/examples/build.gradle +++ b/examples/build.gradle @@ -10,9 +10,9 @@ dependencies { if (file("../.inc-examples").exists()) { implementation project(":") } else { - implementation "ch.loway.oss.ari4java:ari4java:+" + implementation "io.github.ari4java:ari4java:+" } - implementation "ch.qos.logback:logback-classic:1.5.25" + implementation "ch.qos.logback:logback-classic:1.5.26" implementation "io.netty:netty-all:4.2.9.Final" } diff --git a/examples/settings.gradle b/examples/settings.gradle index 0f6b5991..19692206 100755 --- a/examples/settings.gradle +++ b/examples/settings.gradle @@ -1,7 +1,7 @@ if (file("../.build-examples").exists()) { includeBuild("../") { dependencySubstitution { - substitute(module("ch.loway.oss.ari4java:ari4java")).using(project(":")) + substitute(module("io.github.ari4java:ari4java")).using(project(":")) } } }