+ /* process debug */
+ if (options.deb)
+ debug(NULL, 0, "trace", string);
+ /* process log */
+ if (options.log[0])
+ {
+ fp = fopen(options.log, "a");
+ if (fp)
+ {
+ fwrite(string, strlen(string), 1, fp);
+ fclose(fp);
+ }
+ }
+ }
+ }
+
+ /* process admin */
+ admin = admin_first;
+ while(admin)
+ {
+ if (admin->trace.detail)
+ {
+ string = print_trace(admin->trace.detail, admin->trace.port, admin->trace.interface, admin->trace.caller, admin->trace.dialing, admin->trace.category);
+ if (string)
+ {
+ /* seek to end of response list */
+ response = admin->response;
+ responsep = &admin->response;
+ while(response)
+ {
+ responsep = &response->next;
+ response = response->next;
+ }
+
+ /* create state response */
+ response = (struct admin_queue *)MALLOC(sizeof(struct admin_queue)+sizeof(admin_message));
+ memuse++;
+ response->num = 1;
+ /* message */
+ response->am[0].message = ADMIN_TRACE_RESPONSE;
+ SCPY(response->am[0].u.trace_rsp.text, string);
+
+ /* attach to response chain */
+ *responsep = response;
+ responsep = &response->next;
+ }