diff --git a/asterisk/ami.anubis b/asterisk/ami.anubis index b290f4e..43d355c 100644 --- a/asterisk/ami.anubis +++ b/asterisk/ami.anubis @@ -9,15 +9,11 @@ read system/string.anubis read tools/basis.anubis read tools/connections.anubis +read calexium_lib/web/CXM_http_get_common.anubis -read asterisk/ami_types.anubis -read asterisk/ami_commands.anubis -read web/CXM_http_get_common.anubis +transmit calexium_lib/asterisk/ami_types.anubis +transmit calexium_lib/asterisk/ami_commands.anubis - - - public define Result( - define Maybe(One) receive ( @@ -116,6 +112,7 @@ public define Maybe(Asterisk_client) String server_name, AMI_Auth auth )= + //println("asterisk_new_client "+server_name); if separate_name_port(server_name, 5038) is (name, server_port) then // // resolve server name and call 'https_get' with numeric server address: @@ -153,7 +150,7 @@ public define Maybe(Asterisk_client) failure. -global define One + global define One ami_test ( List(String) args diff --git a/asterisk/ami_commands.anubis b/asterisk/ami_commands.anubis index 1bc1803..35e0840 100644 --- a/asterisk/ami_commands.anubis +++ b/asterisk/ami_commands.anubis @@ -6,7 +6,7 @@ * */ -read asterisk/ami_types.anubis +read calexium_lib/asterisk/ami_types.anubis public define AMI_Action ami_login(String user, String password, Bool events) = action("Login", [ @@ -32,3 +32,20 @@ public define AMI_Action ami_originate_call(String extension, String out_number) ] ) . + +public define AMI_Action + ami_originate_call + ( + String extension, + String out_number, + String context + )= + action("Originate", [ + key_value("Channel", "SIP/"+extension), + key_value("Exten", out_number), + key_value("Context", context), + key_value("Priority", "1"), + key_value("Async", "yes") + ] + ) +. diff --git a/web/CXM_form.anubis b/web/CXM_form.anubis index 2f55e4d..fa478bd 100644 --- a/web/CXM_form.anubis +++ b/web/CXM_form.anubis @@ -226,6 +226,7 @@ public type CXM_Form_Field: div (List(CoreAttrs), HTML_In_Form content), partial (HTML_Partial_Content p_content), br, + hr (List(CoreAttrs) options), // input_with_help (CXM_Form_Field field, // Maybe(String) help_title, // String help_text, @@ -384,7 +385,12 @@ public define CXM_Form_Field )= hidden(html_Id(""), web_arg_name, value). - +public define CXM_Form_Field + hr + = + hr([]) +. + //--- explanation field --------------------- // ////////////////////////////////////////////////////////// @@ -580,7 +586,8 @@ public define HTML_In_Form div(options, e) then div(options, e), partial(p_content) then partial(p_content), - br then br, + br then br, + hr(opts) then hr(opts), // input_with_help(input, help_title, help_text, width) then // sequence([ // format_CXM_Form_Field(input, lwa, html_tooltip(force_String(help_title), help_text, width)), @@ -607,7 +614,7 @@ public define HTML_In_Form failure then same, success(n) then same(n) }, - submit(attrs + [class(htmlClass.class)], button_text), + submit(attrs + [class(htmlClass.class + " cxm_submit")], button_text), action_name, extra_operands ), diff --git a/web/CXM_making_a_web_site.anubis b/web/CXM_making_a_web_site.anubis index 861df62..54725eb 100644 --- a/web/CXM_making_a_web_site.anubis +++ b/web/CXM_making_a_web_site.anubis @@ -1385,7 +1385,8 @@ public type HTML_In_Form: li (List(CoreAttrs), HTML_In_Form content), button (List(CoreAttrs), HTML_In_Form content), i (List(CoreAttrs), String text), - span (List(CoreAttrs), String text) + span (List(CoreAttrs), String text), + hr (List(CoreAttrs)) . @@ -1658,7 +1659,8 @@ public type HTML_Off_Form: li (List(CoreAttrs), HTML_Off_Form content), button (List(CoreAttrs), HTML_Off_Form content), i (List(CoreAttrs), String text), - span (List(CoreAttrs), String text) + span (List(CoreAttrs), String text), + hr (List(CoreAttrs)) . 'HTML_Off_Form' defines all the elements you may put outside any form. @@ -1867,11 +1869,11 @@ public define HTML_Off_Form . public define HTML_Off_Form - text - ( - String s - ) = - text([],s) + text + ( + String s + )= + text([], s) . @@ -1892,6 +1894,18 @@ public define HTML_Off_Form span([], to_decimal(i)) . +public define HTML_Off_Form + hr + = + hr([]) +. + +public define HTML_In_Form + hr + = + hr([]) +. + - Cell a gap between two other cells : public define HTML_Cell(HTML_Off_Form) @@ -3513,7 +3527,8 @@ type HTML_Any($T): any_li (List(CoreAttrs), $T content), any_button (List(CoreAttrs), $T element), any_i (List(CoreAttrs), String text), - any_span (List(CoreAttrs), String text) + any_span (List(CoreAttrs), String text), + any_hr (List(CoreAttrs)) . @@ -3815,8 +3830,6 @@ define URL_or_JavaScript ) }. - - Now, we format the actioner according to its aspect. define List(Text_Option) @@ -4926,9 +4939,11 @@ define Printable_tree ["",t,"\n"], any_span(opts , t) then ["",t,""] - }. - - + any_hr(opts) then + ["