diff --git a/apps/app_confbridge.c b/apps/app_confbridge.c index ae17bcab6f..9b3ddba836 100644 --- a/apps/app_confbridge.c +++ b/apps/app_confbridge.c @@ -198,23 +198,29 @@ ---- Example 1 ---- In this example the custom user profile set on the channel will automatically be used by the ConfBridge application. - exten => 1,1,Answer() + + exten => 1,1,Answer() + ; In this example the effect of the following line is ; implied: - ; same => n,Set(CONFBRIDGE(user,template)=default_user) - same => n,Set(CONFBRIDGE(user,announce_join_leave)=yes) - same => n,Set(CONFBRIDGE(user,startmuted)=yes) - same => n,ConfBridge(1) + + same => n,Set(CONFBRIDGE(user,template)=default_user) + same => n,Set(CONFBRIDGE(user,announce_join_leave)=yes) + same => n,Set(CONFBRIDGE(user,startmuted)=yes) + same => n,ConfBridge(1) + ---- Example 2 ---- This example shows how to use a predefined user profile in confbridge.conf as a template for a dynamic profile. Here we make an admin/marked user out of the my_user profile that you define in confbridge.conf. - exten => 1,1,Answer() - same => n,Set(CONFBRIDGE(user,template)=my_user) - same => n,Set(CONFBRIDGE(user,admin)=yes) - same => n,Set(CONFBRIDGE(user,marked)=yes) - same => n,ConfBridge(1) + + exten => 1,1,Answer() + same => n,Set(CONFBRIDGE(user,template)=my_user) + same => n,Set(CONFBRIDGE(user,admin)=yes) + same => n,Set(CONFBRIDGE(user,marked)=yes) + same => n,ConfBridge(1) + diff --git a/funcs/func_cdr.c b/funcs/func_cdr.c index d7bc211452..2c6e2e1018 100644 --- a/funcs/func_cdr.c +++ b/funcs/func_cdr.c @@ -161,7 +161,9 @@ CDRs can only be modified before the bridge between two channels is torn down. For example, CDRs may not be modified after the Dial application has returned. - Example: exten => 1,1,Set(CDR(userfield)=test) + + exten => 1,1,Set(CDR(userfield)=test) + diff --git a/funcs/func_dialgroup.c b/funcs/func_dialgroup.c index 9a98b3ca24..64aa65882e 100644 --- a/funcs/func_dialgroup.c +++ b/funcs/func_dialgroup.c @@ -67,10 +67,11 @@ fallback to a queue when the front line people are busy or unavailable, but you still want front line people to log in and out of that group, just like a queue. - Example: - exten => 1,1,Set(DIALGROUP(mygroup,add)=SIP/10) - exten => 1,n,Set(DIALGROUP(mygroup,add)=SIP/20) - exten => 1,n,Dial(${DIALGROUP(mygroup)}) + + exten => 1,1,Set(DIALGROUP(mygroup,add)=SIP/10) + same => n,Set(DIALGROUP(mygroup,add)=SIP/20) + same => n,Dial(${DIALGROUP(mygroup)}) + ***/ diff --git a/funcs/func_env.c b/funcs/func_env.c index 26025002ec..aba753352e 100644 --- a/funcs/func_env.c +++ b/funcs/func_env.c @@ -178,48 +178,61 @@ Read and write text file in character and line mode. Examples: - Read mode (byte): - ;reads the entire content of the file. - Set(foo=${FILE(/tmp/test.txt)}) - ;reads from the 11th byte to the end of the file (i.e. skips the first 10). - Set(foo=${FILE(/tmp/test.txt,10)}) - ;reads from the 11th to 20th byte in the file (i.e. skip the first 10, then read 10 bytes). - Set(foo=${FILE(/tmp/test.txt,10,10)}) - + + same => n,Set(foo=${FILE(/tmp/test.txt)}) + + + same => n,Set(foo=${FILE(/tmp/test.txt,10)}) + + + same => n,Set(foo=${FILE(/tmp/test.txt,10,10)}) + Read mode (line): - ; reads the 3rd line of the file. - Set(foo=${FILE(/tmp/test.txt,3,1,l)}) - ; reads the 3rd and 4th lines of the file. - Set(foo=${FILE(/tmp/test.txt,3,2,l)}) - ; reads from the third line to the end of the file. - Set(foo=${FILE(/tmp/test.txt,3,,l)}) - ; reads the last three lines of the file. - Set(foo=${FILE(/tmp/test.txt,-3,,l)}) - ; reads the 3rd line of a DOS-formatted file. - Set(foo=${FILE(/tmp/test.txt,3,1,l,d)}) - + + same => n,Set(foo=${FILE(/tmp/test.txt,3,1,l)}) + + + same => n,Set(foo=${FILE(/tmp/test.txt,3,2,l)}) + + + same => n,Set(foo=${FILE(/tmp/test.txt,3,,l)}) + + + same => n,Set(foo=${FILE(/tmp/test.txt,-3,,l)}) + + + same => n,Set(foo=${FILE(/tmp/test.txt,3,1,l,d)}) + Write mode (byte): - ; truncate the file and write "bar" - Set(FILE(/tmp/test.txt)=bar) - ; Append "bar" - Set(FILE(/tmp/test.txt,,,a)=bar) - ; Replace the first byte with "bar" (replaces 1 character with 3) - Set(FILE(/tmp/test.txt,0,1)=bar) - ; Replace 10 bytes beginning at the 21st byte of the file with "bar" - Set(FILE(/tmp/test.txt,20,10)=bar) - ; Replace all bytes from the 21st with "bar" - Set(FILE(/tmp/test.txt,20)=bar) - ; Insert "bar" after the 4th character - Set(FILE(/tmp/test.txt,4,0)=bar) - + + same => n,Set(FILE(/tmp/test.txt)=bar) + + + same => n,Set(FILE(/tmp/test.txt,,,a)=bar) + + + same => n,Set(FILE(/tmp/test.txt,0,1)=bar) + + + same => n,Set(FILE(/tmp/test.txt,20,10)=bar) + + + same => n,Set(FILE(/tmp/test.txt,20)=bar) + + + same => n,Set(FILE(/tmp/test.txt,4,0)=bar) + Write mode (line): - ; Replace the first line of the file with "bar" - Set(FILE(/tmp/foo.txt,0,1,l)=bar) - ; Replace the last line of the file with "bar" - Set(FILE(/tmp/foo.txt,-1,,l)=bar) - ; Append "bar" to the file with a newline - Set(FILE(/tmp/foo.txt,,,al)=bar) + + same => n,Set(FILE(/tmp/foo.txt,0,1,l)=bar) + + + same => n,Set(FILE(/tmp/foo.txt,-1,,l)=bar) + + + same => n,Set(FILE(/tmp/foo.txt,,,al)=bar) + If live_dangerously in asterisk.conf is set to no, this function can only be executed from the diff --git a/funcs/func_frame_drop.c b/funcs/func_frame_drop.c index f5d70f322a..522685cbd0 100644 --- a/funcs/func_frame_drop.c +++ b/funcs/func_frame_drop.c @@ -91,9 +91,15 @@ Examples: - exten => 1,1,Set(FRAME_DROP(TX)=DTMF_BEGIN,DTMF_END); drop only DTMF frames towards this channel. - exten => 1,1,Set(FRAME_DROP(TX)=ANSWER); drop only ANSWER CONTROL frames towards this channel. - exten => 1,1,Set(FRAME_DROP(RX)=DTMF_BEGIN,DTMF_END); drop only DTMF frames received on this channel. + + exten => 1,1,Set(FRAME_DROP(TX)=DTMF_BEGIN,DTMF_END) + + + exten => 1,1,Set(FRAME_DROP(TX)=ANSWER) + + + exten => 1,1,Set(FRAME_DROP(RX)=DTMF_BEGIN,DTMF_END) + ***/ diff --git a/funcs/func_frame_trace.c b/funcs/func_frame_trace.c index b62bae9dee..b023c9f41d 100644 --- a/funcs/func_frame_trace.c +++ b/funcs/func_frame_trace.c @@ -69,9 +69,15 @@ Examples: - exten => 1,1,Set(FRAME_TRACE(white)=DTMF_BEGIN,DTMF_END); view only DTMF frames. - exten => 1,1,Set(FRAME_TRACE()=DTMF_BEGIN,DTMF_END); view only DTMF frames. - exten => 1,1,Set(FRAME_TRACE(black)=DTMF_BEGIN,DTMF_END); view everything except DTMF frames. + + exten => 1,1,Set(FRAME_TRACE(white)=DTMF_BEGIN,DTMF_END) + + + exten => 1,1,Set(FRAME_TRACE()=DTMF_BEGIN,DTMF_END) + + + exten => 1,1,Set(FRAME_TRACE(black)=DTMF_BEGIN,DTMF_END) + ***/ diff --git a/funcs/func_math.c b/funcs/func_math.c index c5c30e4b6e..c3bc71fbf4 100644 --- a/funcs/func_math.c +++ b/funcs/func_math.c @@ -71,7 +71,9 @@ Performs mathematical functions based on two parameters and an operator. The returned value type is type - Example: Set(i=${MATH(123%16,int)}) - sets var i=11 + + same => n,Set(i=${MATH(123%16,int)}) + @@ -104,8 +106,10 @@ Decrements the value of a variable, while returning the updated value to the dialplan - Example: DEC(MyVAR) - Decrements MyVar - Note: DEC(${MyVAR}) - Is wrong, as DEC expects the variable name, not its value + + same => n,NoOp(${DEC(MyVAR)}) + + DEC(${MyVAR}) is wrong, as DEC expects the variable name, not its value @@ -123,8 +127,9 @@ Returns the minimum of two numbers num1 and num2. - Example: Set(min=${MIN(7,4)}); - Sets the min variable equal to 4. + + same => n,Set(min=${MIN(7,4)}) + @@ -142,8 +147,9 @@ Returns the maximum of two numbers num1 and num2. - Example: Set(max=${MAX(4,7)}); - Sets the max variable equal to 7. + + same => n,Set(max=${MAX(4,7)}) + @@ -160,8 +166,9 @@ Returns the absolute value of a number num. - Example: Set(absval=${ABS(-13)}); - Sets the absval variable equal to 13. + + same => n,Set(absval=${ABS(-13)}) + ***/ diff --git a/funcs/func_odbc.c b/funcs/func_odbc.c index 7e4e6a3bb7..43c4a0c6a5 100644 --- a/funcs/func_odbc.c +++ b/funcs/func_odbc.c @@ -93,7 +93,9 @@ Used in SQL templates to escape data which may contain single ticks ' which are otherwise used to delimit data. - Example: SELECT foo FROM bar WHERE baz='${SQL_ESC(${ARG1})}' + + SELECT foo FROM bar WHERE baz='${SQL_ESC(${ARG1})}' + @@ -106,7 +108,9 @@ Used in SQL templates to escape data which may contain backslashes \ which are otherwise used to escape data. - Example: SELECT foo FROM bar WHERE baz='${SQL_ESC(${SQL_ESC_BACKSLASHES(${ARG1})})}' + + SELECT foo FROM bar WHERE baz='${SQL_ESC(${SQL_ESC_BACKSLASHES(${ARG1})})}' + ***/ diff --git a/funcs/func_periodic_hook.c b/funcs/func_periodic_hook.c index 6b90ee3b83..3c7b93e6a7 100644 --- a/funcs/func_periodic_hook.c +++ b/funcs/func_periodic_hook.c @@ -67,15 +67,15 @@ For example, you could use this function to enable playing a periodic beep sound in a call. - To turn on: - Set(BEEPID=${PERIODIC_HOOK(hooks,beep,180)}) - - To turn off: - Set(PERIODIC_HOOK(${BEEPID})=off) - - To turn back on again later: - Set(PERIODIC_HOOK(${BEEPID})=on) - + + same => n,Set(BEEPID=${PERIODIC_HOOK(hooks,beep,180)}) + + + same => n,Set(PERIODIC_HOOK(${BEEPID})=off) + + + same => n,Set(PERIODIC_HOOK(${BEEPID})=on) + It is important to note that the hook does not actually run on the channel itself. It runs asynchronously on a new channel. Any audio generated by the hook gets injected into the call for diff --git a/funcs/func_pitchshift.c b/funcs/func_pitchshift.c index 779f064e72..4057ed9c87 100644 --- a/funcs/func_pitchshift.c +++ b/funcs/func_pitchshift.c @@ -97,15 +97,30 @@ Examples: - exten => 1,1,Set(PITCH_SHIFT(tx)=highest); raises pitch an octave - exten => 1,1,Set(PITCH_SHIFT(rx)=higher) ; raises pitch more - exten => 1,1,Set(PITCH_SHIFT(both)=high) ; raises pitch - exten => 1,1,Set(PITCH_SHIFT(rx)=low) ; lowers pitch - exten => 1,1,Set(PITCH_SHIFT(tx)=lower) ; lowers pitch more - exten => 1,1,Set(PITCH_SHIFT(both)=lowest) ; lowers pitch an octave - - exten => 1,1,Set(PITCH_SHIFT(rx)=0.8) ; lowers pitch - exten => 1,1,Set(PITCH_SHIFT(tx)=1.5) ; raises pitch + + exten => 1,1,Set(PITCH_SHIFT(tx)=highest) + + + exten => 1,1,Set(PITCH_SHIFT(rx)=higher) + + + exten => 1,1,Set(PITCH_SHIFT(both)=high) + + + exten => 1,1,Set(PITCH_SHIFT(rx)=low) + + + exten => 1,1,Set(PITCH_SHIFT(tx)=lower) + + + exten => 1,1,Set(PITCH_SHIFT(both)=lowest) + + + exten => 1,1,Set(PITCH_SHIFT(rx)=0.8) + + + exten => 1,1,Set(PITCH_SHIFT(tx)=1.5) + ***/ diff --git a/funcs/func_rand.c b/funcs/func_rand.c index bf208e9e23..2b70ba3443 100644 --- a/funcs/func_rand.c +++ b/funcs/func_rand.c @@ -49,8 +49,9 @@ Choose a random number between min and max. min defaults to 0, if not specified, while max defaults to RAND_MAX (2147483647 on many systems). - Example: Set(junky=${RAND(1,8)}); - Sets junky to a random number between 1 and 8, inclusive. + + exten => s,1,Set(junky=${RAND(1,8)}) + ***/ diff --git a/funcs/func_sha1.c b/funcs/func_sha1.c index 6c96ecd059..11685b2f24 100644 --- a/funcs/func_sha1.c +++ b/funcs/func_sha1.c @@ -45,9 +45,11 @@ Generate a SHA1 digest via the SHA1 algorythm. - Example: Set(sha1hash=${SHA1(junky)}) - Sets the asterisk variable sha1hash to the string 60fa5675b9303eb62f99a9cd47f9f5837d18f9a0 - which is known as his hash + + exten => s,1,Set(sha1hash=${SHA1(junky)}) + + The example above sets the asterisk variable sha1hash to the string 60fa5675b9303eb62f99a9cd47f9f5837d18f9a0 + which is known as its hash ***/ diff --git a/funcs/func_shell.c b/funcs/func_shell.c index fe1debe884..c8c2187180 100644 --- a/funcs/func_shell.c +++ b/funcs/func_shell.c @@ -91,7 +91,9 @@ static int shell_helper(struct ast_channel *chan, const char *cmd, char *data, Collects the output generated by a command executed by the system shell - Example: Set(foo=${SHELL(echo bar)}) + + exten => s,1,Set(foo=${SHELL(echo bar)}) + The command supplied to this function will be executed by the system's shell, typically specified in the SHELL environment variable. There diff --git a/funcs/func_speex.c b/funcs/func_speex.c index 1a88fae7f3..7d05d6f43c 100644 --- a/funcs/func_speex.c +++ b/funcs/func_speex.c @@ -66,9 +66,10 @@ analog lines, but could be useful for other channels as well. The target volume is set with a number between 1-32768. The larger the number the louder (more gain) the channel will receive. - Examples: - exten => 1,1,Set(AGC(rx)=8000) - exten => 1,2,Set(AGC(tx)=off) + + exten => 1,1,Set(AGC(rx)=8000) + exten => 1,2,Set(AGC(tx)=off) + @@ -87,9 +88,10 @@ that it is executed on. It is very useful for noisy analog lines, especially when adjusting gains or using AGC. Use rx for audio received from the channel and tx to apply the filter to the audio being sent to the channel. - Examples: - exten => 1,1,Set(DENOISE(rx)=on) - exten => 1,2,Set(DENOISE(tx)=off) + + exten => 1,1,Set(DENOISE(rx)=on) + exten => 1,2,Set(DENOISE(tx)=off) + ***/ diff --git a/funcs/func_strings.c b/funcs/func_strings.c index 3eed847d54..77cdc99f28 100644 --- a/funcs/func_strings.c +++ b/funcs/func_strings.c @@ -62,7 +62,10 @@ AST_THREADSTORAGE(tmp_buf); carriage return, and tab characters, respectively. Also, octal and hexadecimal specifications are recognized by the patterns \0nnn and \xHH, respectively. For example, if you wanted to encode a comma as the delimiter, you could use either \054 or \x2C. - Example: If ${example} contains ex-amp-le, then ${FIELDQTY(example,-)} returns 3. + + exten => s,1,Set(example=ex-amp-le) + same => n,NoOp(${FIELDQTY(example,-)}) + @@ -83,7 +86,10 @@ AST_THREADSTORAGE(tmp_buf); carriage return, and tab characters, respectively. Also, octal and hexadecimal specifications are recognized by the patterns \0nnn and \xHH, respectively. For example, if you wanted to encode a comma as the delimiter, you could use either \054 or \x2C. - Example: If ${example} contains ex-amp-le, then ${FIELDNUM(example,-,amp)} returns 2. + + exten => s,1,Set(example=ex-amp-le) + same => n,NoOp(${FIELDNUM(example,-,amp)}) + @@ -190,8 +196,10 @@ AST_THREADSTORAGE(tmp_buf); string, instead. The functions which take a variable name need to be passed var and not ${var}. Similarly, use PASSTHRU() and not ${PASSTHRU()}. - Example: ${CHANNEL} contains SIP/321-1 - ${CUT(PASSTHRU(${CUT(CHANNEL,-,1)}),/,2)}) will return 321 + + exten => s,1,NoOp(${CHANNEL}) ; contains SIP/321-1 + same => n,NoOp(${CUT(PASSTHRU(${CUT(CHANNEL,-,1)}),/,2)}) + @@ -257,7 +265,9 @@ AST_THREADSTORAGE(tmp_buf); - Example: ${KEYPADHASH(Les)} returns "537" + + exten => s,1,Return(${KEYPADHASH(Les)}) + @@ -273,7 +283,9 @@ AST_THREADSTORAGE(tmp_buf); The comma-delimited list passed as a value to which the function is set will be interpreted as a set of values to which the comma-delimited list of variable names in the argument should be set. - Example: Set(ARRAY(var1,var2)=1,2) will set var1 to 1 and var2 to 2 + + same => n,Set(ARRAY(var1,var2)=1,2) + @@ -289,7 +301,9 @@ AST_THREADSTORAGE(tmp_buf); This is useful for converting a date into EPOCH time, possibly to pass to an application like SayUnixTime or to calculate the difference between the two date strings - Example: ${STRPTIME(2006-03-01 07:30:35,America/Chicago,%Y-%m-%d %H:%M:%S)} returns 1141219835 + + same => n,NoOp(${STRPTIME(2006-03-01 07:30:35,America/Chicago,%Y-%m-%d %H:%M:%S)}) + @@ -343,7 +357,9 @@ AST_THREADSTORAGE(tmp_buf); - Example: ${TOUPPER(Example)} returns "EXAMPLE" + + exten => s,1,NoOp(${TOUPPER(Example)}) + @@ -354,7 +370,9 @@ AST_THREADSTORAGE(tmp_buf); - Example: ${TOLOWER(Example)} returns "example" + + exten => s,1,NoOp(${TOLOWER(Example)}) + @@ -365,7 +383,9 @@ AST_THREADSTORAGE(tmp_buf); - Example: ${LEN(example)} returns 7 + + exten => s,1,NoOp(${LEN(example)}) + @@ -399,11 +419,12 @@ AST_THREADSTORAGE(tmp_buf); - Example: - exten => s,1,Set(array=one,two,three) - exten => s,n,While($["${SET(var=${SHIFT(array)})}" != ""]) - exten => s,n,NoOp(var is ${var}) - exten => s,n,EndWhile + + exten => s,1,Set(array=one,two,three) + exten => s,n,While($["${SET(var=${SHIFT(array)})}" != ""]) + exten => s,n,NoOp(var is ${var}) + exten => s,n,EndWhile + This would iterate over each value in array, left to right, and would result in NoOp(var is one), NoOp(var is two), and NoOp(var is three) being executed. @@ -419,11 +440,12 @@ AST_THREADSTORAGE(tmp_buf); - Example: - exten => s,1,Set(array=one,two,three) - exten => s,n,While($["${SET(var=${POP(array)})}" != ""]) - exten => s,n,NoOp(var is ${var}) - exten => s,n,EndWhile + + exten => s,1,Set(array=one,two,three) + exten => s,n,While($["${SET(var=${POP(array)})}" != ""]) + exten => s,n,NoOp(var is ${var}) + exten => s,n,EndWhile + This would iterate over each value in array, right to left, and would result in NoOp(var is three), NoOp(var is two), and NoOp(var is one) being executed. @@ -439,7 +461,10 @@ AST_THREADSTORAGE(tmp_buf); - Example: Set(PUSH(array)=one,two,three) would append one, + + exten => s,1,Set(PUSH(array)=one,two,three) + + This would append one, two, and three to the end of the values stored in the variable "array". @@ -454,7 +479,10 @@ AST_THREADSTORAGE(tmp_buf); - Example: Set(UNSHIFT(array)=one,two,three) would insert one, + + exten => s,1,Set(UNSHIFT(array)=one,two,three) + + This would insert one, two, and three before the values stored in the variable "array". diff --git a/funcs/func_talkdetect.c b/funcs/func_talkdetect.c index 88c470e8e3..257ecda8f3 100644 --- a/funcs/func_talkdetect.c +++ b/funcs/func_talkdetect.c @@ -103,11 +103,18 @@ natural speech. By default this value is 2500ms. Valid values are 1 through 2^31. - Example: - same => n,Set(TALK_DETECT(set)=) ; Enable talk detection - same => n,Set(TALK_DETECT(set)=1200) ; Update existing talk detection's silence threshold to 1200 ms - same => n,Set(TALK_DETECT(remove)=) ; Remove talk detection - same => n,Set(TALK_DETECT(set)=,128) ; Enable and set talk threshold to 128 + + same => n,Set(TALK_DETECT(set)=) + + + same => n,Set(TALK_DETECT(set)=1200) + + + same => n,Set(TALK_DETECT(remove)=) + + + same => n,Set(TALK_DETECT(set)=,128) + This function will set the following variables: The TALK_DETECT function uses an audiohook to inspect the @@ -117,10 +124,11 @@ it typically makes sense to place functions that modify the voice media data prior to placing the TALK_DETECT function, as this will yield better results. - Example: - same => n,Set(DENOISE(rx)=on) ; Denoise received audio - same => n,Set(TALK_DETECT(set)=) ; Perform talk detection on the denoised received audio + + same => n,Set(DENOISE(rx)=on) ; Denoise received audio + same => n,Set(TALK_DETECT(set)=) ; Perform talk detection on the denoised received audio + ***/ diff --git a/funcs/func_version.c b/funcs/func_version.c index 01cb748454..baef884ac4 100644 --- a/funcs/func_version.c +++ b/funcs/func_version.c @@ -47,7 +47,7 @@ A string of digits is returned, e.g. 10602 for 1.6.2 or 100300 for 10.3.0, - or 999999 when using an SVN build. + or 999999 when using a Git build. The string representing the user's name whose account @@ -73,9 +73,10 @@ - If there are no arguments, return the version of Asterisk in this format: SVN-branch-1.4-r44830M - Example: Set(junky=${VERSION()}; - Sets junky to the string SVN-branch-1.6-r74830M, or possibly, SVN-trunk-r45126M. + If there are no arguments, return the version of Asterisk in this format: 18.12.0 + + same => n,Set(junky=${VERSION()} ; sets junky to 18.12.0, or possibly GITMasterxxxxxx + ***/ diff --git a/funcs/func_vmcount.c b/funcs/func_vmcount.c index 66007034a1..b6302ccbae 100644 --- a/funcs/func_vmcount.c +++ b/funcs/func_vmcount.c @@ -57,7 +57,9 @@ Count the number of voicemails in a specified mailbox, you could also specify the mailbox folder. - Example: exten => s,1,Set(foo=${VMCOUNT(125@default)}) + + exten => s,1,Set(foo=${VMCOUNT(125@default)}) + An ampersand-separated list of mailboxes may be specified to count voicemails in multiple mailboxes. If a folder is specified, this will apply to all mailboxes specified. diff --git a/funcs/func_volume.c b/funcs/func_volume.c index a20bb76042..93728728d6 100644 --- a/funcs/func_volume.c +++ b/funcs/func_volume.c @@ -59,11 +59,24 @@ The VOLUME function can be used to increase or decrease the tx or rx gain of any channel. - For example: - Set(VOLUME(TX)=3) - Set(VOLUME(RX)=2) - Set(VOLUME(TX,p)=3) - Set(VOLUME(RX,p)=3) + + same => n,Set(VOLUME(TX)=3) + + + same => n,Set(VOLUME(RX)=2) + + + same => n,Set(VOLUME(TX,p)=3) + + + same => n,Set(VOLUME(RX,p)=3) + + + same => n,Set(VOLUME(RX)=-4) + + + same => n,Set(VOLUME(RX)=0) + ***/ diff --git a/res/res_calendar.c b/res/res_calendar.c index 98f9169347..4af1fde72b 100644 --- a/res/res_calendar.c +++ b/res/res_calendar.c @@ -193,7 +193,9 @@ - Example: CALENDAR_WRITE(calendar,field1,field2,field3)=val1,val2,val3 + + same => n,Set(CALENDAR_WRITE(calendar,field1,field2,field3)=val1,val2,val3) + The field and value arguments can easily be set/passed using the HASHKEYS() and HASH() functions diff --git a/res/res_mutestream.c b/res/res_mutestream.c index 8040a3ac9b..93c6d0a9d8 100644 --- a/res/res_mutestream.c +++ b/res/res_mutestream.c @@ -69,16 +69,13 @@ - The MUTEAUDIO function can be used to mute inbound (to the PBX) or outbound audio in a call. - - Examples: - - - MUTEAUDIO(in)=on - - - MUTEAUDIO(in)=off - + The MUTEAUDIO function can be used to mute inbound (to the PBX) or outbound audio in a call. + + exten => s,1,Set(MUTEAUDIO(in)=on) + + + exten => s,1,Set(MUTEAUDIO(in)=off) + diff --git a/res/res_pjsip_config_wizard.c b/res/res_pjsip_config_wizard.c index 4c1c59b0ca..59976b1584 100644 --- a/res/res_pjsip_config_wizard.c +++ b/res/res_pjsip_config_wizard.c @@ -65,25 +65,24 @@ endpoint, aor, contact, auth and phoneprov objects necessary for a phone to get phone provisioning information, register, and make and receive calls. A hint is also created in the default context for extension 1000. - - - [myphone] - type = wizard - sends_auth = no - accepts_auth = yes - sends_registrations = no - accepts_registrations = yes - has_phoneprov = yes - transport = ipv4 - has_hint = yes - hint_exten = 1000 - inbound_auth/username = testname - inbound_auth/password = test password - endpoint/allow = ulaw - endpoint/context = default - phoneprov/MAC = 001122aa4455 - phoneprov/PROFILE = profile1 - + + [myphone] + type = wizard + sends_auth = no + accepts_auth = yes + sends_registrations = no + accepts_registrations = yes + has_phoneprov = yes + transport = ipv4 + has_hint = yes + hint_exten = 1000 + inbound_auth/username = testname + inbound_auth/password = test password + endpoint/allow = ulaw + endpoint/context = default + phoneprov/MAC = 001122aa4455 + phoneprov/PROFILE = profile1 + The first 8 items are specific to the wizard. The rest of the items are passed verbatim to the underlying objects. @@ -92,21 +91,20 @@ The following configuration snippet would create the endpoint, aor, contact, auth, identify and registration objects necessary for a trunk to another pbx or ITSP that requires registration. - - - [mytrunk] - type = wizard - sends_auth = yes - accepts_auth = no - sends_registrations = yes - accepts_registrations = no - transport = ipv4 - remote_hosts = sip1.myitsp.com:5060,sip2.myitsp.com:5060 - outbound_auth/username = testname - outbound_auth/password = test password - endpoint/allow = ulaw - endpoint/context = default - + + [mytrunk] + type = wizard + sends_auth = yes + accepts_auth = no + sends_registrations = yes + accepts_registrations = no + transport = ipv4 + remote_hosts = sip1.myitsp.com:5060,sip2.myitsp.com:5060 + outbound_auth/username = testname + outbound_auth/password = test password + endpoint/allow = ulaw + endpoint/context = default + Of course, any of the items in either example could be placed into templates and shared among wizard objects. @@ -227,10 +225,10 @@ exten => <hint_exten>,1,<hint_application> You can specify any valid extensions.conf application expression. - Examples: - Dial(${HINT}) - Gosub(stdexten,${EXTEN},1(${HINT})) - + + Dial(${HINT}) + Gosub(stdexten,${EXTEN},1(${HINT})) + Any extensions.conf style variables specified are passed directly to the dialplan. diff --git a/res/res_pjsip_header_funcs.c b/res/res_pjsip_header_funcs.c index ee941479d7..fa6db34a3f 100644 --- a/res/res_pjsip_header_funcs.c +++ b/res/res_pjsip_header_funcs.c @@ -84,65 +84,59 @@ channel. One exception is that you can read headers that you have already added on the outbound channel. Examples: - ; - ; Set 'somevar' to the value of the 'From' header. - exten => 1,1,Set(somevar=${PJSIP_HEADER(read,From)}) - ; - ; Set 'via2' to the value of the 2nd 'Via' header. - exten => 1,1,Set(via2=${PJSIP_HEADER(read,Via,2)}) - ; - ; Set 'xhdr' to the value of the 1sx X-header. - exten => 1,1,Set(xhdr=${PJSIP_HEADER(read,X-*,1)}) - ; - ; Add an 'X-Myheader' header with the value of 'myvalue'. - exten => 1,1,Set(PJSIP_HEADER(add,X-MyHeader)=myvalue) - ; - ; Add an 'X-Myheader' header with an empty value. - exten => 1,1,Set(PJSIP_HEADER(add,X-MyHeader)=) - ; - ; Update the value of the header named 'X-Myheader' to 'newvalue'. - ; 'X-Myheader' must already exist or the call will fail. - exten => 1,1,Set(PJSIP_HEADER(update,X-MyHeader)=newvalue) - ; - ; Remove all headers whose names exactly match 'X-MyHeader'. - exten => 1,1,Set(PJSIP_HEADER(remove,X-MyHeader)=) - ; - ; Remove all headers that begin with 'X-My'. - exten => 1,1,Set(PJSIP_HEADER(remove,X-My*)=) - ; - ; Remove all previously added headers. - exten => 1,1,Set(PJSIP_HEADER(remove,*)=) - ; - + + exten => 1,1,Set(somevar=${PJSIP_HEADER(read,From)}) + + + exten => 1,1,Set(via2=${PJSIP_HEADER(read,Via,2)}) + + + exten => 1,1,Set(xhdr=${PJSIP_HEADER(read,X-*,1)}) + + + exten => 1,1,Set(PJSIP_HEADER(add,X-MyHeader)=myvalue) + + + exten => 1,1,Set(PJSIP_HEADER(add,X-MyHeader)=) + + + ; 'X-Myheader' must already exist or the call will fail. + exten => 1,1,Set(PJSIP_HEADER(update,X-MyHeader)=newvalue) + + + exten => 1,1,Set(PJSIP_HEADER(remove,X-MyHeader)=) + + + exten => 1,1,Set(PJSIP_HEADER(remove,X-My*)=) + + + exten => 1,1,Set(PJSIP_HEADER(remove,*)=) + The remove action can be called by reading - or writing PJSIP_HEADER. - ; - ; Display the number of headers removed - exten => 1,1,Verbose( Removed ${PJSIP_HEADER(remove,X-MyHeader)} headers) - ; - ; Set a variable to the number of headers removed - exten => 1,1,Set(count=${PJSIP_HEADER(remove,X-MyHeader)}) - ; - ; Just remove them ignoring any count - exten => 1,1,Set(=${PJSIP_HEADER(remove,X-MyHeader)}) - exten => 1,1,Set(PJSIP_HEADER(remove,X-MyHeader)=) - ; - + or writing PJSIP_HEADER. + + exten => 1,1,Verbose( Removed ${PJSIP_HEADER(remove,X-MyHeader)} headers) + + + exten => 1,1,Set(count=${PJSIP_HEADER(remove,X-MyHeader)}) + + + exten => 1,1,Set(=${PJSIP_HEADER(remove,X-MyHeader)}) + exten => 1,1,Set(PJSIP_HEADER(remove,X-MyHeader)=) + If you call PJSIP_HEADER in a normal dialplan context you'll be operating on the caller's (incoming) channel which may not be what you want. To operate on the callee's (outgoing) - channel call PJSIP_HEADER in a pre-dial handler. - Example: - ; - [handler] - exten => addheader,1,Set(PJSIP_HEADER(add,X-MyHeader)=myvalue) - exten => addheader,2,Set(PJSIP_HEADER(add,X-MyHeader2)=myvalue2) - ; - [somecontext] - exten => 1,1,Dial(PJSIP/${EXTEN},,b(handler^addheader^1)) - ; - + channel call PJSIP_HEADER in a pre-dial handler. + + [handler] + exten => addheader,1,Set(PJSIP_HEADER(add,X-MyHeader)=myvalue) + exten => addheader,2,Set(PJSIP_HEADER(add,X-MyHeader2)=myvalue2) + + [somecontext] + exten => 1,1,Dial(PJSIP/${EXTEN},,b(handler^addheader^1)) +