View | Details | Raw Unified | Return to bug 37582
Collapse All | Expand All

(-)a/C4/SIP/Sip.pm (-7 / +6 lines)
Lines 187-195 sub boolspace { Link Here
187
#
187
#
188
188
189
sub write_msg {
189
sub write_msg {
190
    my ($self, $msg, $server) = @_;
190
    my ( $self, $msg, $server ) = @_;
191
    my $terminator = $server->{account}->{terminator};
191
    my $terminator = $server->{account}->{terminator};
192
    my $encoding = $server->{account}->{encoding};
192
    my $encoding   = $server->{account}->{encoding};
193
193
194
    $terminator ||= q{};
194
    $terminator ||= q{};
195
    $terminator = ( $terminator eq 'CR' ) ? $CR : $CRLF;
195
    $terminator = ( $terminator eq 'CR' ) ? $CR : $CRLF;
Lines 197-219 sub write_msg { Link Here
197
    my $separator = $server->{account}->{convert_nonprinting_characters};
197
    my $separator = $server->{account}->{convert_nonprinting_characters};
198
    $msg =~ s/[^[:print:]]/$separator/g if defined $separator;
198
    $msg =~ s/[^[:print:]]/$separator/g if defined $separator;
199
199
200
    $msg = encode($encoding, $msg) if ( $encoding );
200
    $msg = encode( $encoding, $msg ) if ($encoding);
201
201
202
    my $cksum;
202
    my $cksum;
203
203
204
    # $msg = encode_utf8($msg);
204
    # $msg = encode_utf8($msg);
205
    if ($error_detection) {
205
    if ($error_detection) {
206
        if (defined($self->{seqno})) {
206
        if ( defined( $self->{seqno} ) ) {
207
            $msg .= 'AY' . $self->{seqno};
207
            $msg .= 'AY' . $self->{seqno};
208
        }
208
        }
209
        $msg .= 'AZ';
209
        $msg .= 'AZ';
210
        $cksum = checksum($msg);
210
        $cksum = checksum($msg);
211
        $msg .= sprintf('%04.4X', $cksum);
211
        $msg .= sprintf( '%04.4X', $cksum );
212
    }
212
    }
213
213
214
    STDOUT->autoflush(1);
214
    STDOUT->autoflush(1);
215
    print $msg, $terminator;
215
    print $msg, $terminator;
216
    siplog("LOG_INFO", "OUTPUT MSG: '$msg'");
216
    siplog( "LOG_INFO", "OUTPUT MSG: '$msg'" );
217
217
218
    $last_response = $msg;
218
    $last_response = $msg;
219
}
219
}
220
- 

Return to bug 37582