rem: int **pcbp = NULL, beg, end, crt;
add: int **pcbp = NULL;
context: int xj_send_sip_msg(str *to, str *from, str *contact, str *msg, int *cbp){	str  msg_type = { "MESSAGE", 7};	char buf[512];	str  tfrom;	str  str_hdr;	int **pcbp = NULL, beg, end, crt;	char buf1[1024];	if( !to || !to->s || to->len <= 0 			|| !from || !from->s || from->len <= 0 			|| !msg || !msg->s || msg->len <= 0			|| (cbp && *cbp!=0) )		return -1;	// from correction	beg = crt = 0;	end = -1;	while(crt < from->len && from->s[crt]!='@')	{		if(from->s[crt]=='%')		{			beg = end + 1;			end = crt;		}		crt++;	}	if(end > 0)		sprintf(buf, "\"%.*s\" <sip:%.*s>", end-beg, from->s+beg,					from->len, from->s);	else		sprintf(buf, "<sip:%.*s>", from->len, from->s);			tfrom.len = strlen(buf);	tfrom.s = buf;		// building Contact and Content-Type	strcpy(buf1,"Content-Type: text/plain"CRLF"Contact: ");	str_hdr.len = 24 + CRLF_LEN + 9;	if(contact != NULL && contact->len > 2) 	{		strncat(buf1,contact->s,contact->len);		str_hdr.len += contact->len;	}	else 	{		strncat(buf1,tfrom.s,tfrom.len);		str_hdr.len += tfrom.len;	}	strcat(buf1, CRLF);	str_hdr.len += CRLF_LEN;	str_hdr.s = buf1;	if(cbp)	{		DBG("XJAB:xj_send_sip_msg: uac callback parameter [%p==%d]\n",cbp,*cbp);		if((pcbp = (int**)shm_malloc(sizeof(int*))) == NULL)			return -1;		*pcbp = cbp;		return tmb.t_uac( &msg_type, to, &str_hdr , msg, &tfrom,					xj_tuac_callback, (void*)pcbp, 0);	}	else		return tmb.t_uac( &msg_type, to, &str_hdr , msg, &tfrom, 0 , 0, 0);}