00001
00002
00003
00004 #include <stdio.h>
00005 #include <stdlib.h>
00006 #include <string.h>
00007 #include <stdarg.h>
00008 #include "../str.h"
00009
00010
00011 #define EXTRA_DEBUG
00012 #include "../parser/parse_uri.c"
00013 #include "../dprint.c"
00014
00015
00016 int ser_error=0;
00017 int log_stderr=1;
00018 int process_no=0;
00019 struct process_table* pt=0;
00020 int phone2tel=1;
00021
00022 int my_pid() {return 0; };
00023
00024 struct cfg_group_core default_core_cfg = {
00025 L_DBG,
00026 LOG_DAEMON,
00027 #ifdef USE_DST_BLACKLIST
00028
00029 0,
00030 DEFAULT_BLST_TIMEOUT,
00031 DEFAULT_BLST_MAX_MEM,
00032 #endif
00033
00034 #ifdef USE_IPV6
00035 1,
00036 #else
00037 0,
00038 #endif
00039 0,
00040 30,
00041 20,
00042 10,
00043 20,
00044 -1,
00045 -1,
00046 -1,
00047 1,
00048 1,
00049 0,
00050
00051 #ifdef USE_DNS_CACHE
00052 1,
00053 0,
00054 0,
00055 0,
00056 DEFAULT_DNS_NEG_CACHE_TTL,
00057 DEFAULT_DNS_CACHE_MIN_TTL,
00058 DEFAULT_DNS_CACHE_MAX_TTL,
00059 DEFAULT_DNS_MAX_MEM,
00060 0,
00061 #endif
00062 #ifdef PKG_MALLOC
00063 0,
00064 #endif
00065 #ifdef SHM_MEM
00066 0,
00067 #endif
00068 };
00069
00070 void *core_cfg = &default_core_cfg;
00071
00072 void dprint(char * format, ...)
00073 {
00074 va_list ap;
00075
00076 fprintf(stderr, "%2d(%d) ", process_no, my_pid());
00077 va_start(ap, format);
00078 vfprintf(stderr,format,ap);
00079 fflush(stderr);
00080 va_end(ap);
00081 }
00082
00083
00084
00085 int main (int argc, char** argv)
00086 {
00087
00088 int r;
00089 struct sip_uri uri;
00090
00091 if (argc<2){
00092 printf("usage: %s uri [, uri...]\n", argv[0]);
00093 exit(1);
00094 }
00095
00096 for (r=1; r<argc; r++){
00097 if (parse_uri(argv[r], strlen(argv[r]), &uri)<0){
00098 printf("error: parsing %s\n", argv[r]);
00099 }
00100 }
00101 return 0;
00102 }