sipops.c
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "../../mod_fix.h"
00027 #include "../../cmpapi.h"
00028
00029 #include "sipops.h"
00030
00031 int w_cmp_uri(struct sip_msg *msg, char *uri1, char *uri2)
00032 {
00033 str s1;
00034 str s2;
00035 int ret;
00036
00037 if(fixup_get_svalue(msg, (gparam_p)uri1, &s1)!=0)
00038 {
00039 LM_ERR("cannot get first parameter\n");
00040 return -8;
00041 }
00042 if(fixup_get_svalue(msg, (gparam_p)uri2, &s2)!=0)
00043 {
00044 LM_ERR("cannot get second parameter\n");
00045 return -8;
00046 }
00047 ret = cmp_uri_str(&s1, &s2);
00048 if(ret==0)
00049 return 1;
00050 if(ret>0)
00051 return -1;
00052 return -2;
00053 }
00054
00055 int w_cmp_aor(struct sip_msg *msg, char *uri1, char *uri2)
00056 {
00057 str s1;
00058 str s2;
00059 int ret;
00060
00061 if(fixup_get_svalue(msg, (gparam_p)uri1, &s1)!=0)
00062 {
00063 LM_ERR("cannot get first parameter\n");
00064 return -8;
00065 }
00066 if(fixup_get_svalue(msg, (gparam_p)uri2, &s2)!=0)
00067 {
00068 LM_ERR("cannot get second parameter\n");
00069 return -8;
00070 }
00071 ret = cmp_aor_str(&s1, &s2);
00072 if(ret==0)
00073 return 1;
00074 if(ret>0)
00075 return -1;
00076 return -2;
00077 }
00078