[asterisk-users] Trying to send customer mwi updates

Mike Diehl mdiehl at diehlnet.com
Thu Dec 8 23:55:22 CST 2011


Hi all,

I'm trying to send message waiting updates to my phones vai perl and sipsak.

What I've got so far is:

====================================================
#!/usr/bin/perl

$user="phone_login";
$DOMAIN="phone_ip";
$port=phone_port;
$SIP_FROM="Asterisk";
$SIP_SERVER="sipserver.example.com";
$SEQUENCE=1;
$CONTENT_LENGTH=300;
$NEW_MESSAGES=3;
$OLD_MESSAGES=4;
$HAS_NEW=1;

$s .= "NOTIFY sip:${user}@${DOMAIN} SIP/2.0\r\l";
$s .= "From: <sip:${SIP_FROM}@${SIP_SERVER}>\r\l";
$s .= "To: <sip:${user}@${DOMAIN}:${port}>\r\l";
$s .= "Contact: <sip:${user}@${SIP_SERVER}>\r\l";
$s .= "Call-ID: ${SEQUENCE}@${SIP_SERVER}\r\l";
$s .= "CSeq: ${SEQUENCE} NOTIFY\r\l";
$s .= "Event: message-summary\r\l";
$s .= "Content-Type: application/simple-message-summary\r\l";
$s .= "Content-Length: ${CONTENT_LENGTH}\r\l";
$s .= "\r\l";
$s .= "Messages-Waiting: ${HAS_NEW}\r\l";
$s .= "Voicemail: ${NEW_MESSAGES}/${OLD_MESSAGES}\r\l";

open OUT, ">/tmp/x.sip";
print OUT $s;
close OUT;

$result = `/usr/bin/sipsak -s sip\:${user}\@${DOMAIN} -f /tmp/x.sip`;

print "$result\n";
====================================================

What I get as output is:
(type: 3, code: 3): from phone_ip

A sniffer running on my phone's gateway router tells me that it's sending an 
ICMP port unreachable message back to the sip server.

What am I doing wrong?

TIA,


-- 

Take care and have fun,
Mike Diehl.



More information about the asterisk-users mailing list