Commit 52168de73a331148b5027e242a8d8697b1a4540f
1 parent
647c64d2
add ami_originate_call with more arguments
add hr in making a website
Showing
4 changed files
with
73 additions
and
31 deletions
Show diff stats
asterisk/ami.anubis
| @@ -9,15 +9,11 @@ | @@ -9,15 +9,11 @@ | ||
| 9 | read system/string.anubis | 9 | read system/string.anubis |
| 10 | read tools/basis.anubis | 10 | read tools/basis.anubis |
| 11 | read tools/connections.anubis | 11 | read tools/connections.anubis |
| 12 | +read calexium_lib/web/CXM_http_get_common.anubis | ||
| 12 | 13 | ||
| 13 | -read asterisk/ami_types.anubis | ||
| 14 | -read asterisk/ami_commands.anubis | ||
| 15 | -read web/CXM_http_get_common.anubis | 14 | +transmit calexium_lib/asterisk/ami_types.anubis |
| 15 | +transmit calexium_lib/asterisk/ami_commands.anubis | ||
| 16 | 16 | ||
| 17 | - | ||
| 18 | - | ||
| 19 | - public define Result( | ||
| 20 | - | ||
| 21 | define Maybe(One) | 17 | define Maybe(One) |
| 22 | receive | 18 | receive |
| 23 | ( | 19 | ( |
| @@ -116,6 +112,7 @@ public define Maybe(Asterisk_client) | @@ -116,6 +112,7 @@ public define Maybe(Asterisk_client) | ||
| 116 | String server_name, | 112 | String server_name, |
| 117 | AMI_Auth auth | 113 | AMI_Auth auth |
| 118 | )= | 114 | )= |
| 115 | + //println("asterisk_new_client "+server_name); | ||
| 119 | if separate_name_port(server_name, 5038) is (name, server_port) then | 116 | if separate_name_port(server_name, 5038) is (name, server_port) then |
| 120 | // | 117 | // |
| 121 | // resolve server name and call 'https_get' with numeric server address: | 118 | // resolve server name and call 'https_get' with numeric server address: |
| @@ -153,7 +150,7 @@ public define Maybe(Asterisk_client) | @@ -153,7 +150,7 @@ public define Maybe(Asterisk_client) | ||
| 153 | failure. | 150 | failure. |
| 154 | 151 | ||
| 155 | 152 | ||
| 156 | -global define One | 153 | + global define One |
| 157 | ami_test | 154 | ami_test |
| 158 | ( | 155 | ( |
| 159 | List(String) args | 156 | List(String) args |
asterisk/ami_commands.anubis
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | * | 6 | * |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | -read asterisk/ami_types.anubis | 9 | +read calexium_lib/asterisk/ami_types.anubis |
| 10 | 10 | ||
| 11 | public define AMI_Action ami_login(String user, String password, Bool events) = | 11 | public define AMI_Action ami_login(String user, String password, Bool events) = |
| 12 | action("Login", [ | 12 | action("Login", [ |
| @@ -32,3 +32,20 @@ public define AMI_Action ami_originate_call(String extension, String out_number) | @@ -32,3 +32,20 @@ public define AMI_Action ami_originate_call(String extension, String out_number) | ||
| 32 | ] | 32 | ] |
| 33 | ) | 33 | ) |
| 34 | . | 34 | . |
| 35 | + | ||
| 36 | +public define AMI_Action | ||
| 37 | + ami_originate_call | ||
| 38 | + ( | ||
| 39 | + String extension, | ||
| 40 | + String out_number, | ||
| 41 | + String context | ||
| 42 | + )= | ||
| 43 | + action("Originate", [ | ||
| 44 | + key_value("Channel", "SIP/"+extension), | ||
| 45 | + key_value("Exten", out_number), | ||
| 46 | + key_value("Context", context), | ||
| 47 | + key_value("Priority", "1"), | ||
| 48 | + key_value("Async", "yes") | ||
| 49 | + ] | ||
| 50 | + ) | ||
| 51 | +. |
web/CXM_form.anubis
| @@ -226,6 +226,7 @@ public type CXM_Form_Field: | @@ -226,6 +226,7 @@ public type CXM_Form_Field: | ||
| 226 | div (List(CoreAttrs), HTML_In_Form content), | 226 | div (List(CoreAttrs), HTML_In_Form content), |
| 227 | partial (HTML_Partial_Content p_content), | 227 | partial (HTML_Partial_Content p_content), |
| 228 | br, | 228 | br, |
| 229 | + hr (List(CoreAttrs) options), | ||
| 229 | // input_with_help (CXM_Form_Field field, | 230 | // input_with_help (CXM_Form_Field field, |
| 230 | // Maybe(String) help_title, | 231 | // Maybe(String) help_title, |
| 231 | // String help_text, | 232 | // String help_text, |
| @@ -384,7 +385,12 @@ public define CXM_Form_Field | @@ -384,7 +385,12 @@ public define CXM_Form_Field | ||
| 384 | )= | 385 | )= |
| 385 | hidden(html_Id(""), web_arg_name, value). | 386 | hidden(html_Id(""), web_arg_name, value). |
| 386 | 387 | ||
| 387 | - | 388 | +public define CXM_Form_Field |
| 389 | + hr | ||
| 390 | + = | ||
| 391 | + hr([]) | ||
| 392 | +. | ||
| 393 | + | ||
| 388 | //--- explanation field --------------------- | 394 | //--- explanation field --------------------- |
| 389 | 395 | ||
| 390 | // ////////////////////////////////////////////////////////// | 396 | // ////////////////////////////////////////////////////////// |
| @@ -580,7 +586,8 @@ public define HTML_In_Form | @@ -580,7 +586,8 @@ public define HTML_In_Form | ||
| 580 | div(options, e) then div(options, e), | 586 | div(options, e) then div(options, e), |
| 581 | 587 | ||
| 582 | partial(p_content) then partial(p_content), | 588 | partial(p_content) then partial(p_content), |
| 583 | - br then br, | 589 | + br then br, |
| 590 | + hr(opts) then hr(opts), | ||
| 584 | // input_with_help(input, help_title, help_text, width) then | 591 | // input_with_help(input, help_title, help_text, width) then |
| 585 | // sequence([ | 592 | // sequence([ |
| 586 | // format_CXM_Form_Field(input, lwa, html_tooltip(force_String(help_title), help_text, width)), | 593 | // format_CXM_Form_Field(input, lwa, html_tooltip(force_String(help_title), help_text, width)), |
| @@ -607,7 +614,7 @@ public define HTML_In_Form | @@ -607,7 +614,7 @@ public define HTML_In_Form | ||
| 607 | failure then same, | 614 | failure then same, |
| 608 | success(n) then same(n) | 615 | success(n) then same(n) |
| 609 | }, | 616 | }, |
| 610 | - submit(attrs + [class(htmlClass.class)], button_text), | 617 | + submit(attrs + [class(htmlClass.class + " cxm_submit")], button_text), |
| 611 | action_name, | 618 | action_name, |
| 612 | extra_operands | 619 | extra_operands |
| 613 | ), | 620 | ), |
web/CXM_making_a_web_site.anubis
| @@ -1385,7 +1385,8 @@ public type HTML_In_Form: | @@ -1385,7 +1385,8 @@ public type HTML_In_Form: | ||
| 1385 | li (List(CoreAttrs), HTML_In_Form content), | 1385 | li (List(CoreAttrs), HTML_In_Form content), |
| 1386 | button (List(CoreAttrs), HTML_In_Form content), | 1386 | button (List(CoreAttrs), HTML_In_Form content), |
| 1387 | i (List(CoreAttrs), String text), | 1387 | i (List(CoreAttrs), String text), |
| 1388 | - span (List(CoreAttrs), String text) | 1388 | + span (List(CoreAttrs), String text), |
| 1389 | + hr (List(CoreAttrs)) | ||
| 1389 | . | 1390 | . |
| 1390 | 1391 | ||
| 1391 | 1392 | ||
| @@ -1658,7 +1659,8 @@ public type HTML_Off_Form: | @@ -1658,7 +1659,8 @@ public type HTML_Off_Form: | ||
| 1658 | li (List(CoreAttrs), HTML_Off_Form content), | 1659 | li (List(CoreAttrs), HTML_Off_Form content), |
| 1659 | button (List(CoreAttrs), HTML_Off_Form content), | 1660 | button (List(CoreAttrs), HTML_Off_Form content), |
| 1660 | i (List(CoreAttrs), String text), | 1661 | i (List(CoreAttrs), String text), |
| 1661 | - span (List(CoreAttrs), String text) | 1662 | + span (List(CoreAttrs), String text), |
| 1663 | + hr (List(CoreAttrs)) | ||
| 1662 | . | 1664 | . |
| 1663 | 1665 | ||
| 1664 | 'HTML_Off_Form' defines all the elements you may put outside any form. | 1666 | 'HTML_Off_Form' defines all the elements you may put outside any form. |
| @@ -1867,11 +1869,11 @@ public define HTML_Off_Form | @@ -1867,11 +1869,11 @@ public define HTML_Off_Form | ||
| 1867 | . | 1869 | . |
| 1868 | 1870 | ||
| 1869 | public define HTML_Off_Form | 1871 | public define HTML_Off_Form |
| 1870 | - text | ||
| 1871 | - ( | ||
| 1872 | - String s | ||
| 1873 | - ) = | ||
| 1874 | - text([],s) | 1872 | + text |
| 1873 | + ( | ||
| 1874 | + String s | ||
| 1875 | + )= | ||
| 1876 | + text([], s) | ||
| 1875 | . | 1877 | . |
| 1876 | 1878 | ||
| 1877 | 1879 | ||
| @@ -1892,6 +1894,18 @@ public define HTML_Off_Form | @@ -1892,6 +1894,18 @@ public define HTML_Off_Form | ||
| 1892 | span([], to_decimal(i)) | 1894 | span([], to_decimal(i)) |
| 1893 | . | 1895 | . |
| 1894 | 1896 | ||
| 1897 | +public define HTML_Off_Form | ||
| 1898 | + hr | ||
| 1899 | + = | ||
| 1900 | + hr([]) | ||
| 1901 | +. | ||
| 1902 | + | ||
| 1903 | +public define HTML_In_Form | ||
| 1904 | + hr | ||
| 1905 | + = | ||
| 1906 | + hr([]) | ||
| 1907 | +. | ||
| 1908 | + | ||
| 1895 | - Cell a gap between two other cells : | 1909 | - Cell a gap between two other cells : |
| 1896 | 1910 | ||
| 1897 | public define HTML_Cell(HTML_Off_Form) | 1911 | public define HTML_Cell(HTML_Off_Form) |
| @@ -3513,7 +3527,8 @@ type HTML_Any($T): | @@ -3513,7 +3527,8 @@ type HTML_Any($T): | ||
| 3513 | any_li (List(CoreAttrs), $T content), | 3527 | any_li (List(CoreAttrs), $T content), |
| 3514 | any_button (List(CoreAttrs), $T element), | 3528 | any_button (List(CoreAttrs), $T element), |
| 3515 | any_i (List(CoreAttrs), String text), | 3529 | any_i (List(CoreAttrs), String text), |
| 3516 | - any_span (List(CoreAttrs), String text) | 3530 | + any_span (List(CoreAttrs), String text), |
| 3531 | + any_hr (List(CoreAttrs)) | ||
| 3517 | . | 3532 | . |
| 3518 | 3533 | ||
| 3519 | 3534 | ||
| @@ -3815,8 +3830,6 @@ define URL_or_JavaScript | @@ -3815,8 +3830,6 @@ define URL_or_JavaScript | ||
| 3815 | ) | 3830 | ) |
| 3816 | }. | 3831 | }. |
| 3817 | 3832 | ||
| 3818 | - | ||
| 3819 | - | ||
| 3820 | Now, we format the actioner according to its aspect. | 3833 | Now, we format the actioner according to its aspect. |
| 3821 | 3834 | ||
| 3822 | define List(Text_Option) | 3835 | define List(Text_Option) |
| @@ -4926,9 +4939,11 @@ define Printable_tree | @@ -4926,9 +4939,11 @@ define Printable_tree | ||
| 4926 | ["<i", format_attrs(opts), ">",t,"</i>\n"], | 4939 | ["<i", format_attrs(opts), ">",t,"</i>\n"], |
| 4927 | any_span(opts , t) then | 4940 | any_span(opts , t) then |
| 4928 | ["<span", format_attrs(opts), ">",t,"</span>"] | 4941 | ["<span", format_attrs(opts), ">",t,"</span>"] |
| 4929 | - }. | ||
| 4930 | - | ||
| 4931 | - | 4942 | + any_hr(opts) then |
| 4943 | + ["<hr", format_attrs(opts),">"] | ||
| 4944 | + } | ||
| 4945 | +. | ||
| 4946 | + | ||
| 4932 | 4947 | ||
| 4933 | 4948 | ||
| 4934 | // *** [5.8] Formating 'in form' elements. | 4949 | // *** [5.8] Formating 'in form' elements. |
| @@ -5158,6 +5173,8 @@ define Printable_tree | @@ -5158,6 +5173,8 @@ define Printable_tree | ||
| 5158 | format(cinfo,ic_v,any_i(opts,t),format_element,is_https, action_count, head_tags), | 5173 | format(cinfo,ic_v,any_i(opts,t),format_element,is_https, action_count, head_tags), |
| 5159 | span(opts,t) then | 5174 | span(opts,t) then |
| 5160 | format(cinfo,ic_v,any_span(opts,t),format_element,is_https, action_count, head_tags) | 5175 | format(cinfo,ic_v,any_span(opts,t),format_element,is_https, action_count, head_tags) |
| 5176 | + hr(opts) then | ||
| 5177 | + format(cinfo,ic_v,any_hr(opts),format_element,is_https, action_count, head_tags) | ||
| 5161 | }. | 5178 | }. |
| 5162 | 5179 | ||
| 5163 | 5180 | ||
| @@ -5219,12 +5236,12 @@ define Bool | @@ -5219,12 +5236,12 @@ define Bool | ||
| 5219 | mail_to(m,e) then false, // 'e' may but should not contain an upload | 5236 | mail_to(m,e) then false, // 'e' may but should not contain an upload |
| 5220 | scroller(w,h,cw,ch,e) then contains_an_upload(e), | 5237 | scroller(w,h,cw,ch,e) then contains_an_upload(e), |
| 5221 | actioner(c,t,a,an,eo,ja) then false, | 5238 | actioner(c,t,a,an,eo,ja) then false, |
| 5222 | - foreign_link_new(_,_,_) then false, | 5239 | + foreign_link_new(_,_,_) then false, |
| 5223 | foreign_link(o,u) then false, | 5240 | foreign_link(o,u) then false, |
| 5224 | foreign_link(o,u,n) then false, | 5241 | foreign_link(o,u,n) then false, |
| 5225 | private_download(p,n,e,a) then false, | 5242 | private_download(p,n,e,a) then false, |
| 5226 | - text_input(o,lt,l,n,i,w) then false, | ||
| 5227 | - text_input_ro(o,lt,l,n,i,w) then false, | 5243 | + text_input(o,lt,l,n,i,w) then false, |
| 5244 | + text_input_ro(o,lt,l,n,i,w) then false, | ||
| 5228 | password_input(o,lt,l,n,i,w) then false, | 5245 | password_input(o,lt,l,n,i,w) then false, |
| 5229 | text_area(o,lt,id,n,i,w,h) then false, | 5246 | text_area(o,lt,id,n,i,w,h) then false, |
| 5230 | file_upload(o,l,i,n,w) then true, | 5247 | file_upload(o,l,i,n,w) then true, |
| @@ -5233,7 +5250,7 @@ define Bool | @@ -5233,7 +5250,7 @@ define Bool | ||
| 5233 | selector_c(o,l,i,n,s,c) then false, | 5250 | selector_c(o,l,i,n,s,c) then false, |
| 5234 | selector_c(o,l,i,n,s,c,p) then false, | 5251 | selector_c(o,l,i,n,s,c,p) then false, |
| 5235 | radio_button(o,_,_,n,v,c) then false, | 5252 | radio_button(o,_,_,n,v,c) then false, |
| 5236 | - radio_button_r(o,_,_,n,v,c) then false, | 5253 | + radio_button_r(o,_,_,n,v,c) then false, |
| 5237 | check_box(o,_,_,n,v,c) then false, | 5254 | check_box(o,_,_,n,v,c) then false, |
| 5238 | check_box_r(o,_,_,n,v,c) then false, | 5255 | check_box_r(o,_,_,n,v,c) then false, |
| 5239 | div(o,c) then contains_an_upload(c), | 5256 | div(o,c) then contains_an_upload(c), |
| @@ -5247,7 +5264,8 @@ define Bool | @@ -5247,7 +5264,8 @@ define Bool | ||
| 5247 | li(_,_) then false, | 5264 | li(_,_) then false, |
| 5248 | button(_,_) then false, | 5265 | button(_,_) then false, |
| 5249 | i(_,_) then false, | 5266 | i(_,_) then false, |
| 5250 | - span(_,_) then false | 5267 | + span(_,_) then false, |
| 5268 | + hr(_) then false | ||
| 5251 | } | 5269 | } |
| 5252 | . | 5270 | . |
| 5253 | 5271 | ||
| @@ -5391,7 +5409,10 @@ define Printable_tree | @@ -5391,7 +5409,10 @@ define Printable_tree | ||
| 5391 | i(opts, t) then | 5409 | i(opts, t) then |
| 5392 | format(cinfo,ic_v,any_i(opts,t),format_element,is_https, action_count, head_tags), | 5410 | format(cinfo,ic_v,any_i(opts,t),format_element,is_https, action_count, head_tags), |
| 5393 | span(opts,t) then | 5411 | span(opts,t) then |
| 5394 | - format(cinfo,ic_v,any_span(opts,t),format_element,is_https, action_count, head_tags), | 5412 | + format(cinfo,ic_v,any_span(opts,t),format_element,is_https, action_count, head_tags), |
| 5413 | + hr(opts) then | ||
| 5414 | + format(cinfo,ic_v,any_hr(opts),format_element,is_https, action_count, head_tags), | ||
| 5415 | + | ||
| 5395 | }. | 5416 | }. |
| 5396 | 5417 | ||
| 5397 | 5418 |