From Tilghman Lesher:

Some commands and IEs from the current release of Asterisk are missing from the
IAX protocol dissector.  This patch provides them.

svn path=/trunk/; revision=40141
This commit is contained in:
Jaap Keuter 2011-12-09 23:14:14 +00:00
parent caa30d0c3d
commit d2f9204568
3 changed files with 119 additions and 9 deletions

View File

@ -118,17 +118,25 @@ static int hf_iax2_cap_g723_1 = -1;
static int hf_iax2_cap_gsm = -1;
static int hf_iax2_cap_ulaw = -1;
static int hf_iax2_cap_alaw = -1;
static int hf_iax2_cap_g726 = -1;
static int hf_iax2_cap_g726_aal2 = -1;
static int hf_iax2_cap_adpcm = -1;
static int hf_iax2_cap_slinear = -1;
static int hf_iax2_cap_lpc10 = -1;
static int hf_iax2_cap_g729a = -1;
static int hf_iax2_cap_speex = -1;
static int hf_iax2_cap_ilbc = -1;
static int hf_iax2_cap_g726 = -1;
static int hf_iax2_cap_g722 = -1;
static int hf_iax2_cap_siren7 = -1;
static int hf_iax2_cap_siren14 = -1;
static int hf_iax2_cap_slinear16 = -1;
static int hf_iax2_cap_jpeg = -1;
static int hf_iax2_cap_png = -1;
static int hf_iax2_cap_h261 = -1;
static int hf_iax2_cap_h263 = -1;
static int hf_iax2_cap_h263_plus = -1;
static int hf_iax2_cap_h264 = -1;
static int hf_iax2_cap_mpeg4 = -1;
static int hf_iax2_fragments = -1;
static int hf_iax2_fragment = -1;
@ -259,6 +267,9 @@ static const value_string iax_iax_subclasses[] = {
{35, "PROVISION"},
{36, "FWDOWNL"},
{37, "FWDATA"},
{38, "TXMEDIA"},
{39, "RTKEY"},
{40, "CALLTOKEN"},
{0,NULL}
};
@ -351,6 +362,11 @@ static const value_string iax_ies_type[] = {
{IAX_IE_RR_DROPPED, "Dropped frames"},
{IAX_IE_RR_OOO, "Frames received out of order"},
{IAX_IE_DATAFORMAT, "Data call format"},
{IAX_IE_VARIABLE, "IAX2 variable"},
{IAX_IE_OSPTOKEN, "OSP Token"},
{IAX_IE_CALLTOKEN, "Call Token"},
{IAX_IE_CAPABILITY2, "64-bit codec capability"},
{IAX_IE_FORMAT2, "64-bit codec format"},
{0,NULL}
};
@ -359,17 +375,25 @@ static const value_string codec_types[] = {
{AST_FORMAT_GSM, "GSM compression"},
{AST_FORMAT_ULAW, "Raw mu-law data (G.711)"},
{AST_FORMAT_ALAW, "Raw A-law data (G.711)"},
{AST_FORMAT_G726, "ADPCM (G.726, 32kbps)"},
{AST_FORMAT_G726_AAL2,"ADPCM (G.726, 32kbps)"},
{AST_FORMAT_ADPCM, "ADPCM (IMA)"},
{AST_FORMAT_SLINEAR, "Raw 16-bit Signed Linear (8000 Hz) PCM"},
{AST_FORMAT_LPC10, "LPC10, 180 samples/frame"},
{AST_FORMAT_G729A, "G.729a Audio"},
{AST_FORMAT_SPEEX, "SpeeX Free Compression"},
{AST_FORMAT_ILBC, "iLBC Free Compression"},
{AST_FORMAT_G726, "G.726 compression"},
{AST_FORMAT_G722, "G.722 wideband"},
{AST_FORMAT_SIREN7, "G.722.1 32k wideband (aka Siren7)"},
{AST_FORMAT_SIREN14, "G.722.1 Annex C 48k wideband (aka Siren14)"},
{AST_FORMAT_SLINEAR16,"Raw 16kHz signed linear audio"},
{AST_FORMAT_JPEG, "JPEG Images"},
{AST_FORMAT_PNG, "PNG Images"},
{AST_FORMAT_H261, "H.261 Video"},
{AST_FORMAT_H263, "H.263 Video"},
{AST_FORMAT_H263_PLUS,"H.263+ Video"},
{AST_FORMAT_H264, "H.264 Video"},
{AST_FORMAT_MP4_VIDEO,"MPEG4 Video"},
{0,NULL}
};
@ -393,14 +417,20 @@ static const value_string iax_causecodes[] = {
{AST_CAUSE_UNALLOCATED, "Unallocated"},
{AST_CAUSE_NO_ROUTE_TRANSIT_NET, "No route transit net"},
{AST_CAUSE_NO_ROUTE_DESTINATION, "No route to destination"},
{AST_CAUSE_MISDIALLED_TRUNK_PREFIX, "Misdialled trunk prefix"},
{AST_CAUSE_CHANNEL_UNACCEPTABLE, "Channel unacceptable"},
{AST_CAUSE_CALL_AWARDED_DELIVERED, "Call awarded delivered"},
{AST_CAUSE_PRE_EMPTED, "Preempted"},
{AST_CAUSE_NUMBER_PORTED_NOT_HERE, "Number ported not here"},
{AST_CAUSE_NORMAL_CLEARING, "Normal clearing"},
{AST_CAUSE_USER_BUSY, "User busy"},
{AST_CAUSE_NO_USER_RESPONSE, "No user response"},
{AST_CAUSE_NO_ANSWER, "No answer"},
{AST_CAUSE_SUBSCRIBER_ABSENT, "Subscriber absent"},
{AST_CAUSE_CALL_REJECTED, "Call rejected"},
{AST_CAUSE_NUMBER_CHANGED, "Number changed"},
{AST_CAUSE_REDIRECTED_TO_NEW_DESTINATION,"Redirected to new destination"},
{AST_CAUSE_ANSWERED_ELSEWHERE, "Answered elsewhere"},
{AST_CAUSE_DESTINATION_OUT_OF_ORDER, "Destination out of order"},
{AST_CAUSE_INVALID_NUMBER_FORMAT, "Invalid number format"},
{AST_CAUSE_FACILITY_REJECTED, "Facility rejected"},
@ -412,7 +442,6 @@ static const value_string iax_causecodes[] = {
{AST_CAUSE_SWITCH_CONGESTION, "Switch congestion"},
{AST_CAUSE_ACCESS_INFO_DISCARDED, "Access info discarded"},
{AST_CAUSE_REQUESTED_CHAN_UNAVAIL, "Requested channel unavailable"},
{AST_CAUSE_PRE_EMPTED, "Preempted"},
{AST_CAUSE_FACILITY_NOT_SUBSCRIBED, "Facility not subscribed"},
{AST_CAUSE_OUTGOING_CALL_BARRED, "Outgoing call barred"},
{AST_CAUSE_INCOMING_CALL_BARRED, "Incoming call barred"},
@ -1244,17 +1273,25 @@ static guint32 dissect_ies (tvbuff_t * tvb, guint32 offset,
proto_tree_add_item(codec_tree, hf_iax2_cap_gsm, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN );
proto_tree_add_item(codec_tree, hf_iax2_cap_ulaw, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN );
proto_tree_add_item(codec_tree, hf_iax2_cap_alaw, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN );
proto_tree_add_item(codec_tree, hf_iax2_cap_g726, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN );
proto_tree_add_item(codec_tree, hf_iax2_cap_g726_aal2, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN );
proto_tree_add_item(codec_tree, hf_iax2_cap_adpcm, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN );
proto_tree_add_item(codec_tree, hf_iax2_cap_slinear, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN );
proto_tree_add_item(codec_tree, hf_iax2_cap_lpc10, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN );
proto_tree_add_item(codec_tree, hf_iax2_cap_g729a, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN );
proto_tree_add_item(codec_tree, hf_iax2_cap_speex, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN );
proto_tree_add_item(codec_tree, hf_iax2_cap_ilbc, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN );
proto_tree_add_item(codec_tree, hf_iax2_cap_g726, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN );
proto_tree_add_item(codec_tree, hf_iax2_cap_g722, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN );
proto_tree_add_item(codec_tree, hf_iax2_cap_siren7, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN );
proto_tree_add_item(codec_tree, hf_iax2_cap_siren14, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN );
proto_tree_add_item(codec_tree, hf_iax2_cap_slinear16, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN );
proto_tree_add_item(codec_tree, hf_iax2_cap_jpeg, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN );
proto_tree_add_item(codec_tree, hf_iax2_cap_png, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN );
proto_tree_add_item(codec_tree, hf_iax2_cap_h261, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN );
proto_tree_add_item(codec_tree, hf_iax2_cap_h263, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN );
proto_tree_add_item(codec_tree, hf_iax2_cap_h263_plus, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN );
proto_tree_add_item(codec_tree, hf_iax2_cap_h264, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN );
proto_tree_add_item(codec_tree, hf_iax2_cap_mpeg4, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN );
break;
}
@ -2661,9 +2698,9 @@ proto_register_iax2 (void)
TFS(&tfs_supported_not_supported), AST_FORMAT_ALAW,
NULL, HFILL }},
{&hf_iax2_cap_g726,
{"G.726 compression", "iax2.cap.g726",FT_BOOLEAN, 32,
TFS(&tfs_supported_not_supported), AST_FORMAT_G726,
{&hf_iax2_cap_g726_aal2,
{"G.726 compression (AAL2 packing)", "iax2.cap.g726_aal2",FT_BOOLEAN, 32,
TFS(&tfs_supported_not_supported), AST_FORMAT_G726_AAL2,
NULL, HFILL }},
{&hf_iax2_cap_adpcm,
@ -2696,6 +2733,31 @@ proto_register_iax2 (void)
TFS(&tfs_supported_not_supported), AST_FORMAT_ILBC,
NULL, HFILL }},
{&hf_iax2_cap_g726,
{"ADPCM (G.726, 32kbps, RFC3551 codeword packing)", "iax2.cap.g726", FT_BOOLEAN, 32,
TFS(&tfs_supported_not_supported), AST_FORMAT_G726,
NULL, HFILL }},
{&hf_iax2_cap_g722,
{"G.722 wideband audio", "iax2.cap.g722", FT_BOOLEAN, 32,
TFS(&tfs_supported_not_supported), AST_FORMAT_G722,
NULL, HFILL }},
{&hf_iax2_cap_siren7,
{"G.722.1 (also known as Siren7, 32kbps assumed)", "iax2.cap.siren7", FT_BOOLEAN, 32,
TFS(&tfs_supported_not_supported), AST_FORMAT_SIREN7,
NULL, HFILL }},
{&hf_iax2_cap_siren14,
{"G.722.1 Annex C (also known as Siren14, 48kbps assumed)", "iax2.cap.siren14", FT_BOOLEAN, 32,
TFS(&tfs_supported_not_supported), AST_FORMAT_SIREN14,
NULL, HFILL }},
{&hf_iax2_cap_slinear16,
{"Raw 16-bit Signed Linear (16000 Hz) PCM", "iax2.cap.slinear16", FT_BOOLEAN, 32,
TFS(&tfs_supported_not_supported), AST_FORMAT_SLINEAR16,
NULL, HFILL }},
{&hf_iax2_cap_jpeg,
{"JPEG images", "iax2.cap.jpeg", FT_BOOLEAN, 32,
TFS(&tfs_supported_not_supported), AST_FORMAT_JPEG,
@ -2716,6 +2778,21 @@ proto_register_iax2 (void)
TFS(&tfs_supported_not_supported), AST_FORMAT_H263,
NULL, HFILL }},
{&hf_iax2_cap_h263_plus,
{"H.263+ video", "iax2.cap.h263_plus", FT_BOOLEAN, 32,
TFS(&tfs_supported_not_supported), AST_FORMAT_H263_PLUS,
NULL, HFILL }},
{&hf_iax2_cap_h264,
{"H.264 video", "iax2.cap.h264", FT_BOOLEAN, 32,
TFS(&tfs_supported_not_supported), AST_FORMAT_H264,
NULL, HFILL }},
{&hf_iax2_cap_mpeg4,
{"MPEG4 video", "iax2.cap.mpeg4", FT_BOOLEAN, 32,
TFS(&tfs_supported_not_supported), AST_FORMAT_MP4_VIDEO,
NULL, HFILL }},
/* reassembly stuff */
{&hf_iax2_fragments,
{"IAX2 Fragments", "iax2.fragments", FT_NONE, BASE_NONE, NULL, 0x0,

View File

@ -95,6 +95,9 @@
#define IAX_COMMAND_PROVISION 35 /* Provision device */
#define IAX_COMMAND_FWDOWNL 36 /* Download firmware */
#define IAX_COMMAND_FWDATA 37 /* Firmware Data */
#define IAX_COMMAND_TXMEDIA 38 /* Transfer Media */
#define IAX_COMMAND_RTKEY 39 /* Rotate key */
#define IAX_COMMAND_CALLTOKEN 40 /* Call token */
#define IAX_DEFAULT_REG_EXPIRE 60 /* By default require re-registration once per minute */
@ -154,20 +157,31 @@
#define IAX_IE_RR_DELAY 49 /* Max playout delay for received frames (in ms) u16 */
#define IAX_IE_RR_DROPPED 50 /* Dropped frames (presumably by jitterbuf) u32 */
#define IAX_IE_RR_OOO 51 /* Frames received Out of Order u32 */
#define IAX_IE_VARIABLE 52 /* IAX variable transmission */
#define IAX_IE_OSPTOKEN 53 /* OSP Token */
#define IAX_IE_CALLTOKEN 54 /* Call Token */
#define IAX_IE_CAPABILITY2 55 /* Codec capability */
#define IAX_IE_FORMAT2 56 /* Desired codec capability */
#define IAX_IE_DATAFORMAT 255 /* Data call format -- iax_dataformat_t */
/* hangup cause codes */
#define AST_CAUSE_UNALLOCATED 1
#define AST_CAUSE_NO_ROUTE_TRANSIT_NET 2
#define AST_CAUSE_NO_ROUTE_DESTINATION 3
#define AST_CAUSE_MISDIALLED_TRUNK_PREFIX 5
#define AST_CAUSE_CHANNEL_UNACCEPTABLE 6
#define AST_CAUSE_CALL_AWARDED_DELIVERED 7
#define AST_CAUSE_PRE_EMPTED 8
#define AST_CAUSE_NUMBER_PORTED_NOT_HERE 14
#define AST_CAUSE_NORMAL_CLEARING 16
#define AST_CAUSE_USER_BUSY 17
#define AST_CAUSE_NO_USER_RESPONSE 18
#define AST_CAUSE_NO_ANSWER 19
#define AST_CAUSE_SUBSCRIBER_ABSENT 20
#define AST_CAUSE_CALL_REJECTED 21
#define AST_CAUSE_NUMBER_CHANGED 22
#define AST_CAUSE_REDIRECTED_TO_NEW_DESTINATION 23
#define AST_CAUSE_ANSWERED_ELSEWHERE 26
#define AST_CAUSE_DESTINATION_OUT_OF_ORDER 27
#define AST_CAUSE_INVALID_NUMBER_FORMAT 28
#define AST_CAUSE_FACILITY_REJECTED 29
@ -179,7 +193,6 @@
#define AST_CAUSE_SWITCH_CONGESTION 42
#define AST_CAUSE_ACCESS_INFO_DISCARDED 43
#define AST_CAUSE_REQUESTED_CHAN_UNAVAIL 44
#define AST_CAUSE_PRE_EMPTED 45
#define AST_CAUSE_FACILITY_NOT_SUBSCRIBED 50
#define AST_CAUSE_OUTGOING_CALL_BARRED 52
#define AST_CAUSE_INCOMING_CALL_BARRED 54

View File

@ -39,7 +39,7 @@
/*! Raw A-law data (G.711) */
#define AST_FORMAT_ALAW (1 << 3)
/*! ADPCM (G.726, 32kbps) */
#define AST_FORMAT_G726 (1 << 4)
#define AST_FORMAT_G726_AAL2 (1 << 4)
/*! ADPCM (IMA) */
#define AST_FORMAT_ADPCM (1 << 5)
/*! Raw 16-bit Signed Linear (8000 Hz) PCM */
@ -52,6 +52,16 @@
#define AST_FORMAT_SPEEX (1 << 9)
/*! iLBC Free Compression */
#define AST_FORMAT_ILBC (1 << 10)
/*! ADPCM (G.726, 32kbps, RFC3551 codeword packing) */
#define AST_FORMAT_G726 (1 << 11)
/*! G.722 */
#define AST_FORMAT_G722 (1 << 12)
/*! G.722.1 (also known as Siren7, 32kbps assumed) */
#define AST_FORMAT_SIREN7 (1 << 13)
/*! G.722.1 Annex C (also known as Siren14, 48kbps assumed) */
#define AST_FORMAT_SIREN14 (1 << 14)
/*! Raw 16-bit Signed Linear (16000 Hz) PCM */
#define AST_FORMAT_SLINEAR16 (1 << 15)
/*! Maximum audio format */
#define AST_FORMAT_MAX_AUDIO (1 << 15)
/*! JPEG Images */
@ -62,8 +72,18 @@
#define AST_FORMAT_H261 (1 << 18)
/*! H.263 Video */
#define AST_FORMAT_H263 (1 << 19)
/*! H.263+ Video */
#define AST_FORMAT_H263_PLUS (1 << 20)
/*! H.264 Video */
#define AST_FORMAT_H264 (1 << 21)
/*! MPEG4 Video */
#define AST_FORMAT_MP4_VIDEO (1 << 22)
/*! Max one */
#define AST_FORMAT_MAX_VIDEO (1 << 24)
/*! G.719 (64 kbps assumed) */
#define AST_FORMAT_G719 (1 << 32)
/*! SpeeX Wideband (16kHz) Free Compression */
#define AST_FORMAT_SPEEX16 (1 << 33)
/* data format for IAX_IE_DATAFORMAT ie */