Index: channels/chan_iax2.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v retrieving revision 1.131 diff -p -2 -r1.131 chan_iax2.c *** channels/chan_iax2.c 26 Apr 2004 11:38:21 -0000 1.131 --- channels/chan_iax2.c 27 Apr 2004 14:06:02 -0000 *************** struct chan_iax2_pvt { *** 433,436 **** --- 433,437 ---- struct iax2_dpcache *dpentries; int notransfer; /* do we want native bridging */ + int restrictcid; }; *************** static int iax2_call(struct ast_channel *** 2163,2166 **** --- 2164,2171 ---- iaxs[callno]->initid = ast_sched_add(sched, iaxs[callno]->maxtime * 2, auto_congest, CALLNO_TO_PTR(callno)); } + + if (c->restrictcid || c->callingpres >= 0x20) { + iax_ie_append(&ied, IAX_IE_RESTRICTCID); + } send_command(iaxs[callno], AST_FRAME_IAX, IAX_COMMAND_NEW, 0, ied.buf, ied.pos, -1); *************** static struct ast_channel *ast_iax2_new( *** 2511,2514 **** --- 2516,2520 ---- strncpy(tmp->context, i->context, sizeof(tmp->context)-1); strncpy(tmp->exten, i->exten, sizeof(tmp->exten)-1); + tmp->restrictcid = i->restrictcid; tmp->adsicpe = i->peeradsicpe; tmp->pvt->fixup = iax2_fixup; *************** static int check_access(int callno, stru *** 3231,3234 **** --- 3237,3242 ---- iaxs[callno]->peercapability = ies->capability; } + if (ies->restrictcid) + iaxs[callno]->restrictcid = ies->restrictcid; if (ies->version) version = ies->version; Index: channels/iax2-parser.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/iax2-parser.c,v retrieving revision 1.19 diff -p -2 -r1.19 iax2-parser.c *** channels/iax2-parser.c 22 Apr 2004 19:16:52 -0000 1.19 --- channels/iax2-parser.c 27 Apr 2004 14:06:02 -0000 *************** int iax_parse_ies(struct iax_ies *ies, u *** 544,547 **** --- 544,551 ---- ies->fwdatalen = len; break; + + case IAX_IE_RESTRICTCID: + ies->restrictcid = 1; + break; default: snprintf(tmp, sizeof(tmp), "Ignoring unknown information element '%s' (%d) of length %d\n", iax_ie2str(ie), ie, len); Index: channels/iax2-parser.h =================================================================== RCS file: /usr/cvsroot/asterisk/channels/iax2-parser.h,v retrieving revision 1.7 diff -p -2 -r1.7 iax2-parser.h *** channels/iax2-parser.h 24 Feb 2004 21:27:16 -0000 1.7 --- channels/iax2-parser.h 27 Apr 2004 14:06:02 -0000 *************** struct iax_ies { *** 51,54 **** --- 51,55 ---- unsigned char *fwdata; unsigned char fwdatalen; + int restrictcid; }; Index: channels/iax2.h =================================================================== RCS file: /usr/cvsroot/asterisk/channels/iax2.h,v retrieving revision 1.14 diff -p -2 -r1.14 iax2.h *** channels/iax2.h 24 Feb 2004 21:27:16 -0000 1.14 --- channels/iax2.h 27 Apr 2004 14:06:02 -0000 *************** *** 112,115 **** --- 112,116 ---- #define IAX_IE_FWBLOCKDESC 35 /* Firmware block description -- u32 */ #define IAX_IE_FWBLOCKDATA 36 /* Firmware block of data -- raw */ + #define IAX_IE_RESTRICTCID 100 /* restrict caller*id flag */ #define IAX_AUTH_PLAINTEXT (1 << 0)