wml_maybe_call

one of the documented procedures in this installation of the ACS
Usage:
wml_maybe_call {-parse_p 0} phone_number name
What it does:
Add a tag to give user option to call number passed in. If parse_p flag is set we try to parse the phone number and only provide a link if parsing returned a result.
Defined in: /web/philip/tcl/wap-defs.tcl

Source code:

arg_parser_for_wml_maybe_call $args

    if $parse_p {
	set result [util_parse_phone $phone_number]
    } else {
	set result [ns_set new]
	ns_set put $result number $phone_number
    }

    set the_number [ns_set get $result number]

    if [ns_set size $result] {
	set type_i [ns_set find $result type]
	if { $type_i >= 0 && [string compare [ns_set value $result $type_i]  UsTenDigit] == 0 } {
	    return "<a href=\"wtai://wp/mc;$the_number\">call</a>"
	} else {
	    if ![empty_string_p $the_number] {
		return "<a href=\"/wap/phone-tweak.wap?digits=$the_number\">call</a>"
	    }  
	}
    }


philg@mit.edu