[Asterisk-cvs] asterisk/channels chan_sip.c,1.171,1.172 chan_zap.c,1.95,1.96

martinp at lists.digium.com martinp at lists.digium.com
Thu Sep 4 22:59:48 CDT 2003


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv20530/channels

Modified Files:
	chan_sip.c chan_zap.c 
Log Message:
Add restrictcid=[yes|no] for chan_zap and chan_sip. You can specify if the sip/zap users will have the callerid transmitted as ANI or CALLERID.


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.171
retrieving revision 1.172
diff -C2 -d -r1.171 -r1.172
*** chan_sip.c	4 Sep 2003 04:40:37 -0000	1.171
--- chan_sip.c	5 Sep 2003 04:00:57 -0000	1.172
***************
*** 63,66 ****
--- 63,68 ----
  #define EXPIRY_GUARD_SECS	15
  
+ #define CALLERID_UNKNOWN	"Unknown"
+ 
  #define SIP_DTMF_RFC2833	(1 << 0)
  #define SIP_DTMF_INBAND		(1 << 1)
***************
*** 218,221 ****
--- 220,224 ----
  	char peersecret[81];
  	char callerid[256];					/* Caller*ID */
+ 	int restrictcid;			/* hide presentation from remote user */
  	char via[256];
  	char accountcode[20];				/* Account code */
***************
*** 277,280 ****
--- 280,284 ----
  	int inUse;
  	int incominglimit;
+ 	int restrictcid;
  	struct ast_ha *ha;
  	struct sip_user *next;
***************
*** 847,850 ****
--- 851,855 ----
  	res = 0;
  	p->outgoing = 1;
+ 	p->restrictcid = ast->restrictcid;
  	transmit_invite(p, "INVITE", 1, NULL, vxml_url,distinctive_ring, 1);
  	if (p->maxtime) {
***************
*** 1241,1244 ****
--- 1246,1250 ----
  		tmp->callgroup = i->callgroup;
  		tmp->pickupgroup = i->pickupgroup;
+ 		tmp->restrictcid = i->restrictcid;
                  if (strlen(i->accountcode))
                          strncpy(tmp->accountcode, i->accountcode, sizeof(tmp->accountcode)-1);
***************
*** 2608,2611 ****
--- 2614,2620 ----
  				l = callerid;
  	}
+ 	/* if user want's his callerid restricted */
+ 	if (p->restrictcid)
+ 		l = CALLERID_UNKNOWN;
  	if (!n || !strlen(n))
  		n = l;
***************
*** 3801,3804 ****
--- 3810,3814 ----
  				p->callgroup = user->callgroup;
  				p->pickupgroup = user->pickupgroup;
+ 				p->restrictcid = user->restrictcid;
  				if (user->dtmfmode) {
  					p->dtmfmode = user->dtmfmode;
***************
*** 5542,5545 ****
--- 5552,5557 ----
  			} else if (!strcasecmp(v->name, "insecure")) {
  				user->insecure = ast_true(v->value);
+ 			} else if (!strcasecmp(v->name, "restrictcid")) {
+ 				user->restrictcid = ast_true(v->value);
  			} //else if (strcasecmp(v->name,"type"))
  			//	ast_log(LOG_WARNING, "Ignoring %s\n", v->name);

Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.95
retrieving revision 1.96
diff -C2 -d -r1.95 -r1.96
*** chan_zap.c	4 Sep 2003 18:55:35 -0000	1.95
--- chan_zap.c	5 Sep 2003 04:00:57 -0000	1.96
***************
*** 154,157 ****
--- 154,159 ----
  static int hidecallerid = 0;
  
+ static int restrictcid = 0;
+ 
  static int callreturn = 0;
  
***************
*** 383,386 ****
--- 385,389 ----
  	int callreturn;
  	int permhidecallerid;		/* Whether to hide our outgoing caller ID or not */
+ 	int restrictcid;
  	int callwaitingrepeat;		/* How many samples to wait before repeating call waiting */
  	int cidcwexpire;			/* When to expire our muting for CID/CW */
***************
*** 1477,1481 ****
  		if (pri_call(p->pri->pri, p->call, p->digital ? PRI_TRANS_CAP_DIGITAL : PRI_TRANS_CAP_SPEECH, 
  			p->prioffset, p->pri->nodetype == PRI_NETWORK ? 0 : 1, 1, l, p->pri->dialplan - 1, n,
! 			l ? PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN : PRES_NUMBER_NOT_AVAILABLE,
  			c + p->stripmsd, p->pri->dialplan - 1, 
  			((p->law == ZT_LAW_ALAW) ? PRI_LAYER_1_ALAW : PRI_LAYER_1_ULAW))) {
--- 1480,1484 ----
  		if (pri_call(p->pri->pri, p->call, p->digital ? PRI_TRANS_CAP_DIGITAL : PRI_TRANS_CAP_SPEECH, 
  			p->prioffset, p->pri->nodetype == PRI_NETWORK ? 0 : 1, 1, l, p->pri->dialplan - 1, n,
! 			l ? (ast->restrictcid ? PRES_PROHIB_USER_NUMBER_PASSED_SCREEN : PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN) : PRES_NUMBER_NOT_AVAILABLE,
  			c + p->stripmsd, p->pri->dialplan - 1, 
  			((p->law == ZT_LAW_ALAW) ? PRI_LAYER_1_ALAW : PRI_LAYER_1_ULAW))) {
***************
*** 3739,3742 ****
--- 3742,3746 ----
  			tmp->ani = strdup(i->callerid);
  		}
+ 		tmp->restrictcid = i->restrictcid;
  #ifdef ZAPATA_PRI
  		/* Assume calls are not idle calls unless we're told differently */
***************
*** 5099,5102 ****
--- 5103,5107 ----
  		tmp->stripmsd = stripmsd;
  		tmp->use_callerid = use_callerid;
+ 		tmp->restrictcid = restrictcid;
  		strncpy(tmp->accountcode, accountcode, sizeof(tmp->accountcode)-1);
  		tmp->amaflags = amaflags;
***************
*** 6714,6717 ****
--- 6719,6724 ----
  			else
  				strncpy(callerid, v->value, sizeof(callerid)-1);
+ 		} else if (!strcasecmp(v->name, "restrictcid")) {
+ 			restrictcid = ast_true(v->value);
  		} else if (!strcasecmp(v->name, "accountcode")) {
  			strncpy(accountcode, v->value, sizeof(accountcode)-1);




More information about the svn-commits mailing list