Re: [OpenSIPS-Users] prefix to account

2009-03-26 Thread Brett Nemeroff
I'll give this a shot and report my results... thanks for the suggestions!!!
-Brett


On Thu, Mar 26, 2009 at 11:53 AM, Bogdan-Andrei Iancu <
bog...@voice-system.ro> wrote:

> Hi Ovidiu,
>
> indeed, this is an interesting approach that may work.
>
> Regards,
> Bogdan
>
>
> Ovidiu Sas wrote:
>
>> The dialplan module may help here in matching those prefixes and
>> identifying the carrier.
>> And this will be faster then performing db lookups and maybe more
>> elegant then using the cache.
>>
>> Regards,
>> Ovidiu Sas
>>
>> On Thu, Mar 26, 2009 at 8:45 AM, Bogdan-Andrei Iancu
>>  wrote:
>>
>>
>>> hi Brett,
>>>
>>> well, if you do not have any control over the prefix format, there is no
>>> other way than keeping the len also.
>>>
>>> regards,
>>> bogdan
>>>
>>> Brett Nemeroff wrote:
>>>
>>>
 That's kind of the same line as them all being the same length..
 Here's my problem.. in general, I have no problem making those kinds
 of assumptions.. but what I ran into is a rather large customer came
 to me and TOLD me that they were going to be sending me calls and THIS
 is the prefix. And of course, that prefix defies any kind of standard
 I may have set.  In this case, I'm not in a position really to request
 the calls be sent differently.. And in general, I'm wondering if there
 are any "good ideas" on how to go about doing it..

 I assume you were going down the line of looking for the first
 occurance of a 9, then substringing it? Yeah, I can do that.. I'd
 probably like to use something like a # instead.. But still doesn't
 fix when I get sent a prefix I'm not expecting.

 I suppose each account could have a prefix length.. Then I can store
 the prefix length by account in cache.. just seems kinda messy.
 -Brett


 On Wed, Mar 25, 2009 at 1:11 PM, Bogdan-Andrei Iancu
 mailto:bog...@voice-system.ro>> wrote:

Hi Brett,


Brett Nemeroff wrote:

Hey All,
I was just wanting to get some feedback from the community on
how you may handle this. I have a number of clients who like
to use "prefixes" in the dialed number coupled with IP address
authentication to link calls to a specific account..

It starts out simple.. Customer A sends me calls from
1.2.3.4.. Great. I have a table that links IP to account.. So
now I can account those calls..

But now customer A, has subcustomer A.1, or A.2 They still
send calls from 1.2.3.4, but they'll send prefix 001234 before
the dialed number (like 00123415125551212). In this case, I
want to identify the 1.2.3.4 + prefix of 001234 as being
customer A.1, then strip off 001234.

So in general, I do an avp_db_query (to be replaced by a
cache_fetch) for $si + substr($rU)... Which works fine.. BUT
if the prefix is not of a fixed length.. I'm not even really
sure hwo to go about it..

can you simply build your prefixes in such a manner that you can
identify the end of them? like all prefixes end with 9 and they do
not contain 9

Regards,
Bogdan


(pardon the messy sql, it's really just to prove a point)
with the avp_db_query, I can simply do a "like" select ala:
select account from customertrunks where ip=$si and to_did
like concat($rU,'%')

But if I do a cache_fetch, I can't do the pattern  match..

So how do you guys do this? or do you do it at all. :) I see a
lot of clients asking for some sort of call prefixes.. usually
a fixed length will make them happy, but I've got some now
that don't have a fixed length.

Thanks,
Brett


  

___
Users mailing list
Users@lists.opensips.org 
http://lists.opensips.org/cgi-bin/mailman/listinfo/users






>>> ___
>>> Users mailing list
>>> Users@lists.opensips.org
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>>
>>>
>>
>>
>>
>
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] prefix to account

2009-03-26 Thread Bogdan-Andrei Iancu
Hi Ovidiu,

indeed, this is an interesting approach that may work.

Regards,
Bogdan

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


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] prefix to account

2009-03-26 Thread Ovidiu Sas
The dialplan module may help here in matching those prefixes and
identifying the carrier.
And this will be faster then performing db lookups and maybe more
elegant then using the cache.

Regards,
Ovidiu Sas

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

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] prefix to account

2009-03-26 Thread Bogdan-Andrei Iancu
hi Brett,

well, if you do not have any control over the prefix format, there is no 
other way than keeping the len also.

regards,
bogdan

Brett Nemeroff wrote:
> That's kind of the same line as them all being the same length.. 
> Here's my problem.. in general, I have no problem making those kinds 
> of assumptions.. but what I ran into is a rather large customer came 
> to me and TOLD me that they were going to be sending me calls and THIS 
> is the prefix. And of course, that prefix defies any kind of standard 
> I may have set.  In this case, I'm not in a position really to request 
> the calls be sent differently.. And in general, I'm wondering if there 
> are any "good ideas" on how to go about doing it..
>
> I assume you were going down the line of looking for the first 
> occurance of a 9, then substringing it? Yeah, I can do that.. I'd 
> probably like to use something like a # instead.. But still doesn't 
> fix when I get sent a prefix I'm not expecting.
>
> I suppose each account could have a prefix length.. Then I can store 
> the prefix length by account in cache.. just seems kinda messy.
> -Brett
>
>
> On Wed, Mar 25, 2009 at 1:11 PM, Bogdan-Andrei Iancu 
> mailto:bog...@voice-system.ro>> wrote:
>
> Hi Brett,
>
>
> Brett Nemeroff wrote:
>
> Hey All,
> I was just wanting to get some feedback from the community on
> how you may handle this. I have a number of clients who like
> to use "prefixes" in the dialed number coupled with IP address
> authentication to link calls to a specific account..
>
> It starts out simple.. Customer A sends me calls from
> 1.2.3.4.. Great. I have a table that links IP to account.. So
> now I can account those calls..
>
> But now customer A, has subcustomer A.1, or A.2 They still
> send calls from 1.2.3.4, but they'll send prefix 001234 before
> the dialed number (like 00123415125551212). In this case, I
> want to identify the 1.2.3.4 + prefix of 001234 as being
> customer A.1, then strip off 001234.
>
> So in general, I do an avp_db_query (to be replaced by a
> cache_fetch) for $si + substr($rU)... Which works fine.. BUT
> if the prefix is not of a fixed length.. I'm not even really
> sure hwo to go about it..
>
> can you simply build your prefixes in such a manner that you can
> identify the end of them? like all prefixes end with 9 and they do
> not contain 9
>
> Regards,
> Bogdan
>
>
> (pardon the messy sql, it's really just to prove a point)
> with the avp_db_query, I can simply do a "like" select ala:
> select account from customertrunks where ip=$si and to_did
> like concat($rU,'%')
>
> But if I do a cache_fetch, I can't do the pattern  match..
>
> So how do you guys do this? or do you do it at all. :) I see a
> lot of clients asking for some sort of call prefixes.. usually
> a fixed length will make them happy, but I've got some now
> that don't have a fixed length.
>
> Thanks,
> Brett
>
> 
> 
>
> ___
> Users mailing list
> Users@lists.opensips.org 
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>  
>
>
>


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] prefix to account

2009-03-25 Thread Brett Nemeroff
That's kind of the same line as them all being the same length.. Here's my
problem.. in general, I have no problem making those kinds of assumptions..
but what I ran into is a rather large customer came to me and TOLD me that
they were going to be sending me calls and THIS is the prefix. And of
course, that prefix defies any kind of standard I may have set.  In this
case, I'm not in a position really to request the calls be sent
differently.. And in general, I'm wondering if there are any "good ideas" on
how to go about doing it..

I assume you were going down the line of looking for the first occurance of
a 9, then substringing it? Yeah, I can do that.. I'd probably like to use
something like a # instead.. But still doesn't fix when I get sent a prefix
I'm not expecting.

I suppose each account could have a prefix length.. Then I can store the
prefix length by account in cache.. just seems kinda messy.
-Brett


On Wed, Mar 25, 2009 at 1:11 PM, Bogdan-Andrei Iancu  wrote:

> Hi Brett,
>
> Brett Nemeroff wrote:
>
>> Hey All,
>> I was just wanting to get some feedback from the community on how you may
>> handle this. I have a number of clients who like to use "prefixes" in the
>> dialed number coupled with IP address authentication to link calls to a
>> specific account..
>>
>> It starts out simple.. Customer A sends me calls from 1.2.3.4.. Great. I
>> have a table that links IP to account.. So now I can account those calls..
>>
>> But now customer A, has subcustomer A.1, or A.2 They still send calls from
>> 1.2.3.4, but they'll send prefix 001234 before the dialed number (like
>> 00123415125551212). In this case, I want to identify the 1.2.3.4 + prefix of
>> 001234 as being customer A.1, then strip off 001234.
>>
>> So in general, I do an avp_db_query (to be replaced by a cache_fetch) for
>> $si + substr($rU)... Which works fine.. BUT if the prefix is not of a fixed
>> length.. I'm not even really sure hwo to go about it..
>>
> can you simply build your prefixes in such a manner that you can identify
> the end of them? like all prefixes end with 9 and they do not contain 9
>
> Regards,
> Bogdan
>
>>
>> (pardon the messy sql, it's really just to prove a point)
>> with the avp_db_query, I can simply do a "like" select ala: select account
>> from customertrunks where ip=$si and to_did like concat($rU,'%')
>>
>> But if I do a cache_fetch, I can't do the pattern  match..
>>
>> So how do you guys do this? or do you do it at all. :) I see a lot of
>> clients asking for some sort of call prefixes.. usually a fixed length will
>> make them happy, but I've got some now that don't have a fixed length.
>>
>> Thanks,
>> Brett
>>
>> 
>>
>> ___
>> Users mailing list
>> Users@lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] prefix to account

2009-03-25 Thread Bogdan-Andrei Iancu
Hi Brett,

Brett Nemeroff wrote:
> Hey All,
> I was just wanting to get some feedback from the community on how you 
> may handle this. I have a number of clients who like to use "prefixes" 
> in the dialed number coupled with IP address authentication to link 
> calls to a specific account..
>
> It starts out simple.. Customer A sends me calls from 1.2.3.4.. Great. 
> I have a table that links IP to account.. So now I can account those 
> calls..
>
> But now customer A, has subcustomer A.1, or A.2 They still send calls 
> from 1.2.3.4, but they'll send prefix 001234 before the dialed number 
> (like 00123415125551212). In this case, I want to identify the 1.2.3.4 
> + prefix of 001234 as being customer A.1, then strip off 001234.
>
> So in general, I do an avp_db_query (to be replaced by a cache_fetch) 
> for $si + substr($rU)... Which works fine.. BUT if the prefix is not 
> of a fixed length.. I'm not even really sure hwo to go about it..
can you simply build your prefixes in such a manner that you can 
identify the end of them? like all prefixes end with 9 and they do not 
contain 9

Regards,
Bogdan
>
> (pardon the messy sql, it's really just to prove a point)
> with the avp_db_query, I can simply do a "like" select ala: select 
> account from customertrunks where ip=$si and to_did like concat($rU,'%')
>
> But if I do a cache_fetch, I can't do the pattern  match..
>
> So how do you guys do this? or do you do it at all. :) I see a lot of 
> clients asking for some sort of call prefixes.. usually a fixed length 
> will make them happy, but I've got some now that don't have a fixed 
> length.
>
> Thanks,
> Brett
>
> 
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>   


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] prefix to account

2009-03-24 Thread Brett Nemeroff
Hey All,I was just wanting to get some feedback from the community on how
you may handle this. I have a number of clients who like to use "prefixes"
in the dialed number coupled with IP address authentication to link calls to
a specific account..

It starts out simple.. Customer A sends me calls from 1.2.3.4.. Great. I
have a table that links IP to account.. So now I can account those calls..

But now customer A, has subcustomer A.1, or A.2 They still send calls from
1.2.3.4, but they'll send prefix 001234 before the dialed number (like
00123415125551212). In this case, I want to identify the 1.2.3.4 + prefix of
001234 as being customer A.1, then strip off 001234.

So in general, I do an avp_db_query (to be replaced by a cache_fetch) for
$si + substr($rU)... Which works fine.. BUT if the prefix is not of a fixed
length.. I'm not even really sure hwo to go about it..

(pardon the messy sql, it's really just to prove a point)
with the avp_db_query, I can simply do a "like" select ala: select account
from customertrunks where ip=$si and to_did like concat($rU,'%')

But if I do a cache_fetch, I can't do the pattern  match..

So how do you guys do this? or do you do it at all. :) I see a lot of
clients asking for some sort of call prefixes.. usually a fixed length will
make them happy, but I've got some now that don't have a fixed length.

Thanks,
Brett
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users