[SR-Users] Add country code on incoming calls - if not present

Michael Nielsen mic.niel84 at gmail.com
Wed Sep 2 13:33:15 CEST 2015


Oh, I see... This should be what I was looking for. Thanx

On Wed, Sep 2, 2015 at 9:14 AM, Daniel-Constantin Mierla <miconda at gmail.com>
wrote:

> As alternative, if you need the country code for caller only, then look at
> load_credentials parameter for auth_db module. If you add the country code
> in the subscriber table, it will be loaded from database whent he
> authentication is done (i.e., in the same query with the password).
>
> Cheers,
> Daniel
>
>
> On 01/09/15 17:37, Michael Nielsen wrote:
>
> What if I just want to lookup the country code IF the country code is not
> set.
> Then queries to MySQL for this would only be made in the cases where the
> subscriber do not type in + or 00?
>
> I've tried to look at avpops which apparently uses the usr_preferences as
> standard - but without any luck...
>
> On Tuesday, September 1, 2015, Daniel Tryba <d.tryba at pocos.nl> wrote:
>
>> On Tuesday 01 September 2015 16:43:42 Michael Nielsen wrote:
>> > If I want to load a user specific country code, using avp, how can I do
>> > this?
>> >
>> > I've added kamctl avp add MY-SUBSCRIBER countrycode 0 +44, so +44 is
>> added
>> > to usr_preferences.
>> >
>> > But calling $avp(countrycode) doesn't seem to give me +44?
>>
>> There is more than one way to do it, but I choose to load the
>> usr_preferences
>> into avps after authentication with avp_db_query (to have a fixed number
>> of
>> queries per call at the expense of memory).
>>
>> //auth
>>                 if(avp_db_query("SELECT
>> replace(replace(concat('src_',attribute),'.','_'),'-','_'),value FROM
>> usr_preferences WHERE username='$avp(au)' and domain='$fd' and
>> length(value) >
>> 0"))
>>                 {
>>                         while($avp(i:1)!=$null)
>>                         {
>>                                 $avp($avp(i:1)[*])=$null;
>>                                 $avp($avp(i:1))=$avp(i:2);
>>
>>                                 $avp(i:1)=$null;
>>                                 $avp(i:2)=$null;
>>                         }
>>                 }
>>
>>
>> _______________________________________________
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>> sr-users at lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing listsr-users at lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
> --
> Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
> Book: SIP Routing With Kamailio - http://www.asipto.com
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20150902/418991ea/attachment.html>


More information about the sr-users mailing list