*** ../orig/asterisk/channels/chan_iax2.c 2004-07-09 09:37:44.000000000 +0200 --- channels/chan_iax2.c 2004-07-16 13:41:23.000000000 +0200 *************** struct chan_iax2_pvt { *** 472,473 **** --- 472,475 ---- int notransfer; /* do we want native bridging */ + int restrictcid; + int callingpres; }; *************** static int iax2_call(struct ast_channel *** 2244,2245 **** --- 2246,2249 ---- iax_ie_append_int(&ied, IAX_IE_DATETIME, iax2_datetime()); + if (c->restrictcid) iax_ie_append(&ied, IAX_IE_RESTRICTCID); + if (c->callingpres) iax_ie_append_int(&ied, IAX_IE_CALLINGPRES, c->callingpres); /* Transmit the string in a "NEW" request */ *************** static struct ast_channel *ast_iax2_new( *** 2610,2611 **** --- 2614,2617 ---- tmp->pvt->fixup = iax2_fixup; + tmp->restrictcid = i->restrictcid; + tmp->callingpres = i->callingpres; i->owner = tmp; *** ../orig/asterisk/channels/iax2.h 2004-05-25 06:34:43.000000000 +0200 --- channels/iax2.h 2004-07-15 20:41:27.000000000 +0200 *************** *** 115,116 **** --- 115,119 ---- + #define IAX_IE_RESTRICTCID 100 /* restrict Caller*ID flag */ + #define IAX_IE_CALLINGPRES 102 /* Calling-Presentation Code */ + #define IAX_AUTH_PLAINTEXT (1 << 0) *** ../orig/asterisk/channels/iax2-parser.c 2004-07-07 11:34:01.000000000 +0200 --- channels/iax2-parser.c 2004-07-15 20:40:20.000000000 +0200 *************** static struct iax2_ie { *** 160,161 **** --- 160,163 ---- { IAX_IE_PROVVER, "PROVISIONG VER", dump_int }, + { IAX_IE_RESTRICTCID, "RESTRICT CID" }, + { IAX_IE_CALLINGPRES, "CALLING PRES", dump_byte }, }; *************** int iax_parse_ies(struct iax_ies *ies, u *** 660,661 **** --- 662,674 ---- break; + case IAX_IE_RESTRICTCID: + ies->restrictcid = 1; + break; + + case IAX_IE_CALLINGPRES: + if (len != (int)sizeof(unsigned char)) { + snprintf(tmp, (int)sizeof(tmp), "Expected provisioning version to be %d byte long but was %d\n", (int)sizeof(unsigned char), len); + } else { + ies->callingpres =(int)(*(char*)data+2); + } + break; default: *** ../orig/asterisk/channels/iax2-parser.h 2004-07-07 11:34:01.000000000 +0200 --- channels/iax2-parser.h 2004-07-15 20:33:39.000000000 +0200 *************** struct iax_ies { *** 54,55 **** --- 54,57 ---- int provverpres; + int restrictcid; + int callingpres; };