[asterisk-bugs] [JIRA] (ASTERISK-16501) [patch] use a realtime __options__ column to store several name=value pairs
Walter Doekes (JIRA)
noreply at issues.asterisk.org
Thu Mar 16 10:14:09 CDT 2017
[ https://issues.asterisk.org/jira/browse/ASTERISK-16501?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Walter Doekes updated ASTERISK-16501:
-------------------------------------
Description:
Hi,
I'd like to add a special realtime column name named {{\_\_options\_\_}} that can hold several variables so I don't have to add a column to the table for every variable I might want to use someday.
Example use:
I have an {{asterisk_sipfriends}} table with a couple of columns: name, type, secret, host, ipaddr, port, nat.
Now there is one particular host that needs the "{{session-timers=refuse}}" to be set. (In my case, an Alcatel box that lies about Supported: timer.) I really don't want to add a "{{session-timers}}" column to the {{asterisk_sipfriends}} table for two related reasons:
(1) I just want to add an "advanced config" field to my peer configuration interface, not a specific session-timers option and
(2) there might be some other option that is needed at some point that I can set through this "advanced config" string directly without having to alter the table again.
h2. STEPS TO REPRODUCE
With the attached patch, I can do this:
{noformat}
ALTER TABLE asterisk_sipfriends ADD COLUMN __options__ VARCHAR(255) DEFAULT '';
UPDATE asterisk_sipfriends SET __options__ = 'session-timers=refuse;session-expires=123;other-bogus-option=42' WHERE name = 'alcatel-box';
{noformat}
Result:
{noformat}
voys-agilo*CLI> sip show peer alcatel-box load
...
Sess-Timers : Refuse
Sess-Refresh : uas
Sess-Expires : 123 secs
...
{noformat}
h2. ADDITIONAL INFORMATION
The attached patch is against 1.6.2.10. If required, I can create patches against SVN (1.6.2 and trunk).
(And the documentation might need a bit of tweaking perhaps.)
was:
Hi,
I'd like to add a special realtime column name named "__options__" that can hold several variables so I don't have to add a column to the table for every variable I might want to use someday.
Example use:
I have an asterisk_sipfriends table with a couple of columns: name, type, secret, host, ipaddr, port, nat.
Now there is one particular host that needs the "session-timers=refuse" to be set. (In my case, an Alcatel box that lies about Supported: timer.) I really don't want to add a "session-timers" column to the asterisk_sipfriends table for two related reasons: (1) I just want to add an "advanced config" field to my peer configuration interface, not a specific session-timers option and (2) there might be some other option that is needed at some point that I can set through this "advanced config" string directly without having to alter the table again.
****** STEPS TO REPRODUCE ******
With the attached patch, I can do this:
ALTER TABLE asterisk_sipfriends ADD COLUMN __options__ VARCHAR(255) DEFAULT '';
UPDATE asterisk_sipfriends SET __options__ = 'session-timers=refuse;session-expires=123;other-bogus-option=42' WHERE name = 'alcatel-box';
Result:
voys-agilo*CLI> sip show peer alcatel-box load
...
Sess-Timers : Refuse
Sess-Refresh : uas
Sess-Expires : 123 secs
...
****** ADDITIONAL INFORMATION ******
The attached patch is against 1.6.2.10. If required, I can create patches against SVN (1.6.2 and trunk).
(And the documentation might need a bit of tweaking perhaps.)
> [patch] use a realtime __options__ column to store several name=value pairs
> ---------------------------------------------------------------------------
>
> Key: ASTERISK-16501
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-16501
> Project: Asterisk
> Issue Type: New Feature
> Components: Resources/res_realtime
> Reporter: Walter Doekes
> Attachments: 20100804__issue17791.diff
>
>
> Hi,
> I'd like to add a special realtime column name named {{\_\_options\_\_}} that can hold several variables so I don't have to add a column to the table for every variable I might want to use someday.
> Example use:
> I have an {{asterisk_sipfriends}} table with a couple of columns: name, type, secret, host, ipaddr, port, nat.
> Now there is one particular host that needs the "{{session-timers=refuse}}" to be set. (In my case, an Alcatel box that lies about Supported: timer.) I really don't want to add a "{{session-timers}}" column to the {{asterisk_sipfriends}} table for two related reasons:
> (1) I just want to add an "advanced config" field to my peer configuration interface, not a specific session-timers option and
> (2) there might be some other option that is needed at some point that I can set through this "advanced config" string directly without having to alter the table again.
> h2. STEPS TO REPRODUCE
> With the attached patch, I can do this:
> {noformat}
> ALTER TABLE asterisk_sipfriends ADD COLUMN __options__ VARCHAR(255) DEFAULT '';
> UPDATE asterisk_sipfriends SET __options__ = 'session-timers=refuse;session-expires=123;other-bogus-option=42' WHERE name = 'alcatel-box';
> {noformat}
> Result:
> {noformat}
> voys-agilo*CLI> sip show peer alcatel-box load
> ...
> Sess-Timers : Refuse
> Sess-Refresh : uas
> Sess-Expires : 123 secs
> ...
> {noformat}
> h2. ADDITIONAL INFORMATION
> The attached patch is against 1.6.2.10. If required, I can create patches against SVN (1.6.2 and trunk).
> (And the documentation might need a bit of tweaking perhaps.)
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list