hey all
after making call forward feature using avpops module and its exported functions avp_db_load and avp_pushto
i have a problem :
assuming all calls to extension 12001 will be forwarded to extension 12008, in opensers's database i have added the following :
username=12001
domain =mydomain
attribute = callfwd
value = sip:12008@mydomain
type = 0
untill that every thing was fine and all calls comes to 12001 forward to 12008 without any problem , the problem comes from when i am using 12008 to call 12001 it calls itself ( mean 12008)
so anyone can tell me what i have missed ?
i have configured my openser.cfg like this
in loaded modules section added
loadmodules "avpops.so"
in module parameter section added :
modparam("avpops", "avp_url", "mysql://openser:openserrw@localhost/openser")
modparam("avpops", "avp_table", "usr_preferences")
in Invite message handler added :
if(avp_db_load("$ru/username","$avp(s:callfwd)")) {
avp_pushto("$ru", "$avp(s:callfwd)");
route(1);
exit;
}
any suggestions ?
Hello,
On 08/30/08 16:53, muhammad akl wrote:
hey all
after making call forward feature using avpops module and its exported functions avp_db_load and avp_pushto
i have a problem :
assuming all calls to extension 12001 will be forwarded to extension 12008, in opensers's database i have added the following :
username=12001
domain =mydomain
attribute = callfwd
value = sip:12008@mydomain
type = 0
untill that every thing was fine and all calls comes to 12001 forward to 12008 without any problem , the problem comes from when i am using 12008 to call 12001 it calls itself ( mean 12008)
just check if the origin is the same as destination and reply something like not found or so.
Cheers, Daniel
so anyone can tell me what i have missed ?
i have configured my openser.cfg like this
in loaded modules section added
loadmodules "avpops.so"
in module parameter section added :
modparam("avpops", "avp_url", "mysql://openser:openserrw@localhost/openser") modparam("avpops", "avp_table", "usr_preferences")
in Invite message handler added :
if(avp_db_load("$ru/username","$avp(s:callfwd)")) { avp_pushto("$ru", "$avp(s:callfwd)"); route(1); exit; }
any suggestions ?
Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
thx miconda for you reply but as am still new to these stuff could you explain more and how to do this check ?
here is my configuration file :
El Wednesday 03 September 2008 19:34:40 muhammad akl escribió:
thx miconda for you reply but as am still new to these stuff could you explain more and how to do this check ?
Showing all the config and asking "please fix it for me" is not the best way to get help.
You already have the solution:
just check if the origin is the same as destination and reply something like not found or so.
Well:
1) ¿What is the origin? the "From" URI.
2) ¿What is the destination? the RURI (no the "To" URI).
3) How to do a comparision? Using if A "==" B
4) How to reply something? Commonly using "sl" module.
All is here: http://www.kamailio.org/dokuwiki/doku.php/pseudovariables:1.4.x http://www.kamailio.org/docs/modules/1.4.x/sl.html
btw thanks inaki for your explanation
but to make things much clear putting my configuration file doesn't mean to have a spoon-feed solution , i mentioned that am still new and before poting my question i searched alot and read much more about avp module either on kamailio site or voice-system tutorial but as am still in my first steps got some diffculty to understand these issues
and finally i put my question for all people not for particular person and who could help me i'd appreciate that
El Thursday 04 September 2008 11:32:03 muhammad akl escribió:
btw thanks inaki for your explanation
but to make things much clear putting my configuration file doesn't mean to have a spoon-feed solution , i mentioned that am still new and before poting my question i searched alot and read much more about avp module either on kamailio site or voice-system tutorial but as am still in my first steps got some diffculty to understand these issues
and finally i put my question for all people not for particular person and who could help me i'd appreciate that
Ok, did you try the 4 steps I suggested in my mail? any doubt in any of them?
Regards.
i'm trying to understand the steps inaki as much as i can here is what i got :
what i understood to make such blind call forward feature in firstly i should use the function avp_db_load and load in the string AVP callfwd the value of the attribute callfwd which matched the requested user (i already know that $ru mean the sip request uri )
now after loading the value i should push it to the new R-uri which has the "value field " in the usr_preferences column using avp_pushto("$ru","$avp(s:callfwd)")
so i want to ask now what is the equivalent pseudo-variable to the new R-uri ? i want to make somthing like that
if(avp_check("$avp(s:callfwd)", "eq/$ru/i")) avp_delete("$avp(s:callfwd)");
btw i dont know what /i mean in the op_name but i saw some examples put it
i tried with that sytanx but it didn;t work , as what i understood also that the attribute value is being loaded in ram so what i want to achieve is to check if the attribute callfwd are found in ram so delete it ,else establish the call in normal way
i hope my words are clear and Understandable
regards
El Viernes, 5 de Septiembre de 2008, muhammad akl escribió:
what i understood to make such blind call forward feature in firstly i should use the function avp_db_load and load in the string AVP callfwd the value of the attribute callfwd which matched the requested user (i already know that $ru mean the sip request uri )
now after loading the value i should push it to the new R-uri which has the "value field " in the usr_preferences column using avp_pushto("$ru","$avp(s:callfwd)")
You can do the same easier by doing:
$ru = $avp(s:callfwd)
so i want to ask now what is the equivalent pseudo-variable to the new R-uri ?
This question makes no sense. The new RURI is just $ru, that has been replaced in the above operation.
i want to make somthing like that
if(avp_check("$avp(s:callfwd)", "eq/$ru/i")) avp_delete("$avp(s:callfwd)");
btw i dont know what /i mean in the op_name but i saw some examples put it
i = case insensitive
i tried with that sytanx but it didn;t work , as what i understood also that the attribute value is being loaded in ram so what i want to achieve is to check if the attribute callfwd are found in ram so delete it ,else establish the call in normal way
i hope my words are clear and Understandable
Well, I'd suggest you using "xlog" to debug the varialbes and values you are using, before and after any of your operations. Add some "xlog" and paste the result.