1 package Net::Indosoft::Voicebridge;
13 Net::Indosoft::Voicebridge - Interface to Indosoft Voicebridge API
21 our $VERSION = '0.01';
25 use Net::Indosoft::Voicebridge;
27 my $handle = Net::GlobalPOPs::MediaServicesAPI->new(
28 'url' => 'http://your_tag.kanobe.net:8080/vbsoap/voicebridgeAPI.php',
35 Creates a new Net::Indosoft::Voicebridge object.
41 my $class = ref($proto) || $proto;
42 my $self = ref($_[0]) ? shift : { @_ };
44 # my $soap = new SOAP::Lite (
45 # 'service' => $URL.'?wsdl',
47 # $self->{soap} = $soap;
52 #ideally this could be retreived from the WSDL, but hey
53 # or at least derived from the method name?
55 'addAccount' => 'Account',
56 'modifyAccount' => 'Account',
57 'addClient' => 'Client',
58 'modifyClient' => 'Client',
59 'addConference' => 'Conference',
60 'modifyConference' => 'Conference',
63 #this is think they're just on crack. returnning a string to parse inside
64 #a ton of XML? somehow that misses the point.
66 'addAccount' => [ qw( account_id ) ],
67 'modifyAccount' => [ qw( account_id ) ],
68 'addClient' => [ qw( client_id ) ],
69 'modifyClient' => [ qw( client_id ) ],
70 'addConference' => [ qw( conference_id moderator_pin participant_pin ) ],
71 'modifyConference' => [ qw( conference_id ) ],
77 $AUTOLOAD =~ /(^|::)(\w+)$/ or die "unparsable AUTOLOAD: $AUTOLOAD";
79 return if $function eq 'DESTROY';
81 my $uri = "voicebridgeAPI/$function";
86 -> proxy($self->{url})
87 # -> on_action( sub { join '/', @_ } ) #according to the wsdl, right?
88 # -> on_action( sub { "urn:voicebridgeAPI/$function" } )
90 # -> default_ns("urn:voicebridgeAPI")
94 my $obj = $requestobj{$function};
97 my $opts = ref($_[0]) ? shift : { @_ };
99 warn "$_: ". $opts->{$_}. "\n" foreach keys %$opts;
102 $request = SOAP::Data->name( $obj =>
104 map SOAP::Data->name( $_ )->value( $opts->{$_} ), keys %$opts
114 my $som = $soap->call( $function, $request );
116 die $som->faultstring if $som->fault;
117 return { 'error' => $som->faultdetail } if $som->fault;
119 warn Dumper($som->body) if $DEBUG > 1;
121 my $return = $som->valueof("//${function}Response/return");
123 if ( $return =~ /^<errors/i ) {
124 my $rsom = SOAP::Deserializer->deserialize($return);
125 my @errors = $rsom->valueof('//errors/error');
126 return { 'error' => join(' / ', @errors ) } if @errors;
129 if ( $function =~ /^delete/ && $return !~ /Deleted Success?fully/i ) {
130 return { 'error' => 'Deletion unsuccessful',
135 my %return = ( 'return'=>$return );
136 foreach my $rp ( @{ $returnparse{$function} || [] } ) {
137 #are they always numeric?
138 $return =~ /\W$rp\s*=\s*(\d+)/ and $return{$rp} = $1;
146 Pass a list of key=>value pairs or a hash reference:
148 i.account_name: Required Field: Alpha Numeric
149 ii.account_desc: Alpha Numeric
150 iii.account_addr: Alpha Numeric
151 iv.account_city: Alpha Numeric
152 v.account_state: Alpha Numeric
153 vi.account_country: Alpha Numeric
154 vii.account_zip: Alpha Numeric
155 viii.account_phone: Required Field: Alpha Numeric Ex: 123-123-1234
156 ix.account_fax: Alpha Numeric
157 x.account_email: Required Field, have to be in valid email format
158 xi.account_password: Required Field: Alpha Numeric
160 Returns a hash reference with one element, either 'error' for error conditions,
161 or 'account_id' if the account is created sucessfully.
165 Pass a list of key=>value pairs or a hash reference:
167 xiv.account_id: Required Field (Provided when the account was created)
168 xv.account_name: Required Field
175 xxii.account_phone: Required Field
177 xxiv.account_email: Required Field
178 xxv.account_password: Required Field
180 Returns a hash reference with one element, either 'error' for error conditions,
181 or 'account_id' if the account is modified sucessfully.
185 Pass a list of key=>value pairs or a hash reference:
187 account_id: Required Field Alpha Numeric
188 client_contact_name: Required Field Alpha Numeric
189 client_contact_addr Alpha Numeric
190 client_contact_city Alpha Numeric
191 client_contact_state Alpha Numeric
192 client_contact_country Alpha Numeric
193 client_contact_zip Alpha Numeric
194 client_contact_phone: Required Field Alpha Numeric
195 client_contact_fax Alpha Numeric
196 client_contact_email: Required Field Alpha Numeric
197 client_contact_password: Required Field Alpha Numeric
199 Returns a hash reference with one element, either 'error' for error conditions,
200 or 'client_id' if the account is created sucessfully.
204 Pass a list of key=>value pairs or a hash reference:
206 client_id: Required Field
207 account_id: Required Field
208 client_contact_name: Required Field
212 client_contact_country
214 client_contact_phone: Required Field
216 client_contact_email: Required Field
217 client_contact_password: Required Field
219 Returns a hash reference with one element, either 'error' for error conditions,
220 or 'client_id' if the account is modified sucessfully.
224 Pass a list of key=>value pairs or a hash reference:
226 client_id: Required Field Alpha Numeric (Required to associate conference to client, client ID provided when new client is added)
227 conference_name: Required Field Alpha Numeric
228 conference_desc Alpha Numeric
229 start_time: Required Field Alpha Numeric
231 1 ¿ Presentation mode
232 0 ¿ Conversation Mode
233 entry_ann_flag: Integer
244 play_user_cnt_flag: Integer
245 1- Announce number of conference members currently in conference
247 wait_for_admin_flag: Integer
248 1 - Only start conference once admin enters
249 0 ¿ all users without admin
250 stop_on_admin_exit_flag: Integer
251 1 - End conference when admin exits:
253 second_pin_flag: Integer
254 1 - Prompt conference members for a second pin/password when logging in?
255 0 - No Extra conference PIN
256 secondary_pin: Integer
257 If second_pin_flag is 1 also pass the PIN
258 allow_sub_conf: Integer
259 1 ¿ Allow sub conference for this conference
260 0 ¿ Donot Allow sub conference
262 Duration in minutes e.g 30 for 30 minutes
263 conference_type: reservationless/reserved
265 On errors, returns a hash reference with one element, 'error', otherwise
266 returns a hash reference with the following keys: conference_id, moderator_pin
269 =head2 modifyConference
271 Pass a list of key=>value pairs or a hash reference:
273 conference_id: Required Field
274 client_id: Required Field
275 conference_name: Required Field
277 start_time: Required Field
279 1 ¿ Presentation mode
280 0 ¿ Conversation Mode
281 entry_ann_flag: Integer
291 play_user_cnt_flag: Integer
292 1- Announce number of conference members currently in conference
294 wait_for_admin_flag: Integer
295 1 - Only start conference once admin enters
296 0 ¿ all users without admin
297 stop_on_admin_exit_flag: Integer
298 1 - End conference when admin exits:
300 second_pin_flag: Integer
301 1 - Prompt conference members for a second pin/password when logging in?
302 0 - No Extra conference PIN
303 secondary_pin: Integer
304 If second_pin_flag is 1 also pass the PIN
305 allow_sub_conf: Integer
306 1 ¿ Allow sub conference for this conference
307 0 ¿ Donot Allow sub conference
309 Duration in minutes e.g 30 for 30 minutes
311 Returns a hash reference with one element, either 'error' for error conditions,
312 or 'conference_id' if the conference is modified sucessfully.
316 Pass a list of key=>value pairs or a hash reference:
318 i.account_id: Required Field
320 On errors, should returns a hash reference with one element, 'error'.
324 Pass a list of key=>value pairs or a hash reference:
326 ii.client_id: Required Field
328 On errors, should returns a hash reference with one element, 'error'.
330 =head2 deleteConference
332 Pass a list of key=>value pairs or a hash reference:
334 iii.conference_id: Required Field
336 On errors, should returns a hash reference with one element, 'error'.
338 =head1 The services below are not yet documented/online
340 =head2 addConferencePIN
342 =head2 modifyConferencePIN
344 =head2 deleteConferencePIN
354 Ivan Kohler, C<< <ivan-voicebridge at freeside.biz> >>
358 Please report any bugs or feature requests to C<bug-net-indosoft-voicebridge at rt.cpan.org>, or through
359 the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-Indosoft-Voicebridge>. I will be notified, and then you'll
360 automatically be notified of progress on your bug as I make changes.
364 You can find documentation for this module with the perldoc command.
366 perldoc Net::Indosoft::Voicebridge
368 You can also look for information at:
372 =item * RT: CPAN's request tracker
374 L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Indosoft-Voicebridge>
376 =item * AnnoCPAN: Annotated CPAN documentation
378 L<http://annocpan.org/dist/Net-Indosoft-Voicebridge>
382 L<http://cpanratings.perl.org/d/Net-Indosoft-Voicebridge>
386 L<http://search.cpan.org/dist/Net-Indosoft-Voicebridge>
390 =head1 ACKNOWLEDGEMENTS
392 This module was developed by Freeside Internet Services, Inc.
393 If you need a complete, open-source web-based application to manage your
394 customers, conferences, billing and trouble ticketing, please visit
397 Development sponsored by NxxTcom Conferencing. If you need a cost-effective
398 voice, web or video conference, please visit http://www.nxxtcom.net/
400 =head1 COPYRIGHT & LICENSE
402 Copyright (c) 2009 Freeside Internet Services, Inc. <http://freeside.biz/>
405 This program is free software; you can redistribute it and/or modify it
406 under the same terms as Perl itself.