idnits 2.17.1 draft-guy-iax-04.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** It looks like you're using RFC 3978 boilerplate. You should update this to the boilerplate described in the IETF Trust License Policy document (see https://trustee.ietf.org/license-info), which is required now. -- Found old boilerplate from RFC 3978, Section 5.1 on line 23. -- Found old boilerplate from RFC 3978, Section 5.2b on line 23. -- Found old boilerplate from RFC 3978, Section 5.5, updated by RFC 4748 on line 4380. -- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 4391. -- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 4398. -- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 4404. -- The document has an RFC 3978 Section 5.2(b) Derivative Works Limitation clause. If this document is intended for submission to the IESG for publication, this constitutes an error. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 1 instance of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust Copyright Line does not match the current year == Line 572 has weird spacing: '... snd ack ...' == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'SHOULD not' in this paragraph: When the following messages are received, an ACK MUST be sent in return: NEW, HANGUP, REJECT, ACCEPT, PONG, AUTHREP, REGREL, REGACK, REGREJ, TXREL. ACKs SHOULD not be expected by any peer and their purpose is purely to force the transport layer to be up to date. -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (March 30, 2008) is 5864 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- ** Obsolete normative reference: RFC 3447 (Obsoleted by RFC 8017) ** Obsolete normative reference: RFC 3454 (Obsoleted by RFC 7564) ** Obsolete normative reference: RFC 3491 (Obsoleted by RFC 5891) ** Obsolete normative reference: RFC 4646 (Obsoleted by RFC 5646) -- Obsolete informational reference (is this intentional?): RFC 3525 (Obsoleted by RFC 5125) -- Obsolete informational reference (is this intentional?): RFC 3761 (Obsoleted by RFC 6116, RFC 6117) -- Obsolete informational reference (is this intentional?): RFC 4395 (Obsoleted by RFC 7595) -- Obsolete informational reference (is this intentional?): RFC 4566 (Obsoleted by RFC 8866) Summary: 5 errors (**), 0 flaws (~~), 4 warnings (==), 13 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 M. Spencer 3 Internet-Draft Digium, Inc. 4 Intended status: Informational B. Capouch 5 Expires: October 1, 2008 Saint Joseph's College 6 E. Guy, Ed. 7 TruPhone 8 F. Miller 9 Cornfed Systems, Inc. 10 K. Shumard 11 March 30, 2008 13 IAX: Inter-Asterisk eXchange Version 2 14 draft-guy-iax-04 16 Status of this Memo 18 By submitting this Internet-Draft, each author represents that any 19 applicable patent or other IPR claims of which he or she is aware 20 have been or will be disclosed, and any of which he or she becomes 21 aware will be disclosed, in accordance with Section 6 of BCP 79. 22 This document may not be modified, and derivative works of it may not 23 be created. 25 Internet-Drafts are working documents of the Internet Engineering 26 Task Force (IETF), its areas, and its working groups. Note that 27 other groups may also distribute working documents as Internet- 28 Drafts. 30 Internet-Drafts are draft documents valid for a maximum of six months 31 and may be updated, replaced, or obsoleted by other documents at any 32 time. It is inappropriate to use Internet-Drafts as reference 33 material or to cite them other than as "work in progress." 35 The list of current Internet-Drafts can be accessed at 36 http://www.ietf.org/ietf/1id-abstracts.txt. 38 The list of Internet-Draft Shadow Directories can be accessed at 39 http://www.ietf.org/shadow.html. 41 This Internet-Draft will expire on October 1, 2008. 43 Abstract 45 This document describes IAX, the Inter-Asterisk eXchange protocol, an 46 application-layer control and media protocol for creating, modifying, 47 and terminating multimedia sessions over Internet Protocol (IP) 48 networks. IAX was developed by the open source community for the 49 Asterisk PBX and is targeted primarily at Voice over Internet 50 Protocol (VoIP) call control, but it can be used with streaming video 51 or any other type of multimedia. 53 IAX is an "all in one" protocol for handling multimedia in IP 54 networks. It combines both control and media services in the same 55 protocol. In addition, IAX uses a single UDP data stream on a static 56 port greatly simplifying Network Address Translation (NAT) gateway 57 traversal, eliminating the need for other protocols to work around 58 NAT, and simplifying network and firewall management. IAX employs a 59 compact encoding which decreases bandwidth usage and is well suited 60 for Internet telephony service. In addition, its open nature permits 61 new payload types additions needed to support additional services. 63 Table of Contents 65 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 5 66 1.1. Basic Properties . . . . . . . . . . . . . . . . . . . . 5 67 1.2. Drawbacks . . . . . . . . . . . . . . . . . . . . . . . . 6 68 2. IAX Terminology . . . . . . . . . . . . . . . . . . . . . . . 7 69 3. Overview of IAX Protocol . . . . . . . . . . . . . . . . . . 8 70 4. Naming Conventions . . . . . . . . . . . . . . . . . . . . . 10 71 5. IAX Uniform Resource Identifiers . . . . . . . . . . . . . . 11 72 5.1. IAX URI Scheme Registration . . . . . . . . . . . . . . . 11 73 5.2. URI Comparison . . . . . . . . . . . . . . . . . . . . . 13 74 6. Peer Behavior and Related Messages . . . . . . . . . . . . . 15 75 6.1. Registration (OPTIONAL) . . . . . . . . . . . . . . . . . 15 76 6.2. Call Leg Management . . . . . . . . . . . . . . . . . . . 22 77 6.3. Call Control . . . . . . . . . . . . . . . . . . . . . . 28 78 6.4. Mid-Call Link Operations . . . . . . . . . . . . . . . . 30 79 6.5. Call Path Optimization . . . . . . . . . . . . . . . . . 32 80 6.6. Call Tear Down . . . . . . . . . . . . . . . . . . . . . 37 81 6.7. Network Monitoring . . . . . . . . . . . . . . . . . . . 37 82 6.8. Digit Dialing . . . . . . . . . . . . . . . . . . . . . . 38 83 6.9. Miscellaneous . . . . . . . . . . . . . . . . . . . . . . 40 84 6.10. Media Messages . . . . . . . . . . . . . . . . . . . . . 42 85 7. Message Transport . . . . . . . . . . . . . . . . . . . . . . 44 86 7.1. Trunking . . . . . . . . . . . . . . . . . . . . . . . . 44 87 7.2. Timers . . . . . . . . . . . . . . . . . . . . . . . . . 45 88 7.3. NAT Considerations . . . . . . . . . . . . . . . . . . . 45 89 7.4. Encryption . . . . . . . . . . . . . . . . . . . . . . . 46 90 8. Message Encoding . . . . . . . . . . . . . . . . . . . . . . 47 91 8.1. Frame Structure . . . . . . . . . . . . . . . . . . . . . 47 92 8.2. Frame Types . . . . . . . . . . . . . . . . . . . . . . . 57 93 8.3. HTML Command Subclasses . . . . . . . . . . . . . . . . . 63 94 8.4. Information Elements . . . . . . . . . . . . . . . . . . 63 95 8.5. Media Formats . . . . . . . . . . . . . . . . . . . . . . 91 96 9. Example Message Flows . . . . . . . . . . . . . . . . . . . . 93 97 9.1. Ping/Pong . . . . . . . . . . . . . . . . . . . . . . . . 93 98 9.2. Lagrq/Lagrp . . . . . . . . . . . . . . . . . . . . . . . 93 99 9.3. Registration . . . . . . . . . . . . . . . . . . . . . . 94 100 9.4. Registration Release . . . . . . . . . . . . . . . . . . 94 101 9.5. Call Path Optimization . . . . . . . . . . . . . . . . . 95 102 9.6. IAX Media Call . . . . . . . . . . . . . . . . . . . . . 95 103 9.7. IAX Media Call via an IAX Device . . . . . . . . . . . . 97 104 10. Security Considerations . . . . . . . . . . . . . . . . . . . 99 105 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 101 106 12. Implementation Notes . . . . . . . . . . . . . . . . . . . . 102 107 13. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 103 108 14. References . . . . . . . . . . . . . . . . . . . . . . . . . 104 109 14.1. Normative References . . . . . . . . . . . . . . . . . . 104 110 14.2. Informative References . . . . . . . . . . . . . . . . . 105 112 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 106 113 Intellectual Property and Copyright Statements . . . . . . . . . 108 115 1. Introduction 117 Numerous protocols have been specified by the Internet community to 118 support control or signaling of multimedia sessions, for instance, 119 SIP [RFC3261], MGCP [RFC3435], and MEGACO/H.248 [RFC3525]. In 120 general, these protocols are designed to offer full support for many 121 types of media transmission. This flexible approach adds some 122 overhead to the protocol headers, but allows for the protocol use 123 well beyond the current application. Typically, these protocols 124 reference, but do not specify, the media transmission protocol used 125 to carry the actual stream. SIP commonly uses Session Description 126 Protocol (SDP) [RFC4566] to specify Real-Time Transport Protocol 127 (RTP) [RFC3550] streams. This method allows for great flexibility, 128 but again leads to more overhead. Furthermore, multimedia solutions 129 which use different, perhaps dynamic, network addresses for signaling 130 and media transmission frequently suffer from Network Address 131 Translation (NAT) traversal and security challenges. 133 IAX is the Inter-Asterisk eXchange protocol which facilitates VoIP 134 connections between servers, and between servers and clients that 135 also use the IAX protocol. IAX was created through an open source 136 methodology rather than through a traditional standards based 137 methodology. It is an open protocol originally used by Asterisk, a 138 dual licensed open source and commercial PBX server from Digium. 139 Independent IAX implementations may be open, proprietary, or licensed 140 in anyway the author seems fit without royalty to the protocol 141 creators. 143 1.1. Basic Properties 145 IAX is a robust and full featured, yet, simple protocol. It is 146 general enough that it can handle most common types of media streams. 147 However, the protocol is highly optimized for VoIP calls where low 148 overhead and low bandwidth consumption are priorities. This 149 pragmatic aspect makes IAX more efficient for VoIP than protocols 150 which consider possibilities far beyond current needs and specify 151 many more details than are strictly necessary to describe or 152 transport a point-to-point call. Furthermore, because IAX is 153 designed to be lightweight and VoIP-friendly, it consumes less 154 bandwidth than more general approaches. IAX is a binary protocol, 155 designed to reduce overhead, especially in regards to voice streams. 156 Bandwidth efficiency, in some places, is sacrificed in exchange for 157 bandwidth efficiency for individual voice calls. For example, when 158 transmitting a voice stream compressed to 8kbs with a 20ms 159 packetization, each data packet consists of 20 bytes. IAX adds 20% 160 overhead, 4 bytes, on the majority of voice packets while RTP adds 161 60% overhead with 12 additional bytes per voice packet. 163 In addition to efficiency, IAX's single static UDP port approach 164 makes IAX traffic easy for network managers to shape, prioritize, and 165 pass through firewalls. IAX's basic structure is that it multiplexes 166 signaling and multiple media streams over a single UDP stream between 167 two computers. IAX also uses the same UDP port for both its 168 signaling and media messages, and because all communications 169 regarding a call are done over a the same point-to-point path, NAT 170 traversal is much simpler for IAX than for other commonly deployed 171 protocols. 173 1.2. Drawbacks 175 While IAX is very effective, addressing many of today's 176 communications needs, it does have a few limitations. For instance, 177 IAX uses a point-to-point codec negotiation mechanism that limits 178 extensibility because every IAX node in a call path must support 179 every used codec to some degree. In addition, the codec definition 180 is controlled by an internally defined 32-bit mask, so the codecs 181 must be defined in the protocol, and the maximum number of 182 simultaneous codecs is, therefore, limited. 184 One of IAX's design strengths also presents a potential problem. The 185 use of a single, well-known, port makes the protocol an easier target 186 for denial of service attacks. Real time systems like VoIP are 187 particularly sensitive to these attacks. 189 The protocol is typically deployed with all signaling and media going 190 to a centralized server. While this combined path approach provides 191 a great deal of control, it limits the overall system scalability. 192 IAX now provides the ability to split the media from the signaling 193 stream which overcomes this limitation of earlier IAX versions. 195 Most IAX drawbacks are due to implementation issues rather than 196 protocol issues. Threading presents a series of problems. Many 197 implementations have a limited number of threads available to process 198 IAX traffic and can become overwhelmed by high use or denial of 199 service attacks. Newer implementations have additional controls to 200 minimize the impact of these challenges. 202 2. IAX Terminology 204 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 205 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 206 document are to be interpreted as described in [RFC2119]. 208 Additionally, this document uses the following terminology: 210 Peer: A host or device that implements the IAX protocol. 212 Call: A call is a relationship between two or more parties (i.e., 213 resources such as devices, user agents, or programs) that exists 214 for some time for the purpose of exchanging real-time media. In 215 the context of this document, a call is an end to end relationship 216 where at least the one leg of call path is implemented using the 217 IAX protocol. 219 Calling Party: A device or program that initiates a call. 221 Called Party: A device or program to which a call is directed. 223 Context: A context is a named partition of a Dialplan. 225 Dialplan: A Dialplan is a set of rules for associating provided 226 names and numbers with a particular called party. 228 Frame: The atomic communication unit between two IAX peers. All IAX 229 messages are carried within frames. 231 Information Element (IE): A discrete data unit appended to an IAX 232 frame which specifies user or call-specific data. 234 Registrant: A registrant is a peer that makes REGISTER requests in 235 order to advertise the address of a resource, i.e., a device or 236 program to which a call may be directed. 238 Registrar: A registrar is a peer that processes REGISTER requests 239 and places the information it receives in those requests into the 240 location service. [RFC3261]. 242 3. Overview of IAX Protocol 244 IAX is a peer-to-peer, VoIP-oriented, protocol. IAX includes both 245 control and media functions. It can register locations, create, 246 modify, terminate multimedia sessions, and carry the actual media 247 streams specified by the sessions it manages. The protocol is 248 designed and optimized for describing and transporting multimedia 249 calls using Internet Protocol. This document describes version 2 of 250 IAX; Version 1, although somewhat similar in design, utilized a 251 different port and was not widely deployed. 253 The basic design approach for IAX multiplexes signaling and multiple 254 media streams over a single UDP association between two hosts. This 255 is accomplished by using the same "well-known" UDP port, 4569, for 256 all types of IAX traffic. IAX's unified signaling and media paths 257 achieve NAT transparency, which is an advantage of IAX over 258 alternative media transport protocols such as SIP [RFC3261]. 260 IAX is coded as a binary protocol. One major benefit of using a 261 binary protocol is bandwidth efficiency because the quality of voice 262 calls is frequently related to the amount of bandwidth consumed. 263 This is one way the protocol is specifically optimized to make 264 efficient use of bandwidth for individual voice calls. The bandwidth 265 efficiency for other stream types is sacrificed for the sake of 266 individual voice calls. Other benefits of a binary protocol are 267 robustness against buffer overrun attacks, and compact implementation 268 capability, which reduces interoperability issues related to parsing. 270 The atomic communication unit in IAX is the "Frame". There are 271 multiple classes of Frames, each of which is described below. In 272 general, "Full Frames" carry signaling/control data, while "Mini 273 Frames" carry media stream data. Full Frames enclose optional 274 'Information Elements' (IEs). IEs describe various types of user- or 275 call-specific data. "Meta Frames" are used for call trunking or 276 video stream transmission. 278 An IAX-based call may consist of many call legs, or segments. Each 279 call leg may be implemented using different protocols, e.g., SIP to 280 IAX to ISDN (Integrated Services Digital Network). IAX is 281 responsible for setting up one or more legs of a complete call path, 282 not necessarily the end-to-end call. 284 IAX is an optimized peer-to-peer protocol. If two adjacent call legs 285 utilize the IAX protocol and if the intermediate peer determines that 286 it does not need to remain in the call path, it can supervise a 287 calling path change such that it removes itself from the path. This 288 supervision is complete, a call path is not changed until all peers 289 in the optimized call path confirm they can properly communicate. 291 IAX supports security features by allowing multiple methods of user 292 authentication and authorization, as well as during peer 293 registration. IAX also specifies a generic framework for native 294 encryption. 296 4. Naming Conventions 298 Call Identifier: A call leg is marked with two unique integers, one 299 assigned by each peer involved in creating the call leg. 301 Number: The Calling and Called Numbers are a set of digits and 302 letters identifying a call originator and the desired terminating 303 resource. The term 'Number' is historic and has been expanded to 304 include letters. A peer is responsible for defining its own 305 dialplan. A peer MAY define its dialplan according to ITU-T 306 Recommendation E.164. [E164] However, this is not required. 308 Username: A username is a string used for identification purposes. 310 5. IAX Uniform Resource Identifiers 312 5.1. IAX URI Scheme Registration 314 This section registers IAX according to the guidelines in [RFC4395]. 316 URI scheme name: 318 iax. 320 Status: 322 Permanent. 324 URI scheme syntax: 326 The "iax:" scheme follows the guidelines in [RFC3986]. 328 The general form is as follows: 330 iax:[username@]host[:port][/number[?context]] 332 where these tokens have the following meanings: 334 iax: The literal 'iax:'. 336 username: A string used for identification purposes. 338 host: The domain of the resource. The host part contains 339 either a fully-qualified domain name or numeric IPv4 or IPv6 340 address. An IPv6 address must be enclosed within brackets 341 (i.e., '[2001:db8::1]') as defined in [RFC3986]. Using the 342 fully-qualified domain name form is RECOMMENDED whenever 343 possible. 345 port: The numeric UDP port number. 347 number: The name or number identifying the resource on that 348 host. 350 context: The name of the host partition in which the service 351 is identified or processed. 353 Examples 354 iax:example.com/alice 355 iax:example.com:4569/alice 356 iax:example.com:4570/alice?friends 357 iax:192.0.2.4:4569/alice?friends 358 iax:[2001:db8::1]:4569/alice?friends 359 iax:example.com/12022561414 360 iax:johnQ@example.com/12022561414 362 ABNF Certain values are included by reference from [RFC3986]: 364 iax-uri = "iax:" [userinfo "@" ]host[":" port][ "/" number[ "?" 365 context]] 367 userinfo = 369 host = 371 port = 373 number = *(unreserved | sub-delims | pct-encoded ) 375 context = *(unreserved | sub-delims | pct-encoded ) 377 unreserved = 379 sub-delims = 381 pct-encoded = 383 URI Scheme Semantics: 385 An IAX URI identifies a communications resource capable of 386 communicating using the IAX Version 2 protocol defined in this 387 document. Within this document, we refer to IAX Version 2 388 protocol URI as IAX. An IAX URI contains enough information to 389 initiate an IAX-based call with that resource. 391 IAX URIs are associated with server resources to which calls may 392 be routed. For instance, an IAX URI may represent an appearance 393 on a phone, a voice-mail box on a messaging service, an 394 interactive program, a PSTN address or gateway, or any group of 395 the above. 397 The iax uri scheme translates into a location that may be used by 398 the iax protocol to establish a new call using the uri scheme 399 components described in the previous section. This new call 400 function is the only defined operation. 402 Encoding considerations: 404 IAX URI scheme encoding conforms to the encoding rules established 405 for URIs in [RFC3986]. 407 Applications/protocols that use this URI scheme name: 409 The scheme is used by ENUM Dynamic Delegation Discovery System 410 (DDDS) services to specify resources that support the IAX 411 protocol. The IAX protocol provides application-layer control and 412 media protocol for creating, modifying, and terminating multimedia 413 sessions over Internet Protocol (IP) networks. 415 Interoperability considerations: 417 None. 419 Security considerations: 421 The IAX URI Scheme does not introduce any new security concerns 422 except that it provides a uniform syntax for describing IAX 423 resources and that, when published, these addresses are subject to 424 various denial of service attacks. 426 Contact: 428 Ed Guy, edguy@emcsw.com, +1.973.437.4519. 430 Author/Change controller 432 Not Applicable. 434 References: 436 Spencer, M., Shumard, K., Capouch, B., and E. Guy, 'IAX: Inter- 437 Asterisk eXchange Version 2,' (This Document), March 2008. 439 5.2. URI Comparison 441 Some operations in this specification require determining whether two 442 IAX URIs are equivalent. IAX URIs are compared for equality 443 according to the following rules: 445 All components of the URI MUST be identical except: 447 The port, if omitted, is considered to be the same as the default, 448 4569. 450 All URI components, except the username field, are case 451 insensitive, and MUST be normalized to lower case as per Section 452 6.2.2.1 of [RFC3986] before comparison. 454 The URIs within each of the following sets are equivalent: 456 iax:atlanta.com/alice 457 iax:AtLaNtA.com/ALicE 458 iax:atlanta.com:4569/alice 460 iax:alice@atlanta.com/alice 461 iax:alice@AtLaNtA.com:4569/ALicE 463 The URIs within the following set are not equivalent: 465 iax:ALICE@atlanta.com/alice 466 iax:alice@atlanta.com/alice 468 NOTE: A host in domain form and in IP address form are NOT considered 469 identical even if the host name resolves to an address record that 470 matches the given IP address. 472 6. Peer Behavior and Related Messages 474 Messages are divided into two categories: reliable and non- 475 guaranteed. The reliable messages are referred to as "Full Frames." 476 In addition to a message type indicator and facilities to ensure 477 reliability, see Section 7, they include the full call identifier. 478 It consists of each of peer's identifiers for the call. Additional 479 attributes, "Information Elements" or "IEs", may be associated with 480 the Full Frame messages. 482 The non-guaranteed messages are referred to as "Mini-Frames" and 483 "Meta Frames" and these more compact messages only have the 484 originating peer's call identifier and MUST NOT have any "Information 485 Elements." 487 Peer behavior is presented in several partitions divided by the 488 following functional areas: 490 Registration (OPTIONAL) 492 Call Link Management 494 Call Path Optimization (OPTIONAL) 496 Mid-Call Behavior 498 Call Tear Down 500 Network Monitoring 502 Digit Dialing (OPTIONAL) 504 Miscellaneous 506 Media Messages 508 Each of these behavior topics and the messages involved are described 509 in the sections which follow. 511 6.1. Registration (OPTIONAL) 513 6.1.1. Overview 515 In order for one IAX peer to be reachable by another IAX peer, the 516 calling peer needs the network address of the receiving peer. This 517 address may be manually provisioned, determined through a shared 518 directory, e.g. an ENUM-like service, [RFC3761] or configured using 519 the IAX protocol. IAX provides a facility for one peer to register 520 its address and credentials with another so that callers can reach 521 the registrant. The IAX registration facility is optional. If 522 implemented, the IAX registration protocol MAY be done in parts, 523 e.g., an analog telephone adapter MAY only implement the registrant 524 portion of the protocol. 526 IAX allows user authentication via multiple methods. MD5 Message- 527 Digest authentication [RFC1321] uses a md5 sum arrangement, but still 528 requires that both ends have plaintext access to the secret. Rivest, 529 Shamir and Adleman's (RSA) algorithm [RFC3447] allows unidirectional 530 secret knowledge through public/private key pairs. IAX Private keys 531 SHOULD always be Triple Data Encryption Standard (3DES) encrypted 532 [RFC1851]. 534 ________________ 535 | | 536 | Unregistered |<--------------------------\ 537 |________________| | 538 | | 539 /Init | | 540 ------------ | | 541 snd REGAUTH | +--------+ | 542 | | | rec REGAUTH | 543 _______V____V___ | ----------- | 544 | | | snd REGREQ | 545 | Reg Sent +----+ | 546 |________________+----------+ | 547 | ^ | rec REGAUTH | 548 rec REGACK | | | /No Credentials| 549 ------------ | | REG timeout | -------------- | 550 snd ack | | ------- | snd ack | 551 | | REGREQ __V___ | 552 _______V____|___ | | | 553 | | | No | | 554 | Registered | | Auth | | 555 |________________| |______| | 556 | ^ | 557 | | rec REGAUTH | 558 | release | /No Credentials| 559 | ------- | -------------- | 560 +-------+ | snd REGREL | snd ack | 561 rec REGAUTH | | | | | 562 ----------- | _V_____V________ | | 563 snd REGREL | | |----------+ | 564 +-----+ Releasing |---------------------------+ 565 |________________| rec ACK 566 ------- 567 x 569 __________ 570 rec REGREJ | | 571 ---------- *->| Rejected | 572 snd ack |__________| 574 Figure 1: Registrant State Diagram 576 Registration, illustrated in Figure 1, is performed by a registrant 577 that sends a username and a registration 'refresh' period to the 578 registrar. This is accomplished with a REGREQ message. If 579 authentication is required, the registrar responds with the REGAUTH 580 message which indicates the types of authentication supported by the 581 registrar. In response, the registrant resends a REGREQ with one of 582 the supported authentications. If the registrant can not 583 authenticate, no further action is necessary. If accepted, the 584 registrar sends a REGACK message which MUST indicate the 'apparent 585 address' and SHOULD indicate the 'refresh'/expire time. If no 586 'refresh' is sent a default registration expiration of 60 seconds 587 MUST be assumed by both peers. At any time during this exchange, the 588 registrar may send a REGREJ message to indicate a failure. 590 A registration has a specified time period associated with it for 591 which it is valid. This time period begins when the registrar sends 592 a REGACK message. A registrant may extend that time period be 593 repeating the registration process. A registrant MAY also force an 594 expiration in the registrar by sending the REGREL message. This 595 message may be challenged with REGAUTH or if sufficient credentials 596 were included, it will be accepted with REGACK. In response to a 597 REGAUTH, a REGREL message SHOULD be resent using the specified 598 credentials. 600 See Section 9.3 and Section 9.4 for example call flows. 602 6.1.2. REGREQ Registration Request Message 604 The REGREQ occurs independently of any media-carrying call. A REGREQ 605 MUST include the 'username' IE and SHOULD include the 'refresh' IE. 606 A REGREQ is used both for an initial registration request as well as 607 for a reply to a REGAUTH. As a reply to a REGAUTH message, it MUST 608 include credentials such as a response to a REGAUTH's challenge. 610 Upon receipt of a REGREQ message which has credentials, a registrar 611 MUST determine their validity. If valid, it MUST respond with a 612 REGACK message indicating the time period for which this registration 613 is valid. If the provided credentials are not valid or the registrar 614 cannot validate the credentials, the registrar MUST respond with a 615 REGREJ message. If credentials are not provided, the registrar MUST 616 respond with a REGAUTH message that indicates the available 617 authentication methods. 619 Registrants MUST implement this message and registrars MUST be able 620 to process it. 622 The following table specifies IEs for this message: 624 +------------+----------------+-------------+-------------+ 625 | IE | Section | Status | Comments | 626 +------------+----------------+-------------+-------------+ 627 | Username | Section 8.4.6 | Required | | 628 | | | | | 629 | MD5 Result | Section 8.4.15 | Conditional | per REGAUTH | 630 | | | | | 631 | RSA Result | Section 8.4.16 | Conditional | per REGAUTH | 632 | | | | | 633 | Refresh | Section 8.4.18 | Optional | | 634 +------------+----------------+-------------+-------------+ 636 6.1.3. REGAUTH Registration Authentication Response Message 638 A REGAUTH is a response to a REGREQ or REGREL. It is sent when a 639 registrar requires authentication to permit registration. A REGAUTH 640 message MUST include the 'authentication methods' and 'username' IEs, 641 and the 'MD5 challenge' or 'RSA challenge' IE if the authentication 642 methods include MD5 or RSA. 644 Upon receipt of a REGAUTH message, the registrant MUST resend the 645 REGREQ or REGREL message with one of the requested credentials, if it 646 has the specified credentials. 648 Registrars MUST implement this message and registrants MUST be able 649 to process it. 651 The following table specifies IEs for this message: 653 +--------------+----------------+-------------+---------------+ 654 | IE | Section | Status | Comments | 655 +--------------+----------------+-------------+---------------+ 656 | Username | Section 8.4.6 | Required | | 657 | | | | | 658 | Auth Methods | Section 8.4.13 | Required | | 659 | | | | | 660 | Challenge | Section 8.4.14 | Conditional | If RSA or MD5 | 661 +--------------+----------------+-------------+---------------+ 663 6.1.4. REGACK Registration Acknowledgment Message 665 A REGACK is sent in response to a REGREQ. A REGACK typically 666 includes the 'refresh' IE specifying the number of seconds before the 667 registration will expire. If the 'refresh' IE is not included with a 668 REGACK, a default registration expiration of 60 seconds MUST be 669 assumed. A REGACK MAY also include the 'username' and 'apparent 670 address' IEs to indicate how the peer identifies the registrant. IEs 671 related to caller identification or the time the registration 672 occurred MAY be sent as well. 674 Receipt of a REGACK message requires an ACK in response. 676 Registrars MUST be able to send this message and registrants MUST be 677 able to process it. 679 The following table specifies IEs for this message: 681 +------------------+----------------+----------+----------+ 682 | IE | Section | Status | Comments | 683 +------------------+----------------+----------+----------+ 684 | Username | Section 8.4.6 | Required | | 685 | | | | | 686 | Date Time | Section 8.4.28 | Required | | 687 | | | | | 688 | Apparent Address | Section 8.4.17 | Required | | 689 | | | | | 690 | Message Count | Section 8.4.23 | Optional | | 691 | | | | | 692 | Calling Number | Section 8.4.2 | Optional | | 693 | | | | | 694 | Calling Name | Section 8.4.4 | Optional | | 695 | | | | | 696 | Refresh | Section 8.4.18 | Optional | | 697 +------------------+----------------+----------+----------+ 699 6.1.5. REGREJ Registration Rejection Message 701 A REGREJ indicates that a registration request has been rejected. 702 This rejection can occur for several reasons. A REGREJ MUST include 703 the 'causecode' and 'cause' IEs to specify why registration was 704 rejected. 706 Upon receipt of a REGREJ message, the registrant MUST consider 707 registration process unsuccessful and no further interaction is 708 required. A peer MAY reinitiate the process at later time accounting 709 for potential configuration changes on the registrar or registrant. 711 Both registrants and registrars MUST be capable of sending and 712 processing this message. 714 The following table specifies IEs for this message: 716 +------------+----------------+----------+----------+ 717 | IE | Section | Status | Comments | 718 +------------+----------------+----------+----------+ 719 | Cause | Section 8.4.21 | Required | | 720 | | | | | 721 | Cause Code | Section 8.4.33 | Required | | 722 +------------+----------------+----------+----------+ 724 6.1.6. REGREL Registration Release Request Message 726 A REGREL is used by a registrant for a forced release of a prior 727 registration. It MUST include the 'username' IE to identify the 728 registrant to be released, and MAY include the 'causecode' and 729 'cause' IEs to specify why registration is being released. 731 Upon receipt of this message, a peer MUST authenticate the sender 732 using the provided credentials or send a REGAUTH message requesting 733 them. If authenticated it MUST immediately purge its registration of 734 the specified registrant or send a REGREJ message if the registration 735 is not found. 737 Registrants SHOULD be capable of sending this message and registrars 738 MUST be able to process it. 740 The following table specifies IEs for this message: 742 +----------+----------------+-------------+-------------------------+ 743 | IE | Section | Status | Comments | 744 +----------+----------------+-------------+-------------------------+ 745 | Username | Section 8.4.6 | Required | | 746 | | | | | 747 | MD5 | Section 8.4.15 | Conditional | MD5 or RSA Result is | 748 | Result | | | required | 749 | | | | | 750 | RSA | Section 8.4.16 | Conditional | | 751 | Result | | | | 752 | | | | | 753 | Cause | Section 8.4.21 | Optional | | 754 | | | | | 755 | Cause | Section 8.4.33 | Optional | | 756 | Code | | | | 757 +----------+----------------+-------------+-------------------------+ 759 6.2. Call Leg Management 761 +--------+ HANGUP/ack 762 | | 763 _____________|__ | 764 | | | 765 +--------->| Initial |<----+ 766 | |________________|<---------------------+ 767 | | ^ 768 | start call | | 769 | ---------- | | 770 | send NEW | +-------+ | 771 | | | | rec AUTHREQ | 772 | _____V__V__ | ----------- | 773 | | | | snd AUTHREP | 774 +------------| Waiting |----+ | 775 rec REJECT |___________|------------------------>+ 776 ---------- | | 777 ack | rec HANGUP | 778 | --------- | 779 | snd ack | 780 | | 781 rec ACCEPT | | 782 ---------- | +------+ | 783 snd ack | | | PROCEEDING / ack | 784 _________V___V | RINGING / ack | 785 | | | | 786 | Linked |-----+ | 787 |______________|------------------------>+ 788 | rec HANGUP | 789 rec ANSWER | ---------- | 790 ------------ | snd ack | 791 snd ack | | 792 | | 793 | rec HANGUP | 794 _______V________ --------- | 795 | | snd ack | 796 | UP |--------------------->+ 797 |________________|--------------------->+ 798 finish 799 ------ 800 snd HANGUP 802 Figure 2: Call Origination State Diagram 803 +--------+ rec HANGUP/ack 804 | | 805 _____________V__ | rec NEW(no Auth)/snd AUTHREQ 806 | | | 807 | Initial |-----+ rec NEW(not Auth)/snd REJECT 808 | | 809 |________________|<--------------------+ 810 | | 811 rec NEW | | 812 (valid credentials)| | 813 ---------- | +------+ | 814 snd ACCEPT | | | snd PROCEEDING | 815 _________V___V | snd RINGING | 816 | | | | 817 | Linked |-----+ | 818 | | 819 |______________|------------------------>+ 820 | rec HANGUP | 821 /answered | ---------- | 822 ----------- | snd ack | 823 snd ANSWER | | 824 | rec HANGUP | 825 _______V________ --------- | 826 | | snd ack | 827 | UP |--------------------->+ 828 |________________|--------------------->+ 829 finish 830 ------ 831 snd HANGUP 833 Figure 3: Call Termination State Diagram 835 6.2.1. Overview 837 The IAX protocol can be used to setup 'links' or 'call legs' between 838 two peers for the purposes of placing a call. The process, 839 illustrated in Figure 2 and Figure 3, starts when a peer sends a NEW 840 message indicating the destination 'number' (or name) of a Called 841 Party on the remote peer. The remote peer can respond with either a 842 credentials challenge (AUTHREQ), a REJECT message, or an ACCEPT 843 message. The AUTHREQ message indicates the permitted authentication 844 schemes and SHOULD result in the sending of an AUTHREP message with 845 the requested credentials. The REJECT message indicates the call 846 cannot be established at this time. And ACCEPT indicates that the 847 call leg between these two peers is established and that Higher level 848 call signaling (Section 6.3) MAY proceed. After sending or receiving 849 the ACCEPT message, the Call Leg is in the 'Linked' state and is used 850 to pass call control message until the call is completed. Further 851 detail on messages used for this process can be found in Section 6.3. 853 Call Legs are labeled with a pair of identifiers. Each end of the 854 call leg assigns the source or destination identifier during the call 855 leg creation process. 857 6.2.2. NEW Request Message 859 A NEW message is sent to initiate a call. It is the first call- 860 specific message sent to initiate an actual media exchange between 861 two peers. 'NEW' messages are unique compared to other Call 862 Supervision messages in that they do not require a destination call 863 identifier in their header. This absence is because the remote 864 peer's source call identifier is not created until after receipt of 865 this frame. Before sending a NEW message, the local IAX peer MUST 866 assign a source call identifier that is not currently being used for 867 another call. A time-stamp MUST also be assigned for the call, 868 beginning at zero and incrementing by one each millisecond. Sequence 869 numbers for a NEW message, described in the transport section, 870 (Section 7) are both set to 0. 872 A NEW message MUST include the 'version' IE, and it MUST be the first 873 IE; the order of other IEs is unspecified. A NEW SHOULD generally 874 include IEs to indicate routing on the remote peer, e.g., via the 875 'called number' IE or to indicate a peer partition or ruleset, the 876 'called context' IE. Caller identification and CODEC negotiation IEs 877 MAY also be included. 879 Upon receipt of a NEW message, the receiving peer examines the 880 destination and MUST perform one of the following actions: 882 Send a REJECT response, 884 Challenge the caller with an AUTHREQ response, 886 Accept the call using an ACCEPT message, or 888 Abort the connection using a HANGUP message, although the REJECT 889 message is preferred at this point in call. 891 If the call is accepted, the peer MUST progress the call and further 892 respond with one of PROCEEDING, RINGING, BUSY or ANSWER depending on 893 the status of the called party on the peer. See Section 6.3 for 894 further detail. 896 The following table specifies IEs for the NEW message: 898 +--------------+----------------+-------------+---------------------+ 899 | IE | Section | Status | Comments | 900 +--------------+----------------+-------------+---------------------+ 901 | Version | Section 8.4.10 | Required | | 902 | | | | | 903 | Called | Section 8.4.1 | Required | | 904 | Number | | | | 905 | | | | | 906 | Auto Answer | Section 8.4.24 | Optional | | 907 | | | | | 908 | Codecs Prefs | Section 8.4.35 | Required | | 909 | | | | | 910 | Calling | Section 8.4.29 | Required | | 911 | Presentation | | | | 912 | | | | | 913 | Calling | Section 8.4.2 | Optional | | 914 | Number | | | | 915 | | | | | 916 | Calling TON | Section 8.4.30 | Required | | 917 | | | | | 918 | Calling TNS | Section 8.4.31 | Required | | 919 | | | | | 920 | Calling Name | Section 8.4.4 | Optional | | 921 | | | | | 922 | ANI | Section 8.4.3 | Optional | | 923 | | | | | 924 | Language | Section 8.4.9 | Optional | | 925 | | | | | 926 | DNID | Section 8.4.12 | Optional | | 927 | | | | | 928 | Called | Section 8.4.5 | Conditional | 'Default' assumed | 929 | Context | | | if IE excluded | 930 | | | | | 931 | Username | Section 8.4.6 | Optional | | 932 | | | | | 933 | RSA Result | Section 8.4.16 | Conditional | If challenged with | 934 | | | | RSA. | 935 | | | | | 936 | MD5 Result | Section 8.4.15 | Conditional | If challenged with | 937 | | | | MD5 | 938 | | | | | 939 | Format | Section 8.4.8 | Required | | 940 | | | | | 941 | Capability | Section 8.4.7 | Conditional | | 942 | | | | | 943 | ADSICPE | Section 8.4.11 | Optional | | 944 | Date Time | Section 8.4.28 | Optional | Suggested | 945 | | | | | 946 | Encryption | Section 8.4.34 | Optional | | 947 +--------------+----------------+-------------+---------------------+ 949 6.2.3. ACCEPT Response Message 951 An ACCEPT response is issued when a NEW message is received, and 952 authentication has taken place (if required). It acknowledges 953 receipt of a NEW message and indicates that the call leg has been 954 setup on the terminating side, including assigning a CODEC. An 955 ACCEPT message MUST include the 'format' IE to indicate its desired 956 CODEC to the originating peer. The CODEC format MUST be one of the 957 formats sent in the associated NEW command. 959 Upon receipt of an ACCEPT, an ACK MUST be sent and the CODEC for the 960 call MAY be configured using the 'format' IE from the received 961 ACCEPT. The call then waits for an ANSWER, HANGUP or other call 962 control signal. (See Section 6.3.) If a subsequent ACCEPT message 963 is received for a call which has already started, or has not sent a 964 NEW message, the message MUST be ignored. 966 The following table specifies IEs for this message: 968 +--------+---------------+----------+----------+ 969 | IE | Section | Status | Comments | 970 +--------+---------------+----------+----------+ 971 | Format | Section 8.4.8 | Required | | 972 +--------+---------------+----------+----------+ 974 6.2.4. REJECT Response Message 976 A REJECT response is sent to indicate that a NEW, AUTHREP, DIAL, or 977 ACCEPT request has been denied. It MAY be due to an authentication 978 failure, an invalid username, or if a peer cannot provide a valid 979 password or response to an issued challenge. It MAY also be used to 980 notify a peer of a call setup failure, e.g., when IAX peers cannot 981 negotiate a CODEC to use. Upon receipt of a REJECT message, the call 982 leg is destroyed and no further action is required. (Note: REJECT 983 messages require an explicit ACK.) 985 REJECT messages MAY include the 'causecode' and 'cause' IEs to 986 indicate the rejection reason. 988 The following table specifies IEs for this message: 990 +------------+----------------+----------+----------+ 991 | IE | Section | Status | Comments | 992 +------------+----------------+----------+----------+ 993 | Cause | Section 8.4.21 | Optional | | 994 | | | | | 995 | Cause Code | Section 8.4.33 | Optional | | 996 +------------+----------------+----------+----------+ 998 6.2.5. HANGUP Request Message 1000 A HANGUP message is sent by either peer and indicates a call tear- 1001 down. It MAY include the 'causecode' and 'cause' IEs to indicate the 1002 reason for terminating the call. Upon receipt of a HANGUP message, 1003 an IAX peer MUST immediately respond with an ACK, and then destroy 1004 the call leg at its end. After a HANGUP message has been received 1005 for a call leg, any messages received which reference that call leg 1006 (i.e., have the same source/destination call identifiers) MUST be 1007 answered with an INVAL message. This indicates that the received 1008 message is invalid because the call no longer exists. 1010 After sending a HANGUP message, the sender MUST destroy the call and 1011 respond to subsequent messages regarding this call with an INVAL 1012 message. 1014 The following table specifies IEs for this message: 1016 +------------+----------------+----------+----------+ 1017 | IE | Section | Status | Comments | 1018 +------------+----------------+----------+----------+ 1019 | Cause | Section 8.4.21 | Optional | | 1020 | | | | | 1021 | Cause Code | Section 8.4.33 | Optional | | 1022 +------------+----------------+----------+----------+ 1024 6.2.6. AUTHREP Authentication Reply Message 1026 An AUTHREP MUST include the appropriate challenge response or 1027 password IE, and is only sent in response to an AUTHREQ. An AUTHREP 1028 requires a response of either an ACCEPT or a REJECT. 1030 Typical reasons for rejecting an AUTHREP include 'destination does 1031 not exist' and 'suitable bearer not found'. 1033 The following table specifies IEs for this message: 1035 +------------+----------------+-------------+----------+ 1036 | IE | Section | Status | Comments | 1037 +------------+----------------+-------------+----------+ 1038 | RSA Result | Section 8.4.16 | Conditional | If RSA | 1039 | | | | | 1040 | MD5 Result | Section 8.4.15 | Conditional | If MD5 | 1041 +------------+----------------+-------------+----------+ 1043 6.2.7. AUTHREQ Authentication Request Message 1045 The AUTHREQ message is sent in response to a NEW message if 1046 authentication is required for the call to be accepted. It MUST 1047 include the 'authentication methods' and 'username' IEs, and the 1048 'challenge' IE if MD5 or RSA authentication is specified. 1050 Upon receiving an AUTHREQ message, the receiver MUST respond with an 1051 AUTHREP or HANGUP message. 1053 The following table specifies IEs for this message: 1055 +--------------+----------------+----------+----------+ 1056 | IE | Section | Status | Comments | 1057 +--------------+----------------+----------+----------+ 1058 | Username | Section 8.4.6 | Required | | 1059 | | | | | 1060 | Auth Methods | Section 8.4.13 | Required | | 1061 | | | | | 1062 | Challenge | Section 8.4.14 | Required | | 1063 +--------------+----------------+----------+----------+ 1065 6.3. Call Control 1067 6.3.1. Overview 1069 IAX's call control messages provide end-to-end signaling functions 1070 common to other telephony control protocols. The messages include 1071 RINGING, ANSWER, BUSY, and PROCEEDING. These messages MUST only be 1072 sent after an IAX call leg has been ACCEPTed. 1074 In response to an exchange starting with a NEW message, typically, 1075 the first call control message is RINGING, however, a PROCEEDING 1076 message MAY precede it or the call MAY proceed directly to the ANSWER 1077 message. If the call is answered, an ANSWER message will be sent. 1078 Other possibilities include a "BUSY" indication, or if the called 1079 party's service cannot be reached, the call will be torn down using 1080 the link-level HANGUP and an appropriate cause code. 1082 If the link was started with a DIAL message, the sequence is an 1083 optional PROCEEDING, then optional RINGING, then ANSWER or BUSY. Of 1084 course, a link level HANGUP MAY occur at any time. 1086 Various private extensions to IAX Control messages have been deployed 1087 for passing application-specific data over IAX control link. One 1088 such extension is an application that controls ham radio 1089 transceivers. An IAX peer that receives a control message that is 1090 not understood MUST respond with the UNSUPPORT message. 1092 The mandatory IAX control messages are explained below. 1094 6.3.2. PROCEEDING Response Message 1096 The PROCEEDING message SHOULD be sent to a calling party when their 1097 call request is being processed by a further network element but has 1098 not yet reached the called party. 1100 Upon receipt of a PROCEEDING message, the peer SHOULD perform 1101 protocol-specific actions to indicate this fact to the calling party, 1102 e.g., tones, an ISUP Proceeding message, etc. If the prior call leg 1103 is utilizing the IAX protocol, a PROCEEDING message MUST be sent to 1104 that peer. The processing of this message at an originating or 1105 transcoding peer is not specified, however, if possible, the status 1106 may be displayed to the calling party. 1108 The PROCEEDING message does not require any IEs. 1110 6.3.3. RINGING Response Message 1112 This message is sent from a terminating party to indicate that that 1113 the called party's service has processed the call request and is 1114 being alerted to the call. A IAX RINGING message MUST be sent to an 1115 IAX-based calling party when the peer determines that the called 1116 party is being alerted, e.g., when their phone is ringing. 1118 Upon receipt of an IAX RINGING message, the peer MUST pass this 1119 indication to the calling party, unless the calling party has already 1120 received such indication. For an initiating peer, this is typically 1121 done by starting the ring-back tone, however, many implementations 1122 start ringback before ringing in order to meet user expectations. If 1123 the calling party is using the IAX protocol, a RINGING message MUST 1124 be passed to this caller. 1126 The RINGING message does not require any IEs. 1128 6.3.4. ANSWER Response Message 1130 This message is sent from the called party to indicate that the party 1131 has accepted the call request and is communicating with the calling 1132 party. Upon receipt of this message, any ring-back or other progress 1133 tones MUST be terminated and the communications channel MUST be 1134 opened. 1136 The ANSWER message does not require any IEs. 1138 6.4. Mid-Call Link Operations 1140 6.4.1. FLASH Request Message 1142 The FLASH message is sent to indicate a mid call feature. Its 1143 interpretation is system dependent and if it is not expected, it 1144 SHOULD be ignored. Typically, this message is only sent from Analog 1145 Telephone adapters when a brief circuit interruption is made during 1146 an answered call. 1148 The FLASH message does not require any IEs. 1150 6.4.2. HOLD Request Message 1152 The HOLD message is sent to cause the remote system to stop 1153 transmitting audio on this channel, and optionally replace the audio 1154 with music or other sounds. If the remote system cannot perform this 1155 request, it SHOULD be ignored. 1157 The HOLD message SHOULD only be sent in IAX calls which are started 1158 using the DIAL message. 1160 The HOLD message does not require any IEs. 1162 6.4.3. UNHOLD Request Message 1164 The UNHOLD message is sent to cause the remote system to resume 1165 transmitting audio on this channel. If the remote system cannot 1166 perform this request, it SHOULD be ignored. 1168 The UNHOLD message SHOULD only be sent in IAX calls after the HOLD 1169 message. 1171 The UNHOLD message does not require any IEs. 1173 6.4.4. QUELCH Request Message 1175 The QUELCH message is sent to cause the remote peer to squelch or 1176 stop transmitting audio on this channel. It MAY replace the audio 1177 sent to the further party with music or other sounds. If the remote 1178 system cannot perform this request, it SHOULD be ignored. 1180 The QUELCH message MUST only be sent in IAX calls after an ACCEPT is 1181 sent or received; it SHOULD only be used on calls which are started 1182 using the NEW message. 1184 The QUELCH message does not require any IEs. 1186 6.4.5. UNQUELCH Request Message 1188 The UNQUELCH message is sent to cause the remote system to resume 1189 transmitting audio on this channel. If it previously replaced the 1190 audio with music or other sounds, it MUST discontinue it immediately. 1191 If the remote system cannot perform this request, it SHOULD be 1192 ignored. 1194 The UNQUELCH message SHOULD only be sent in IAX calls after the 1195 QUELCH message. 1197 The UNQUELCH message does not require any IEs. 1199 6.4.6. TRANSFER Request Message 1201 The TRANSFER message causes the receiving peer to restart the call 1202 using another specified number. The receiving peer MUST be on the 1203 calling side of this call leg and the new call behavior is 1204 unspecified. After processing this message, a HANGUP message SHOULD 1205 be sent and the call leg torn down. 1207 When sending a TRANSFER message, the new number to which the call is 1208 being transferred MUST be included in the CALLED_NUMBER IE and a 1209 CALLED_CONTEXT IE MAY be included. The call leg MUST NOT be used for 1210 anything else and MAY be torn down. 1212 The following table specifies IEs for this message: 1214 +-----------+---------------+----------+----------------------------+ 1215 | IE | Section | Status | Comments | 1216 +-----------+---------------+----------+----------------------------+ 1217 | Called | Section 8.4.1 | Required | | 1218 | Number | | | | 1219 | | | | | 1220 | Called | Section 8.4.5 | Optional | Use this IE if context is | 1221 | Context | | | other than default. | 1222 +-----------+---------------+----------+----------------------------+ 1224 6.5. Call Path Optimization 1226 If a peer is handling a call between two other IAX peers and the peer 1227 no longer has any need to monitor the progress, content, or duration 1228 of the call, it MAY remove itself from the call by directing the 1229 other two peers to communicate directly. This call path 1230 optimization, or "supervised transfer," is done in a manner that 1231 ensures the call will not be lost in the process; the initiating peer 1232 does not give up control of the process until it has confirmed the 1233 other two peers are communicating. Note: the parties involved in the 1234 call are not aware of this operation; it is purely a network 1235 operation. 1237 ________________ 1238 rec TXREJ | | rec TXREL 1239 ---------- *--------->| None |<-----------------+ 1240 snd TXREJ |________________| ack ^ 1241 to other | | | 1242 | V | 1243 | | 1244 | * (From All) | 1245 /Init Transfer | | rec TXREQ | 1246 ------------ | | --------- | 1247 snd TXREQ | | snd TXCNT | 1248 to both | | | 1249 _v___________v__ | 1250 | | | 1251 | Begin |----------------->+ 1252 |________________| | 1253 | | | 1254 rec TXACC | | rec TXREADY | 1255 --------- | | --------- | 1256 snd TXREADY | | x | 1257 | | | 1258 _v___________v__ | 1259 | |----------------->+ 1260 ----------| Ready |---------- | 1261 | |________________| | | 1262 | | | | 1263 /Both Legs Ready| /Both Legs Ready| rec TXMEDIA| | 1264 and not media-only| and media-only | | | 1265 ------------ | ------------ | -----------| | 1266 snd TXREL | snd TXMEDIA | x | | 1267 | | | | 1268 ____V____ _____V___ ___V_____ | 1269 | | | | | | | 1270 | Release | | Media | | Media | | 1271 |_________| |_________| | Pass | | 1272 | |_________| | 1273 | | | 1274 V V | 1275 rec TXCNT +------------------------->+ 1276 ---------- (In any state) 1277 snd TXACC 1279 Figure 4: Call Path Optimization State Diagram 1281 When a peer initiates this procedure, both call legs MUST be in the 1282 UP state, i.e., they MUST have sent or received the ACCEPT message 1283 for that call leg. To start, it sends a TXREQ message with the 1284 addresses and information from the other remote peers to each its 1285 neighbors. If capable of performing this procedure, they begin 1286 transmitting all channel information to both the initiating peer and 1287 the new remote peer. They also send a TXCNT message indicating 1288 packet counts for the call leg to the new remote peer. Each TXCNT 1289 message is acknowledged with a TXACC message. The peers respond by 1290 sending a TXREADY message to the initiator indicating that they have 1291 confirmed the new communications path. When all remote peers have 1292 sent the initiator a TXREADY message, the transfer is successful and 1293 the initiator responds with a TXREL and has finished its involvement 1294 with the call. If during the transfer process, the two remote peers 1295 cannot communicate, they send a TXREJ message to the initiator. An 1296 example is shown in Section 9.5. 1298 These messages are described in the sections which follow: 1300 6.5.1. TXREQ Transfer Request Message 1302 The TXREQ message is sent by a peer to initiate the transfer process. 1303 When sent, It MUST be sent to both adjacent peers involved in the 1304 call. 1306 It MUST include the following Information Elements: 1308 +------------------+----------------+----------+----------+ 1309 | IE | Section | Status | Comments | 1310 +------------------+----------------+----------+----------+ 1311 | Apparent Address | Section 8.4.17 | Required | | 1312 | | | | | 1313 | Call Number | Section 8.4.20 | Required | | 1314 | | | | | 1315 | Transfer ID | Section 8.4.26 | Required | | 1316 +------------------+----------------+----------+----------+ 1318 The Apparent Address is the IP address data structure address for the 1319 other remote peer. The Call Number IE is The callid used by the 1320 other remote peer and the Transfer ID is a unique number assigned by 1321 the initiator. 1323 Upon receipt of a TXREQ message for a valid call from the 1324 corresponding remote peer, a peer MUST respond by attempting to 1325 communicate with the newly specified remote peer. This task is 1326 accomplished by sending a TXCNT message directly to the peer at the 1327 address specified in the Apparent Address parameter. 1329 6.5.2. TXCNT Transfer Connectivity Response Message 1331 The TXCNT message is used to verify connectivity with a potential 1332 replacement peer for a call. It MUST include the TRANSFERID IE. 1333 Upon receipt on a message of this type, and if the peer has 1334 previously received a TXREQ for this call leg, the peer MUST respond 1335 with a TXACC message. 1337 If the TXCNT Message is not successfully transmitted or if a TXACC 1338 message is not received in response to it, the transfer process MUST 1339 be aborted by sending a TXREJ message to the initiating host. 1341 It MUST include the following Information Element: 1343 +----------+----------------+----------+----------------------------+ 1344 | IE | Section | Status | Comments | 1345 +----------+----------------+----------+----------------------------+ 1346 | Transfer | Section 8.4.26 | Required | A unique number assigned | 1347 | ID | | | by the initiator. | 1348 +----------+----------------+----------+----------------------------+ 1350 6.5.3. TXACC Response Message 1352 Like the TXCNT message, the TXACC message is used to verify 1353 connectivity with a potential replacement peer. It MUST include the 1354 TRANSFERID IE. Upon receipt on a message of this type if the peer is 1355 attempting to transfer this call leg, the peer stops sending call 1356 related media to the initiating peer and sends a TXREADY message to 1357 it. 1359 It MUST include the following Information Element: 1361 +----------+----------------+----------+----------------------------+ 1362 | IE | Section | Status | Comments | 1363 +----------+----------------+----------+----------------------------+ 1364 | Transfer | Section 8.4.26 | Required | A unique number assigned | 1365 | ID | | | by the initiator. | 1366 +----------+----------------+----------+----------------------------+ 1368 6.5.4. TXREADY Transfer Ready Response Message 1370 The TXREADY message indicates that the sending peer has verified 1371 connectivity with the peer which it was instructed to transfer the 1372 call. It MUST include the TRANSFERID IE. When TXREADY messages are 1373 received from both remote peers, it MUST discontinue media transport 1374 and send a TXREL message to each peer. 1376 It MUST include the following Information Element: 1378 +----------+----------------+----------+----------------------------+ 1379 | IE | Section | Status | Comments | 1380 +----------+----------------+----------+----------------------------+ 1381 | Transfer | Section 8.4.26 | Required | A unique number assigned | 1382 | ID | | | by the initiator. | 1383 +----------+----------------+----------+----------------------------+ 1385 6.5.5. TXREL Transfer Release Response Message 1387 The TXREL message indicates that the transfer process has 1388 successfully completed. After sending and upon receipt of this 1389 message, no further interaction (other than an ACK, of course) is 1390 needed between the peers on this call-leg. The TXREL is also used to 1391 revert a split-media call (one where the media and signaling follow 1392 different paths) to a call where the media and signaling follow the 1393 same path. 1395 It MUST include the following Information Element: 1397 +-------------+----------------+----------+----------+ 1398 | IE | Section | Status | Comments | 1399 +-------------+----------------+----------+----------+ 1400 | Call Number | Section 8.4.20 | Required | | 1401 +-------------+----------------+----------+----------+ 1403 6.5.6. TXMEDIA Transfer Media Message 1405 The TXREL message indicates that the MEDIA transfer process has 1406 successfully completed. After sending and upon processing of this 1407 message, full frames MUST continue to follow the original signaling 1408 path and media frames MUST follow the newly negotiated path. This 1409 split-path process continues until the call ends with a HANGUP or 1410 peer receives a TXREL message for the call leg. A peer MAY force the 1411 paths to rejoin by sending a TXREL message. 1413 It MUST include the following Information Element: 1415 +-------------+----------------+----------+----------+ 1416 | IE | Section | Status | Comments | 1417 +-------------+----------------+----------+----------+ 1418 | Call Number | Section 8.4.20 | Required | | 1419 +-------------+----------------+----------+----------+ 1421 6.5.7. TXREJ Transfer Rejection Response Message 1423 The TXREJ MAY be sent at anytime during the transfer process to 1424 indicate that the transfer cannot proceed. Upon receiving a TXREJ 1425 message, if the receiver is the initiating peer, it MUST form a TXREJ 1426 message and send it to the other remote peer. 1428 The TXREJ message does not require any IEs. 1430 6.6. Call Tear Down 1432 The messages used to finish a call vary depending on the particular 1433 process the call is in at the time. The terminal messages for a call 1434 are: 1436 HANGUP. See Section 6.2.5. 1438 REJECT. See Section 6.2.4. 1440 TRANSFER. See Section 6.4.6. 1442 TXREADY. See Section 6.5.4. 1444 These messages are discussed in their respective sections. Also, if 1445 the reliable transport procedures determines that messaging cannot be 1446 maintained, the call leg MUST be torn down without any other 1447 indications over the errant IAX call leg. 1449 6.7. Network Monitoring 1451 The IAX protocol has various tools to determine the network load. It 1452 uses the POKE message to monitor reachability of remote peer and the 1453 LAGRQ message to measure the quality of a current call leg including 1454 the jitter buffer delay. 1456 6.7.1. POKE Request Message 1458 A POKE message is sent to test connectivity of a remote IAX peer. It 1459 is similar to a PING message, except that it MUST be sent when there 1460 is no existing call to the remote endpoint. It MAY also be used to 1461 "qualify" a user to a remote peer, so that the remote peer can 1462 maintain awareness of the state of the user. A POKE MUST have 0 as 1463 its destination call number. 1465 Upon receiving a POKE message, the peer MUST respond with a PONG 1466 message. 1468 This message does not require any IEs. 1470 6.7.2. PING Request Message 1472 A PING message is sent to test connectivity of the remote IAX 1473 endpoint on an existing call. Transmission of a PING MAY occur when 1474 a peer-defined number of seconds have passed without receiving an 1475 incoming media frame on a call, or by default every 20 seconds. 1476 Receipt of a PING requires an acknowledging PONG be sent. 1478 This message does not require any IEs. 1480 6.7.3. PONG Response Message 1482 A PONG message is a response to a PING or a POKE. It acknowledges 1483 the connection. The receiver uses the time-stamp of the received 1484 PING or POKE and its times to determine the Round Trip Time of the 1485 connection. Several receiver report IEs MAY be included with a PONG, 1486 including received jitter, received frames, delay, and dropped 1487 frames. Receipt of a PONG requires an ACK. 1489 This message does not require any IEs. 1491 6.7.4. LAGRQ Lag Request Message 1493 A LAGRQ is a lag request. It is sent to determine the lag between 1494 two IAX endpoints, including the amount of time used to process a 1495 frame through a jitter buffer (if any). It requires a clock-based 1496 time-stamp, and MUST be answered with a LAGRP, which MUST echo the 1497 LAGRQ's time-stamp. The lag between the two peers can be computed on 1498 the peer sending the LAGRQ by comparing the time-stamp of the LAGRQ 1499 and the time the LAGRP was received. 1501 This message does not require any IEs. 1503 6.7.5. LAGRP Lag Response Message 1505 A LAGRP is a lag reply, sent in response to a LAGRQ message. It MUST 1506 send the same time-stamp it received in the LAGRQ after passing the 1507 received frame through any jitter buffer the peer has configured. 1509 This message does not require any IEs. 1511 6.8. Digit Dialing 1513 Digit Dialing support is an optional portion of the IAX protocol 1514 designed to support devices that do not maintain their own dial 1515 plans, for instance, analog telephone adapters, or ATAs. The dialing 1516 portion of the IAX protocol MAY be implemented for the client/ 1517 phone-side, server side or not all. The exchanges work as a series 1518 of Dialing Plan requests (DPREQ) each followed by a response (DPREP) 1519 indicating if additional digits SHOULD be collected before sending 1520 the call. The sections that follow describe these messages and the 1521 rules associated with them. 1523 6.8.1. DPREQ Dial Plan Request Message 1525 A DPREQ is a request for the server to analyze the passed called 1526 number and determine if there is a valid dialing pattern on the 1527 remote peer. It MUST include the 'called number' IE to specify what 1528 extension is being queried. This command is used in the case where a 1529 local peer does not handle its own dialplan/extension switching. The 1530 local peer can inquire (as a user dials) how the remote peer 1531 perceives the 'called number'. If a DPREP is received indicating 1532 that the number is valid, a DIAL MAY be sent. 1534 This message MAY be sent by the client and MUST be implemented on 1535 servers which provide IAX dialing support. 1537 It MUST include the following Information Element: 1539 +-------------+----------------+----------+----------+ 1540 | IE | Section | Status | Comments | 1541 +-------------+----------------+----------+----------+ 1542 | Call Number | Section 8.4.20 | Required | | 1543 +-------------+----------------+----------+----------+ 1545 6.8.2. DPREP Dial Plan Response Message 1547 A DPREP is a reply to a DPREQ, containing the status of the dialplan 1548 entry requested in the 'called number' IE of the DPREQ. It MUST 1549 include the 'called number', 'dpstatus', and 'refresh' IEs. The 1550 called number is the same one received in the 'called number' IE of 1551 the DPREQ. The 'dpstatus' IE contains the status of the dialplan 1552 entry referenced by the received called number. The status indicates 1553 whether the called number exists, can exist, needs more digits, or is 1554 invalid. More information can be found in Section 8.4 under the 1555 DPSTATUS information element. The 'refresh' IE specifies the number 1556 of minutes the 'dpstatus' is valid. If the 'refresh' IE is not 1557 present, a default 10 minutes period is assumed. 1559 The sending of this message MUST be implemented by servers which 1560 support IAX dialing. Clients which support IAX dialing MUST be 1561 capable of receiving such messages. 1563 It MUST include the following Information Elements: 1565 +----------+----------------+----------+----------------------------+ 1566 | IE | Section | Status | Comments | 1567 +----------+----------------+----------+----------------------------+ 1568 | Call | Section 8.4.20 | Required | | 1569 | Number | | | | 1570 | | | | | 1571 | Dial | Section 8.4.20 | Required | Indicates if number | 1572 | Plan | | | exists, is a partial | 1573 | Status | | | match, etc. | 1574 | | | | | 1575 | Dial | Section 8.4.20 | Optional | Inclusion is strongly | 1576 | Plan | | | suggested. The default is | 1577 | Refresh | | | 10 minutes. | 1578 +----------+----------------+----------+----------------------------+ 1580 6.8.3. DIAL Request Message 1582 The DIAL message is used with IAX peers that do not maintain their 1583 own dialplan/extension routing. Once an extension is validated by 1584 one or more DPREQ/DPREP exchanges, the number MAY be dialed in a DIAL 1585 message, using the 'called number' IE to specify the extension it is 1586 attempting to reach. The remote peer then handles the remaining 1587 aspects of call setup, including ringing the extension and notifying 1588 the local peer when it has been answered following the same 1589 requirements as the NEW command (Section 6.2.2). 1591 The following table specifies the IEs used by this message: 1593 +-----------+---------------+----------+----------------------------+ 1594 | IE | Section | Status | Comments | 1595 +-----------+---------------+----------+----------------------------+ 1596 | Called | Section 8.4.1 | Required | | 1597 | Number | | | | 1598 | | | | | 1599 | Called | Section 8.4.5 | Optional | Use this IE if context is | 1600 | Context | | | other than default. | 1601 +-----------+---------------+----------+----------------------------+ 1603 6.9. Miscellaneous 1605 6.9.1. ACK acknowledgement Message 1607 An ACK acknowledges the receipt of an IAX message. An ACK is sent 1608 upon receipt of a full frame which does not have any other protocol- 1609 defined response. An ACK MUST have both a source call number and 1610 destination call number. It MUST also not change the sequence number 1611 counters, and MUST return the same time-stamp it received. This 1612 time-stamp allows the originating peer to determine to which message 1613 the ACK is responding. Receipt of an ACK requires no action. 1615 An ACK MAY also be sent as an initial acknowledgment of an IAX 1616 message which requires some other protocol-defined message 1617 acknowledgment, as long as the required message is also sent within 1618 some peer-defined amount of time. This allows the acknowledging peer 1619 to delay transmission of the proper IAX message, which may add 1620 security against brute-force password attacks during authentication 1621 exchanges. 1623 When the following messages are received, an ACK MUST be sent in 1624 return: NEW, HANGUP, REJECT, ACCEPT, PONG, AUTHREP, REGREL, REGACK, 1625 REGREJ, TXREL. ACKs SHOULD not be expected by any peer and their 1626 purpose is purely to force the transport layer to be up to date. 1628 The ACK message does not requires any IEs. 1630 6.9.2. INVAL Invalid Response Message 1632 An INVAL is sent as a response to a received message that is not 1633 valid. This occurs when an IAX peer sends a message on a call after 1634 the remote peer has hungup its end. Upon receipt of an INVAL, a peer 1635 MUST destroy its side of a call. 1637 The INVAL message does not requires any IEs. 1639 6.9.3. VNAK Voice Negative Acknowledgement Message 1641 A VNAK is sent when a message is received out of order, particularly 1642 when a mini frame is received before the first full voice frame on a 1643 call. It is a request for retransmission of dropped messages. A 1644 message is considered out of sequence if the received iseqno is 1645 different than the expected iseqno. On receipt of a VNAK, a peer 1646 MUST retransmit all frames with a higher sequence number than the 1647 VNAK message's iseqno. 1649 The VNAK message does not requires any IEs. 1651 6.9.4. MWI Message Waiting Indicator Request Message 1653 An MWI message is used to indicate to a remote peer that it has one 1654 or more messages waiting. It MAY include the 'msgcount' IE to 1655 specify how many messages are waiting. 1657 The following table specifies IEs used by this message 1659 +----------+----------------+----------+------------+ 1660 | IE | Section | Status | Comments | 1661 +----------+----------------+----------+------------+ 1662 | MSGCOUNT | Section 8.4.23 | Optional | Suggested. | 1663 +----------+----------------+----------+------------+ 1665 6.9.5. UNSUPPORT Unsupported Response Message 1667 An UNSUPPORT message is sent in response to a message that is not 1668 supported by an IAX peer. This occurs when an IAX command with an 1669 unrecognized or unsupported subclass is received. No action is 1670 required upon receipt of this message, though the peer SHOULD be 1671 aware that the message referred to in the optionally included 'IAX 1672 unknown' IE is not supported by the remote peer. 1674 The following table specifies IEs used by this message 1676 +---------+----------------+----------+------------+ 1677 | IE | Section | Status | Comments | 1678 +---------+----------------+----------+------------+ 1679 | UNKNOWN | Section 8.4.22 | Optional | Suggested. | 1680 +---------+----------------+----------+------------+ 1682 6.10. Media Messages 1684 The IAX protocol supports many types of media and these are 1685 transported through the same UDP port as other IAX messages. Voice 1686 and video are unique in that they utilize two different encodings 1687 each with a different support procedures. Abbreviated 'Mini frames' 1688 are normally used for audio and video, however, each time the time- 1689 stamp is a multiple of 32,768 (0x8000 hex), a standard or 'Full 1690 Frame' MUST be sent. This approach facilitates efficiency and 1691 reliability by sending compressed packets, without guaranteed 1692 delivery, most of the time while periodically forcing reliable 1693 exchanges with the peer. If communication fails, call tear-down 1694 procedures are invoked. 1696 Upon receiving any media message, except the abbreviated audio and 1697 video mini frames, an ACK message MUST be sent. The content SHOULD 1698 be passed to an associated application, device, or call leg. The 1699 data MAY be buffered before it is presented to the user. 1701 6.10.1. DTMF Media Message 1703 The message carries a single digit of DTMF (Dual Tone Multiple 1704 Frequency). Useful background information about DTMF can be found in 1706 [RFC4733] and [RFC4734], but, note that IAX does not use the RTP 1707 protocol. 1709 6.10.2. Voice Media Message 1711 The message carries voice data and indicates the CODEC used. 1713 6.10.3. Video Media Message 1715 The frame carries video data and indicates the video format of the 1716 data. 1718 6.10.4. Text Media Message 1720 The frame carries a text message in UTF-8 [RFC3629] format. 1722 6.10.5. Image Media Message 1724 This message carries a single image. The image MUST fit in one 1725 message in this version of the protocol. 1727 6.10.6. HTML Media Message 1729 The HTML message class carries HTML and related data as well as 1730 status about the display of that HTML page. The subclass parameter 1731 indicates the HTML content type. It MAY be a URL, the start, middle 1732 or end of a data block. HTML data MUST be in the format described in 1733 [html401]. 1735 If a peer receives an HTML message for a channel that does not 1736 support HTML, it MUST respond with an HTML message that has the HTML 1737 NOT SUPPORTED indication. 1739 When a devices that supports HTML completes loading the page, it 1740 SHOULD send a LOAD COMPLETE message 1742 6.10.7. Comfort Noise Media Message 1744 This message indicates that comfort noise SHOULD be played. It has a 1745 parameter that indicates the level. The noise is to be locally 1746 generated. 1748 7. Message Transport 1750 IAX is sent over UDP and uses an application level protocol to 1751 provide reliable transport where needed. 1753 With respect to transport, there are two message formats: reliable or 1754 'Full Frames' and unacknowledged 'Mini' or 'Meta' frames. All 1755 messages except certain voice and video messages are reliable. 1756 Reliable messages are transported by a scheme which maintains message 1757 counts and time stamps for both peers involved in the call. The 1758 counts are per call. Each peer maintains a timer for all reliable 1759 messages and MUST periodically retransmit those messages until they 1760 acknowledge or the retry limit is exceeded. 1762 When starting a call, the outgoing and incoming message sequence 1763 numbers MUST both be set to zero. Each reliable message that is sent 1764 increments the message count by one except the ACK, INVAL, TXCNT, 1765 TXACC, and VNAK messages which do not change the message count. The 1766 message includes the outgoing message count and the highest numbered 1767 incoming message which has been received. In addition, it contains a 1768 time-stamp which represents the number of milliseconds since the call 1769 started. Or, in the case of certain network timing messages, it 1770 contains a copy of the time-stamp sent to it. Time-stamps MAY be 1771 approximate, but, MUST be in order. 1773 When any message is received, the time-stamps MUST be checked to make 1774 sure that they are in order. If a message is received out of order, 1775 it MUST be ignored and a VNAK message sent to resynchronize the 1776 peers. And if the message is a reliable message, the incoming 1777 message counter MUST be used to acknowledge all the messages up to 1778 that sequence number which have been sent. 1780 If no acknowledgment is received after a locally configured number of 1781 retries (default 4) the call leg SHOULD be considered unusable and 1782 the call MUST be torn down without any further interaction on this 1783 call leg. 1785 7.1. Trunking 1787 IAX allows multiple media exchanges between the same two peers to be 1788 multiplexed into a single trunk call coalescing media payload into a 1789 combined packet. This decreases bandwidth usage as there are fewer 1790 total packets being transmitted. Trunking MAY occur in one or both 1791 directions of an IAX exchange. A trunk consists of a trunk header 1792 and one or more trunked IAX calls. The trunk message contains a 1793 time-stamp specifying the time of transmission of the trunk frame. 1794 The audio data from the trunked calls are encapsulated in the trunk 1795 frame following the header. Each trunked call consists of two octets 1796 specifying the call's source number, two octets specifying the length 1797 in octets of the media data, and the media data itself. IAX permits 1798 transmitting the time-stamps of each encapsulated mini frame as well, 1799 so that accurate timing information can be used for jitter buffers, 1800 etc. A flag in the meta command header specifies whether the 1801 encapsulated mini frames retain their original time-stamps. If they 1802 do not retain them, they MUST assume the time-stamp in the trunk 1803 header upon being received by the trunk peer. 1805 7.2. Timers 1807 There are various timers in the IAX protocol. There are other 1808 application level timers, such as the call timer and ring timer, 1809 which are beyond the scope of this document. This section describes 1810 the IAX timers and specifies their default values and behavior. 1812 7.2.1. Retransmission Timer 1814 The message retransmission procedures are described in Section 7. On 1815 each call, there is a timer for how long to wait for an 1816 acknowledgment of a message. This timer starts at twice the measured 1817 round trip time from the last PING/PONG command. If a retransmission 1818 is needed, it is exponentially increased until it meets a boundary 1819 value. The maximum retry time period boundary is 10 seconds. 1821 7.2.2. Registration Period Timer 1823 Registrations are valid for a specified time period. It is the 1824 client's responsibility to renew this registration before the time 1825 period expires. The registrations SHOULD be renewed at random 1826 intervals to prevent network congestion. A registrar MUST monitor 1827 this time period and invalidate the registration if the client/ 1828 registrant has not renewed their registration before the timer 1829 elapses. 1831 7.3. NAT Considerations 1833 IAX is very well suited to operating behind NAT due to its single 1834 port approach. This approach eliminates any start of call media 1835 stream delays while the NAT gateway establishes a bidirectional port 1836 association. Deploying a single IAX server behind a NAT gateway 1837 requires little effort. If the server acts as a registrar, the IAX 1838 UDP port on the NAT gateway must be forwarded to the server. If the 1839 server acts as a registrant, the default, 60 second, REGREQ refresh 1840 timer should be sufficient to maintain a port association in the NAT 1841 gateway, however, a static port mapping is preferred. 1843 If multiple servers are to be deployed behind a single NAT gateway, 1844 most NAT gateways require each IAX server to use different UDP ports. 1845 Of course, there may be NAT implementations which recognize when 1846 multiple devices utilize the same private port and and manage it 1847 appropriately. 1849 7.4. Encryption 1851 IAX supports call encryption using the symmetric key, Rijndael [AES] 1852 block cipher (also called AES---Advanced Encryption Standard). 1853 Rijndael is a 128-bit block cipher utilizing a shared secret. IAX 1854 encrypts on a call-by-call basis starting with a plain-text NEW 1855 message indicating, in addition to the other message parameters, that 1856 the call should be encrypted. This indication is given by sending 1857 the ENCRYPTION IE (Section 8.4.34) in the NEW request message. If 1858 the called host supports encryption, it will respond with a plain- 1859 text AUTHREQ message which also includes the ENCRYPTION IE. All 1860 subsequent messages in the call MUST be encrypted. If the called 1861 host does not support encryption, the AUTHREQ sent in response to the 1862 NEW must not include the ENCRYPTION IE and the calling host MUST 1863 either HANGUP the request or continue with the unencrypted call. 1865 The key to use in encrypting the messages is computed by taking the 1866 CHALLENGE IE Section 8.4.14 from the AUTHREQ and concatenating any 1867 one of the shared passwords then computing the 128-bit MD5 digest of 1868 this combination. To decrypt, if there is more than one password for 1869 the peer, each must be tried until the message is successfully 1870 decoded. The key remains constant for the duration of the call. 1871 Only the data portion of the messages are encoded. 1873 8. Message Encoding 1875 8.1. Frame Structure 1877 This section contains the specification for each type of frame that 1878 IAX defines. 1880 8.1.1. Full Frames 1882 Full frames can send signaling or media data. Generally full frames 1883 are used to control initiation, setup, and termination of an IAX 1884 call, but they can also be used to carry stream data (though this is 1885 generally not optimal). 1887 Full frames are sent reliably, so all full frames require an 1888 immediate acknowledgment upon receipt. This acknowledgment can be 1889 explicit via an 'ACK' message (see Section 8.2.12) or implicit based 1890 upon receipt of an appropriate response to the full frame issued. 1892 The standard full frame header length is 12 octets. 1894 Field descriptions: 1896 'F' bit 1898 This bit specifies whether the frame is a full frame or not. If 1899 the 'F' bit is set to 1 the frame is a full frame. If it is set 1900 to 0 it is not a full frame. 1902 Source call number 1904 This 15-bit value specifies the call number the transmitting 1905 client uses to identify this call. The source call number for an 1906 active call MUST NOT be in use by another call on the same client. 1907 Call numbers MAY be reused once a call is no longer active, i.e. 1908 when either there is positive acknowledgment that the call has 1909 been destroyed or when all possible timeouts for the call have 1910 expired. 1912 'R' bit 1914 This bit specifies whether the frame is being retransmitted or 1915 not. If the 'R' bit is set to 0 the frame is being transmitted 1916 for the first time. If it is set to 1 the frame is being 1917 retransmitted. IAX does not specify a retransmit timeout; this is 1918 left to the implementor. 1920 Destination call number 1921 This 15-bit value specifies the call number the transmitting 1922 client uses to reference the call at the remote peer. This number 1923 is the same as the remote peer's source call number. The 1924 destination call number uniquely identifies a call on the remote 1925 peer. The source call number uniquely identifies the call on the 1926 local peer. 1928 Time-stamp 1930 The time-stamp field contains a 32-bit time-stamp maintained by an 1931 IAX peer for a given call. The time-stamp is an incrementally 1932 increasing representation of the number of milliseconds since the 1933 first transmission of the call. 1935 OSeqno 1937 The 8-bit OSeqno field is the outbound stream sequence number. 1938 Upon initialization of a call, its value is 0. It increases 1939 incrementally as full frames are sent. When the counter 1940 overflows, it silently resets to 0. 1942 ISeqno 1944 The 8-bit ISeqno field is the inbound stream sequence number. 1945 Upon initialization of a call its value is 0. It increases 1946 incrementally as full frames are received. At any time the ISeqno 1947 of a call represents the next expected inbound stream sequence 1948 number. When the counter overflows, it silently resets to 0. 1950 Frametype 1952 The Frametype field identifies the type of message carried by the 1953 frame. See Section 8.2 for more information. 1955 'C' bit 1957 This bit determines how the remaining 7 bits of the Subclass field 1958 are coded. If the 'C' bit is set to 1, the Subclass value is 1959 interpreted as a power of 2. If it is not set, the Subclass value 1960 is interpreted as a simple seven-bit unsigned integer. 1962 1 2 3 1963 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1964 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1965 |F| Source Call Number |R| Destination Call Number | 1966 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1967 | time-stamp | 1968 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1969 | OSeqno | ISeqno | Frame Type |C| Subclass | 1970 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1971 | | 1972 : Data : 1973 | | 1974 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1976 Figure 5: Full Frame Binary Format 1978 8.1.2. Mini frames 1980 Mini Frames are so named because their header is a minimal 4 octets. 1981 Mini frames carry no control or signaling data; their sole purpose is 1982 to carry a media stream on an already-established IAX call. They are 1983 sent unreliably. This decision was made because VoIP calls typically 1984 can miss several frames without significant degradation in call 1985 quality while the incurred overhead in ensuring reliability increases 1986 bandwidth requirements and decreases throughput. Further, because 1987 voice calls are typically sent in real time, lost frames are too old 1988 to be reintegrated into the audio stream by the time they can be 1989 retransmitted. 1991 Field descriptions: 1993 'F' bit 1995 Mini frames MUST have the 'F' bit set to 0 to specify that they 1996 are not full frames. 1998 Source call number 2000 The source call number is the number that is used by the 2001 transmitting peer to identify the current call. 2003 time-stamp 2005 Mini frames carry a 16-bit time-stamp, which is the lower 16 bits 2006 of the transmitting peer's full 32-bit time-stamp for the call. 2007 The time-stamp allows synchronization of incoming frames so that 2008 they MAY be processed in chronological order instead of the 2009 (possibly different) order in which they are received. The 16-bit 2010 time-stamp wraps after 65.536 seconds, at which point a full frame 2011 SHOULD be sent to notify the remote peer that its time-stamp has 2012 been reset. A call MUST continue to send mini frames starting 2013 with time-stamp 0 even if acknowledgment of the resynchronization 2014 is not received. 2016 The F bit, source call number, and 16-bit time-stamp comprise the 2017 entire four octet header for a full frame. Following this header is 2018 the actual stream data, of arbitrary length, up to the maximum 2019 supported by the network. 2021 Mini frames are implicitly defined to be of type 'voice frame' 2022 (frametype 2; see Section 8.2). The subclass is implicitly defined 2023 by the most recent full voice frame of a call (i.e. the subclass for 2024 a voice frame specifies the CODEC used with the stream). The first 2025 voice frame of a call SHOULD be sent using the CODEC agreed upon in 2026 the initial CODEC negotiation. On-the-fly CODEC negotiation is 2027 permitted by sending a full voice frame specifying the new CODEC to 2028 use in the subclass field. 2030 1 2 3 2031 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2032 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2033 |F| Source call number | time-stamp | 2034 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2035 | | 2036 : Data : 2037 | | 2038 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2040 Figure 6: Mini Frame Binary Format 2042 8.1.3. Meta frames 2044 Meta frames serve one of two purposes. Meta video frames allow the 2045 transmission of video streams with an optimized header. They are 2046 similar in purpose to mini voice frames. Meta trunk frames are used 2047 for trunking multiple IAX media streams between two peers into one 2048 header, to further minimize bandwidth consumption. 2050 8.1.3.1. Meta Video Frames 2052 Field descriptions: 2054 'F' bit 2055 Meta video frames MUST have the 'F' bit set to 0 to indicate that 2056 they are not full frames. 2058 Meta Indicator 2060 The meta indicator is a 15-bit field of all zeroes, used to 2061 indicate that the frame is a meta frame. Meta frames are 2062 identifiable because the first 16 bits will always be zero in any 2063 meta frame, whereas full or mini frames will have either the 'F' 2064 bit set or some (nonzero) value for the source call number (or 2065 both). 2067 'V' bit 2069 The 'V' bit in a meta video frame is set to 1 to specify that the 2070 frame is a meta video frame. 2072 Source call number 2074 The call number that is used by the transmitting peer to identify 2075 this video call. 2077 time-stamp 2079 Meta video frames carry a 16-bit time-stamp, which is the lower 16 2080 bits of the transmitting peer's full 32-bit time-stamp for the 2081 call. When this time-stamp wraps, a full frame SHOULD be sent to 2082 notify the remote peer that the time-stamp has been reset to 0. 2084 Following the time-stamp is the actual video stream data. Meta video 2085 frames are implicitly defined to be of type 'video frame' (frametype 2086 3; see Section 8.2). The video CODEC used is implicitly defined by 2087 the subclass of the most recent full video frame of a call. 2089 1 2 3 2090 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2091 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2092 |F| Meta Indicator |V| Source Call Number | 2093 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2094 |?| time-stamp | | 2095 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 2096 | Data | 2097 : : 2098 | | 2099 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2100 Figure 7: Meta Video Frame Binary Format 2102 8.1.3.2. Meta Trunk Frames 2104 IAX natively supports two methods of trunking multiple media streams 2105 between two peers into a single association. The first method sends 2106 a standard meta header, along with a single 32-bit time-stamp 2107 describing the transmission time of the trunk frame. Following the 2108 time-stamp are one or more media frames consisting of the call number 2109 and the length in octets of the stream data included in the frame. 2111 The second method of trunking is very similar to the first. It sends 2112 a standard meta header, including the 32-bit time-stamp describing 2113 the time of transmission of the trunk frame. But the media frames 2114 included in the trunk are actually complete mini frames, including 2115 the 16-bit time-stamp for each call. The first method uses slightly 2116 less bandwidth (2 fewer octets per call in the trunk), while the 2117 second method maintains the individual time-stamps for each call so 2118 that jitter buffering can use the actual time-stamps associated with 2119 a call instead of the (less accurate) time-stamp representing the 2120 entire trunk. Either method is permissible for trunking. 2122 Field descriptions: 2124 'F' bit 2126 Meta trunk frames MUST have the 'F' bit set to 0 to indicate that 2127 they are not full frames. 2129 Meta Indicator 2131 The meta indicator is a 15-bit field of all zeroes, used to 2132 indicate that the frame is a meta frame. Meta frames are 2133 identifiable because the first 16 bits will always be zero in any 2134 meta frame, whereas full or mini frames will have either the 'F' 2135 bit set or some (nonzero) value for the source call number (or 2136 both). 2138 'V' bit 2140 The 'V' bit in a meta trunk frame is set to 0 to specify that the 2141 frame is not a meta video frame. 2143 Meta Command 2145 This seven bit field identifies whether the meta frame is a trunk 2146 or not. A value of '1' indicates that the frame is a meta trunk 2147 frame. All other values are reserved for future use. 2149 Command Data 2151 This 8-bit field specifies flags for options which apply to a 2152 trunked call. The least significant bit of the field is the 2153 'trunk time-stamps' flag. A value of 0 indicates that the calls 2154 in the trunk do not include their individual time-stamps. A value 2155 of 1 indicates that the calls do each include their own time- 2156 stamp. All other bits are reserved for future use. 2158 Time-stamp 2160 Meta trunk frames carry a 32-bit time-stamp, which represents the 2161 actual time of transmission of the trunk frame. This is distinct 2162 from the time-stamps of the calls included in the trunk. 2164 Following the 32-bit time-stamp is one or more trunked calls. If the 2165 'trunk time-stamps' flag is set to 0, each entry consists of 2 octets 2166 specifying the source call number of the call, 2 octets specifying 2167 the length in octets of the media data, and then the media data. If 2168 the 'trunk time-stamps' flag is set to 1, each entry consists of 2 2169 octets specifying the length in octets of the media data, and then a 2170 mini frame (2 octets specifying source call number, 2 octets 2171 specifying 16-bit time-stamp, and the media data). The following two 2172 diagrams help illustrate pictorially this structure. 2174 1 2 3 2175 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2176 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2177 |F| Meta Indicator |V|Meta Command | Cmd Data (0) | 2178 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2179 | time-stamp | 2180 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2181 |R| Source Call Number | Data Length (in octets) | 2182 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2183 | | 2184 : Data : 2185 | | 2186 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2187 . 2188 . 2189 . 2190 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2191 |R| Source Call Number | Data Length (in octets) | 2192 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2193 | | 2194 : Data : 2195 | | 2196 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2198 Figure 8: Meta Trunk Frame Binary Format (trunk time-stamps 0) 2199 1 2 3 2200 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2201 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2202 |F| Meta Indicator |V|Meta Command | Cmd Data (1) | 2203 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2204 | time-stamp | 2205 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2206 | Data Length (in octets) |R| Source Call Number | 2207 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2208 | time-stamp | | 2209 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 2210 | Data | 2211 : : 2212 | | 2213 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2214 . 2215 . 2216 . 2217 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2218 | Data Length (in octets) |R| Source Call Number | 2219 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2220 | time-stamp | | 2221 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 2222 | Data | 2223 : : 2224 | | 2225 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2227 Figure 9: Meta Trunk Frame Binary Format (trunk time-stamps 1) 2229 8.1.4. Encrypted Frames 2231 All of the above frames may be encrypted. The header call numbers 2232 are passed through in the clear, first 4 bytes for a full frame or 2 2233 bytes for a mini frame. The remainder of the frame is padded with 2234 between 16 and 32 bytes of random data, then encrypted with AES each 2235 block being xor'd with the previous block. The padding is added at 2236 the front of the data. 2238 Figure 10 shows a padded full frame before encryption. and Figure 11 2239 shows the frame after encryption. Other frame types follows the same 2240 procedure, except the clear text portion is shorter, as described 2241 above. 2243 1 2 3 2244 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2245 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2246 |F| Source Call Number |R| Destination Call Number | 2247 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2248 | 12 Random bytes | 2249 | | 2250 | | 2251 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2252 | 28 Random bits |padding| 2253 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2254 | | 2255 : between 0 and 15 (as indicated by the padding field above) : 2256 : Random bytes : 2257 | | 2258 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2259 | | 2260 : Remainder of Actual Frame : 2261 | | 2262 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2264 Figure 10: Full Frame before encryption 2266 Since AES requires a 16 byte block size, some padding is essential. 2267 This padding has been placed at the beginning of the payload because 2268 it makes it more difficult to take advantage of the predictability of 2269 the IAX frame header. For example, the first encrypted Frame an IAX 2270 client sends within an incoming IAX call is entirely predictable: It 2271 is always an ACK - where even the time-stamp is guessable as it is 2272 the time the AUTHREP packet was sent. 2274 1 2 3 2275 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2276 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2277 |F| Source Call Number |R| Destination Call Number | 2278 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2279 | Encrypted data | 2280 | Multiple of 16 bytes | 2281 | | 2282 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2284 Figure 11: Frame after encryption 2286 The same encryption rules apply to the miniframes, except that the 2287 initial unencrypted portion is only 2 bytes. 2289 8.2. Frame Types 2291 The IAX protocol specifies 10 types of possible frames for the 2292 "frametype" field of a full frame. They are: 2294 8.2.1. DTMF Frame 2296 The frame carries a single digit of DTMF (Dual Tone Multiple 2297 Frequency). More information about DTMF can be found in RFC 2298 4733[RFC4733] and [RFC4734]. 2300 For DTMF frames, the subclass is the actual DTMF digit carried by the 2301 frame. 2303 8.2.2. Voice Frame 2305 The frame carries voice data. 2307 The subclass specifies the audio format of the data. Predefined 2308 voice formats can be found in Section 8.5 below. 2310 8.2.3. Video Frame 2312 The frame carries video data. 2314 The subclass specifies the video format of the data. Predefined 2315 video formats can be found in Section 8.5 below. 2317 8.2.4. Control Frame 2319 The frame carries session control data, i.e. it refers to control of 2320 a device connected to an IAX endpoint. 2322 The subclass is a value from Section 8.2.11 describing the device 2323 control signal. 2325 8.2.5. Null Frame 2327 Frames with the Null value MUST NOT be transmitted. 2329 8.2.6. IAX Frame 2331 The frame carries control data that provides IAX protocol specific 2332 endpoint management. This frametype is used to manage IAX protocol 2333 interactions that are generally independent of the type of endpoints. 2335 The subclass is a value from Section 8.2.12 describing an IAX event. 2337 8.2.7. Text Frame 2339 The frame carries a non-control text message in UTF-8 [RFC3629] 2340 format. 2342 All text frames have a subclass of 0. 2344 8.2.8. Image Frame 2346 The frame carries a single image. 2348 The subclass describes the format of the image from Section 8.5 2349 below. 2351 8.2.9. HTML Frame 2353 The frame carries HTML data. 2355 The subclass is a value from the HTML Subclasses table in 2356 Section 8.3. 2358 8.2.10. Comfort Noise Frame 2360 The frame carries comfort noise. 2362 The subclass is the level of comfort noise in -dBov. 2364 The following table specifies all valid Frame Type Values: 2366 +------+-------------+--------------------------+-------------------+ 2367 | TYPE | Description | Subclass Description | Data Description | 2368 +------+-------------+--------------------------+-------------------+ 2369 | 0x01 | DTMF | 0-9, A-D, *, # | Undefined | 2370 | | | | | 2371 | 0x02 | Voice | Audio Compression Format | Data | 2372 | | | | | 2373 | 0x03 | Video | Video Compression Format | Data | 2374 | | | | | 2375 | 0x04 | Control | See Control Frame Types | Varies with | 2376 | | | | subclass | 2377 | | | | | 2378 | 0x05 | Null | Undefined | Undefined | 2379 | | | | | 2380 | 0x06 | IAX Control | See IAX Protocol | Information | 2381 | | | Messages | Elements | 2382 | | | | | 2383 | 0x07 | Text | Always 0 | Raw Text | 2384 | | | | | 2385 | 0x08 | Image | Image Compression Format | Raw image | 2386 | | | | | 2387 | 0x09 | HTML | See HTML Frame Types | Message Specific | 2388 | | | | | 2389 | 0x0A | Comfort | Level in -dBov of | None | 2390 | | Noise | comfort noise | | 2391 +------+-------------+--------------------------+-------------------+ 2393 8.2.11. Control Frames 2395 The following table specifies all valid Control Frame Subclasses: 2397 +-------------+---------------+-------------------------------------+ 2398 | VALUE | Name | Description | 2399 +-------------+---------------+-------------------------------------+ 2400 | 0x01 | Hangup | The call has been hungup at the | 2401 | | | remote end. | 2402 | | | | 2403 | 0x02 | Reserved | Reserved for future use | 2404 | | | | 2405 | 0x03 | Ringing | Remote end is ringing (ringback) | 2406 | | | | 2407 | 0x04 | Answer | Remote end has answered | 2408 | | | | 2409 | 0x05 | Busy | Remote end is busy | 2410 | | | | 2411 | 0x06 | Reserved | Reserved for future use | 2412 | | | | 2413 | 0x07 | Reserved | Reserved for future use | 2414 | | | | 2415 | 0x08 | Congestion | The call is congested. | 2416 | | | | 2417 | 0x09 | Flash Hook | Flash hook | 2418 | | | | 2419 | 0x0a | Reserved | Reserved for future use | 2420 | | | | 2421 | 0x0b | Option | Device-specific options are being | 2422 | | | transmitted | 2423 | | | | 2424 | 0x0c | Key Radio | Key Radio | 2425 | | | | 2426 | 0x0d | Unkey Radio | Unkey Radio | 2427 | | | | 2428 | 0x0e | Call Progress | Call is in progress | 2429 | | | | 2430 | 0x0f | Call | Call is proceeding | 2431 | | Proceeding | | 2432 | | | | 2433 | 0x10 | Hold | Call is placed on hold | 2434 | | | | 2435 | 0x11 | Unhold | Call is taken off hold | 2436 +-------------+---------------+-------------------------------------+ 2438 8.2.12. IAX Frames 2440 Frames of type 'IAX' are used to provide management of IAX endpoints. 2441 They handle IAX signaling (e.g. call setup, maintenance, and tear- 2442 down). They MAY also handle direct transmission of media data, but 2443 this is not optimal for VoIP calls. They do not carry session- 2444 specific control (e.g., device state), as this is the purpose of 2445 Control Frames. The IAX commands are listed and described below. 2447 The following table specifies all valid IAX Frame Values: 2449 +------+-----------+-----------------------------------------+ 2450 | Hex | Name | Description | 2451 +------+-----------+-----------------------------------------+ 2452 | 0x01 | NEW | Initiate a new call | 2453 | | | | 2454 | 0x02 | PING | Ping request | 2455 | | | | 2456 | 0x03 | PONG | Ping or poke reply | 2457 | | | | 2458 | 0x04 | ACK | Explicit acknowledgment | 2459 | | | | 2460 | 0x05 | HANGUP | Initiate call tear-down | 2461 | | | | 2462 | 0x06 | REJECT | Reject a call | 2463 | | | | 2464 | 0x07 | ACCEPT | Accept a call | 2465 | | | | 2466 | 0x08 | AUTHREQ | Authentication request | 2467 | | | | 2468 | 0x09 | AUTHREP | Authentication reply | 2469 | | | | 2470 | 0x0a | INVAL | Invalid message | 2471 | | | | 2472 | 0x0b | LAGRQ | Lag request | 2473 | | | | 2474 | 0x0c | LAGRP | Lag reply | 2475 | | | | 2476 | 0x0d | REGREQ | Registration request | 2477 | | | | 2478 | 0x0e | REGAUTH | Registration authentication | 2479 | | | | 2480 | 0x0f | REGACK | Registration acknowledgement | 2481 | | | | 2482 | 0x10 | REGREJ | Registration reject | 2483 | | | | 2484 | 0x11 | REGREL | Registration release | 2485 | | | | 2486 | 0x12 | VNAK | Video/Voice retransmit request | 2487 | | | | 2488 | 0x13 | DPREQ | Dialplan request | 2489 | | | | 2490 | 0x14 | DPREP | Dialplan reply | 2491 | | | | 2492 | 0x15 | DIAL | Dial | 2493 | | | | 2494 | 0x16 | TXREQ | Transfer request | 2495 | | | | 2496 | 0x17 | TXCNT | Transfer connect | 2497 | | | | 2498 | 0x18 | TXACC | Transfer accept | 2499 | | | | 2500 | 0x19 | TXREADY | Transfer ready | 2501 | | | | 2502 | 0x1a | TXREL | Transfer release | 2503 | | | | 2504 | 0x1b | TXREJ | Transfer reject | 2505 | | | | 2506 | 0x1c | QUELCH | Halt audio/video [media] transmission | 2507 | | | | 2508 | 0x1d | UNQUELCH | Resume audio/video [media] transmission | 2509 | | | | 2510 | 0x1e | POKE | Poke request | 2511 | | | | 2512 | 0x1f | Reserved | Reserved for future use | 2513 | | | | 2514 | 0x20 | MWI | Message waiting indication | 2515 | | | | 2516 | 0x21 | UNSUPPORT | Unsupported message | 2517 | | | | 2518 | 0x22 | TRANSFER | Remote transfer request | 2519 | | | | 2520 | 0x23 | Reserved | Reserved for future use | 2521 | | | | 2522 | 0x24 | Reserved | Reserved for future use | 2523 | | | | 2524 | 0x25 | Reserved | Reserved for future use | 2525 +------+-----------+-----------------------------------------+ 2527 8.3. HTML Command Subclasses 2529 IAX HTML Command Subclasses: 2531 +--------+----------------------------+ 2532 | NUMBER | DESCRIPTION | 2533 +--------+----------------------------+ 2534 | 1 | Sending a URL | 2535 | | | 2536 | 2 | Data frame | 2537 | | | 2538 | 4 | Beginning frame | 2539 | | | 2540 | 8 | End frame | 2541 | | | 2542 | 16 | Load is complete | 2543 | | | 2544 | 17 | Peer does not support HTML | 2545 | | | 2546 | 18 | Link URL | 2547 | | | 2548 | 19 | Unlink URL | 2549 | | | 2550 | 20 | Reject Link URL | 2551 +--------+----------------------------+ 2553 8.4. Information Elements 2555 IAX messages sent as full frames MAY carry information elements to 2556 specify user- or call-specific data. Information elements are 2557 appended to a frame header in its data field. Zero, one, or multiple 2558 information elements MAY be included with any IAX message. 2560 Information elements are coded as follows: 2562 The first octet of any information element consists of the "IE" 2563 field. The IE field is an identification number which defines the 2564 particular information element. Table 1 lists the defined 2565 information elements and each information element is defined below 2566 the table. 2568 The second octet of any information element is the "data length" 2569 field. It specifies the length in octets of the information 2570 element's data field. 2572 The remaining octet(s) of an information element contain the 2573 actual data being transmitted. The representation of the data is 2574 dependent on the particular information element as identified by 2575 its "IE" field. Some information elements carry binary data, some 2576 carry UTF-8 [RFC3629] data, and some have no data field at all. 2577 Elements which carry UTF-8 MUST prepare strings as per [RFC3454] 2578 and [RFC3491], so that illegal characters, case folding and other 2579 characters properties are handled and compared properly. The data 2580 representation for each information element is described below. 2582 The following table specifies the Information Element Binary Format: 2584 1 2585 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 2586 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2587 | IE | Data Length | 2588 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2589 | | 2590 : DATA : 2591 | | 2592 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2594 The following is a table of the information elements IAX defines, and 2595 a brief description of each information element's purpose. More 2596 information about each IE may be found below the table. 2598 +------+----------------+-------------------------------------------+ 2599 | HEX | NAME | DESCRIPTION | 2600 +------+----------------+-------------------------------------------+ 2601 | HEX | NAME | DESCRIPTION | 2602 | | | | 2603 | 0x01 | CALLED NUMBER | Number/extension being called | 2604 | | | | 2605 | 0x02 | CALLING NUMBER | Calling number | 2606 | | | | 2607 | 0x03 | CALLING ANI | Calling number ANI for billing | 2608 | | | | 2609 | 0x04 | CALLING NAME | Name of caller | 2610 | | | | 2611 | 0x05 | CALLED CONTEXT | Context for number | 2612 | | | | 2613 | 0x06 | USERNAME | Username (peer or user) for | 2614 | | | authentication | 2615 | | | | 2616 | 0x07 | PASSWORD | Password for authentication | 2617 | | | | 2618 | 0x08 | CAPABILITY | Actual CODEC capability | 2619 | | | | 2620 | 0x09 | FORMAT | Desired CODEC format | 2621 | | | | 2622 | 0x0a | LANGUAGE | Desired language | 2623 | | | | 2624 | 0x0b | VERSION | Protocol version | 2625 | | | | 2626 | 0x0c | ADSICPE | CPE ADSI capability | 2627 | | | | 2628 | 0x0d | DNID | Originally dialed DNID | 2629 | | | | 2630 | 0x0e | AUTHMETHODS | Authentication method(s) | 2631 | | | | 2632 | 0x0f | CHALLENGE | Challenge data for MD5/RSA | 2633 | | | | 2634 | 0x10 | MD5 RESULT | MD5 challenge result | 2635 | | | | 2636 | 0x11 | RSA RESULT | RSA challenge result | 2637 | | | | 2638 | 0x12 | APPARENT ADDR | Apparent address of peer | 2639 | | | | 2640 | 0x13 | REFRESH | When to refresh registration | 2641 | | | | 2642 | 0x14 | DPSTATUS | Dialplan status | 2643 | | | | 2644 | 0x15 | CALLNO | Call number of peer | 2645 | | | | 2646 | 0x16 | CAUSE | Cause | 2647 | | | | 2648 | 0x17 | IAX UNKNOWN | Unknown IAX command | 2649 | | | | 2650 | 0x18 | MSGCOUNT | How many messages waiting | 2651 | | | | 2652 | 0x19 | AUTOANSWER | Request auto-answering | 2653 | | | | 2654 | 0x1a | MUSICONHOLD | Request musiconhold with QUELCH | 2655 | | | | 2656 | 0x1b | TRANSFERID | Transfer Request Identifier | 2657 | | | | 2658 | 0x1c | RDNIS | Referring DNIS | 2659 | | | | 2660 | 0x1d | Reserved | Reserved for future use | 2661 | | | | 2662 | 0x1e | Reserved | Reserved for future use | 2663 | | | | 2664 | 0x1f | DATETIME | Date/Time | 2665 | | | | 2666 | 0x20 | Reserved | Reserved for future use | 2667 | | | | 2668 | 0x21 | Reserved | Reserved for future use | 2669 | | | | 2670 | 0x22 | Reserved | Reserved for future use | 2671 | | | | 2672 | 0x23 | Reserved | Reserved for future use | 2673 | | | | 2674 | 0x24 | Reserved | Reserved for future use | 2675 | | | | 2676 | 0x25 | Reserved | Reserved for future use | 2677 | | | | 2678 | 0x26 | CALLINGPRES | Calling presentation | 2679 | | | | 2680 | 0x27 | CALLINGTON | Calling type of number | 2681 | | | | 2682 | 0x28 | CALLINGTNS | Calling transit network select | 2683 | | | | 2684 | 0x29 | SAMPLINGRATE | Supported sampling rates | 2685 | | | | 2686 | 0x2a | CAUSECODE | Hangup cause | 2687 | | | | 2688 | 0x2b | ENCRYPTION | Encryption format | 2689 | | | | 2690 | 0x2c | ENCKEY | Reserved for future Use | 2691 | | | | 2692 | 0x2d | CODEC PREFS | CODEC Negotiation | 2693 | | | | 2694 | 0x2e | RR JITTER | Received jitter, as in rfc3550 | 2695 | | | | 2696 | 0x2f | RR LOSS | Received loss, as in rfc3550 | 2697 | | | | 2698 | 0x30 | RR PKTS | Received frames | 2699 | | | | 2700 | 0x31 | RR DELAY | Max playout delay for received frames in | 2701 | | | ms | 2702 | | | | 2703 | 0x32 | RR DROPPED | Dropped frames (presumably by jitter | 2704 | | | buffer) | 2705 | | | | 2706 | 0x33 | RR OOO | Frames received Out of Order | 2707 +------+----------------+-------------------------------------------+ 2709 Table 1: Information Element Definitions 2711 8.4.1. CALLED NUMBER 2713 The purpose of the CALLED NUMBER information element is to indicate 2714 the number or extension being called. It carries UTF-8-encoded data. 2715 The CALLED NUMBER information element MUST use UTF-8 encoding and not 2716 numeric data because destinations are not limited to E.164 numbers 2717 ([E164]), national numbers, or even digits. It is possible for a 2718 number or extension to include non-numeric characters. The CALLED 2719 NUMBER IE MAY contain a SIP URI, [RFC3261] or a URI in any other 2720 format. The ability to serve a CALLED NUMBER is server dependent. 2722 The CALLED NUMBER information element is generally sent with IAX NEW, 2723 DPREQ, DPREP, DIAL, and TRANSFER messages. 2725 1 2726 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 2727 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2728 | 0x01 | Data Length | 2729 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2730 | | 2731 : UTF-8-encoded CALLED NUMBER : 2732 | | 2733 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2735 8.4.2. CALLING NUMBER 2737 The purpose of the CALLING NUMBER information element is to indicate 2738 the number or extension of the calling entity to the remote peer. It 2739 carries UTF-8-encoded data. 2741 The CALLING NUMBER information element is usually sent with IAX NEW 2742 messages. 2744 1 2745 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 2746 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2747 | 0x02 | Data Length | 2748 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2749 | | 2750 : UTF-8-encoded CALLING NUMBER : 2751 | | 2752 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2754 8.4.3. CALLING ANI 2756 The purpose of the CALLING ANI information element is to indicate the 2757 calling number ANI (Automatic number identification) for billing. It 2758 carries UTF-8-encoded data. 2760 The CALLING ANI information element MAY be sent with an IAX NEW 2761 message, but it is not required. 2763 1 2764 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 2765 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2766 | 0x03 | Data Length | 2767 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2768 | | 2769 : UTF-8-encoded CALLING ANI : 2770 | | 2771 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2773 8.4.4. CALLING NAME 2775 The purpose of the CALLING NAME information element is to indicate 2776 the calling name of the transmitting peer. It carries UTF-8-encoded 2777 data. 2779 The CALLING NAME information element is usually sent with IAX NEW 2780 messages. 2782 1 2783 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 2784 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2785 | 0x04 | Data Length | 2786 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2787 | | 2788 : UTF-8-encoded CALLING NAME : 2789 | | 2790 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2792 8.4.5. CALLED CONTEXT 2794 The purpose of the CALLED CONTEXT information element is to indicate 2795 the context (or partition) of the remote peer's dialplan that the 2796 CALLED NUMBER is interpreted. It carries UTF-8-encoded data. 2798 The CALLED CONTEXT information element MAY be sent with IAX NEW or 2799 TRANSFER messages, though it is not required. 2801 1 2802 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 2803 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2804 | 0x05 | Data Length | 2805 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2806 | | 2807 : UTF-8-encoded CALLED CONTEXT : 2808 | | 2809 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2811 8.4.6. USERNAME 2813 The purpose of the USERNAME information element is to specify the 2814 identity of the user participating in an IAX message exchange. It 2815 carries UTF-8-encoded data. 2817 The USERNAME information element MAY be sent with IAX NEW, AUTHREQ, 2818 REGREQ, REGAUTH, or REGACK messages, or any time a peer needs to 2819 identify a user. 2821 1 2822 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 2823 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2824 | 0x06 | Data Length | 2825 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2826 | | 2827 : UTF-8-encoded USERNAME : 2828 | | 2829 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2831 8.4.7. CAPABILITY 2833 The purpose of the CAPABILITY information element is to indicate the 2834 media CODEC capabilities of an IAX peer. Its data is represented in 2835 a four octet bitmask according to Section 8.5. Multiple CODECs MAY 2836 be specified by logically OR'ing them into the CAPABILITY information 2837 element. 2839 The CAPABILITY information element is sent with IAX NEW messages if 2840 appropriate for the CODEC negotiation method the peer is using. 2842 1 2843 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 2844 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2845 | 0x08 | 0x04 | 2846 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2847 | CAPABILITY according to Media | 2848 | Format Subclass Values Table | 2849 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2851 8.4.8. FORMAT 2853 The purpose of the FORMAT information element is to indicate a single 2854 preferred media CODEC. When sent with a NEW message, the indicated 2855 CODEC is the desired CODEC an IAX peer wishes to use for a call. 2856 When sent with an ACCEPT message, it indicates the actual CODEC that 2857 has been selected for the call. Its data is represented in a four 2858 octet bitmask according to Section 8.5. Only one CODEC MUST be 2859 specified in the FORMAT information element. 2861 1 2862 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 2863 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2864 | 0x09 | 0x04 | 2865 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2866 | FORMAT according to Media | 2867 | Format Subclass Values Table | 2868 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2870 8.4.9. LANGUAGE 2872 The purpose of the LANGUAGE information element is to indicate the 2873 language in which the transmitting peer would like the remote peer to 2874 send signaling information. It carries UTF-8-encoded data and tags 2875 should be selected per [RFC4646] and [RFC4647]. 2877 The LANGUAGE information element MAY be sent with an IAX NEW message. 2879 1 2880 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 2881 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2882 | 0x0a | Data Length | 2883 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2884 | | 2885 : UTF-8-encoded LANGUAGE : 2886 | | 2887 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2889 8.4.10. VERSION 2891 The purpose of the VERSION information element is to indicate the 2892 protocol version the peer is using. Peers at each end of a call MUST 2893 use the same protocol version. Currently the only supported version 2894 is 2. The data field of the VERSION information element is 2 octets 2895 long. 2897 The VERSION information element MUST be sent with an IAX NEW message. 2899 When sent, the VERSION information element MUST be the first IE in 2900 the message. 2902 1 2903 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 2904 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2905 | 0x0b | 0x02 | 2906 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2907 | 0x0002 | 2908 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2910 8.4.11. ADSICPE 2912 The purpose of the ADSICPE information element is to indicate the CPE 2913 ADSI capability. The data field of the ADSICPE information element 2914 is 2 octets long. 2916 The ADSICPE information element MAY be sent with an IAX NEW message. 2918 1 2919 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 2920 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2921 | 0x0c | 0x02 | 2922 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2923 | ADSICPE Capability | 2924 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2926 8.4.12. DNID 2928 The purpose of the DNID information element is to indicate the Dialed 2929 Number ID, which may differ from the 'called number'. It carries 2930 UTF-8-encoded data. 2932 The DNID information element MAY be sent with an IAX NEW message. 2934 1 2935 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 2936 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2937 | 0x0d | Data Length | 2938 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2939 | | 2940 : UTF-8-encoded DNID Data : 2941 | | 2942 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2944 8.4.13. AUTHMETHODS 2946 The purpose of the AUTHMETHODS information element is to indicate the 2947 authentication methods a peer accepts. It is sent as a bitmask 2 2948 octets long. The table below lists the valid authentication methods. 2950 The AUTHMETHODS information element MUST be sent with IAX AUTHREQ and 2951 REGAUTH messages. 2953 1 2954 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 2955 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2956 | 0x0e | 0x02 | 2957 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2958 | Valid Authentication Methods | 2959 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2961 The following table lists valid values for authentication: 2963 +--------+--------------------------+ 2964 | METHOD | DESCRIPTION | 2965 +--------+--------------------------+ 2966 | 0x0001 | Reserved (was Plaintext) | 2967 | | | 2968 | 0x0002 | MD5 | 2969 | | | 2970 | 0x0004 | RSA | 2971 +--------+--------------------------+ 2973 8.4.14. CHALLENGE 2975 The purpose of the CHALLENGE information element is to offer the MD5 2976 or RSA challenge to be used for authentication. It carries the 2977 actual UTF-8-encoded challenge data. 2979 The CHALLENGE information element MUST be sent with IAX AUTHREQ and 2980 REGAUTH messages. 2982 1 2983 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 2984 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2985 | 0x0f | Data Length | 2986 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2987 | | 2988 : UTF-8-encoded Challenge Data : 2989 | | 2990 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2992 8.4.15. MD5 RESULT 2994 The purpose of the MD5 RESULT information element is to offer an MD5 2995 response to an authentication CHALLENGE. It carries the actual UTF- 2996 8-encoded challenge result. 2998 The MD5 RESULT information element MAY be sent with IAX AUTHREP and 2999 REGREQ messages if an AUTHREQ or REGAUTH and appropriate CHALLENGE 3000 has been received. This information element MUST NOT be sent except 3001 in response to a CHALLENGE. 3003 1 3004 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3005 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3006 | 0x10 | Data Length | 3007 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3008 | | 3009 : UTF-8-encoded MD5 Result : 3010 | | 3011 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3013 8.4.16. RSA RESULT 3015 The purpose of the RSA RESULT information element is to offer an RSA 3016 response to an authentication CHALLENGE. It carries the actual UTF- 3017 8-encoded challenge result. 3019 The RSA RESULT information element MAY be sent with IAX AUTHREP and 3020 REGREQ messages if an AUTHREQ or REGAUTH and appropriate CHALLENGE 3021 have been received. This information element MUST NOT be sent except 3022 in response to a CHALLENGE. 3024 1 3025 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3026 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3027 | 0x11 | Data Length | 3028 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3029 | | 3030 : UTF-8-encoded RSA Result : 3031 | | 3032 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3034 8.4.17. APPARENT ADDR 3036 The purpose of the APPARENT ADDR information element is to indicate 3037 the perceived network connection information used to reach a peer, 3038 which may differ from the actual address when the peer is behind NAT. 3039 The APPARENT ADDR IE is populated using the source address values of 3040 the UDP and IP headers in the IAX message to which this response is 3041 generated. The data field of the APPARENT ADDR information element 3042 is the same as the POSIX sockaddr struct for the address family in 3043 use (i.e., sockaddr_in for IPv4, sockaddr_in6 for IPv6). The data 3044 length depends on the type of address being represented. 3046 The APPARENT ADDR information element MUST be sent with IAX TXREQ and 3047 REGACK messages. When used with a TXREQ message, the APPARENT ADDR 3048 MUST specify the address of the peer the local peer is trying to 3049 transfer its end of the connection to. When used with a REGACK 3050 message, the APPARENT ADDR MUST specify the address it uses to reach 3051 the peer (which may be different than the address the peer perceives 3052 itself as in the case of NAT or multi-homed peer machines). 3054 The data field of the APPARENT ADDR information element is the same 3055 as the linux struct sockaddr_in: two octets for the address family, 3056 two octets for the port number, four octets for the IPv4 address, and 3057 8 octets of padding consisting of all bits set to 0. Thus the total 3058 length of the APPARENT ADDR information element is 18 octets. 3060 The following diagram demonstrates the generic APPARENT ADDR format: 3062 1 3063 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3064 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3065 | 0x12 | Data Length | 3066 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3067 | sockaddr struct | 3068 : for address family in use : 3069 | | 3070 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3071 The following diagram demonstrates the APPARENT ADDR format for an 3072 IPv4 address: 3074 1 3075 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3076 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3077 | 0x12 | 0x10 | 3078 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3079 | 0x0200 | <- Address family (INET) 3080 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3081 | 0x11d9 | <- Portno (default 4569) 3082 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3083 | 32-bit IP address | 3084 | | 3085 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3086 | | 3087 | 8 octets of all 0s | 3088 | (padding in sockaddr_in) | 3089 | | 3090 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3092 The following diagram demonstrates the APPARENT ADDR format for an 3093 IPv6 address: 3095 1 3096 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3097 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3098 | 0x12 | 0x1C | 3099 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3100 | 0x0A00 | <- Address family (INET6) 3101 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3102 | 0x11d9 | <- Portno (default 4569) 3103 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3104 | 32 bits | <- Flow information 3105 | | 3106 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3107 | 128-bit IP address | <- Ip6 Address 3108 | | 3109 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3110 | 32 bits | <- Scope ID 3111 | | 3112 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3114 8.4.18. REFRESH 3116 The purpose of the REFRESH information element is to indicate the 3117 number of seconds before an event expires. Its data field is 2 3118 octets long. 3120 The REFRESH information element is used with IAX REGREQ, REGACK, and 3121 DPREP messages. When sent with a REGREQ it is a request that the 3122 peer maintaining the registration set the timeout to REFRESH seconds. 3123 When sent with a DPREP or REGACK, it is informational and tells a 3124 remote peer when the local peer will no longer consider the event 3125 valid. The REFRESH sent with a DPREP tells a peer how long it SHOULD 3126 store the received dialplan response. 3128 If the REFRESH information element is not received with a DPREP, the 3129 expiration of the cache data is assumed to be 10 minutes. If the 3130 REFRESH information element is not received with a REGACK, 3131 registration expiration is assumed to occur after 60 seconds. 3133 1 3134 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3135 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3136 | 0x13 | 0x02 | 3137 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3138 | 2 octets specifying refresh | 3139 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3141 8.4.19. DPSTATUS 3143 The purpose of the DPSTATUS information element is to indicate the 3144 status of a CALLED NUMBER in a remote dialplan. Its data field is a 3145 two octet bitmask specifying flags from the table below. Exactly one 3146 of the low 3 bits MUST be set, and zero, one, or two of the high two 3147 bits MAY be set. 3149 The DPSTATUS information element MUST be sent with IAX DPREP 3150 messages, as it is the payload of the dialplan response. 3152 1 3153 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3154 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3155 | 0x14 | 0x02 | 3156 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3157 |M|R| |N|C|E| 3158 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3159 The following table lists the dialplan status flags: 3161 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3162 | FLAG | DESCRIPTION | 3163 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3164 | 0x0001 | Exists | 3165 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3166 | 0x0002 | Can exist | 3167 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3168 | 0x0004 | Non-existent | 3169 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3170 | 0x4000 | Retain dialtone (ignorepat) | 3171 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3172 | 0x8000 | More digits may match number | 3173 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3175 8.4.20. CALLNO 3177 The purpose of the CALLNO information element is to indicate the call 3178 number a remote peer needs to use as a destination call number to 3179 identify a call being transferred. The peer managing a transfer 3180 sends the CALLNO for one transfer endpoint to the other transfer 3181 endpoint so that it knows what call number to specify for the 3182 transfer. The data field is 2 octets long and specifies a call 3183 number in the same manner as a source call number or destination call 3184 number is specified in a frame header. 3186 The CALLNO information element MUST be sent with IAX TXREQ, TXREADY, 3187 and TXREL messages. Transferring cannot succeed if the CALLNO IE is 3188 not included with the appropriate transfer messages. 3190 1 3191 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3192 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3193 | 0x15 | 0x02 | 3194 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3195 | Callno of transfer recipient | 3196 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3198 8.4.21. CAUSE 3200 The purpose of the CAUSE information element is to indicate the 3201 reason an event occurred. It carries a description of the CAUSE of 3202 the event as UTF-8-encoded data. Notification of the event itself is 3203 handled at the message level. 3205 The CAUSE information element SHOULD be sent with IAX HANGUP, REJECT, 3206 REGREJ, and TXREJ messages. 3208 1 3209 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3210 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3211 | 0x16 | Data Length | 3212 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3213 | | 3214 : UTF-8-encoded CAUSE of event : 3215 | | 3216 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3218 8.4.22. IAX UNKNOWN 3220 The purpose of the IAX UNKNOWN information element is to indicate 3221 that a received IAX command was unknown or unrecognized. The one 3222 octet data field contains the subclass of the received frame that was 3223 unrecognized. 3225 The IAX UNKNOWN information element MUST be sent with IAX UNSUPPORT 3226 messages. 3228 1 3229 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3230 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3231 | 0x17 | 0x01 | 3232 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3233 | Rec'd Subclass| 3234 +-+-+-+-+-+-+-+-+ 3236 8.4.23. MSGCOUNT 3238 The purpose of the MSGCOUNT information element is to indicate how 3239 many voicemail messages are waiting in a registered user's mailbox. 3240 The data field is 2 octets long. If it is set to all 1s, there is at 3241 least one message present. Any other value specifies the number of 3242 old messages in the high 8 bits and the number of new messages in the 3243 low 8 bits. 3245 The IAX MSGCOUNT information element MAY be sent with IAX REGACK 3246 messages. 3248 1 3249 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3250 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3251 | 0x18 | 0x02 | 3252 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3253 | Old messages | New messages | 3254 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3256 8.4.24. AUTOANSWER 3258 The purpose of the AUTOANSWER information element is to request that 3259 a call be auto-answered upon receipt of a NEW message which includes 3260 the AUTOANSWER information element. Note that this is a request and 3261 may or may not be granted by the remote peer. There is no data field 3262 with this information element, as its presence alone indicates all 3263 necessary information. 3265 The AUTOANSWER information element MAY be sent with IAX NEW messages. 3267 1 3268 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3269 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3270 | 0x19 | 0x00 | 3271 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3273 8.4.25. MUSICONHOLD 3275 The purpose of the MUSICONHOLD information element is to request that 3276 music-on-hold be played while a call is in the QUELCH state. The 3277 optional data field specifies a music-on-hold class to be used, as 3278 UTF-8-encoded data. In the absence of a data field, no music-on-hold 3279 class is specified and the IE SHOULD be treated as a generic request 3280 for music-on-hold. 3282 The MUSICONHOLD information element MAY be sent with IAX QUELCH 3283 messages. 3285 If no MUSICONHOLD information element is received, music-on-hold is 3286 not requested. 3288 1 3289 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3290 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3291 | 0x1a | Data Length | 3292 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3293 | | 3294 : Optional Music On Hold Class : 3295 | | 3296 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3298 8.4.26. TRANSFERID 3300 The purpose of the TRANSFERID information element is to identify a 3301 transfer across all three peers participating in a transfer event. 3302 It carries a number, four octets long, that SHOULD be unique for the 3303 duration of the transfer process. 3305 The TRANSFERID information element SHOULD be sent with IAX TXREQ and 3306 TXCNT messages to aid the peers involved in a transfer in identifying 3307 the proper calls. It is not required as long as the transferring 3308 peers can positively identify the calls participating in the transfer 3309 without the TRANSFERID. 3311 1 3312 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3313 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3314 | 0x1b | 0x04 | 3315 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3316 | 4 octet transfer | 3317 | identifier | 3318 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3320 8.4.27. RDNIS 3322 The purpose of the RDNIS information element is to indicate the 3323 referring DNIS. It carries UTF-8-encoded data. 3325 1 3326 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3327 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3328 | 0x1c | Data Length | 3329 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3330 | | 3331 : UTF-8-encoded RDNIS : 3332 | | 3333 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3335 8.4.28. DATETIME 3337 The DATETIME information element indicates the time a message is 3338 sent. This differs from the header time-stamp because that time- 3339 stamp begins at 0 for each call, while the DATETIME is a call- 3340 independent value representing the actual real-world time. The data 3341 field of a DATETIME information element is four octets long and 3342 stores the time as follows: The five least significant bits are 3343 seconds, the next six least significant bits are minutes, the next 3344 least significant five bits are hours, the next least significant 3345 five bits are the day of the month, the next least significant four 3346 bits are the month, and the most significant seven bits are the year. 3347 The year is offset from 2000, and the month is a 1-based index (i.e., 3348 January == 1, February == 2, etc). The timezone of the clock MUST be 3349 UTC to avoid confusion between the peers. 3351 The DATETIME information element SHOULD be sent with IAX NEW and 3352 REGACK messages. However, it is strictly informational. 3354 1 3355 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3356 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3357 | 0x1f | 0x04 | 3358 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3359 | year | month | day | 3360 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3361 | hours | minutes | seconds | 3362 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3364 8.4.29. CALLINGPRES 3366 The purpose of the CALLINGPRES information element is to indicate the 3367 calling presentation of a caller. The data field is 1 octet long and 3368 contains a value from the table below. 3370 The CALLINGPRES information element MUST be sent with IAX NEW 3371 messages. 3373 1 3374 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3375 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3376 | 0x26 | 0x01 | 3377 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3378 | Calling Pres. | 3379 +-+-+-+-+-+-+-+-+ 3380 The following table lists valid calling presentation values: 3382 +------+--------------------------------------+ 3383 | FLAG | PRESENTATION | 3384 +------+--------------------------------------+ 3385 | 0x00 | Allowed user/number not screened | 3386 | | | 3387 | 0x01 | Allowed user/number passed screen | 3388 | | | 3389 | 0x02 | Allowed user/number failed screen | 3390 | | | 3391 | 0x03 | Allowed network number | 3392 | | | 3393 | 0x20 | Prohibited user/number not screened | 3394 | | | 3395 | 0x21 | Prohibited user/number passed screen | 3396 | | | 3397 | 0x22 | Prohibited user/number failed screen | 3398 | | | 3399 | 0x23 | Prohibited network number | 3400 | | | 3401 | 0x43 | Number not available | 3402 +------+--------------------------------------+ 3404 8.4.30. CALLINGTON 3406 The purpose of the CALLINGTON information element is to indicate the 3407 calling type of number of a caller, according to ITU-T Recommendation 3408 Q.931 specifications. The data field is 1 octet long and contains 3409 data from the table below. 3411 The CALLINGTON information element MUST be sent with IAX NEW 3412 messages. 3414 1 3415 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3416 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3417 | 0x27 | 0x01 | 3418 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3419 | Calling TON | 3420 +-+-+-+-+-+-+-+-+ 3421 The following table lists valid calling type of number values from 3422 ITU-T Recommendation Q.931: 3424 +-------+-------------------------+ 3425 | VALUE | DESCRIPTION | 3426 +-------+-------------------------+ 3427 | 0x00 | Unknown | 3428 | | | 3429 | 0x10 | International Number | 3430 | | | 3431 | 0x20 | National Number | 3432 | | | 3433 | 0x30 | Network Specific Number | 3434 | | | 3435 | 0x40 | Subscriber Number | 3436 | | | 3437 | 0x60 | Abbreviated Number | 3438 | | | 3439 | 0x70 | Reserved for extension | 3440 +-------+-------------------------+ 3442 8.4.31. CALLINGTNS 3444 The CALLINGTNS information element indicates the calling transit 3445 network selected for a call. Values are chosen according to ITU-T 3446 Recommendation Q.931 specifications. The data field is two octets 3447 long. The first octet stores the network identification plan in the 3448 least significant four bits according to the first table below, and 3449 the type of network in the next three least significant bits 3450 according to the second table below. The second octet stores the 3451 actual network identification in UTF-8-encoded data. 3453 The CALLINGTNS information element MUST be sent with IAX NEW 3454 messages. 3456 1 3457 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3458 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3459 | 0x28 | 0x02 | 3460 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3461 | | TON | Plan | UTF-8 Net ID | 3462 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3464 The following tables list the valid values for the data field of the 3465 'calling tns' IE. 3467 Q.931 Network Identification Plan Values: 3469 +------+----------------------------------+ 3470 | BITS | DESCRIPTION | 3471 +------+----------------------------------+ 3472 | 0000 | Unknown | 3473 | | | 3474 | 0001 | Caller Identification Code | 3475 | | | 3476 | 0011 | Data Network Identification Code | 3477 +------+----------------------------------+ 3479 Q.931 Type of Network Values: 3481 +------+--------------------------------------+ 3482 | BITS | DESCRIPTION | 3483 +------+--------------------------------------+ 3484 | 000 | User Specified | 3485 | | | 3486 | 010 | National Network Identification | 3487 | | | 3488 | 011 | International Network Identification | 3489 +------+--------------------------------------+ 3491 8.4.32. SAMPLINGRATE 3493 The purpose of the SAMPLINGRATE information element is to specify to 3494 a remote IAX peer the sampling rate in hertz of the audio data being 3495 the peer will use when sending data. Its data field is 2 octets 3496 long. 3498 If the SAMPLINGRATE information element is not specified, a default 3499 sampling rate of 8 kHz may be assumed. 3501 1 3502 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3503 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3504 | 0x29 | 0x02 | 3505 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3506 | Sampling Rate in Hertz | 3507 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3509 8.4.33. CAUSECODE 3511 The purpose of the CAUSECODE information element is to indicate the 3512 reason a call was REJECTed or HANGUPed. It derives from ITU-T 3513 Recommendation Q.931. The data field is one octet long and contains 3514 an entry from the table below. 3516 The CAUSECODE information element SHOULD be sent with IAX HANGUP, 3517 REJECT, REGREJ, and TXREJ messages. 3519 1 3520 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3521 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3522 | 0x2a | 0x01 | 3523 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3524 | Cause Code | 3525 +-+-+-+-+-+-+-+-+ 3527 +--------+----------------------------------------------------------+ 3528 | NUMBER | CAUSE | 3529 +--------+----------------------------------------------------------+ 3530 | 1 | Unassigned/unallocated number | 3531 | | | 3532 | 2 | No route to specified transit network | 3533 | | | 3534 | 3 | No route to destination | 3535 | | | 3536 | 6 | Channel unacceptable | 3537 | | | 3538 | 7 | Call awarded and delivered | 3539 | | | 3540 | 16 | Normal call clearing | 3541 | | | 3542 | 17 | User busy | 3543 | | | 3544 | 18 | No user response | 3545 | | | 3546 | 19 | No answer | 3547 | | | 3548 | 21 | Call rejected | 3549 | | | 3550 | 22 | Number changed | 3551 | | | 3552 | 27 | Destination out of order | 3553 | | | 3554 | 28 | Invalid number format/incomplete number | 3555 | | | 3556 | 29 | Facility rejected | 3557 | | | 3558 | 30 | Response to status enquiry | 3559 | | | 3560 | 31 | Normal, unspecified | 3561 | 34 | No circuit/channel available | 3562 | | | 3563 | 38 | Network out of order | 3564 | | | 3565 | 41 | Temporary failure | 3566 | | | 3567 | 42 | Switch congestion | 3568 | | | 3569 | 43 | Access information discarded | 3570 | | | 3571 | 44 | Requested channel not available | 3572 | | | 3573 | 45 | Pre-empted (causes.h only) | 3574 | | | 3575 | 47 | Resource unavailable, unspecified (Q.931 only) | 3576 | | | 3577 | 50 | Facility not subscribed (causes.h only) | 3578 | | | 3579 | 52 | Outgoing call barred (causes.h only) | 3580 | | | 3581 | 54 | Incoming call barred (causes.h only) | 3582 | | | 3583 | 57 | Bearer capability not authorized | 3584 | | | 3585 | 58 | Bearer capability not available | 3586 | | | 3587 | 63 | Service or option not available (Q.931 only) | 3588 | | | 3589 | 65 | Bearer capability not implemented | 3590 | | | 3591 | 66 | Channel type not implemented | 3592 | | | 3593 | 69 | Facility not implemented | 3594 | | | 3595 | 70 | Only restricted digital information bearer capability is | 3596 | | available (Q.931 only) | 3597 | | | 3598 | 79 | Service or option not available (Q.931 only) | 3599 | | | 3600 | 81 | Invalid call reference | 3601 | | | 3602 | 82 | Identified channel does not exist (Q.931 only) | 3603 | | | 3604 | 83 | A suspended call exists, but this call identity does not | 3605 | | (Q.931 only) | 3606 | | | 3607 | 84 | Call identity in use (Q.931 only) | 3608 | | | 3609 | 85 | No call suspended (Q.931 only) | 3610 | | | 3611 | 86 | Call has been cleared (Q.931 only) | 3612 | | | 3613 | 88 | Incompatible destination | 3614 | | | 3615 | 91 | Invalid transit network selection (Q.931 only) | 3616 | | | 3617 | 95 | Invalid message, unspecified | 3618 | | | 3619 | 96 | Mandatory information element missing (Q.931 only) | 3620 | | | 3621 | 97 | Message type nonexistent/not implemented | 3622 | | | 3623 | 98 | Message not compatible with call state | 3624 | | | 3625 | 99 | Information element nonexistent | 3626 | | | 3627 | 100 | Invalid information element contents | 3628 | | | 3629 | 101 | Message not compatible with call state | 3630 | | | 3631 | 102 | Recovery on timer expiration | 3632 | | | 3633 | 103 | Mandatory information element length error (causes.h | 3634 | | only) | 3635 | | | 3636 | 111 | Protocol error, unspecified | 3637 | | | 3638 | 127 | Internetworking, unspecified | 3639 +--------+----------------------------------------------------------+ 3641 8.4.34. ENCRYPTION 3643 The purpose of the ENCRYPTION information element is to indicate what 3644 encryption methods are accepted for an IAX peer. The data field is a 3645 2 octet bit mask specifying which encryption methods from the table 3646 below are accepted. 3648 The ENCRYPTION information element MAY be sent with IAX NEW and 3649 AUTHREQ messages. 3651 1 3652 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3653 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3654 | 0x2b | 0x01 | 3655 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3656 | Encryption Methods | 3657 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3659 The following table lists valid native encryption methods: 3661 +--------+-------------+ 3662 | METHOD | DESCRIPTION | 3663 +--------+-------------+ 3664 | 0x0001 | AES-128 | 3665 +--------+-------------+ 3667 8.4.35. CODEC PREFS 3669 The purpose of the CODEC PREFS information element is to indicate the 3670 CODEC preferences of the calling peer. The data field consists of a 3671 list of CODECs in the peer's order of preference as UTF-8-encoded 3672 data. 3674 The CODEC PREFS information element MAY be sent with IAX NEW 3675 messages. 3677 If the CODEC PREFS information element is absent, CODEC negotiation 3678 takes place via the CAPABILITY and FORMAT information elements. 3680 1 3681 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3682 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3683 | 0x2d | Data Length | 3684 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3685 | | 3686 : CODEC Prefs Data : 3687 | | 3688 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3690 8.4.36. RR JITTER 3692 The purpose of the Receiver Report (RR) JITTER information element is 3693 to indicate the received jitter on a call, per [RFC3550]. The data 3694 field is 4 octets long and carries the current measured jitter. 3696 The RR JITTER information element MAY be sent with IAX PONG messages. 3698 1 3699 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3700 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3701 | 0x2e | 0x04 | 3702 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3703 | Received Jitter | 3704 | | 3705 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3707 8.4.37. RR LOSS 3709 The purpose of the RR LOSS information element is to indicate the 3710 number of lost frames on a call, per [RFC3550]. The data field is 4 3711 octets long and carries the percentage of frames lost in the first 3712 octet, and the count of lost frames in the next 3 octets. 3714 The RR LOSS information element MAY be sent with IAX PONG messages. 3716 1 3717 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3718 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3719 | 0x2f | 0x04 | 3720 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3721 | Loss Percent | | 3722 +-+-+-+-+-+-+-+-+ Loss Count | 3723 | | 3724 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3726 8.4.38. RR PKTS 3728 The purpose of the RR PKTS information element is to indicate the 3729 total number of frames received on a call, per [RFC3550]. The data 3730 field is 4 octets long and carries the count of frames received. 3732 The RR PKTS information element MAY be sent with IAX PONG messages. 3734 1 3735 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3736 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3737 | 0x30 | 0x04 | 3738 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3739 | Frames Received Count | 3740 | | 3741 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3743 8.4.39. RR DELAY 3745 The purpose of the RR DELAY information element is to indicate the 3746 maximum playout delay for a call, per [RFC3550]. The data field is 2 3747 octets long and specifies the number of milliseconds a frame may be 3748 delayed before it MUST be discarded. 3750 The RR DELAY information element MAY be sent with IAX PONG messages. 3752 1 3753 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3754 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3755 | 0x31 | 0x02 | 3756 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3757 | Maximum Playout Delay | 3758 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3760 8.4.40. RR DROPPED 3762 The purpose of the RR DROPPED information element is to indicate the 3763 total number of dropped frames for a call, per [RFC3550]. The data 3764 field is 4 octets long and carries the number of frames dropped. 3766 The RR DROPPED information element MAY be sent with IAX PONG 3767 messages. 3769 1 3770 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3771 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3772 | 0x32 | 0x04 | 3773 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3774 | Total Frames Dropped | 3775 | | 3776 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3778 8.4.41. RR OOO 3780 The purpose of the RR OOO information element is to indicate the 3781 number of frames received out of order for a call, per [RFC3550]. 3782 The data field is 4 octets long and carries the number of frames 3783 received out of order. 3785 The RR OOO information element MAY be sent with IAX PONG messages. 3787 1 3788 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 3789 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3790 | 0x33 | 0x04 | 3791 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3792 | Frames Received | 3793 | Out of Order | 3794 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3796 8.5. Media Formats 3797 Media Format Subclass Values 3799 +------------+-----------------+------------------------------------+ 3800 | SUBCLASS | DESCRIPTION | LENGTH CALCULATION | 3801 +------------+-----------------+------------------------------------+ 3802 | 0x00000001 | G.723.1 | 4, 20, and 24 byte frames of 240 | 3803 | | | samples | 3804 | | | | 3805 | 0x00000002 | GSM Full Rate | 33 byte chunks of 160 samples or | 3806 | | | 65 byte chunks of 320 samples | 3807 | | | | 3808 | 0x00000004 | G.711 mu-law | 1 byte per sample | 3809 | | | | 3810 | 0x00000008 | G.711 a-law | 1 byte per sample | 3811 | | | | 3812 | 0x00000010 | G.726 | | 3813 | | | | 3814 | 0x00000020 | IMA ADPCM | 1 byte per 2 samples | 3815 | | | | 3816 | 0x00000040 | 16-bit linear | 2 bytes per sample | 3817 | | little-endian | | 3818 | | | | 3819 | 0x00000080 | LPC10 | Variable size frame of 172 samples | 3820 | | | | 3821 | 0x00000100 | G.729 | 20 bytes chunks of 172 samples | 3822 | | | | 3823 | 0x00000200 | Speex | Variable | 3824 | | | | 3825 | 0x00000400 | ILBC | 50 bytes per 240 samples | 3826 | | | | 3827 | 0x00000800 | G.726 AAL2 | | 3828 | | | | 3829 | 0x00001000 | G.722 | 16kHz ADPCM | 3830 | | | | 3831 | 0x00002000 | AMR | Variable | 3832 | | | | 3833 | 0x00010000 | JPEG | | 3834 | | | | 3835 | 0x00020000 | PNG | | 3836 | | | | 3837 | 0x00040000 | H.261 | | 3838 | | | | 3839 | 0x00080000 | H.263 | | 3840 | | | | 3841 | 0x00100000 | H.263p | | 3842 | | | | 3843 | 0x00200000 | H.264 | | 3844 +------------+-----------------+------------------------------------+ 3846 9. Example Message Flows 3848 This section includes call flow diagrams for some of the various 3849 types of IAX calls that can be made. In each diagram, the '=' 3850 character represents a full frame and the '-' character represents a 3851 mini frame. Notes applicable to a generic call may be presented 3852 alongside each diagram. 3854 9.1. Ping/Pong 3856 PING->PONG 3858 Peer A Peer B 3859 ________________________________________ 3860 | | 3861 T | | 3862 i | ===PING============================> | 3863 m | | 3864 e | <============================PONG=== |Has same time-stamp 3865 | | as received PING. 3866 | | ===ACK=============================> |Has same time-stamp 3867 | | | as received PONG 3868 \ / |________________________________________| and original PING 3870 9.2. Lagrq/Lagrp 3872 LAGRQ->LAGRP 3874 Peer A Peer B 3875 ________________________________________ 3876 | | 3877 T | | 3878 i | ===LAGRQ===========================> | 3879 m | | 3880 e | <===========================LAGRP=== |Same time-stamp as 3881 | | received LAGRQ. 3882 | | ===ACK=============================> |Same time-stamp as 3883 | | | received LAGRP and 3884 \ / |________________________________________| original LAGRQ. 3886 9.3. Registration 3888 Registration of an IAX Peer 3890 Registrant A Registrar B 3891 ________________________________________ 3892 | | 3893 T | ===REGREQ==========================> | 3894 i | | 3895 m | <=========================REGAUTH=== | 3896 e | | 3897 | ===REGREQ==========================> | 3898 | | | 3899 | | <==========================REGACK=== | 3900 \ | / | | 3901 \|/ | ===ACK=============================> | 3902 | | 3903 |________________________________________| 3905 9.4. Registration Release 3907 Registration Release 3909 Registrant A Registrar B 3910 ________________________________________ 3911 | | 3912 T | ===REGREL==========================> | 3913 i | | 3914 m | <=========================REGAUTH=== | 3915 e | | 3916 | ===REGREL==========================> | 3917 | | | 3918 | | <==========================REGACK=== | 3919 \ | / | | 3920 \|/ | ===ACK=============================> | 3921 | | 3922 |________________________________________| 3924 9.5. Call Path Optimization 3926 IAX Transfer 3928 Peer L Peer C Peer R 3929 ________________________________________ 3930 | | | 3931 T | | | 3932 | <== TXREQ =====[*]== TXREQ =========> |C requests transfer 3933 i | | | 3934 | ========================== TXCNT ==> |L sends to R 3935 m | | | 3936 | <========================= TXACC ==== |R replies 3937 e | | |R sends Media 3938 | | | to L 3939 | | | | 3940 | | = TXREADY ====> | |L tells C 'ready' 3941 | | | | C stops media to L 3942 | | | | 3943 | | <== TXCNT =========================== |L sends to R 3944 | | | | 3945 | | === TXACC ===========================> |R replies 3946 \ / | | | 3947 | | <== TXREADY ====== |R tells C 'ready' 3948 | | | C stops media to R 3949 | | | 3950 | <== TXREL =====[*]== TXREL =========> |C Releases 3951 | | 3952 |________________________________________| 3954 9.6. IAX Media Call 3956 Complete end-to-end IAX media exchange 3958 Peer A Peer B 3959 ________________________________________ 3960 | | 3961 | ====NEW============================> | 3962 T | <=========================AUTHREQ=== |If authentication 3963 | | specified. 3964 i | ====AUTHREP========================> | 3965 m | <==========================ACCEPT=== | 3966 e | ====ACK============================> | 3967 | | 3968 | | <=============Voice (full frame)=== | 3969 | | ====ACK===========================> | 3970 | | | 3971 | | <---------Voice miniframe (ring)--- | 3972 | | <---------Voice miniframe (ring)--- | 3973 | | | 3974 \ | / | <=========================RINGING=== | 3975 \|/ | ====ACK============================> | 3976 | | 3977 | <---------Voice miniframe (ring)--- | 3978 | <---------Voice miniframe (ring)--- | 3979 | | 3980 | <==========================ANSWER=== | 3981 | ====ACK============================> | 3982 | | 3983 | ====Voice (full frame)=============> | 3984 | <=============================ACK=== | 3985 | | 3986 | | 3987 | <-----------Voice miniframes-------> | exchange occurs 3988 | <--- . ---> | 3989 | <--- . ---> | 3990 | <--- . ---> | 3991 | <-----------Voice miniframes-------> | 3992 | | 3993 | | 3994 | ====Voice (full frame)=============> | (note 1) 3995 | <===ACK============================= | (note 2) 3996 | | (every 65536 ms). 3997 | <=============Voice (full frame)==== | (note 3) 3998 | ====ACK============================> | 3999 | | 4000 | | 4001 | <-----------Voice miniframes-------> | 4002 | <--- . ---> | 4003 | <--- . ---> | 4004 | <--- . ---> | 4005 | <-----------Voice miniframes-------> | 4006 | | 4007 | | 4008 | ====HANGUP=========================> | Either can hangup 4009 | <=============================ACK=== | 4010 |________________________________________| 4012 Note 1: Mini Frames carry the low 16 bits of the peer's 4013 32-bit time-stamp. 4014 Note 2: Full frames re-sync the 32 bit time-stamp when the 16 bit 4015 time-stamp overflows. 4017 Note 3:Each side has its own 32 bit time-stamp so each side needs 4018 to sync at 16 bit overflow. 4020 9.7. IAX Media Call via an IAX Device 4022 An IAX peer is not required to maintain a complete dialplan. In the 4023 event that a user wishes to dial from an IAX peer which does not 4024 switch its own calls, the following call flow diagram may represent 4025 the transaction: 4027 Peer A (IAX Device) Peer B (Dialplan Server) 4028 ________________________________________ 4029 | | 4030 | ====NEW============================> | 4031 T | <=========================AUTHREQ=== | If auth specified 4032 i | ====AUTHREP========================> | 4033 m | <==========================ACCEPT=== | 4034 e | ====ACK============================> | 4035 | | 4036 | ====DPREQ==========================> | (Note 1) 4037 | | <===========================DPREP=== | 4038 | | | 4039 | | ====DIAL===========================> | 4040 | | <========================PROGRESS=== | 4041 | | ====ACK============================> | 4042 \ | / | <==========================ANSWER=== | 4043 \|/ | ====ACK============================> | 4044 | | 4045 | ====Voice (full frame)=============> | 4046 | <=============================ACK=== | 4047 | <=============Voice (full frame)==== | 4048 | ====ACK============================> | 4049 | | 4050 | | 4051 | <-----------Voice miniframes-------> | Media exchange 4052 | <--- . ---> | 4053 | <--- . ---> | 4054 | <--- . ---> | 4055 | <-----------Voice miniframes-------> | 4056 | | 4057 | | 4058 | ====Voice (full frame)=============> | (note 2) 4059 | <===ACK============================= | (note 3) 4060 | | (every 65536 ms). 4061 | <=============Voice (full frame)==== | (Note 4) 4062 | ====ACK============================> | 4063 | | 4064 | | 4065 | <-----------Voice miniframes-------> | 4066 | <--- . ---> | 4067 | <--- . ---> | 4068 | <--- . ---> | 4069 | <-----------Voice miniframes-------> | 4070 | | 4071 | | 4072 | ====HANGUP=========================> | Either can hangup 4073 | <=============================ACK=== | 4074 |________________________________________| 4076 Note 1: There will be multiple DPREQ/DPREPs per call unless 4077 dialed number is 1 digit long 4078 Note 2: Mini Frames carry the low 16 bits of the peer's 4079 32 bit time-stamp. 4080 Note 3: Full frames re-sync the 32 bit time-stamp when the 16 bit 4081 time-stamp overflows 4082 Note 4: Each side has its own 32 bit time-stamp so each side needs 4083 to sync at 16 bit overflow. 4085 10. Security Considerations 4087 IAX is a binary protocol for setting up point-to-point call legs 4088 which includes both media and signaling. As such, it is simpler to 4089 secure than other more general purpose VoIP protocols, however, 4090 security remains a difficult task and various aspects of the protocol 4091 must be examined to identify risks. 4093 IAX registration is an area that requires careful attention. 4094 Previous protocol versions supported clear text passwords, this 4095 feature has been eliminated. The MD5 and RSA alternatives offer much 4096 higher security. Although not specified by the IAX protocol, some 4097 implementations limit the number of registrants per account to one. 4098 And a subsequent registrant with the same credentials would overwrite 4099 the prior and receive the calls destined for that user. Theft of 4100 service is trivial once a malicious caller has the ability to 4101 authenticate. In addition, since distinct cause codes are returned 4102 to erroneous registration attempts, an attacker can distinguish 4103 between existent and nonexistent users in a registration system, thus 4104 resulting in a possible directory harvest attack. 4106 The IAX protocol protects against message replay by using a challenge 4107 response method. The IAX registrar or server challenges each call or 4108 registration with an arbitrary MD5 or RSA challenge. The response 4109 and subsequent authorization relies upon knowledge of a shared 4110 secret. Since the server typically chooses a challenges using a 4111 random number-based technique, the challenge set is large, making 4112 replay highly unlikely. 4114 Although operation in the following manner is not recommended, the 4115 IAX protocol does permit servers to forego the challenge process 4116 described above. This open approach is inherently insecure and does 4117 nothing to prevent unauthorized or usage. 4119 Call Encryption in IAX starts by utilizing static keys. Once 4120 negotiated, the key may be changed for the remainder of the call. 4121 Once the initial key is compromised, all subsequent calls are subject 4122 to interception. A more secure implementation would update the key 4123 frequently and as early as practical during each call. 4125 The IAX protocol is also susceptible to eavesdropping. Call Detail, 4126 i.e., who is calling whom, is sent in unencrypted binary whether the 4127 call is to be encrypted or not. Without encryption, call content, 4128 i.e., audio and video, may be easily intercepted. However, this 4129 content is protected if the call is encrypted. 4131 Man in the middle attacks are a threat to IAX if encryption is not 4132 used. This form of attack permits message insertion, deletion, and 4133 modification such that a call may be redirected or the audio or video 4134 replaced in either or both directions for the complete or any portion 4135 of a call. If encryption is used, the call is protected end to end. 4136 Note: an initial NEW message in an encrypted call is unencrypted and 4137 could be changed; however, this is limited to a denial of service 4138 attack because subsequent messages containing the same address 4139 information are redelivered in an encrypted form. 4141 Denial of service attacks can take at least two forms in IAX. One is 4142 simply overloading the peers with bogus requests. A carefully 4143 implemented IAX peer would identify this situation and raise an alarm 4144 or take other protective action. 4146 Another form of denial of service (DoS) against an existing call is 4147 an engineered attack against an existing call. Injecting media, 4148 causing excess processing by inserting out of order packets, and 4149 sending commands such as hangup or transfer. These attacks require 4150 close monitoring of the binary channel to be successful as the 4151 message sequence numbers would need to be synchronized with the 4152 protocol exchange. 4154 Of course, providing lower layer security with IPSEC, [RFC4301], 4155 would address many of these potential issues. 4157 Unicode, [RFC3629] , and [RFC3454] security considerations also 4158 apply. 4160 11. IANA Considerations 4162 This document requests registration of the "iax" URI Scheme. See 4163 Section 5. IAX also requires a well-known UDP port to be assigned. 4164 The current port in use is 4569. 4166 12. Implementation Notes 4168 The original IAX implementation was in Asterisk, the open-source pbx, 4169 but [wikipedia] lists thirteen other publically available 4170 implementations at the time of this writing. Some of these 4171 implementations used draft versions of this specification. Many 4172 others were developed using the Asterisk source code as the only 4173 specification. While this approach is definitive, it is very 4174 difficult to determine the protocols higher level logic and optimize 4175 it for the particular programming language or application 4176 environment. Interoperability of these implementations can not be 4177 guaranteed. 4179 Aside from the trials and tribulations of reverse engineering the 4180 source code to create a new implementation, the key lessons learned 4181 involve the use of threads, support of international character sets, 4182 security, and improved controls to limit interference during denial 4183 of service attacks. 4185 The current Asterisk implementation has a limited number of IAX 4186 worker threads and, as a result, its scalability is limited, but it 4187 can run on low end machines where threads may not be freely 4188 available. Improving the threading model will undoubtedly improve 4189 performance. 4191 Internationalization and localization are issues that were not 4192 originally addressed by most implementations. It was always on the 4193 IAX developers' road map, but never a priority. While creating this 4194 document, we formalized support for UTF-8 encoding to better support 4195 Internationalization and localization. 4197 With regards to security, many IAX implementations permit clear text 4198 authentication. This method is not secure and should not be used. 4200 Recently, some issues have been raised regarding server robustness 4201 when under a denial of service attack. IAX servers which support 4202 unauthenticated requests can receive the equivalent of a SYN attack. 4203 To mitigate the impact of these attacks, various controls to limit 4204 the number of unauthenticated calls and the number of calls per user 4205 may be added to the implementation. Other approaches, such as 4206 transferring the call to another, more protected port or using IP 4207 rate limiting when excessive failures are detected, are also 4208 suggested. 4210 Lastly, given the open nature of the protocol and implementations, it 4211 is very easy to extend. This situation makes Postel's Robustness 4212 Principle, "Be conservative in what you do, be liberal in what you 4213 accept from others," essential to any successful IAX implementation. 4215 13. Acknowledgments 4217 This work was supported by Internet Foundation Austria. The authors 4218 would like to thank Birgit Arkesteijn, Marc Blanchet, Mohamed 4219 Boucadair, Steve Kann, Olle Johansson, Alexander Mayrhofer, Tim 4220 Panton, and Peter Saint-Andre for their extensive review and 4221 technical input. We would also like to thank Christopher DeMarco, 4222 Frank Ellermann, Daniel Medeiros, Dimitri E. Prado, Leif Madson, and 4223 Tilghman Lesher for their support and suggestions. 4225 14. References 4227 14.1. Normative References 4229 [AES] U.S. Department of Commerce/N.I.S.T., "FIPS-197, 4230 Announcing the Advanced Encryption Standard", 4231 November 2001. 4233 [E164] ITU-T, "The International Public Telecommunication Number 4234 Plan", Recommendation E.164, May 1997. 4236 [RFC1321] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321, 4237 April 1992. 4239 [RFC1851] Karn, P., Metzger, P., and W. Simpson, "The ESP Triple DES 4240 Transform", RFC 1851, September 1995. 4242 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 4243 Requirement Levels", BCP 14, RFC 2119, March 1997. 4245 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 4246 A., Peterson, J., Sparks, R., Handley, M., and E. 4247 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 4248 June 2002. 4250 [RFC3447] Jonsson, J. and B. Kaliski, "Public-Key Cryptography 4251 Standards (PKCS) #1: RSA Cryptography Specifications 4252 Version 2.1", RFC 3447, February 2003. 4254 [RFC3454] Hoffman, P. and M. Blanchet, "Preparation of 4255 Internationalized Strings ("stringprep")", RFC 3454, 4256 December 2002. 4258 [RFC3491] Hoffman, P. and M. Blanchet, "Nameprep: A Stringprep 4259 Profile for Internationalized Domain Names (IDN)", 4260 RFC 3491, March 2003. 4262 [RFC3550] Schulzrinne, H., Casner, S., Frederick, R., and V. 4263 Jacobson, "RTP: A Transport Protocol for Real-Time 4264 Applications", STD 64, RFC 3550, July 2003. 4266 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 4267 10646", STD 63, RFC 3629, November 2003. 4269 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 4270 Resource Identifier (URI): Generic Syntax", STD 66, 4271 RFC 3986, January 2005. 4273 [RFC4646] Phillips, A. and M. Davis, "Tags for Identifying 4274 Languages", BCP 47, RFC 4646, September 2006. 4276 [RFC4647] Phillips, A. and M. Davis, "Matching of Language Tags", 4277 BCP 47, RFC 4647, September 2006. 4279 [html401] Jacobs, I., Hors, A., and D. Raggett, "HTML 4.01 4280 Specification", World Wide Web Consortium 4281 Recommendation REC-html401-19991224, December 1999, 4282 . 4284 14.2. Informative References 4286 [RFC3435] Andreasen, F. and B. Foster, "Media Gateway Control 4287 Protocol (MGCP) Version 1.0", RFC 3435, January 2003. 4289 [RFC3525] Groves, C., Pantaleo, M., Anderson, T., and T. Taylor, 4290 "Gateway Control Protocol Version 1", RFC 3525, June 2003. 4292 [RFC3761] Faltstrom, P. and M. Mealling, "The E.164 to Uniform 4293 Resource Identifiers (URI) Dynamic Delegation Discovery 4294 System (DDDS) Application (ENUM)", RFC 3761, April 2004. 4296 [RFC4301] Kent, S. and K. Seo, "Security Architecture for the 4297 Internet Protocol", RFC 4301, December 2005. 4299 [RFC4395] Hansen, T., Hardie, T., and L. Masinter, "Guidelines and 4300 Registration Procedures for New URI Schemes", BCP 115, 4301 RFC 4395, February 2006. 4303 [RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session 4304 Description Protocol", RFC 4566, July 2006. 4306 [RFC4733] Schulzrinne, H. and T. Taylor, "RTP Payload for DTMF 4307 Digits, Telephony Tones, and Telephony Signals", RFC 4733, 4308 December 2006. 4310 [RFC4734] Schulzrinne, H. and T. Taylor, "Definition of Events for 4311 Modem, Fax, and Text Telephony Signals", RFC 4734, 4312 December 2006. 4314 [wikipedia] 4315 http://en.wikipedia.org/wiki/IAX, "Inter-Asterisk 4316 eXchange". 4318 Authors' Addresses 4320 Mark A. Spencer 4321 Digium, Inc. 4322 150 West Park Loop Suite 100 4323 Huntsville, AL 35806 4324 US 4326 Phone: +1 256 428 6000 4327 Email: markster@digium.com 4328 URI: http://www.digium.com/ 4330 Brian Capouch 4331 Saint Joseph's College 4332 PO Box 909 4333 Rensselaer, IN 47978 4334 US 4336 Phone: +1 219 866 6114 4337 Email: brianc@saintjoe.edu 4339 Ed Guy (editor) 4340 TruPhone 4341 235 Main Street, STE 253 4342 Madison, NJ 07940 4343 US 4345 Phone: +1 973 437 4519 4346 Email: edguy@emcsw.com 4347 URI: http://www.TruPhone.com/ 4349 Frank Miller 4350 Cornfed Systems, Inc. 4351 103 Overhill Road 4352 Baltimore, MD 21210 4353 US 4355 Phone: +1 410 404-8790 4356 Email: fwmiller@cornfed.com 4357 URI: http://www.digium.com/ 4358 Kenneth C. Shumard 4359 3818 N Lakegrove Way 4360 Boise, ID 83713 4361 US 4363 Phone: +1 208 724 7801 4364 Email: kshumard@gmail.com 4366 Full Copyright Statement 4368 Copyright (C) The IETF Trust (2008). 4370 This document is subject to the rights, licenses and restrictions 4371 contained in BCP 78, and except as set forth therein, the authors 4372 retain all their rights. 4374 This document and the information contained herein are provided on an 4375 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 4376 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND 4377 THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS 4378 OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF 4379 THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 4380 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 4382 Intellectual Property 4384 The IETF takes no position regarding the validity or scope of any 4385 Intellectual Property Rights or other rights that might be claimed to 4386 pertain to the implementation or use of the technology described in 4387 this document or the extent to which any license under such rights 4388 might or might not be available; nor does it represent that it has 4389 made any independent effort to identify any such rights. Information 4390 on the procedures with respect to rights in RFC documents can be 4391 found in BCP 78 and BCP 79. 4393 Copies of IPR disclosures made to the IETF Secretariat and any 4394 assurances of licenses to be made available, or the result of an 4395 attempt made to obtain a general license or permission for the use of 4396 such proprietary rights by implementers or users of this 4397 specification can be obtained from the IETF on-line IPR repository at 4398 http://www.ietf.org/ipr. 4400 The IETF invites any interested party to bring to its attention any 4401 copyrights, patents or patent applications, or other proprietary 4402 rights that may cover technology that may be required to implement 4403 this standard. Please address the information to the IETF at 4404 ietf-ipr@ietf.org.