# Asterisk ERROR astobj2.c: user\_data is NULL

**URL:** <https://community.asterisk.org/t/asterisk-error-astobj2-c-user-data-is-null/49125>\
**Category:** Asterisk Support\
**Created:** [June 18, 2015, 1:30pm UTC](https://community.asterisk.org/t/asterisk-error-astobj2-c-user-data-is-null/49125 "2015-06-18T13:30:52Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![mjordan](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/mjordan/32/1509_2.png) [@mjordan](https://community.asterisk.org/u/mjordan)\
**Post date:** [August 10, 2016, 8:51pm UTC](https://community.asterisk.org/t/asterisk-error-astobj2-c-user-data-is-null/49125/9 "2016-08-10T20:51:48Z")

</div>

@david551 is right in that fixing the issue where the forward fails would prevent the error from occurring. That being said, I _think_ the continual errors that occur after failing to forward the Local channel occur are due to an improperly handled off-nominal condition.

I took a look at the log statement just prior to the errors being reported from `astobj2`:

```auto
	if (ast_call(o->chan, stuff, 0)) {
		ast_log(LOG_NOTICE, "Forwarding failed to dial '%s/%s'\n",
			tech, stuff);
		do_hang(o);
		numnochan++;
	}
}

ast_channel_publish_dial(qe->chan, o->chan, stuff, NULL);
ast_channel_publish_dial_forward(qe->chan, original, o->chan, NULL,
	"CANCEL", ast_channel_call_forward(original));

```

You can see that if we log out `Forwarding failed to dial ...`, we immediately hangup the `o` channel:

```auto
static void do_hang(struct callattempt *o)
{
	o->stillgoing = 0;
	ast_hangup(o->chan);
	o->chan = NULL;
}

```

Note that `o->chan` is now `NULL`.

Immediately after this, we attempt to raise events about the now cancelled dial:

```auto
	ast_channel_publish_dial(qe->chan, o->chan, stuff, NULL);
	ast_channel_publish_dial_forward(qe->chan, original, o->chan, NULL,
		"CANCEL", ast_channel_call_forward(original));

```

Those function calls are going to try and interact with `o->chan`, which is now quite `NULL`.

Please file a bug report for this, as there should be enough information in your CLI snippet to figure out what is happening. Attaching a full log, along with your `queues.conf` and `extensions.conf`, however, would be appreciated, as it will make verifying that I’m right a lot easier 🙂

---

_[View the full topic](https://community.asterisk.org/t/asterisk-error-astobj2-c-user-data-is-null/49125)._
