ERROR[10869][C-00000000]: chan_sip.c:14002 initreqprep: The To header was truncated in call .This call setup will fail

ERROR[10869]: chan_sip.c:14002 initreqprep: The To header was truncated in call ‘38ac3e3a233667f3a37500a6f3c7d@192.x.x.x:xxxx’. This call setup will fail.

what is the meaning of this error?

ERROR[10869][C-00000000]: chan_sip.c:14002 initreqprep: The To header was truncated in call ‘6bc21e2b47af02f93e7f06f77a33a@192.x.x.x:xxxx’. This call setup will fail.
failed to extend from 512 to 681
failed to extend from 512 to 681
failed to extend from 512 to 681
failed to extend from 256 to 656

I can’t find this anywhere…My users are registered but after registering my users i face this error.
Any help will be appreciated. Thnx

Don’t use such long a destination URI. You will get this error if the To header would exceed 255 bytes

It also looks like you have run out of memory, which might indicate a bug (a memory leak) but one would need to know the exact version before even considering whether that was worth pursuing.

	char to[256];
...
 	if (!ast_strlen_zero(p->todnid)) {
 		/*! \todo Need to add back the VXML URL here at some point, possibly use build_string for all this junk */
 		if (!strchr(p->todnid, '@')) {
 			/* We have no domain in the dnid */
			ret = snprintf(to, sizeof(to), "<sip:%s@%s>%s%s", p->todnid, p->tohost, ast_strlen_zero(p->theirtag) ? "" : ";tag=", p->theirtag);
 		} else {
			ret = snprintf(to, sizeof(to), "<sip:%s>%s%s", p->todnid, ast_strlen_zero(p->theirtag) ? "" : ";tag=", p->theirtag);
 		}
 	} else {
 		if (sipmethod == SIP_NOTIFY && !ast_strlen_zero(p->theirtag)) {
 			/* If this is a NOTIFY, use the From: tag in the subscribe (RFC 3265) */
			ret = snprintf(to, sizeof(to), "<%s%s>;tag=%s", (strncasecmp(p->uri, "sip:", 4) ? "sip:" : ""), p->uri, p->theirtag);
 		} else if (p->options && p->options->vxml_url) {
 			/* If there is a VXML URL append it to the SIP URL */
			ret = snprintf(to, sizeof(to), "<%s>;%s", p->uri, p->options->vxml_url);
 		} else {
			ret = snprintf(to, sizeof(to), "<%s>", p->uri);
		}
 	}
	if (ret < 0 || ret >= sizeof(to)) { /* a return value of size or more means that the output was truncated */
		/* We don't have an escape path from here... */
		ast_log(LOG_ERROR, "The To header was truncated in call '%s'. This call setup will fail.\n", p->callid);
	}
1 Like

So how can i fix this problem…???
i’m using “asterisk-11.20.0”…

As I said, use a shorter destination address. Exceeding 255 characters should be quite difficult, but without seeing what parameters have been passed to Dial (or, although you don’t mention a redirection, were included in the incoming Contact header on a 302 redirection), that is the best advice that we give you.

(You could, always, recompile with a larger array, but, if you are breaking the current limit, you are doing something strange.)

1 Like