Question about outbound-publish
Hi,
I’m trying to use the outbound-publish feature of pjsip with Kamailio. I’m trying to publish the state of a custom devstate.
My pjsip.conf looks like :
[pub-user]
type=outbound-publish
server_uri=sip : 192.168.100.37
from_uri=sip : 192.168.100.37
expiration=3600
event=dialog
multi_user=yes
@body=application/dialog-info+xml
My extensions.conf :
exten = switch1,hint,Custom:switch1
When I change my devstate, the publish is correctly sent to Kamailio except that the expires of the PUBLISH request is always set to 1 even if I have specified 3600 (which is the default) in my pjsip.conf. Anyway, I have managed this in my kamailio config to modify the expires header before processing the PUBLISH.
So, after I set Custom:switch1 to RINGING the SIP dialog looks like :
<— Transmitting SIP request (756 bytes) to UDP:192.168.100.37:5060 —>
PUBLISH sip:switch1 @ 192.168.100.37 SIP/2.0
Via: SIP/2.0/UDP 192.168.100.37:5080;rport;branch=z9hG4bKPj4b17d9a9-db31-49cf-87dd-11ebe4d989d7
From: <sip:switch1 @ 192.168.100.37>;tag=cd175668-a009-49bf-a4bf-3d6bded7baca
To: <sip:switch1 @ 192.168.100.37>
Call-ID: 1f92cef4-52d5-4c89-8392-85439058eddb
CSeq: 29295 PUBLISH
Event: dialog
SIP-If-Match: a.1506445499.12665.2.0
Expires: 1
Max-Forwards: 70
User-Agent: Asterisk PBX 14.6.0
Content-Type: application/dialog-info+xml
Content-Length: 252
<— Received SIP response (471 bytes) from UDP:192.168.100.37:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.100.37:5080;rport=5080;branch=z9hG4bKPj4b17d9a9-db31-49cf-87dd-11ebe4d989d7;received=192.168.100.37
From: <sip:switch1 @ 192.168.100.37>;tag=cd175668-a009-49bf-a4bf-3d6bded7baca
To: <sip:switch1 @ 192.168.100.37>;tag=b596189c6de9c38f624fd84638f43be6-2d0e
Call-ID: 1f92cef4-52d5-4c89-8392-85439058eddb
CSeq: 29295 PUBLISH
Expires: 1
SIP-ETag: a.1506445499.12666.3.1
Server: kamailio (5.0.3 (x86_64/linux))
Content-Length: 0
Some time after, Asterisk resend a PUBLISH with the ETag found on the last OK :
<— Transmitting SIP request (458 bytes) to UDP:192.168.100.37:5060 —>
PUBLISH sip:switch1 @ 192.168.100.37 SIP/2.0
Via: SIP/2.0/UDP 192.168.100.37:5080;rport;branch=z9hG4bKPj90ae1b54-8315-4692-a2a8-541e01d3ae7c
From: <sip:switch1 @ 192.168.100.37>;tag=fdc7a2da-81a0-45ca-a11b-5dfd65af7a5d
To: <sip:switch1 @ 192.168.100.37>
Call-ID: 1f92cef4-52d5-4c89-8392-85439058eddb
CSeq: 29296 PUBLISH
Event: dialog
SIP-If-Match: a.1506445499.12666.3.1
Expires: 1
Max-Forwards: 70
User-Agent: Asterisk PBX 14.6.0
Content-Length: 0
My question here is why Asterisk is using the ETag of the last packet while it set the expires to 1?
Anyway, Kamailio reply with the following :
SIP/2.0 412 Conditional request failed
Via: SIP/2.0/UDP 192.168.100.37:5080;rport=5080;branch=z9hG4bKPj90ae1b54-8315-4692-a2a8-541e01d3ae7c;received=192.168.100.37
From: <sip:switch1 @ 192.168.100.37>;tag=fdc7a2da-81a0-45ca-a11b-5dfd65af7a5d
To: <sip:switch1 @ 192.168.100.37>;tag=b596189c6de9c38f624fd84638f43be6-dcb1
Call-ID: 1f92cef4-52d5-4c89-8392-85439058eddb
CSeq: 29296 PUBLISH
Server: kamailio (5.0.3 (x86_64/linux))
Content-Length: 0
And every hours, Asterisk keeps sending :
<— Transmitting SIP request (419 bytes) to UDP:192.168.100.37:5060 —>
PUBLISH sip:switch1 @ 192.168.100.37 SIP/2.0
Via: SIP/2.0/UDP 192.168.100.37:5080;rport;branch=z9hG4bKPja39e351e-7851-47ed-a609-f5062762f04e
From: <sip:switch1 @ 192.168.100.37>;tag=8c2c0ed4-c533-42e8-9519-be64cf8bd9e7
To: <sip:switch1 @ 192.168.100.37>
Call-ID: 791ef48e-6e87-442a-a5b8-03af911c06a9
CSeq: 8447 PUBLISH
Event: dialog
Expires: 1
Max-Forwards: 70
User-Agent: Asterisk PBX 14.6.0
Content-Length: 0
And get back :
<— Received SIP response (437 bytes) from UDP:192.168.100.37:5060 —>
SIP/2.0 400 Invalid request
Via: SIP/2.0/UDP 192.168.100.37:5080;rport=5080;branch=z9hG4bKPja39e351e-7851-47ed-a609-f5062762f04e;received=192.168.100.37
From: <sip:switch1 @ 192.168.100.37>;tag=8c2c0ed4-c533-42e8-9519-be64cf8bd9e7
To: <sip:switch1 @ 192.168.100.37>;tag=b596189c6de9c38f624fd84638f43be6-dd6a
Call-ID: 791ef48e-6e87-442a-a5b8-03af911c06a9
CSeq: 8447 PUBLISH
Server: kamailio (5.0.3 (x86_64/linux))
Content-Length: 0
Why Asterisk is sending a PUBLISH with no SIP-If-Match with an empty body ?
Don’t pay attention to the spaces I’ve put in all SIP uri to make the forum happy.
Thank you for your help,
Regards,
Cyrille