Marc,<br><br>just to avoid unnecessary processing, I would say the patch for the connector should look like:<br>&nbsp;(authorize function, right after if MULTIPLE_PREPAID_ENGINES block<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Patch for the digest uri starting with + (openser is not able to touch that, and cdrtool not able to recognise)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if to_uri.find(&#39;+&#39;) != -1:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; log(1, &#39;destination containing +, will replace it with 00...&#39;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to_uri = to_uri.replace(&#39;+&#39;, &#39;00&#39;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; res_newsession_raw=client_prepaid.new_session(username, to_uri, SESSION_MAXDUR)<br>
<br><br>In OpenSER, I have done the following, right after radius_proxy_authorize call:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!radius_proxy_authorize(&quot;&quot;)) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy_challenge(&quot;&quot;,&quot;0&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else if (!check_from()) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_send_reply(&quot;403&quot;, &quot;Use From=ID&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (uri=~&quot;^sip:\+.*@&quot;){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strip(1);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; prefix(&quot;00&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xlog(&quot;Changed RURI due to +, new one is: $rU&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<br><br>DanB<br><br><br><br><div class="gmail_quote">On Mon, Mar 3, 2008 at 2:23 PM, Marc LEURENT &lt;<a href="mailto:lftsy@leurent.eu">lftsy@leurent.eu</a>&gt; 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 class="Ih2E3d">-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
</div>Thanks Dan and Iñaki for your answers:<br>
<br>
I&#39;ve changed this in the freeradius-cdrtool module of Dan:<br>
#to_uri=atrbValue(params,&#39;Digest-URI&#39;)<br>
to_uri=atrbValue(params,&#39;Digest-URI&#39;).replace(&#39;+&#39;,&#39;00&#39;)<br>
<div class="Ih2E3d"><br>
&gt; 2. A bit dirty patch on the freeradius-cdrtool connector to replace &quot;+&quot;<br>
&gt; with &quot;00&quot; in case of calls starting with +, before querying cdrtool in<br>
&gt; auth phase. In this case you must replace also in openser + with 00 so<br>
&gt; when the call will go out, should go with 00 (to be properly reflected<br>
&gt; later in cdrs). - this is what I did and looks like running smooth.<br>
</div>But I don&#39;t understand how to change the second part in OpenSER?<br>
<br>
Otherwize I will do it in the accounting python module?<br>
<br>
Thanks!<br>
<br>
<br>
Dan-Cristian Bogos a écrit :<br>
<div class="Ih2E3d">&gt; Hi Marc,<br>
&gt;<br>
&gt; had the same issue. The problem is that CDRTool supports only one type<br>
&gt; of international prefix (in your case any of &#39;00&#39; or &#39;+&#39;, so no way of<br>
&gt; specifying two).<br>
&gt; The reason you cannot replace + with 00 before authentication is that<br>
&gt; the full digest-nonce is calculated based on a series of factors (which<br>
&gt; includes original from and to uris and replacing to_uri before sending<br>
&gt; the request to radius to be authenticated would mean that radius will<br>
&gt; never recognize the nonce to be valid anymore).<br>
&gt;<br>
&gt; There are two ways of fixing your problem, as I see them (and mines too):<br>
&gt; 1. CDRTool folks should support some sort of list of international<br>
&gt; prefixes recognized and stripped.<br>
&gt; 2. A bit dirty patch on the freeradius-cdrtool connector to replace &quot;+&quot;<br>
&gt; with &quot;00&quot; in case of calls starting with +, before querying cdrtool in<br>
&gt; auth phase. In this case you must replace also in openser + with 00 so<br>
&gt; when the call will go out, should go with 00 (to be properly reflected<br>
&gt; later in cdrs). - this is what I did and looks like running smooth.<br>
&gt;<br>
&gt;<br>
&gt; Cheers,<br>
&gt; DanB<br>
&gt;<br>
&gt; On Mon, Mar 3, 2008 at 12:46 PM, Marc LEURENT &lt;<a href="mailto:lftsy@leurent.eu">lftsy@leurent.eu</a><br>
</div><div class="Ih2E3d">&gt; &lt;mailto:<a href="mailto:lftsy@leurent.eu">lftsy@leurent.eu</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt; Hello<br>
&gt; I have trouble with number dialed starting with +<br>
&gt; CDRTool doesn&#39; understand it.<br>
&gt; So I have to strip it from the request and replace it by 00!<br>
&gt; The problem is that even using this at the begenning of OpenSER<br>
&gt; script, it&#39;s not working (see CDRTool log below)<br>
&gt;<br>
&gt; Any idea how to solve it?<br>
&gt; Thanks<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;# normalization to e164<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;if($ruri.user =~ &quot;^\+[1-9][0-9]+&quot;) {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xlog(&quot;STRIPING + For e164 NORMALIZATION \r\n&quot;);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;strip(1);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;prefix(&quot;00&quot;);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;subst(&#39;/^To:(.*)sip:\+(.*)$/To:\1sip:00\2/ig&#39;);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;};<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Mar &nbsp;3 12:24:49 krusty CDRTool[15025]: MaxSessionTime<br>
</div>&gt; From=<a href="mailto:mleurent@sip.wifirst.net">mleurent@sip.wifirst.net</a> &lt;mailto:<a href="mailto:mleurent@sip.wifirst.net">mleurent@sip.wifirst.net</a>&gt;<br>
<div class="Ih2E3d">&gt; To=<a href="mailto:sip:+33677832975@sip.wifirst.net">sip:+33677832975@sip.wifirst.net</a><br>
</div>&gt; &lt;mailto:<a href="mailto:sip">sip</a>:+33677832975@<a href="http://sip.wifirst.net" target="_blank">sip.wifirst.net</a>&gt; Dura<br>
<div class="Ih2E3d">&gt; tion=10800 Lock=1<br>
&gt; Mar &nbsp;3 12:24:49 krusty CDRTool[15025]: Load last minute: 1 calls @<br>
&gt; 0.00 cps, memory: 16.77 MB, uptime: 0.6 hours<br>
&gt; Mar &nbsp;3 12:24:49 krusty CDRTool[15025]: Call to<br>
</div>&gt; +33677832975@<a href="http://sip.wifirst.net" target="_blank">sip.wifirst.net</a> &lt;<a href="http://sip.wifirst.net" target="_blank">http://sip.wifirst.net</a>&gt;, no limit imposed<br>
<div class="Ih2E3d">&gt; Mar &nbsp;3 12:24:49 krusty CDRTool[15025]: GetBalance<br>
</div>&gt; From=<a href="mailto:mleurent@sip.wifirst.net">mleurent@sip.wifirst.net</a> &lt;mailto:<a href="mailto:mleurent@sip.wifirst.net">mleurent@sip.wifirst.net</a>&gt;<br>
<div class="Ih2E3d">&gt; Mar &nbsp;3 12:24:51 krusty /usr/sbin/openser[18637]: ACC: call missed:<br>
&gt; timestamp=1204543491;method=INVITE;from_tag=xirvq;to_tag=<br>
&gt; ;call_id=<a href="mailto:cpvrqboancqnuii@192.168.95.139">cpvrqboancqnuii@192.168.95.139</a><br>
</div>&gt; &lt;mailto:<a href="mailto:cpvrqboancqnuii@192.168.95.139">cpvrqboancqnuii@192.168.95.139</a>&gt;;code=487;reason=Request<br>
<div class="Ih2E3d">&gt; Terminated<br>
&gt; Mar &nbsp;3 12:24:51 krusty CDRTool[15025]: DebitBalance<br>
</div>&gt; From=<a href="mailto:mleurent@sip.wifirst.net">mleurent@sip.wifirst.net</a> &lt;mailto:<a href="mailto:mleurent@sip.wifirst.net">mleurent@sip.wifirst.net</a>&gt;<br>
<div class="Ih2E3d">&gt; To=<a href="mailto:sip:0033677832975@sip.wifirst.net">sip:0033677832975@sip.wifirst.net</a><br>
</div>&gt; &lt;mailto:<a href="mailto:sip">sip</a>:<a href="mailto:0033677832975@sip.wifirst.net">0033677832975@sip.wifirst.net</a>&gt; Durat<br>
<div><div></div><div class="Wj3C7c">&gt; ion=0<br>
&gt;<br>
&gt;<br>
&gt; OpenSER config extract:<br>
&gt;<br>
&gt; # ATTENTION: DO NOT PUT ; at the end of the radius_extra attribute<br>
&gt; modparam(&quot;acc&quot;, &quot;radius_extra&quot;, &quot;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Called-Station-Id=$tu;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Calling-Station-Id=$fu;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Canonical-URI=$avp(to_destination);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;User-Name=$avp(user_name);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Billing-Party=$avp(billing_party);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Sip-User-Realm=$ar;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SIP-Proxy-IP=$Ri;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Source-IP=$si;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Source-Port=$sp;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Acct-Authentic=$avp(s:authentic);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;From-Header=$hdr(from);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;User-Agent=$hdr(user-agent);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Contact=$hdr(contact);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Event=$hdr(event)&quot;)<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;# Set the acc flags<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;xlog(&quot;JUSTE BEFORE SETTING FLAGS FOR RADIUS\r\n&quot;);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;if(is_method(&quot;INVITE&quot;) &amp;&amp; !has_totag()) {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xlog(&quot;L_INFO&quot;, &quot;I AM SETTING THE FLAGS FOR RADIUS \r\n&quot;);<br>
&gt; # &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $avp(s:authentic) = 1;<br>
&gt; # &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $avp(can_uri) = $ru; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# SIP Request&#39;s URI<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$avp(user_name) = $au + &quot;@&quot; + $ar;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$avp(billing_party) = $au + &quot;@&quot; + $ar;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$avp(to_destination) = $tu;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xlog(&quot;SETTING FLAGS 1 FOR RADIUS \r\n&quot;);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;setflag(1); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # radius_flag<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xlog(&quot;SETTING FLAGS 2 FOR RADIUS \r\n&quot;);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;setflag(2); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # radius_missed_flag<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;};<br>
<br>
</div></div>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.openser.org">Users@lists.openser.org</a> &lt;mailto:<a href="mailto:Users@lists.openser.org">Users@lists.openser.org</a>&gt;<br>
<div class="Ih2E3d"><a href="http://lists.openser.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser.org/cgi-bin/mailman/listinfo/users</a><br>
<br>
<br>
</div><div class="Ih2E3d">-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.6 (GNU/Linux)<br>
Comment: Using GnuPG with Mozilla - <a href="http://enigmail.mozdev.org" target="_blank">http://enigmail.mozdev.org</a><br>
<br>
</div>iD8DBQFHy/vbrxOjjFYWQtoRAsrUAKCDWa3PPsuBCGy6Op9O0sr7Fk9uugCffchO<br>
p7WCUKUX3skiyPUcgqc8c/Y=<br>
=SWwN<br>
-----END PGP SIGNATURE-----<br>
</blockquote></div><br>