I'll give this a shot and report my results... thanks for the suggestions!!!<br>-Brett<br><br><br><div class="gmail_quote">On Thu, Mar 26, 2009 at 11:53 AM, Bogdan-Andrei Iancu <span dir="ltr"><<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</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;">Hi Ovidiu,<br>
<br>
indeed, this is an interesting approach that may work.<br>
<br>
Regards,<br><font color="#888888">
Bogdan</font><div><div></div><div class="h5"><br>
<br>
Ovidiu Sas wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
The dialplan module may help here in matching those prefixes and<br>
identifying the carrier.<br>
And this will be faster then performing db lookups and maybe more<br>
elegant then using the cache.<br>
<br>
Regards,<br>
Ovidiu Sas<br>
<br>
On Thu, Mar 26, 2009 at 8:45 AM, Bogdan-Andrei Iancu<br>
<<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
hi Brett,<br>
<br>
well, if you do not have any control over the prefix format, there is no<br>
other way than keeping the len also.<br>
<br>
regards,<br>
bogdan<br>
<br>
Brett Nemeroff wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
That's kind of the same line as them all being the same length..<br>
Here's my problem.. in general, I have no problem making those kinds<br>
of assumptions.. but what I ran into is a rather large customer came<br>
to me and TOLD me that they were going to be sending me calls and THIS<br>
is the prefix. And of course, that prefix defies any kind of standard<br>
I may have set. In this case, I'm not in a position really to request<br>
the calls be sent differently.. And in general, I'm wondering if there<br>
are any "good ideas" on how to go about doing it..<br>
<br>
I assume you were going down the line of looking for the first<br>
occurance of a 9, then substringing it? Yeah, I can do that.. I'd<br>
probably like to use something like a # instead.. But still doesn't<br>
fix when I get sent a prefix I'm not expecting.<br>
<br>
I suppose each account could have a prefix length.. Then I can store<br>
the prefix length by account in cache.. just seems kinda messy.<br>
-Brett<br>
<br>
<br>
On Wed, Mar 25, 2009 at 1:11 PM, Bogdan-Andrei Iancu<br>
<<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a> <mailto:<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a>>> wrote:<br>
<br>
Hi Brett,<br>
<br>
<br>
Brett Nemeroff wrote:<br>
<br>
Hey All,<br>
I was just wanting to get some feedback from the community on<br>
how you may handle this. I have a number of clients who like<br>
to use "prefixes" in the dialed number coupled with IP address<br>
authentication to link calls to a specific account..<br>
<br>
It starts out simple.. Customer A sends me calls from<br>
1.2.3.4.. Great. I have a table that links IP to account.. So<br>
now I can account those calls..<br>
<br>
But now customer A, has subcustomer A.1, or A.2 They still<br>
send calls from 1.2.3.4, but they'll send prefix 001234 before<br>
the dialed number (like 00123415125551212). In this case, I<br>
want to identify the 1.2.3.4 + prefix of 001234 as being<br>
customer A.1, then strip off 001234.<br>
<br>
So in general, I do an avp_db_query (to be replaced by a<br>
cache_fetch) for $si + substr($rU)... Which works fine.. BUT<br>
if the prefix is not of a fixed length.. I'm not even really<br>
sure hwo to go about it..<br>
<br>
can you simply build your prefixes in such a manner that you can<br>
identify the end of them? like all prefixes end with 9 and they do<br>
not contain 9....<br>
<br>
Regards,<br>
Bogdan<br>
<br>
<br>
(pardon the messy sql, it's really just to prove a point)<br>
with the avp_db_query, I can simply do a "like" select ala:<br>
select account from customertrunks where ip=$si and to_did<br>
like concat($rU,'%')<br>
<br>
But if I do a cache_fetch, I can't do the pattern match..<br>
<br>
So how do you guys do this? or do you do it at all. :) I see a<br>
lot of clients asking for some sort of call prefixes.. usually<br>
a fixed length will make them happy, but I've got some now<br>
that don't have a fixed length.<br>
<br>
Thanks,<br>
Brett<br>
<br>
------------------------------------------------------------------------<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a> <mailto:<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br>
<br>
<br>
<br>
<br>
</blockquote>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br>
<br>
</blockquote>
<br>
<br>
</blockquote>
<br>
</div></div></blockquote></div><br>