How is MSet() different from Set()? Is it supposed to be a "Multi"-Set()? Why was it added in 1.6? Philipp Kempgen -- das-asterisk-buch.de - the-asterisk-book.com Amooma GmbH - Bachstr. 126 - 56566 Neuwied -> amooma.de Gesch?ftsf?hrer: Stefan Wintermeyer, Handelsregister: Neuwied B14998 --
Philipp Kempgen wrote:> How is MSet() different from Set()? > Is it supposed to be a "Multi"-Set()? > Why was it added in 1.6? > > > Philipp Kempgen >It is a Multiset application. My recollection of the addition is that due to parser changes in 1.6, a statement like: exten => s,1,Set(FOO=hello,BAR=world) would result in a variable called FOO being set to the value "hello,BAR=world". The MSet application was added to facilitate being able to set multiple variables in a single application call. If using MSet, the above would instead result in a variable called FOO being set to the value "hello" and a variable called BAR being set to "world". Mark Michelson
Mark Michelson wrote:> Philipp Kempgen wrote: >> How is MSet() different from Set()? >> Is it supposed to be a "Multi"-Set()? >> Why was it added in 1.6? >> >> >> Philipp Kempgen >> > > It is a Multiset application. My recollection of the addition is that due to > parser changes in 1.6, a statement like: > > exten => s,1,Set(FOO=hello,BAR=world) > > would result in a variable called FOO being set to the value "hello,BAR=world". > The MSet application was added to facilitate being able to set multiple > variables in a single application call. If using MSet, the above would instead > result in a variable called FOO being set to the value "hello" and a variable > called BAR being set to "world". > > Mark Michelson >An even better answer is in the UPGRADE-1.6.txt document in the Asterisk source: * The behavior of the Set application now depends upon a compatibility option, set in asterisk.conf. To use the old 1.4 behavior, which allowed Set to take multiple key/value pairs, set app_set=1.4 in [compat] in asterisk.conf. To use the new behavior, which permits variables to be set with embedded commas, set app_set=1.6 in [compat] in asterisk.conf. Note that you can have both behaviors at the same time, if you switch to using MSet if you want the old behavior. Mark Michelson
On Friday 12 December 2008 15:41:54 Mark Michelson wrote:> would result in a variable called FOO being set to the value > "hello,BAR=world". The MSet application was added to facilitate being able > to set multiple variables in a single application call. If using MSet, the > above would instead result in a variable called FOO being set to the value > "hello" and a variable called BAR being set to "world".what about Set(ARRAY(var1,var2)=value1,value2) ? is the MSet() app a better/quicker way to do this? -- Anthony - messinet.com - messinet.com/~amessina/gallery 8F89 5E72 8DF0 BCF0 10BE 9967 92DC 35DC B001 4A4E -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part. Url : lists.digium.com/pipermail/asterisk-users/attachments/20081212/6f25ce94/attachment.pgp