--- op_server.pl 2004-11-04 15:30:38.000000000 -0800 +++ /var/www/html/op_panel-0.19-working/op_server.pl 2004-11-08 20:10:02.000000000 -0800 @@ -90,6 +90,10 @@ my %no_encryption = (); my %total_shapes; my @btninclude = (); +my $outbound_trunk; +my $outbound_context; +my $outbound_exten; +my $outbound_priority; my $PADDING = join( '', @@ -249,6 +253,10 @@ $ren_queuemember = $config->{"GENERAL"}{"rename_queue_member"}; $change_led = $config->{"GENERAL"}{"change_led_agent"}; $cdial_nosecure = $config->{"GENERAL"}{"clicktodial_insecure"}; + $outbound_trunk = $config->{"GENERAL"}{"outbound_trunk"}; + $outbound_context = $config->{"GENERAL"}{"outbound_context"}; + $outbound_exten = $config->{"GENERAL"}{"outbound_exten"}; + $outbound_priority = $config->{"GENERAL"}{"outbound_priority"}; my @todos_los_rooms; foreach my $val ($config) @@ -652,7 +660,7 @@ # swf movie on load, with info about buttons, layout, etc. $/ = "\n"; - my %style_variables; + my %style_variables = {}; my @contextos = (); my @uniq = (); my $contextoactual = ""; @@ -2052,6 +2060,49 @@ } } +sub generate_outbound_call +{ + # requires op_server.cfg entries for + # outbound_trunk = "IAX2/xxxxx@NuFone/"; or "Zap/g2/"; + # outbound_context = "your_context"; + # outbound_exten = "1"; + # outbound_priority = "1"; + + my $mgrCTS = shift; + my $numtodial = shift; + + $numtodial = load_num_to_dial(); + + if ($numtodial ne "") { + my $dial_string = $outbound_trunk . $numtodial; + + $mgrCTS = "Action: Originate\r\n"; + $mgrCTS .= "Channel: $dial_string\r\n"; + $mgrCTS .= "Context: $outbound_context\r\n"; + $mgrCTS .= "Exten: $outbound_exten\r\n"; + $mgrCTS .= "Priority: $outbound_priority\r\n"; + $mgrCTS .= "\r\n"; + + send_command_to_manager($mgrCTS); + log_debug("originate call: $numtodial completed", 128); + + } else { + + log_debug("originate call: $numtodial failed", 128); + + } +} + +sub load_num_to_dial +{ + my $numtodial = shift; + + # add code to lookup number from file/db + $numtodial = "1" . "4088660517"; + + return $numtodial; +} + sub send_initial_status { @@ -2318,6 +2369,7 @@ elsif ($val =~ /QueueStatus/) { $evento = "queuestatus"; } elsif ($val =~ /Link/) { $evento = "link"; } elsif ($val =~ /^Join/) { $evento = "join"; } + elsif ($val =~ /^Gencall/) { $evento = "gencall"; } elsif ($val =~ /^MeetmeJoin/) { $evento = "meetmejoin"; } elsif ($val =~ /^MeetmeLeave/) { $evento = "meetmeleave"; } elsif ($val =~ /^Agentlogin/) { $evento = "agentlogin"; } @@ -2543,6 +2595,12 @@ $evento = ""; } + if ($evento eq "gencall") + { + generate_outbound_call(); + $evento = ""; + } + if ($evento eq "meetmejoin") { my $originate = "no";