External MWI

First of all, Long time Asterisk tinkerer, first time forum poster.

I am currently in the process of building a SIP <-> SCCP gateway using Asterisk. I have had to apply a patch based on information located here: http://www.mail-archive.com/sipx-users@list.sipfoundry.org/msg01020.html in order for sipXecs to register to Asterisk (Please note that commenting this line of code out makes this standards compliant. It is currently not standards compliant). Now that I have Asterisk registering, here is my problem:

What I am trying to accomplish here is to have MWI notifications from sipXecs be sent on to the SCCP devices. sipXecs can do MWI notifications two different ways: via a UA SUBSCRIBE to which subsequent NOTIFYs are sent, or via the non-standard unsolicited MWI method.

First of all, here are my releveant sip.conf, sccp.conf, and extensions.conf entries for solicited MWI:

sip.conf:

[general]
register => 200:redacted@sip.corp.ezuce.com/200
mwi => 200:redacted@sip.corp.ezuce.com/200
[sip_proxy200]
type=peer
allowsubscribe=yes
username=200
host=sip.corp.ezuce.com
fromuser=200
realm=sip.corp.ezuce.com
canreinvite=yes
nat=no
context=ext200
usereqphone=yes
directmedia=yes
insecure=very
mailbox=200@SIP_Remote

sccp.conf:

;-----------------------------------------------------------------------------------
; Phone e84040a35e9d
;-----------------------------------------------------------------------------------
[SEPE84040A35E9D](defaultdevice)
devicetype = 7962
description = Test User
button = line, 200
button = empty
button = empty
button = empty
button = empty
button = empty
softkeyset = my_softkeyset

;-----------------------------------------------------------------------------------
; Line 200
;-----------------------------------------------------------------------------------
[200](defaultline)
id = 200
pin = 1234
label = Ext 200
mailbox = 200@SIP_Remote
cid_name = Test User
cid_num = 200
regexten = 200

extensions.conf:

[ext200]
exten => 200,hint,SCCP/200
exten => 200,1,Dial(SCCP/200,120)
exten => 200,h,hangup()
exten => _.,1,Dial(SIP/sip_proxy200/${EXTEN})

With these settings Asterisk cannot ever subscribe. Here is the SIP dialog that happens:

--- (18 headers 3 lines) ---
Retransmitting #1 (no NAT) to 172.16.1.5:5060:
SUBSCRIBE sip:200@sip.corp.ezuce.com SIP/2.0
Via: SIP/2.0/UDP 172.16.1.109:5060;branch=z9hG4bK12a7f622
Max-Forwards: 70
From: "asterisk" <sip:200@172.16.1.109>;tag=as236247f3
To: <sip:200@sip.corp.ezuce.com>
Contact: <sip:200@172.16.1.109:5060>
Call-ID: 12f2aa19793b94d021bc2bfc1a4bb4fa@172.16.1.109:5060
CSeq: 102 SUBSCRIBE
User-Agent: Asterisk PBX 1.8.7.1
Date: Thu, 10 May 2012 15:59:14 GMT
Event: message-summary
Accept: application/simple-message-summary
Expires: 3600
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


---

<--- SIP read from UDP:172.16.1.5:5060 --->
SIP/2.0 401 Unauthorized
Record-Route: <sip:172.16.1.5:5060;lr;x-sipX-done>
From: "asterisk" <sip:200@172.16.1.109>;tag=as236247f3
To: <sip:200@sip.corp.ezuce.com>;tag=M1ZWLc
Call-Id: 12f2aa19793b94d021bc2bfc1a4bb4fa@172.16.1.109:5060
Cseq: 102 SUBSCRIBE
Via: SIP/2.0/UDP 172.16.1.109:5060;branch=z9hG4bK12a7f622
Www-Authenticate: Digest realm="sip.corp.ezuce.com", nonce="d37800372dbd1aa6d2f0a8cf988fb8864fabe5d3", qop="auth"
User-Agent: sipXecs/4.4.0 sipXecs/publisher (Linux)
Date: Thu, 10 May 2012 15:59:15 GMT
Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, SUBSCRIBE
Accept-Language: en
Supported: sip-cc-01, timer
Content-Length: 0

<------------->
--- (14 headers 0 lines) ---
Retransmitting #2 (no NAT) to 172.16.1.5:5060:
SUBSCRIBE sip:200@sip.corp.ezuce.com SIP/2.0
Via: SIP/2.0/UDP 172.16.1.109:5060;branch=z9hG4bK12a7f622
Max-Forwards: 70
From: "asterisk" <sip:200@172.16.1.109>;tag=as236247f3
To: <sip:200@sip.corp.ezuce.com>
Contact: <sip:200@172.16.1.109:5060>
Call-ID: 12f2aa19793b94d021bc2bfc1a4bb4fa@172.16.1.109:5060
CSeq: 102 SUBSCRIBE
User-Agent: Asterisk PBX 1.8.7.1
Date: Thu, 10 May 2012 15:59:14 GMT
Event: message-summary
Accept: application/simple-message-summary
Expires: 3600
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


---

<--- SIP read from UDP:172.16.1.5:5060 --->
SIP/2.0 401 Unauthorized
Record-Route: <sip:172.16.1.5:5060;lr;x-sipX-done>
From: "asterisk" <sip:200@172.16.1.109>;tag=as236247f3
To: <sip:200@sip.corp.ezuce.com>;tag=M1ZWLc
Call-Id: 12f2aa19793b94d021bc2bfc1a4bb4fa@172.16.1.109:5060
Cseq: 102 SUBSCRIBE
Via: SIP/2.0/UDP 172.16.1.109:5060;branch=z9hG4bK12a7f622
Www-Authenticate: Digest realm="sip.corp.ezuce.com", nonce="d37800372dbd1aa6d2f0a8cf988fb8864fabe5d3", qop="auth"
User-Agent: sipXecs/4.4.0 sipXecs/publisher (Linux)
Date: Thu, 10 May 2012 15:59:15 GMT
Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, SUBSCRIBE
Accept-Language: en
Supported: sip-cc-01, timer
Content-Length: 0

This continues indefinitely

If I try to switch to unsolicited MWI by modifying settings on sipX and changing sip.conf to the following:

[general]
register => 200:redacted@sip.corp.ezuce.com/200
[sip_proxy200]
type=peer
allowsubscribe=yes
username=200
host=sip.corp.ezuce.com
fromuser=200
realm=sip.corp.ezuce.com
canreinvite=yes
nat=no
context=ext200
usereqphone=yes
directmedia=yes
insecure=very
unsolicited_mailbox=200

Asterisk receives a NOTIFY with the MWI information, but does nothing with it:

<--- SIP read from UDP:172.16.1.5:5060 --->
NOTIFY sip:200@172.16.1.109:5060;x-sipX-nonat;sipXecs-CallDest=INT SIP/2.0
Record-Route: <sip:172.16.1.5:5060;lr>
Content-Type: application/simple-message-summary
Content-Length: 96
Event: message-summary
Subscription-State: terminated
From: sip:IVR@sip.corp.ezuce.com
To: sip:200@sip.corp.ezuce.com
Call-Id: static-mwi-200@sip.corp.ezuce.com-0017
Cseq: 0 NOTIFY
Contact: <sip:200@sip.corp.ezuce.com;x-sipX-nonat>
User-Agent: sipXecs/4.4.0 sipXecs/publisher (Linux)
Date: Thu, 10 May 2012 16:31:35 GMT
Max-Forwards: 18
Supported: sip-cc-01, timer
Via: SIP/2.0/UDP 172.16.1.5;branch=z9hG4bK-XX-4e3bXo`QXF`CiJNEFS0iKRNZkw~mnBwTcI9y5U3Qp0qUpQvpw
Via: SIP/2.0/UDP 172.16.1.5:5110;branch=z9hG4bK-XX-0505QQQPaDSIvsQG9N0h8kaJ7Q
X-Sipx-Spiral: true

Messages-Waiting: yes
Message-Account: sip:200@sip.corp.ezuce.com
Voice-Message: 1/1 (0/0)

<------------->

Does anyone have any indications what I could be doing wrong? Also, is there a way to view message counts in a mailbox from CLI? I appreciate any help in advance.

Thanks!

Upon further review, I am seeing this for unsolicited MWI:

[code]<— SIP read from UDP:172.16.1.5:5060 —>
NOTIFY sip:200@172.16.1.109:5060;x-sipX-nonat SIP/2.0
Content-Type: application/simple-message-summary
Content-Length: 96
Event: message-summary
Subscription-State: active;expires=300
From: sip:200@sip.corp.ezuce.com;tag=gsLhv9
To: sip:200@sip.corp.ezuce.com;tag=db7b4751baff3771c2bd610594d47477
Call-Id: implied-mwi-72811d456a81f92e51d6692e1913d30b@172.16.1.5
Cseq: 2 NOTIFY
Contact: sip:200@sip.corp.ezuce.com;x-sipX-nonat
User-Agent: sipXecs/4.4.0 sipXecs/publisher (Linux)
Date: Thu, 10 May 2012 17:41:37 GMT
Max-Forwards: 19
Supported: sip-cc-01, timer
Via: SIP/2.0/UDP 172.16.1.5;branch=z9hG4bK-XX-54fahOCUSh_MewUEl7ovZjJfqA
Via: SIP/2.0/UDP 172.16.1.5:5110;branch=z9hG4bK-XX-05832LSNlfHNuqZDb36yjs2A8g

Messages-Waiting: yes
Message-Account: sip:200@sip.corp.ezuce.com
Voice-Message: 2/1 (0/0)

<------------->
— (16 headers 3 lines) —

<— Transmitting (no NAT) to 172.16.1.5:5060 —>
SIP/2.0 481 Call/Transaction Does Not Exist
Via: SIP/2.0/UDP 172.16.1.5;branch=z9hG4bK-XX-54fahOCUSh_MewUEl7ovZjJfqA;received=172.16.1.5
Via: SIP/2.0/UDP 172.16.1.5:5110;branch=z9hG4bK-XX-05832LSNlfHNuqZDb36yjs2A8g
From: sip:200@sip.corp.ezuce.com;tag=gsLhv9
To: sip:200@sip.corp.ezuce.com;tag=db7b4751baff3771c2bd610594d47477
Call-ID: implied-mwi-72811d456a81f92e51d6692e1913d30b@172.16.1.5
CSeq: 2 NOTIFY
Server: Asterisk PBX 1.8.7.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0

<------------>
[/code]

I think you would be better off on the developer mailing list.

Issue filed per request on dev mailing list: https://issues.asterisk.org/jira/browse/ASTERISK-19861

That is the bug tracker, not the developer mailing list.

It seems to me that you have a feature request, and that will not be accepted on the bug tracker.