Rt & asterisk

hi
good time

i want to join rt(request tracker) to asterisk by rt-soap-server.pl.
but i dont no what to do…

1- i installed-> SOAP::Lite and MIME::Entity
2-after that ,how I run ./rt-soap-server.pl ? And how configure?

hi
good time

i want to join rt(request tracker) to asterisk by rt-soap-server.pl.
but i dont no what to do…

1- i installed-> SOAP::Lite and MIME::Entity
2-after that ,how I run ./rt-soap-server.pl ? And how configure?

rt soap server is rather obsolet, you would better use the REST
interface.

Here we linked asterisk to RT in the following ways:

  • our heldesk dialplan ask for a ticket number
  • if no ticket number is given, asterisk use RESt to create a new RT
    ticket with the requestor set using caller phone and our ldap
    directory
  • if a ticket is found, nothing is done
  • once the call hangup, the conversation recorder is added as a comment
    to the previous exisitng or created ticket.

On RT site, we added the ability to call people by a simple link and
component that tell asterisk via IAX to call the number from the sip
attached to the current rt user. Then again the conversation is attached
to the ticket and timeworked updated.

Easter-eggs Spécialiste GNU/Linux
44-46 rue de l’Ouest - 75014 Paris - France - Métro Gaité
Phone: +33 (0) 1 43 35 00 37 - Fax: +33 (0) 1 43 35 00 76
mailto:elacour@easter-eggs.com - http://www.easter-eggs.com

hi
good time

i want to join rt(request tracker) to asterisk by rt-soap-server.pl.
but i dont no what to do…

1- i installed-> SOAP::Lite and MIME::Entity
2-after that ,how I run ./rt-soap-server.pl ? And how configure?

I recommend to take a look at RT::Client::REST. REST is far easier to deal
with than SOAP.

Sample module using RT::Client::REST:

Regards
Racke

Modern Perl, Dancer and eCommerce consulting.

Thanks…
I want to create a ticket with attachment…(callervoice.gsm)
But according to my search in web I can not use from Rest because when I create ticket, the attach file was not sent with them…
This is important for me that gsm file be created with ticket…

Pls help me…

Thanks…
I want to create a ticket with attachment…(callervoice.gsm)
But according to my search in web I can not use from Rest because when I create ticket, the attach file was not sent with them…
This is important for me that gsm file be created with ticket…

Pls help me…

Thanks…
I want to create a ticket with attachment…(callervoice.gsm)
But according to my search in web I can not use from Rest because when I
create ticket, the attach file was not sent with them…

You need to first create the ticket by rest and retrieve the user Id, then add
a correspondance or comment by rest including your gsm file as attachments. See
sample python code used here attached to this email.

Easter-eggs Spécialiste GNU/Linux
44-46 rue de l’Ouest - 75014 Paris - France - Métro Gaité
Phone: +33 (0) 1 43 35 00 37 - Fax: +33 (0) 1 43 35 00 76
mailto:elacour@easter-eggs.com - http://www.easter-eggs.com

peephonert.py (2.6 KB)

Thanks you…

i tried according to my search in web wrote the following code by php:

<?php $attachment_1 = file_get_contents('/opt/app/test/1.jpg'); $content = "id: 12\n"; $content = $content . "Action: comment\n"; $content = $content . "Text: Im adding some text\n And adding some more text\n And some more\n"; $content = $content . "TimeWorked: 30\n"; $content = $content . "Attachment: 1.jpg\n"; $request = 'http://192.168.1.201/rt/REST/1.0/'; $request .= 'ticket/12/comment'; $postargs = array( 'user' => 'root', 'pass' => 'Nasim1414', 'content' => $content, 'attachment_1' => $attachment_1 ); // get the curl session object $session = curl_init($request); // set the POST options curl_setopt ($session, CURLOPT_POST, true); curl_setopt ($session, CURLOPT_POSTFIELDS, $postargs); curl_setopt($session, CURLOPT_HEADER, true); curl_setopt($session, CURLOPT_RETURNTRANSFER, true); curl_setopt( $session, CURLOPT_HTTPHEADER, array( 'Expect:' ) ); // do the POST and then close the session $response = curl_exec($session); print_r($response); curl_close($session); ?>

But i Do not know Why not run and Gives the following message:

HTTP/1.1 200 OK
Server: Apache/2.4.7 (Ubuntu)
Set-Cookie: RT_SID_tickets.80=53fc8c23dd35759180ae28e5edb2a967; path=/rt; HttpOnly
X-Frame-Options: DENY
Vary: Accept-Encoding
Transfer-Encoding: chunked
Content-Type: text/plain; charset=utf-8

RT/4.0.19 400 Bad Request

No attachment for 1.jpg

please help…

Thanks you…

i tried according to my search in web wrote the following code by php:

<?php $attachment_1 = file_get_contents('/opt/app/test/1.jpg'); $content = "id: 12\n"; $content = $content . "Action: comment\n"; $content = $content . "Text: Im adding some text\n And adding some more text\n And some more\n"; $content = $content . "TimeWorked: 30\n"; $content = $content . "Attachment: 1.jpg\n";

$content = $content . “Attachment: 1\n”;

I guess.

Easter-eggs Spécialiste GNU/Linux
44-46 rue de l’Ouest - 75014 Paris - France - Métro Gaité
Phone: +33 (0) 1 43 35 00 37 - Fax: +33 (0) 1 43 35 00 76
mailto:elacour@easter-eggs.com - http://www.easter-eggs.com

Does not work :frowning: :

HTTP/1.1 200 OK
Server: Apache/2.4.7 (Ubuntu)
Set-Cookie:
RT_SID_tickets.80=18cb22f93510931eb02ea53741f19242;
path=/rt; HttpOnly
X-Frame-Options: DENY
Vary: Accept-Encoding
Transfer-Encoding: chunked
Content-Type: text/plain; charset=utf-8

RT/4.0.19 400 Bad Request

No attachment for 1

Does not work :frowning: :

sorry, no time to debug this now, maybe someone else on this list …

Easter-eggs Spécialiste GNU/Linux
44-46 rue de l’Ouest - 75014 Paris - France - Métro Gaité
Phone: +33 (0) 1 43 35 00 37 - Fax: +33 (0) 1 43 35 00 76
mailto:elacour@easter-eggs.com - http://www.easter-eggs.com

very thankssss…

nobody help me?

very thankssss…

nobody help me?

I suggest to use the Perl module RT::Rest::Client and not trying to hack the content
by your own. Even PHP should have some support for stuff like that.

Regards
Racke

Modern Perl, Dancer and eCommerce consulting.

ok thanks.
in perl:
comment in ticket in create but Without attach…
What to Do?

#!/usr/bin/perl

comment_on_ticket.pl – add comment to an RT ticket.

use strict;
use warnings;
use RT::Client::REST::Ticket;
use Error qw(:try);
use RT::Client::REST;
use RT::Client::REST::Ticket;
use MIME::Entity;
use MIME::Lite;

unless (@ARGV >= 4) {
die “Usage: $0 username password ticket_id comment\n”;
}

my $rt = RT::Client::REST->new(
server => ($ENV{RTSERVER} || ‘http://192.168.1.201/rt’),
);
$rt->login(
username=> shift(@ARGV),
password=> shift(@ARGV),
);

my $attachments_1 = MIME::Lite->new(Type =>‘application/octet-stream’);
$attachments_1->attach(Type => ‘application/octet-stream’,
Path => ‘/pasokh.gsm’,
Filename => ‘pasokh.gsm’,
Disposition => ‘attachment’
);

my $ticket = RT::Client::REST::Ticket->new(
rt => $rt,
id => shift(@ARGV),
);

try {
$ticket->comment(
message => shift(@ARGV),
cc => [qw(info [at] pionfirm)],
attachments_1 => $attachments_1
);
}

catch Exception::Class::Base with {
my $e = shift;
die ref($e), ": ", $e->message || $e->description, “\n”;
};

use Data::Dumper;
print Dumper($ticket);On Wednesday, November 5, 2014 10:01 PM, Shahab Sharifzadeh sshguard@ymail.com wrote:

very thankssss…

nobody help me?

nobody?