#!/usr/bin/perl

# SIProvaSIP.pl
# mangle with SIP stuff
# Rocco Lucia <rlucia@iscanet.com>

$pid = open(SIPSAK, "-|");
if(!$pid) {
  open(SIPSAK,"|sipsak -n  -v -l 34999 -G -f - -s sip:phone1\@10.0.0.66") || die "I will die\n"; 
  printf SIPSAK <<EOF;
NOTIFY sip:phone1\@10.0.0.66 SIP/2.0
Via: SIP/2.0/UDP 10.0.0.2:5060;branch=z9hG4bKWy3Di7iee
From: "asterisk" <sip:asterisk\@10.0.0.2>;tag=4686b5b0
To: "phone1" <sip:phone1\@10.0.0.66>
Contact: "asterisk" <sip:asterisk\@10.0.0.2>
Call-ID: qPHqkuzHAP24\@10.0.0.2
CSeq: 1149 NOTIFY
User-Agent: Asterisk PBX
Event: message-summary
Content-Type: application/simple-message-summary
Content-Length: 37

Messages-Waiting: yes
Voicemail: 3/2
EOF
}
