コード例 #1
0
ファイル: tm.c プロジェクト: Gaoithe/openimscore_ims
/* wrapper function needed after changes in w_t_reply */
int w_t_reply_wrp(struct sip_msg *m, unsigned int code, char *txt)
{
	fparam_t c;
	fparam_t r;
	
	c.type = FPARAM_INT;
	c.orig = NULL; /* ? */
	c.v.i = code;
	
	r.type = FPARAM_STRING;
	r.orig = NULL; /* ? */
	r.v.asciiz = txt;

	return w_t_reply(m, (char *)&c, (char*)&r);
}
コード例 #2
0
ファイル: tm.c プロジェクト: Deni90/opensips
inline static int w_pv_t_reply(struct sip_msg *msg, char* code, char* text)
{
	str code_s;
	unsigned int code_i;

	if(((pv_elem_p)code)->spec.getf!=NULL) {
		if(pv_printf_s(msg, (pv_elem_p)code, &code_s)!=0)
			return -1;
		if(str2int(&code_s, &code_i)!=0 || code_i<100 || code_i>699)
			return -1;
	} else {
		code_i = ((pv_elem_p)code)->spec.pvp.pvn.u.isname.name.n;
	}

	if(((pv_elem_p)text)->spec.getf!=NULL) {
		if(pv_printf_s(msg, (pv_elem_p)text, &code_s)!=0 || code_s.len <=0)
			return -1;
	} else {
		code_s = ((pv_elem_p)text)->text;
	}

	return w_t_reply(msg, (char*)(unsigned long)code_i, (char*)&code_s);
}