ast_channel_unlock(pkt->owner->owner);
} else {
/* If no channel owner, destroy now */
- ast_set_flag(&pkt->owner->flags[0], SIP_NEEDDESTROY);
+
+ /* Let the peerpoke system expire packets when the timer expires for poke_noanswer */
+ if (pkt->method != SIP_OPTIONS)
+ ast_set_flag(&pkt->owner->flags[0], SIP_NEEDDESTROY);
}
}
/* In any case, go ahead and remove the packet */
peer->call = NULL;
return 0;
}
- if (peer->call > 0) {
+ if (peer->call) {
if (sipdebug)
ast_log(LOG_NOTICE, "Still have a QUALIFY dialog active, deleting\n");
sip_destroy(peer->call);