Hello everyone,
I'm trying to load an avp from the database, now from my understanding I simply use the avp_db_load() function. Now I previously setup my avp_table to be usr_preferences, now I'm doing the following:
route[5] { xlog("L_INFO", "time [$Tf] method <$rm> r-uri <$ru> 2nd via <$hdr(via[1])>\n");
avp_db_load("$rU/username", "$avp(s:e911)");
xlog("L_INFO", "CURRENT AVP VALUE: $avp(s:e911)");
if(is_avp_set("$avp(s:e911)")) { xlog("L_INFO", "CURRENT $ru: $ru"); avp_pushto("$ru", "$avp(s:e911)"); xlog("L_INFO", "AFTER $ru: $ru"); }
route(1); }
For route 5, and I have a AVP row for 'e911' in the database, with the username, domain, and the attribute set, the attribute ofcourse being e911, type 0, and a value set. However, I keep getting NULL back for the AVP I'm trying to pull, does anyone care to explain what I'm doing wrong? Thanks.
Hi Brandon,
Perhaps if you use avp_db_query, you will have better luck.
The simple example below uses $fU instead of $rU and assumes that you have a column in usr_preferences called "e911".
Hope this helps.
if (!avp_db_query("SELECT e911 FROM usr_preferences WHERE username = '$fU'", "$avp(s:e911)")) { xlog("L_NOTICE", "DATABASE ERROR avp_db_query() failed\n"); sl_send_reply("500", "Server Internal Error"); exit; }
Regards, Norm
Brandon Armstead wrote:
Hello everyone,
I'm trying to load an avp from the database, now from my understanding I simply use the avp_db_load() function. Now I previously setup my avp_table to be usr_preferences, now I'm doing the following:
route[5] { xlog("L_INFO", "time [$Tf] method <$rm> r-uri <$ru> 2nd via <$hdr(via[1])>\n");
avp_db_load("$rU/username", "$avp(s:e911)"); xlog("L_INFO", "CURRENT AVP VALUE: $avp(s:e911)"); if(is_avp_set("$avp(s:e911)")) { xlog("L_INFO", "CURRENT \$ru: $ru"); avp_pushto("$ru", "$avp(s:e911)"); xlog("L_INFO", "AFTER \$ru: $ru"); } route(1);
}
For route 5, and I have a AVP row for 'e911' in the database, with the username, domain, and the attribute set, the attribute ofcourse being e911, type 0, and a value set. However, I keep getting NULL back for the AVP I'm trying to pull, does anyone care to explain what I'm doing wrong? Thanks.
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users
Has anyone had any experience with Openser and a SPA9000 configured as I describe below?
I have my SPA9000 registered on one line to my ITSP. Calls out to the ITSP work fine from phones registered to the SPA9000. I have the SPA9000 registered to the Openser on line 2 of the SPA9000, and calls from extensions registered on the SPA9000 can call extensions registered on the OpenSER.
I use Openser as a sip proxy with lots of phone extensions (more than the SPA9000 will support). When trying to call from a phone registered on Openser to a phone registered to the SPA9000, I get a 403 Forbidden. Same with attempts to dial out to the ITSP.
Am I trying to do something that can't be done, or is it a SPA9000 configuration problem?
Thanks for any suggestions, Scott
Scott Yagel
PacketCall, Inc.
syagel@packetcall.net
Hi Scott,
first try to see which entity generates the Forbidden reply? the proxy, the callee phone?
regards, bogdan
Scott Yagel wrote:
Has anyone had any experience with Openser and a SPA9000 configured as I describe below?
I have my SPA9000 registered on one line to my ITSP. Calls out to the ITSP work fine from phones registered to the SPA9000. I have the SPA9000 registered to the Openser on line 2 of the SPA9000, and calls from extensions registered on the SPA9000 can call extensions registered on the OpenSER.
I use Openser as a sip proxy with lots of phone extensions (more than the SPA9000 will support). When trying to call from a phone registered on Openser to a phone registered to the SPA9000, I get a 403 Forbidden. Same with attempts to dial out to the ITSP.
Am I trying to do something that can't be done, or is it a SPA9000 configuration problem? [Confused]
Thanks for any suggestions, Scott
Scott Yagel
PacketCall, Inc.
syagel@packetcall.net mailto:syagel@packetcall.net
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users
It appears that the 403 is generated by the SPA9000, so I am assuming that, if this will work at all, there are some configuration changes that need to be made to the SPA9000 in relation to its connection to Openser. I think Openser is working as required.
Regards, Scott Yagel PacketCall, Inc. syagel@packetcall.net -----Original Message----- From: Bogdan-Andrei Iancu [mailto:bogdan@voice-system.ro] Sent: Wednesday, January 24, 2007 3:43 AM To: syagel@packetcall.net Cc: users@openser.org Subject: Re: [Users] openser, spa9000, etc.
Hi Scott,
first try to see which entity generates the Forbidden reply? the proxy, the callee phone?
regards, bogdan
Scott Yagel PacketCall, Inc. syagel@packetcall.net
-----Original Message----- From: Bogdan-Andrei Iancu [mailto:bogdan@voice-system.ro] Sent: Wednesday, January 24, 2007 3:43 AM To: syagel@packetcall.net Cc: users@openser.org Subject: Re: [Users] openser, spa9000, etc.
Hi Scott,
first try to see which entity generates the Forbidden reply? the proxy, the callee phone?
regards, bogdan
Scott Yagel wrote:
Has anyone had any experience with Openser and a SPA9000 configured as I describe below?
I have my SPA9000 registered on one line to my ITSP. Calls out to the ITSP work fine from phones registered to the SPA9000. I have the SPA9000 registered to the Openser on line 2 of the SPA9000, and calls from extensions registered on the SPA9000 can call extensions registered on the OpenSER.
I use Openser as a sip proxy with lots of phone extensions (more than the SPA9000 will support). When trying to call from a phone registered on Openser to a phone registered to the SPA9000, I get a 403 Forbidden. Same with attempts to dial out to the ITSP.
Am I trying to do something that can't be done, or is it a SPA9000 configuration problem? [Confused]
Thanks for any suggestions, Scott
Scott Yagel
PacketCall, Inc.
syagel@packetcall.net mailto:syagel@packetcall.net
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users
Hello,
did you get any error messages in syslog. Try: avp_db_load("$ru/username", "$avp(s:e911)");
$rU is username, and $ru is R-URI from where to get the username (first version should fire errors).
Cheers, Daniel
On 01/23/07 19:59, Brandon Armstead wrote:
Hello everyone,
I'm trying to load an avp from the database, now from my
understanding I simply use the avp_db_load() function. Now I previously setup my avp_table to be usr_preferences, now I'm doing the following:
route[5] { xlog("L_INFO", "time [$Tf] method <$rm> r-uri <$ru> 2nd via <$hdr(via[1])>\n");
avp_db_load("$rU/username", "$avp(s:e911)"); xlog("L_INFO", "CURRENT AVP VALUE: $avp(s:e911)"); if(is_avp_set("$avp(s:e911)")) { xlog("L_INFO", "CURRENT \$ru: $ru"); avp_pushto("$ru", "$avp(s:e911)"); xlog("L_INFO", "AFTER \$ru: $ru"); } route(1);
}
For route 5, and I have a AVP row for 'e911' in the database, with the username, domain, and the attribute set, the attribute ofcourse being e911, type 0, and a value set. However, I keep getting NULL back for the AVP I'm trying to pull, does anyone care to explain what I'm doing wrong? Thanks.
-- Brandon Armstead
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users
Hello Daniel,
I just tryed exactly this:
if(avp_db_load("$ru/username", "$avp(s:e911)")) { avp_pushto("$ru", "$avp(s:e911)"); }
I even tried printing out the AVP after it should have been loaded, once again NULL. There is a row in usr_preferences, I have it working with avp_db_query, however for the life of me can not get avp_db_load to work? I have a column 'username', a column 'domain', a column 'attribute', a column 'type', and a column 'value'. The attribute is e911, the value is set, and the username is set, as well as domain, although domain in this case should not matter. I just can't get it working..... any help is appreciated, thanks!
On 1/24/07, Daniel-Constantin Mierla daniel@voice-system.ro wrote:
Hello,
did you get any error messages in syslog. Try: avp_db_load("$ru/username", "$avp(s:e911)");
$rU is username, and $ru is R-URI from where to get the username (first version should fire errors).
Cheers, Daniel
On 01/23/07 19:59, Brandon Armstead wrote:
Hello everyone,
I'm trying to load an avp from the database, now from my
understanding I simply use the avp_db_load() function. Now I previously setup my avp_table to be usr_preferences, now I'm doing the following:
route[5] { xlog("L_INFO", "time [$Tf] method <$rm> r-uri <$ru> 2nd via <$hdr(via[1])>\n");
avp_db_load("$rU/username", "$avp(s:e911)"); xlog("L_INFO", "CURRENT AVP VALUE: $avp(s:e911)"); if(is_avp_set("$avp(s:e911)")) { xlog("L_INFO", "CURRENT \$ru: $ru"); avp_pushto("$ru", "$avp(s:e911)"); xlog("L_INFO", "AFTER \$ru: $ru"); } route(1);
}
For route 5, and I have a AVP row for 'e911' in the database, with the username, domain, and the attribute set, the attribute ofcourse being e911, type 0, and a value set. However, I keep getting NULL back for the AVP I'm trying to pull, does anyone care to explain what I'm doing wrong? Thanks.
-- Brandon Armstead
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users
Hello Brandon,
what is the value you have in the column 'type' for this record?
Cheers, Daniel
On 01/24/07 14:03, Brandon Armstead wrote:
Hello Daniel,
I just tryed exactly this: if(avp_db_load("$ru/username", "$avp(s:e911)")) { avp_pushto("$ru", "$avp(s:e911)"); } I even tried printing out the AVP after it should have been
loaded, once again NULL. There is a row in usr_preferences, I have it working with avp_db_query, however for the life of me can not get avp_db_load to work? I have a column 'username', a column 'domain', a column 'attribute', a column 'type', and a column 'value'. The attribute is e911, the value is set, and the username is set, as well as domain, although domain in this case should not matter. I just can't get it working..... any help is appreciated, thanks!
On 1/24/07, *Daniel-Constantin Mierla* <daniel@voice-system.ro mailto:daniel@voice-system.ro> wrote:
Hello, did you get any error messages in syslog. Try: avp_db_load("$ru/username", "$avp(s:e911)"); $rU is username, and $ru is R-URI from where to get the username (first version should fire errors). Cheers, Daniel On 01/23/07 19:59, Brandon Armstead wrote: > Hello everyone, > > I'm trying to load an avp from the database, now from my > understanding I simply use the avp_db_load() function. Now I > previously setup my avp_table to be usr_preferences, now I'm doing the > following: > > route[5] > { > xlog("L_INFO", "time [$Tf] method <$rm> r-uri <$ru> 2nd via > <$hdr(via[1])>\n"); > > avp_db_load("$rU/username", "$avp(s:e911)"); > > xlog("L_INFO", "CURRENT AVP VALUE: $avp(s:e911)"); > > if(is_avp_set("$avp(s:e911)")) > { > xlog("L_INFO", "CURRENT \$ru: $ru"); > avp_pushto("$ru", "$avp(s:e911)"); > xlog("L_INFO", "AFTER \$ru: $ru"); > } > > route(1); > } > > For route 5, and I have a AVP row for 'e911' in the database, with the > username, domain, and the attribute set, the attribute ofcourse being > e911, type 0, and a value set. However, I keep getting NULL back for > the AVP I'm trying to pull, does anyone care to explain what I'm doing > wrong? Thanks. > > -- > Brandon Armstead > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users@openser.org <mailto:Users@openser.org> > http://openser.org/cgi-bin/mailman/listinfo/users >
-- Brandon Armstead
Hello daniel,
The value would be 0. Sent via BlackBerry from T-Mobile
-----Original Message----- From: Daniel-Constantin Mierla daniel@voice-system.ro Date: Wed, 24 Jan 2007 16:49:52 To:Brandon Armstead brandon.armstead@gmail.com Cc:users@openser.org Subject: Re: [Users] avp_db_load
Hello Brandon,
what is the value you have in the column 'type' for this record?
Cheers, Daniel
On 01/24/07 14:03, Brandon Armstead wrote:
Hello Daniel,
I just tryed exactly this: if(avp_db_load("$ru/username", "$avp(s:e911)")) { avp_pushto("$ru", "$avp(s:e911)"); } I even tried printing out the AVP after it should have been
loaded, once again NULL. There is a row in usr_preferences, I have it working with avp_db_query, however for the life of me can not get avp_db_load to work? I have a column 'username', a column 'domain', a column 'attribute', a column 'type', and a column 'value'. The attribute is e911, the value is set, and the username is set, as well as domain, although domain in this case should not matter. I just can't get it working..... any help is appreciated, thanks!
On 1/24/07, *Daniel-Constantin Mierla* <daniel@voice-system.ro mailto:daniel@voice-system.ro> wrote:
Hello, did you get any error messages in syslog. Try: avp_db_load("$ru/username", "$avp(s:e911)"); $rU is username, and $ru is R-URI from where to get the username (first version should fire errors). Cheers, Daniel On 01/23/07 19:59, Brandon Armstead wrote: > Hello everyone, > > I'm trying to load an avp from the database, now from my > understanding I simply use the avp_db_load() function. Now I > previously setup my avp_table to be usr_preferences, now I'm doing the > following: > > route[5] > { > xlog("L_INFO", "time [$Tf] method <$rm> r-uri <$ru> 2nd via > <$hdr(via[1])>\n"); > > avp_db_load("$rU/username", "$avp(s:e911)"); > > xlog("L_INFO", "CURRENT AVP VALUE: $avp(s:e911)"); > > if(is_avp_set("$avp(s:e911)")) > { > xlog("L_INFO", "CURRENT \$ru: $ru"); > avp_pushto("$ru", "$avp(s:e911)"); > xlog("L_INFO", "AFTER \$ru: $ru"); > } > > route(1); > } > > For route 5, and I have a AVP row for 'e911' in the database, with the > username, domain, and the attribute set, the attribute ofcourse being > e911, type 0, and a value set. However, I keep getting NULL back for > the AVP I'm trying to pull, does anyone care to explain what I'm doing > wrong? Thanks. > > -- > Brandon Armstead > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users@openser.org <mailto:Users@openser.org> > http://openser.org/cgi-bin/mailman/listinfo/users >
-- Brandon Armstead
_______________________________________________ Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users
Hello Brandon,
I have tested locally and seem to work. What version of openser do you use? Could you update to latest CVS version of your release and try again? I tested with 1.1.1 and devel version. Here Is what I have:
if(is_method("INVITE")) { avp_db_load("$ru/username", "$avp(s:e911)"); xlog("avp -- $avp(s:e911) \n"); }
0(10251) DEBUG:avpops:load_avps: loaded avps = 1 0(10251) avp -- 12345
+------+----------+-------------+-----------+------+-------+---------------------+ | uuid | username | domain | attribute | type | value | modified | +------+----------+-------------+-----------+------+-------+---------------------+ | | user | openser.org | e911 | 0 | 12345 | 2007-01-25 10:53:20 | +------+----------+-------------+-----------+------+-------+---------------------+
Cheers, Daniel
On 01/24/07 16:57, Brandon@voipo.com wrote:
Hello daniel,
The value would be 0.
Sent via BlackBerry from T-Mobile
-----Original Message----- From: Daniel-Constantin Mierla daniel@voice-system.ro Date: Wed, 24 Jan 2007 16:49:52 To:Brandon Armstead brandon.armstead@gmail.com Cc:users@openser.org Subject: Re: [Users] avp_db_load
Hello Brandon,
what is the value you have in the column 'type' for this record?
Cheers, Daniel
On 01/24/07 14:03, Brandon Armstead wrote:
Hello Daniel,
I just tryed exactly this: if(avp_db_load("$ru/username", "$avp(s:e911)")) { avp_pushto("$ru", "$avp(s:e911)"); } I even tried printing out the AVP after it should have been
loaded, once again NULL. There is a row in usr_preferences, I have it working with avp_db_query, however for the life of me can not get avp_db_load to work? I have a column 'username', a column 'domain', a column 'attribute', a column 'type', and a column 'value'. The attribute is e911, the value is set, and the username is set, as well as domain, although domain in this case should not matter. I just can't get it working..... any help is appreciated, thanks!
On 1/24/07, *Daniel-Constantin Mierla* <daniel@voice-system.ro mailto:daniel@voice-system.ro> wrote:
Hello, did you get any error messages in syslog. Try: avp_db_load("$ru/username", "$avp(s:e911)"); $rU is username, and $ru is R-URI from where to get the username (first version should fire errors). Cheers, Daniel On 01/23/07 19:59, Brandon Armstead wrote: > Hello everyone, > > I'm trying to load an avp from the database, now from my > understanding I simply use the avp_db_load() function. Now I > previously setup my avp_table to be usr_preferences, now I'm doing the > following: > > route[5] > { > xlog("L_INFO", "time [$Tf] method <$rm> r-uri <$ru> 2nd via > <$hdr(via[1])>\n"); > > avp_db_load("$rU/username", "$avp(s:e911)"); > > xlog("L_INFO", "CURRENT AVP VALUE: $avp(s:e911)"); > > if(is_avp_set("$avp(s:e911)")) > { > xlog("L_INFO", "CURRENT \$ru: $ru"); > avp_pushto("$ru", "$avp(s:e911)"); > xlog("L_INFO", "AFTER \$ru: $ru"); > } > > route(1); > } > > For route 5, and I have a AVP row for 'e911' in the database, with the > username, domain, and the attribute set, the attribute ofcourse being > e911, type 0, and a value set. However, I keep getting NULL back for > the AVP I'm trying to pull, does anyone care to explain what I'm doing > wrong? Thanks. > > -- > Brandon Armstead > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users@openser.org <mailto:Users@openser.org> > http://openser.org/cgi-bin/mailman/listinfo/users >
-- Brandon Armstead
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users