I’ve setup an asterisk server and successfully contected voip phones to asterisk. But phones requies to recieve and send some notify to other phones in call. Currently phones send notify to asterisk but asterisk does not forward that notify to other UAC. Is there a way to forward or recreate notification on-the-fly and send it to other UACs
I’ve also tried to put kamailio in front and wrote a simple client with pjsip but when I make a call from the client I’ve wrote, a unique call-id is generated on the client side for invite method than asterisk create it’s own.
The flow looks like (1) Client → (2) Kamailio → (3) Asterisk → (4) Kamailio → (5) UAC.
So generated callid from client is same until 3rd step. But when asterisk send invite to uac it changes callid which can be seen in step 4. And when I forward notify directly from kamailio after invites has been accepted by clients, pjsip says 481 Call/Transaction Does Not Exist which makes sense since the client does not know the new call-id. Therefore putting kamailio in front to forward notifies did not work either
Also, it is of the nature of the SIP protocol that requests such as NOTIFY can only be sent to a UAS. However, that is OK, because (5) is a UAS, not a UAC in your call flow. ((3) is a UAS on the left and a UAC on the right.)
Okay then, I have tried to send notify with pjsip send notify endpoint command which is triggered by the client and the notification type defined in pjsip_notify.conf. However other side of the call throws error saying 481 Call Leg/Transaction Does Not Exist. Isn’t notifies needs to be separate from the calls and if it is not how can I send a notify accepted by the VoIP phone. Here is the packets
SIP/2.0 481 Call Leg/Transaction Does Not Exist
Call-ID:b6fd0f6e-aad4-4277-b195-7317400012f7
CSeq:48132 NOTIFY
From:sip:{TO_NUMBER}@{ASTERISK_IP};tag=5e0bfdd0-1251-4620-8b10-3d461cbe9686
To:sip:{TO_NUMBER}@{TO_IP};tag=4A59324631353641879A0100
Via:SIP/2.0/UDP {ASTERISK_IP}:5060;rport;branch=z9hG4bKPj0d00d827-71f7-4c83-95cf-4192e1d68812
Content-Length:0
By the way of course the phone sees Call-ID: b6fd0f6e-aad4-4277-b195-7317400012f7 first time with this notify, prior to the notify request phone never encountered with this id
The “pjsip send notify” CLI command sends an unsolicited out of dialog NOTIFY request. It does not support sending one within a call, if that’s required then it won’t work. There’s no support for doing this in Asterisk, adding support would require code changes.
It worked great finally my phone is happy with the coming notify. But how can I query channel-name with endpoint number because PJSIP/NUM apparently not a valid channel name but PJSIP/NUM-0000001 is valid