*** res_features.c.orig	Mon Apr 10 19:29:51 2006
--- ../asterisk-1.2.7.1/res/res_features.c	Thu Jun 29 00:45:36 2006
***************
*** 146,151 ****
--- 146,152 ----
  	int parkingtime;
  	int notquiteyet;
  	char peername[1024];
+ 	char peercid[1024];
  	unsigned char moh_trys;
  	struct parkeduser *next;
  };
***************
*** 327,334 ****
  		pu->parkingtime = parkingtime;
  	if (extout)
  		*extout = x;
! 	if (peer) 
  		ast_copy_string(pu->peername, peer->name, sizeof(pu->peername));
  
  	/* Remember what had been dialed, so that if the parking
  	   expires, we try to come back to the same place */
--- 328,340 ----
  		pu->parkingtime = parkingtime;
  	if (extout)
  		*extout = x;
! 	if (peer) {
  		ast_copy_string(pu->peername, peer->name, sizeof(pu->peername));
+ 		if (peer->cid.cid_num)
+ 			ast_copy_string(pu->peercid, peer->cid.cid_num, sizeof(pu->peercid));
+ 		else
+ 			pu->peercid[0] = 0;
+ 	}
  
  	/* Remember what had been dialed, so that if the parking
  	   expires, we try to come back to the same place */
***************
*** 1521,1527 ****
  						}
  					}
  					if (con) {
! 						snprintf(returnexten, sizeof(returnexten), "%s||t", peername);
  						ast_add_extension2(con, 1, peername, 1, NULL, NULL, "Dial", strdup(returnexten), FREE, registrar);
  					}
  					ast_copy_string(pu->chan->exten, peername, sizeof(pu->chan->exten));
--- 1527,1536 ----
  						}
  					}
  					if (con) {
! 						if (pu->peercid[0])
! 							snprintf(returnexten, sizeof(returnexten), "%s/%s||t", peername, pu->peercid);
! 						else
! 							snprintf(returnexten, sizeof(returnexten), "%s||t", peername);
  						ast_add_extension2(con, 1, peername, 1, NULL, NULL, "Dial", strdup(returnexten), FREE, registrar);
  					}
  					ast_copy_string(pu->chan->exten, peername, sizeof(pu->chan->exten));

