Home arrow Asterisk arrow IAX2: Inter-Asterisk eXchange Version 2

Language Translator

Hacking Zone

Hacking Tools
Attacking

Configure Windows

Windows Configuration

Novels

Mix Novels

Human Personality

Body Language
IAX2: Inter-Asterisk eXchange Version 2 PDF Print E-mail
Written by Hemanshu Patel   
Tuesday, 18 December 2007
Article Index
IAX2: Inter-Asterisk eXchange Version 2
Page 2
Page 3
Page 4
Page 5
Page 6
Page 7
Page 8
Page 9
Page 10
Page 11
Page 12
Page 13
Page 14
Page 15
Page 16
Page 17
Page 18
Page 19
Page 20
Page 21
Page 22
Page 23
Page 24
Page 25
Page 26
Page 27
Page 28
Page 29
Page 30
Page 31
Page 32
Page 33
Page 34

IAX2: Inter-Asterisk eXchange Version 2 

 

This document describes the Inter-Asterisk eXchange protocol, Version  2, (IAX2) an application-layer control and media protocol for creating, modifying, and terminating multimedia sessions over Internet Protocol (IP) networks.  IAX2 was developed by the open source community for the Asterisk PBX and is targeted primarily at Voice over Internet Protocol (VoIP) call control, but it can be used with streaming video or any other type of multimedia.




                                                              M. Spencer
   IAX2 is an "all in one" protocol for handling multimedia in IP
   networks.  It combines both control and media services in the same
   protocol.  In addition, IAX2 uses a single UDP data stream on a
   static port greatly simplifying Network Address Translation (NAT)
   gateway traversal, eliminating the need for other protocols to work
   around NAT, and simplifying network and firewall management.  IAX2
   employs a compact encoding which decreases bandwidth usage and is
   well suited for Internet telephony service.  In addition, its open
   nature permits new payload types additions needed to support
   additional services.


Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   7
     1.1.  Basic Properties  . . . . . . . . . . . . . . . . . . . .   7
     1.2.  Drawbacks . . . . . . . . . . . . . . . . . . . . . . . .   8
   2.  IAX2 Terminology  . . . . . . . . . . . . . . . . . . . . . .   9
   3.  Overview of IAX2 Protocol . . . . . . . . . . . . . . . . . .  10
   4.  Naming Conventions  . . . . . . . . . . . . . . . . . . . . .  12
   5.  IAX2 Uniform Resource Identifiers . . . . . . . . . . . . . .  13
     5.1.  IAX2 URI Scheme Registration  . . . . . . . . . . . . . .  13
     5.2.  URI Comparison  . . . . . . . . . . . . . . . . . . . . .  15
   6.  Peer Behavior and Related Messages  . . . . . . . . . . . . .  17
     6.1.  Registration (OPTIONAL) . . . . . . . . . . . . . . . . .  17
       6.1.1.  Overview  . . . . . . . . . . . . . . . . . . . . . .  18
       6.1.2.  REGREQ Registration Request Message . . . . . . . . .  20
       6.1.3.  REGAUTH Registration Authentication Response
               Message . . . . . . . . . . . . . . . . . . . . . . .  21
       6.1.4.  REGACK Registration Acknowledgment Message  . . . . .  21
       6.1.5.  REGREJ Registration Rejection Message . . . . . . . .  22
       6.1.6.  REGREL Registration Release Request Message . . . . .  23
     6.2.  Call Leg Management . . . . . . . . . . . . . . . . . . .  24
       6.2.1.  Overview  . . . . . . . . . . . . . . . . . . . . . .  25
       6.2.2.  NEW Request Message . . . . . . . . . . . . . . . . .  26
       6.2.3.  ACCEPT Response Message . . . . . . . . . . . . . . .  28
       6.2.4.  REJECT Response Message . . . . . . . . . . . . . . .  28
       6.2.5.  HANGUP Request Message  . . . . . . . . . . . . . . .  29
       6.2.6.  AUTHREP Authentication Reply Message  . . . . . . . .  29
       6.2.7.  AUTHREQ Authentication Request Message  . . . . . . .  30
     6.3.  Call Control  . . . . . . . . . . . . . . . . . . . . . .  30
       6.3.1.  Overview  . . . . . . . . . . . . . . . . . . . . . .  30
       6.3.2.  PROCEEDING Response Message . . . . . . . . . . . . .  31
       6.3.3.  RINGING Response Message  . . . . . . . . . . . . . .  31
       6.3.4.  ANSWER Response Message . . . . . . . . . . . . . . .  32
     6.4.  Mid-Call Link Operations  . . . . . . . . . . . . . . . .  32
       6.4.1.  FLASH Request Message . . . . . . . . . . . . . . . .  32
       6.4.2.  HOLD Request Message  . . . . . . . . . . . . . . . .  32
       6.4.3.  UNHOLD Request Message  . . . . . . . . . . . . . . .  32
       6.4.4.  QUELCH Request Message  . . . . . . . . . . . . . . .  33
       6.4.5.  UNQUELCH Request Message  . . . . . . . . . . . . . .  33
       6.4.6.  TRANSFER Request Message  . . . . . . . . . . . . . .  33
     6.5.  Call Path Optimization  . . . . . . . . . . . . . . . . .  34
       6.5.1.  TXREQ Transfer Request Message  . . . . . . . . . . .  36
       6.5.2.  TXCNT Transfer Connectivity Response Message  . . . .  37
       6.5.3.  TXACC Response Message  . . . . . . . . . . . . . . .  37
       6.5.4.  TXREADY Transfer Ready Response Message . . . . . . .  37
       6.5.5.  TXREL Transfer Release Response Message . . . . . . .  38
       6.5.6.  TXMEDIA Transfer Media Message  . . . . . . . . . . .  38
       6.5.7.  TXREJ Transfer Rejection Response Message . . . . . .  39
     6.6.  Call Tear Down  . . . . . . . . . . . . . . . . . . . . .  39
     6.7.  Network Monitoring  . . . . . . . . . . . . . . . . . . .  39
       6.7.1.  POKE Request Message  . . . . . . . . . . . . . . . .  39
       6.7.2.  PING Request Message  . . . . . . . . . . . . . . . .  40
       6.7.3.  PONG Response Message . . . . . . . . . . . . . . . .  40
       6.7.4.  LAGRQ Lag Request Message . . . . . . . . . . . . . .  40
       6.7.5.  LAGRP Lag Response Message  . . . . . . . . . . . . .  40
     6.8.  Digit Dialing . . . . . . . . . . . . . . . . . . . . . .  40
       6.8.1.  DPREQ Dial Plan Request Message . . . . . . . . . . .  41
       6.8.2.  DPREP Dial Plan Response Message  . . . . . . . . . .  41
       6.8.3.  DIAL Request Message  . . . . . . . . . . . . . . . .  42
     6.9.  Firmware Download . . . . . . . . . . . . . . . . . . . .  42
       6.9.1.  FWDOWNL Firmware Download Request Message . . . . . .  43
       6.9.2.  FWDATA Firmware Data Response Message . . . . . . . .  43
     6.10. Provisioning  . . . . . . . . . . . . . . . . . . . . . .  44
       6.10.1. PROVISION Request Message . . . . . . . . . . . . . .  44
     6.11. Miscellaneous . . . . . . . . . . . . . . . . . . . . . .  44
       6.11.1. ACK acknowledgement Message . . . . . . . . . . . . .  44
       6.11.2. INVAL Invalid Response Message  . . . . . . . . . . .  45
       6.11.3. VNAK Voice Negative Acknowledgement Message . . . . .  45
       6.11.4. MWI Message Waiting Indicator Request Message . . . .  45
       6.11.5. UNSUPPORT Unsupported Response Message  . . . . . . .  46
     6.12. Media Messages  . . . . . . . . . . . . . . . . . . . . .  46
       6.12.1. DTMF Media Message  . . . . . . . . . . . . . . . . .  46
       6.12.2. Voice Media Message . . . . . . . . . . . . . . . . .  46
       6.12.3. Video Media Message . . . . . . . . . . . . . . . . .  47
       6.12.4. Text Media Message  . . . . . . . . . . . . . . . . .  47
       6.12.5. Image Media Message . . . . . . . . . . . . . . . . .  47
       6.12.6. HTML Media Message  . . . . . . . . . . . . . . . . .  47
       6.12.7. Comfort Noise  Media Message  . . . . . . . . . . . .  47
   7.  Message Transport . . . . . . . . . . . . . . . . . . . . . .  48
     7.1.  Trunking  . . . . . . . . . . . . . . . . . . . . . . . .  48
     7.2.  Timers  . . . . . . . . . . . . . . . . . . . . . . . . .  49
       7.2.1.  Retransmission Timer  . . . . . . . . . . . . . . . .  49
       7.2.2.  Registration Period Timer . . . . . . . . . . . . . .  49
     7.3.  NAT Considerations  . . . . . . . . . . . . . . . . . . .  49
     7.4.  Encryption  . . . . . . . . . . . . . . . . . . . . . . .  50
   8.  Message Encoding  . . . . . . . . . . . . . . . . . . . . . .  51
     8.1.  Frame Structure . . . . . . . . . . . . . . . . . . . . .  51
       8.1.1.  Full Frames . . . . . . . . . . . . . . . . . . . . .  51
       8.1.2.  Mini frames . . . . . . . . . . . . . . . . . . . . .  53
       8.1.3.  Meta frames . . . . . . . . . . . . . . . . . . . . .  54
       8.1.4.  Encrypted Frames  . . . . . . . . . . . . . . . . . .  59
     8.2.  Frame Types . . . . . . . . . . . . . . . . . . . . . . .  61
       8.2.1.  DTMF Frame  . . . . . . . . . . . . . . . . . . . . .  61
       8.2.2.  Voice Frame . . . . . . . . . . . . . . . . . . . . .  61
       8.2.3.  Video Frame . . . . . . . . . . . . . . . . . . . . .  61
       8.2.4.  Control Frame . . . . . . . . . . . . . . . . . . . .  61
       8.2.5.  Null Frame  . . . . . . . . . . . . . . . . . . . . .  61
       8.2.6.  IAX2 Frame  . . . . . . . . . . . . . . . . . . . . .  61
       8.2.7.  Text Frame  . . . . . . . . . . . . . . . . . . . . .  62
       8.2.8.  Image Frame . . . . . . . . . . . . . . . . . . . . .  62
       8.2.9.  HTML Frame  . . . . . . . . . . . . . . . . . . . . .  62
       8.2.10. Comfort Noise Frame . . . . . . . . . . . . . . . . .  62
       8.2.11. Control Frames  . . . . . . . . . . . . . . . . . . .  64
       8.2.12. IAX2 Frames . . . . . . . . . . . . . . . . . . . . .  65
     8.3.  HTML Command Subclasses . . . . . . . . . . . . . . . . .  67
     8.4.  Information Elements  . . . . . . . . . . . . . . . . . .  67
       8.4.1.  CALLED NUMBER . . . . . . . . . . . . . . . . . . . .  70
       8.4.2.  CALLING NUMBER  . . . . . . . . . . . . . . . . . . .  71
       8.4.3.  CALLING ANI . . . . . . . . . . . . . . . . . . . . .  71
       8.4.4.  CALLING NAME  . . . . . . . . . . . . . . . . . . . .  72
       8.4.5.  CALLED CONTEXT  . . . . . . . . . . . . . . . . . . .  72
       8.4.6.  USERNAME  . . . . . . . . . . . . . . . . . . . . . .  73
       8.4.7.  CAPABILITY  . . . . . . . . . . . . . . . . . . . . .  73
       8.4.8.  FORMAT  . . . . . . . . . . . . . . . . . . . . . . .  74
       8.4.9.  LANGUAGE  . . . . . . . . . . . . . . . . . . . . . .  74
       8.4.10. VERSION . . . . . . . . . . . . . . . . . . . . . . .  74
       8.4.11. ADSICPE . . . . . . . . . . . . . . . . . . . . . . .  75
       8.4.12. DNID  . . . . . . . . . . . . . . . . . . . . . . . .  75
       8.4.13. AUTHMETHODS . . . . . . . . . . . . . . . . . . . . .  76
       8.4.14. CHALLENGE . . . . . . . . . . . . . . . . . . . . . .  76
       8.4.15. MD5 RESULT  . . . . . . . . . . . . . . . . . . . . .  77
       8.4.16. RSA RESULT  . . . . . . . . . . . . . . . . . . . . .  77
       8.4.17. APPARENT ADDR . . . . . . . . . . . . . . . . . . . .  78
       8.4.18. REFRESH . . . . . . . . . . . . . . . . . . . . . . .  80
       8.4.19. DPSTATUS  . . . . . . . . . . . . . . . . . . . . . .  80
       8.4.20. CALLNO  . . . . . . . . . . . . . . . . . . . . . . .  81
       8.4.21. CAUSE . . . . . . . . . . . . . . . . . . . . . . . .  81
       8.4.22. IAX2 UNKNOWN  . . . . . . . . . . . . . . . . . . . .  82
       8.4.23. MSGCOUNT  . . . . . . . . . . . . . . . . . . . . . .  82
       8.4.24. AUTOANSWER  . . . . . . . . . . . . . . . . . . . . .  83
       8.4.25. MUSICONHOLD . . . . . . . . . . . . . . . . . . . . .  83
       8.4.26. TRANSFERID  . . . . . . . . . . . . . . . . . . . . .  84
       8.4.27. RDNIS . . . . . . . . . . . . . . . . . . . . . . . .  84
       8.4.28. PROVISIONING  . . . . . . . . . . . . . . . . . . . .  85
       8.4.29. AESPROVISIONING . . . . . . . . . . . . . . . . . . .  85
       8.4.30. DATETIME  . . . . . . . . . . . . . . . . . . . . . .  86
       8.4.31. DEVICETYPE  . . . . . . . . . . . . . . . . . . . . .  86
       8.4.32. SERVICEIDENT  . . . . . . . . . . . . . . . . . . . .  87
       8.4.33. FIRMWAREVER . . . . . . . . . . . . . . . . . . . . .  87
       8.4.34. FWBLOCKDESC . . . . . . . . . . . . . . . . . . . . .  88
       8.4.35. FWBLOCKDATA . . . . . . . . . . . . . . . . . . . . .  88
       8.4.36. PROVVER . . . . . . . . . . . . . . . . . . . . . . .  89
       8.4.37. CALLINGPRES . . . . . . . . . . . . . . . . . . . . .  89
       8.4.38. CALLINGTON  . . . . . . . . . . . . . . . . . . . . .  90
       8.4.39. CALLINGTNS  . . . . . . . . . . . . . . . . . . . . .  91
       8.4.40. SAMPLINGRATE  . . . . . . . . . . . . . . . . . . . .  92
       8.4.41. CAUSECODE . . . . . . . . . . . . . . . . . . . . . .  92
       8.4.42. ENCRYPTION  . . . . . . . . . . . . . . . . . . . . .  95
       8.4.43. ENCKEY  . . . . . . . . . . . . . . . . . . . . . . .  96
       8.4.44. CODEC PREFS . . . . . . . . . . . . . . . . . . . . .  96
       8.4.45. RR JITTER . . . . . . . . . . . . . . . . . . . . . .  97
       8.4.46. RR LOSS . . . . . . . . . . . . . . . . . . . . . . .  97
       8.4.47. RR PKTS . . . . . . . . . . . . . . . . . . . . . . .  98
       8.4.48. RR DELAY  . . . . . . . . . . . . . . . . . . . . . .  98
       8.4.49. RR DROPPED  . . . . . . . . . . . . . . . . . . . . .  98
       8.4.50. RR OOO  . . . . . . . . . . . . . . . . . . . . . . .  99
     8.5.  Media Formats . . . . . . . . . . . . . . . . . . . . . .  99
   9.  Example Message Flows . . . . . . . . . . . . . . . . . . . . 101
     9.1.  Ping/Pong . . . . . . . . . . . . . . . . . . . . . . . . 101
     9.2.  Lagrq/Lagrp . . . . . . . . . . . . . . . . . . . . . . . 101
     9.3.  Registration  . . . . . . . . . . . . . . . . . . . . . . 102
     9.4.  Registration  . . . . . . . . . . . . . . . . . . . . . . 102
     9.5.  Provisioning  . . . . . . . . . . . . . . . . . . . . . . 103
     9.6.  Firmware Download . . . . . . . . . . . . . . . . . . . . 103
     9.7.  Call Path Optimization  . . . . . . . . . . . . . . . . . 104
     9.8.  IAX2 Media Call . . . . . . . . . . . . . . . . . . . . . 104
     9.9.  IAX2 Media Call via an IAX2 Device  . . . . . . . . . . . 106
   10. Security Considerations . . . . . . . . . . . . . . . . . . . 108
   11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 109
   12. Implementation Notes  . . . . . . . . . . . . . . . . . . . . 110
   13. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 111
   14. References  . . . . . . . . . . . . . . . . . . . . . . . . . 112
     14.1. Normative References  . . . . . . . . . . . . . . . . . . 112
     14.2. Informative References  . . . . . . . . . . . . . . . . . 112
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . . 114
   Intellectual Property and Copyright Statements  . . . . . . . . . 116



 
< Prev
Your Ad Here

Donate us!!

Enter Amount:

RSS socialnet

Add to MyYahoo!
Subscribe in NewsGator Online
Add to Newsburst
Add to Google
Add to My AOL
Add to Pluck
Subscribe in FeedLounge
Add to Windows Live
Add to NetVibes
Subscribe in Rojo
Subscribe in Bloglines
Add to MyMSN
Add to Plusmo for your cellphone
Add to PageFlakes
Add to Technorati
Add to BlinkBits