Hello Ravi ,<br><br>i'm using radiator but not freeradius, actually my users are stored into an user flat file.<br><br>here you can have an example of user :<br><br><a href="mailto:0123452000@sip.720.fr">0123452000@sip.720.fr</a> User-Password = "2000"<br>
User-Name = "0123452000",<br> Sip-User-ID = "0123452000",<br> Sip-User-Realm = "<a href="http://sip.720.fr">sip.720.fr</a>",<br>
Sip-URI-User = "<a href="mailto:0123452000@sip.720.fr">0123452000@sip.720.fr</a>",<br> Sip-Rpid = "0123452000",<br> Sip-Group = "full",<br>
Sip-AVP = "asserted_id:0123452000"<br><br>and concerning services attributes, you have to declare them like this :<br><br>=> in kamailio.cfg (or openser.cfg, ser.cfg, opensips.cfg) :<br>
<br>modparam("acc|auth_radius", "service_type", 15)<br>modparam("avp_radius", "caller_service_type", 30)<br>modparam("avp_radius", "callee_service_type", 31)<br>
<br>if you're using peering module :<br>modparam("peering", "verify_destination_service_type", 21)<br>modparam("peering", "verify_source_service_type", 22)<br><br>=> in the radius dictionary (for radiusclient-ng, and the dictionary used by your radius server)<br>
<br>### Service-Type Values ###<br>VALUE Service-Type Call-Check 10 # RFC2865, uri_radius<br>VALUE Service-Type Group-Check 12 # Proprietary, group_radius<br>VALUE Service-Type Sip-Session 15 # Schulzrinne, acc/auth radius<br>
VALUE Service-Type Sip-Verify-Destination 20 # Proprietary, peering<br>VALUE Service-Type Sip-Verify-Source 21 # Proprietary, peering<br>VALUE Service-Type Sip-Caller-AVPs 30 # Proprietary, avp_radius<br>
VALUE Service-Type Sip-Callee-AVPs 31 # Proprietary, avp_radius<br><br>=> then, in your radius server config, you must add one handler per service-type<br><br>example for radiator, just a base config based on flat user file:<br>
<br><Handler Service-Type=Sip-Verify-Destination><br> RewriteUsername s/^sip:(.*)/$1/<br> <AuthBy FILE><br> NoCheckPassword<br> Filename %D/user.peer<br> NoDefault<br>
</AuthBy><br></Handler><br><br><br>I can't help you actually for a radius DB, 'cause i'm working on it.<br><br>cheers,<br><br>.Sam.<br><br>-- <br>Samuel MULLER<br>Ingénieur Reseaux & Telecom<br>
720 DEGRES<br>+33 (0)663 128 505<br><a href="mailto:sml@720.fr">sml@720.fr</a><br><br><br><br><div class="gmail_quote">On Wed, Nov 5, 2008 at 1:28 PM, LetMeKnow <span dir="ltr"><<a href="mailto:sunkara.raviprakash.feb14@gmail.com">sunkara.raviprakash.feb14@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>Hello Samuel, </div><div>Can you check the radius services attributes </div><div><br></div>
<div>is you using users.conf or radius databases. </div><div><br></div><div>can see this url <span style="font-size: 12px; white-space: pre;"><a href="http://www.kamailio.org/docs/openser-radius-1.0.x.html#freeradius_users" target="_blank">http://www.kamailio.org/docs/openser-radius-1.0.x.html#freeradius_users</a></span></div>
<div><br></div><div><br></div><br clear="all">Thanks &Regards<br>Ravi Prakash Sunkara<br>VoIP Architect & JAVA-SIP Developer<br>+91-9999882776<br>
<br><br><div class="gmail_quote">2008/11/5 Samuel Muller <span dir="ltr"><<a href="mailto:sml@720.fr" target="_blank">sml@720.fr</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">
Hello all,<br><br>I've a little question :<br>I got a username in an AVP by avp_load_radius, and I would rewrite the uri with it.<br><br>The objectives is to replace the r-uri by an ipbx uri, then forward
the call to it by a new branch (to not loose the phone number
requested).<br>
in this case : 0123452000 is behind a spa9000. The user 0123452000 has
an AVP called "ipbx", that i'm using to do some groups and permissions
(plus the rewrite).<br><br clear="all">actually, it does not work, i tried many ways :<br><br> # load radius attributes of the callee<br> if (!avp_load_radius("callee"))<br> {<br> xlog("L_INFO","-> user unknown in radius usr db : $ru");<br>
route(15); # route PSTN<br> }<br><br> # verify the AVPs we got (caller and callee)<br> xlog("L_INFO", " -AVP------------------------------------- ");<br> avp_print();<br>
xlog("L_INFO", " ----------------------------------------- ");<br><br> # callee is behind an ipbx (avp ipbx) ?<br> if (is_avp_set("$avp(s:callee_ipbx)"))<br> {<br>
xlog("L_INFO", "-> callee is behind an ipbx : $avp(s:callee_ipbx)");<br> setflag(14); # flag IPBX<br> #subst_user('/$rU$/$avp(s:callee_ipbx)/');<br>
#rewriteuri("sip:$avp(s:callee_ipbx)@$rd"<b></b>);<br> rewriteuser($avp(s:callee_ipbx));<br> }<br><br> # callee in usrloc ?<br> if (lookup("location"))<br>
{<br> append_hf("P-hint: usrloc applied\r\n");<br> xlog("L_INFO","-> registered user called : $tu");<br> route(7); # route FORWARD<br>
}<br> else<br> {<br> xlog("L_INFO","-> 480: local user not found in usrloc : $tu");<br> sl_send_reply("480","Temporarily Unavailable");<br>
drop;<br> }<br><br>and in the debugs log :<br><br>Nov 5 13:04:51 ser0 kamailio[2930]: -ROUTE--INBOUND-------------------------- <br>Nov 5 13:04:51 ser0 kamailio[2930]: DBG:avp_radius:load_avp_user: rc_auth Success <br>
Nov 5 13:04:51 ser0 kamailio[2930]: DBG:avp_radius:load_avp_user: AVP 'callee_asserted_id'/0='0123452000'/0 has been added <br>Nov 5 13:04:51 ser0 kamailio[2930]: DBG:avp_radius:load_avp_user: AVP 'callee_ipbx'/0='spa9000'/0 has been added <br>
Nov 5 13:04:51 ser0 kamailio[2930]: -AVP------------------------------------- <br>Nov 5 13:04:51 ser0 kamailio[2930]: INFO:avpops:ops_print_avp: p=0x7fb3d7e5cfe8, flags=0x0003 <br>Nov 5 13:04:51 ser0 kamailio[2930]: INFO:avpops:ops_print_avp: ^I^I^Iname=<callee_ipbx> <br>
Nov 5 13:04:51 ser0 kamailio[2930]: INFO:avpops:ops_print_avp: ^I^I^Ival_str=<spa9000 / 7> <br>Nov 5 13:04:51 ser0 kamailio[2930]: INFO:avpops:ops_print_avp: p=0x7fb3d7e5cf88, flags=0x0003 <br>Nov 5 13:04:51 ser0 kamailio[2930]: INFO:avpops:ops_print_avp: ^I^I^Iname=<callee_asserted_id> <br>
Nov 5 13:04:51 ser0 kamailio[2930]: INFO:avpops:ops_print_avp: ^I^I^Ival_str=<0123452000 / 10> <br>Nov 5 13:04:51 ser0 kamailio[2930]: INFO:avpops:ops_print_avp: p=0x7fb3d7e5ced8, flags=0x0003 <br>Nov 5 13:04:51 ser0 kamailio[2930]: INFO:avpops:ops_print_avp: ^I^I^Iname=<caller_asserted_id> <br>
Nov 5 13:04:51 ser0 kamailio[2930]: INFO:avpops:ops_print_avp: ^I^I^Ival_str=<0123451011 / 10> <br>Nov 5 13:04:51 ser0 kamailio[2930]: INFO:avpops:ops_print_avp: p=0x7fb3d7e5ce38, flags=0x0003 <br>Nov 5 13:04:51 ser0 kamailio[2930]: ----------------------------------------- <br>
Nov 5 13:04:51 ser0 kamailio[2930]: -> callee is behind an ipbx : spa9000<br>Nov 5 13:04:51 ser0 kamailio[2930]: DBG:registrar:lookup: '$avp(<a href="mailto:s@sip.720.fr" target="_blank">s@sip.720.fr</a>' Not found in usrloc <br>
Nov 5 13:04:51 ser0 kamailio[2930]: -> 480: local user not found in usrloc : <a href="mailto:sip%3A0123452000@sip.720.fr" target="_blank">sip:0123452000@sip.720.fr</a><br>Nov 5 13:04:51 ser0 kamailio[2930]: DBG:core:parse_headers: flags=ffffffffffffffff <br>
Nov 5 13:04:51 ser0 kamailio[2930]: DBG:core:check_via_address: params <a href="http://77.246.81.162" target="_blank">77.246.81.162</a>, <a href="http://192.168.0.134" target="_blank">192.168.0.134</a>, 0 <br>Nov 5 13:04:51 ser0 kamailio[2930]: DBG:core:destroy_avp_list: destroying list 0x7fb3d7e5d040 <br>
Nov 5 13:04:51 ser0 kamailio[2930]: DBG:core:receive_msg: cleaning up <br><br><br>-> But, if I did it by :<br><br> if (uri =~ "^sip:012345200{1}")<br> {<br> rewriteuri("<a href="mailto:sip%3Aspa9000@sip.720.fr" target="_blank">sip:spa9000@sip.720.fr</a>");<br>
}<br> if (lookup("location"))<br>
{<br>
append_hf("P-hint: usrloc applied\r\n");<br>
xlog("L_INFO","-> registered user called : $tu");<br>
route(7); # route FORWARD<br>
}<br><br>it works great, and the call is ok (the ipbx forward correctly the request the phone behind him).<br><br><br> Anyone has an idea ? thanks in advance !<br><br><br>-- <br><font color="#888888">Samuel MULLER<br>
<br>
</font><br></div></div>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a><br>
<a href="http://lists.kamailio.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.kamailio.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br>
</blockquote></div><br><br>