This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; This dialplan fragment allow to dial a given number from the asterisk console on a given span : | |
; 1- check span ability to place a call | |
; 2- check logical group ability to place a call, as well as group allocation strategy | |
; 3- check caller ID presentation | |
; 4- check outgoing voice quality by announcing ${SYSTEMNAME} via speech synthesis | |
; 5- check incoming voice quality by Echo()'ing the called party | |
; | |
; Usage: | |
; $ sudo asterisk -rv | |
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env pike | |
int timeout_data=10; | |
int timeout=40; | |
string host_check = "www.example.com"; | |
string query_check = "GET / HTTP/1.1"; | |
int port_check = 80; | |
mapping headers = ([ "User-Agent":"Pike Loop HTTP test" ]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Dial 999 to dynamically create or join a conference : | |
; c – Announce user(s) count on joining a conference | |
; I – Announce user join/leave without review | |
; x – Leave the conference when the last marked user leaves | |
; s – Present menu (user or admin) when * is received (send to menu) | |
; M( class ) – Enable music on hold when the conference has a single caller | |
; Either : | |
; d – Dynamically add conference | |
; D – Dynamically add conference, prompting for a PIN | |
exten => 999,1,MeetMe(,cIxDsM) ; PIN-protected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[acme-attendant] | |
; Simple Auto-attendant - call 1234 to get prompted a personnal extension | |
exten => 1234,1,Ringing() | |
same => n,Wait(3) | |
same => n,Background(enter-ext-of-person) | |
same => n,Dumpchan() | |
same => n,WaitExten(10) | |
same => n,Hangup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simplest blank asterisk AEL config file | |
// | |
// This configuration file is reloaded | |
// - With the "ael reload" command in the CLI | |
// - With the "reload" command (that reloads everything) in the CLI | |
// | |
// NOTE! NOTE! NOTE! | |
// Asterisk by default will load both extensions.conf and extensions.ael files. | |
// Upon loading these files the dialplans generated from both with be merged, | |
// so you must make sure that you don't have any overlapping contexts or global |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env pike | |
// This script take a dirty CSV as input | |
// Output a white-trimed CSV : spaces, tabs, CR, LF | |
// Set up the following | |
string in_dirty_path = ""; | |
string out_clean_path = ""; | |
int i_ve_set_file_paths = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Calendar.dwim_day("2001-02-12")->distance(Calendar.now())->how_many(Calendar.Day)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; You may miss MeetMe() from your old asterisk box | |
; Here's an asterisk fragment whose goal is to mimic the following MeetMe() line using Confbridge() | |
; exten => 42,1,MeetMe(,cIxDsM) | |
; call 42 to create/join dynamic pin-protected ConfBridge() conference | |
; adapt context and call number to your actual numbering plan | |
[your-random-context] | |
exten => 42,1,NoOp() | |
same => n,Goto(conference,s,1) | |
same => n,Hangup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> object t = System.Time(); t->sec; t->usec; t->usec_full; | |
(1) Result: 1556201631 | |
(2) Result: 393431 | |
(3) Result: 1556201631393970 | |
> object s = Calendar.parse("%Y-%M-%aT%h:%m:%s.%f","2019-04-25T15:10:03.193000+00:00"); | |
> s->f_unix_time(); | |
(1) Result: 1556197803.193 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/pike | |
// Pre-shared key. Should be 16 bytes, kept secret | |
string key = "secret16byteskey"; | |
// Message to encode | |
string msg_from = "What's your name, James?"; | |
int main(int argc, array(string) argv) | |
{ | |
write("key : %O\nmsg : %O\n", key, msg_from); |
OlderNewer