+static void r_options(struct sip_inst *inst, int status, char const *phrase, nua_t *nua, nua_magic_t *magic, nua_handle_t *nh, nua_hmagic_t *hmagic, sip_t const *sip, tagi_t tags[])
+{
+ PDEBUG(DEBUG_SIP, "options result %d received\n", status);
+
+// if (status >= 200 && status <= 299) {
+ PDEBUG(DEBUG_SIP, "options ok, scheduling option timer with %d seconds\n", inst->options_interval);
+ /* restart option timer */
+ schedule_timer(&inst->register_option_timer, inst->options_interval, 0);
+ return;
+/// }
+
+ PDEBUG(DEBUG_SIP, "Register options failed, starting register timer\n");
+ inst->register_state = REGISTER_STATE_FAILED;
+ PDEBUG(DEBUG_SIP, "nua_handle_destroy %x\n", nh);
+ nua_handle_destroy(nh);
+ inst->register_handle = NULL;
+ /* if failed, start register interval timer with REGISTER_RETRY_TIMER */
+ schedule_timer(&inst->register_retry_timer, REGISTER_RETRY_TIMER);
+}
+