Hi Benny and All,
I have suffered a problem in these days.
When there incoming a subscribe, The on_new_transaction() will be called to create dialog sub list.
dlgsub_head = (struct dlgsub*) dlg->mod_data[mod_evsub.mod.id];
if (dlgsub_head == NULL)
{
// allocate a new dlgsub instance
}
// Point to the first dlgsub in the list..
dlgsub = dlgsub_head->next;
However, we have the following problem..
Please correct me in case of my missunderstand, thanks!
(1) Where the dlg->mod_data[mod_evsub.mod.id] was initialized?
pjsip_dlg_add_usage is the one who initial the dlg->mod_data.
Is that correct?
(2) We found if multiple subscribes were received, the last one will overwrite the previous one in the dlgsub list.
My question was should we allocate a new node once the dlgsub not NULL
dlgsub_head = (struct dlgsub*) dlg->mod_data[mod_evsub.mod.id];
if (dlgsub_head == NULL) {
// allocate new node
}
else
// Allocate new node and attach to the existed list
Champion Wang
Best Regards!
隨身的 Windows Live Messenger 和 Hotmail,不限時地掌握資訊盡在指間 — Windows Live for Mobile
http://3c.msn.com.tw/mobile/
2010/1/13 Wang Eric eric_wanga@hotmail.com:
Hi Benny and All,
I have suffered a problem in these days.
When there incoming a subscribe, The on_new_transaction() will be called to
create dialog sub list.
dlgsub_head = (struct dlgsub*) dlg->mod_data[mod_evsub.mod.id];
if (dlgsub_head == NULL)
{
// allocate a new dlgsub instance
}
// Point to the first dlgsub in the list..
dlgsub = dlgsub_head->next;
However, we have the following problem..
Please correct me in case of my missunderstand, thanks!
(1) Where the dlg->mod_data[mod_evsub.mod.id] was initialized?
pjsip_dlg_add_usage is the one who initial the dlg->mod_data.
Is that correct?
Yes.
(2) We found if multiple subscribes were received, the last one will
overwrite the previous one in the dlgsub list.
My question was should we allocate a new node once the dlgsub not NULL
dlgsub_head = (struct dlgsub*) dlg->mod_data[mod_evsub.mod.id];
if (dlgsub_head == NULL) {
// allocate new node
}
else
// Allocate new node and attach to the existed list
Frankly I'm not sure if we support multiple active SUBSCRIBE sessions.
I think we support more than one SUBSCRIBEs, but as long as there is
only one SUBSCRIBE session is active at one time (the other ones must
have been terminated). This scenario then would be similar to multiple
call transfer attempts (e.g. first transfer attempt fails, then
retry).
Why do you need multiple SUBSCRIBEs btw?
Cheers
Benny
Hi Benny,
Thanks for your valueable input
When there incoming a KPML subscribe first. An UAS KPML subscribe will be created for this.
(i.e. dlgsub point to kpml at this time)
one moment later, user transfer this call. So an UAC REFER subscribe will be created for this.
(the previous kpml dlgsub will be overwritted at this time)
After this, when KPML receive expires=0 packet, the dlgsub will lokk up fail.
After a glanced study of the sip_dialog.h.
I think if we modified the mod_data[] as a list, we might keep the multiple active SUBSCRIBEs session.
void *mod_data[PJSIP_MAX_MODULE]; /**< Module data. */
How to you think, please comment or correct me in caase of my missunderstand.
Best Regards!
Champion Wang Jan 14, 2010
Frankly I'm not sure if we support multiple active SUBSCRIBE sessions.
I think we support more than one SUBSCRIBEs, but as long as there is
only one SUBSCRIBE session is active at one time (the other ones must
have been terminated). This scenario then would be similar to multiple
call transfer attempts (e.g. first transfer attempt fails, then
retry).
Why do you need multiple SUBSCRIBEs btw?
Cheers
Benny
隨身的 Windows Live Messenger 和 Hotmail,不限時地掌握資訊盡在指間 — Windows Live for Mobile
http://3c.msn.com.tw/mobile/
2010/1/14 Wang Eric eric_wanga@hotmail.com:
Hi Benny,
Thanks for your valueable input
When there incoming a KPML subscribe first. An UAS KPML subscribe will be
created for this.
(i.e. dlgsub point to kpml at this time)
one moment later, user transfer this call. So an UAC REFER subscribe will be
created for this.
(the previous kpml dlgsub will be overwritted at this time)
I don't think that is the case. The new session would be appended to
the dlgsub list.
In fact I think I was wrong, and after checking the code again, it
looks like we do support multiple SUBSCRIBE sessions. Multiple
SUBSCRIBE sessions with different event package is supported. If you
need to have multiple SUBSCRIBE sessions with the same event package,
then you will need to enable event ID to distinguish between the
sessions.
After this, when KPML receive expires=0 packet, the dlgsub will lokk up
fail.
After a glanced study of the sip_dialog.h.
I think if we modified the mod_data[] as a list, we might keep the multiple
active SUBSCRIBEs session.
void *mod_data[PJSIP_MAX_MODULE]; /**< Module data. */
How to you think, please comment or correct me in caase of my
missunderstand.
We don't need to change mod_data as list, that will just defeat the
purpose. In fact, we already have dlgsub list to maintain list of
SUBSCRIBE sessions in the dialog, so theoretically we should support
this.
Cheers
Benny
Hi Benny,
Thanks for you help in advance.
Sorry for the unclear information I provided before.
(1) The event ID does exist at out dialog SUBSCRIBEs only. I'm not sure if this is a problem for the scenario we mentioned before.
All the trouble I said before was in dialog KPML and REFER.
(2) The code flow that what I seen was
a. In dialog KPML was received.
evsub0x1003d1a UAS subscription created, using dialog dlg0x10039eb4
b. dlgsub belongs this KPML was allocated by evsub_create()
==== [on_new_transaction()] Subscription lookup info dlg=0x10039eb4 dlgsub=0x1003d564 -----------> Here I dumped the dlgsub instance at on_new_transaction()
c. User transfer the call
evsub0x1003ae8 UAC subscription created, using dialog dlg0x10039eb4
d. A brend new dlgsub was create for this REFER also by evsub_create()
===== [on_new_transaction()] Subscription lookup info dlg=0x10039eb4 dlgsub=0x1004f9f8 -----------> Here I dumped the dlgsub instance at on_new_transaction()
I don't see the 2nd dlgsub (REFER) attached to the 1st dlgsub (KPML). ???
e. Receive the expires=0 KPML packet
====== [on_new_transaction()] Subscription lookup info dlg=0x10039eb4 dlgsub=0x1004f9f8 ------------> The dlgsub list contain the REFER method only.
Subscription Does Not Exist for SUBSCRIBE, event=kpml;id=
Please give me more insight regard this, thanks for your help in advance.
Best Regards!
The roughly packet header FYI..
SUBSCRIBE sip:216756d7-e7a8-4ee9-bf88-80d36ce680b2@192.168.164.88:2048;transport=TCP;x-device=dev00 SIP/2.0
Date: Tue, 12 Jan 2010 18:59:19 GMT
From: sip:1@192.168.164.243;tag=438a4f45-ba20-4b13-bdaf-683a3b596e9f-19842689
Event: kpml
Content-Length: 370
User-Agent:
To: sip:1107@192.168.164.243;tag=7e9c8f51-339c-4f42-a3c4-77ac83997c7e
Contact: sip:192.168.164.243:5060;transport=tcp
Expires: 7200
Content-Type: application/kpml-request+xml
Call-ID: c95d6f5d-2159-41a8-919c-f64fce5af63d
Accept: application/kpml-response+xml
Via: SIP/2.0/TCP 192.168.164.243:5060;branch=z9hG4bK798657aa4fe2
CSeq: 101 SUBSCRIBE
Max-Forwards: 70
---============
REFER sip:1@192.168.164.243:5060;transport=tcp SIP/2.0
Via: SIP/2.0/tcp 192.168.164.88:2048;rport;branch=z9hG4bKPjc0a7fe14-bdb2-4720-a309-8117391e5d89
Max-Forwards: 70
From: sip:1107@192.168.164.243;tag=7e9c8f51-339c-4f42-a3c4-77ac83997c7e
To: sip:1@192.168.164.243;tag=438a4f45-ba20-4b13-bdaf-683a3b596e9f-19842689
Contact: sip:216756d7-e7a8-4ee9-bf88-80d36ce680b2@192.168.164.88:2048;transport=TCP;x-device=dev00;+sip.instance="urn:uuid:00000000-0000-0000-0000-00e0a66658c5";+u.sip!devicename.ccm="ATA00E0A66658C5";+u.sip!model.com="550"
Call-ID: c95d6f5d-2159-41a8-919c-f64fce5af63d
CSeq: 5589 REFER
Event: refer;
Expires: 600
嶄新的 Windows 7:找出適合您的電腦。深入了解。
http://windows.microsoft.com/shop
Hi Benny,
It's me again. Provide some more detail flow that I encountered.
I believe that REFER and KPML are register as Evtsub module to PJSIP core.
Please let me know in case of my miss tracing.
c. User transfer the call
evsub0x1003ae8 UAC subscription created, using dialog dlg0x10039eb4
When the REFER UAC created, we'll get the following log.
dlg0x10039eb4 Module mod-evsub already registered as dialog usage, updating the data 0x100xxx
And the dlgsub_head will be overwrited later by
dlg->mod_data[mod->id] = mod_data;
Please have a look for the flow and let me know anything I lost.
Thanks!
Best Regards!
Champion Wang 01/15/2010
用部落格分享照片、影音、趣味小工具和最愛清單,盡情秀出你自己 — Windows Live Spaces
http://home.spaces.live.com/?showUnauth=1&lc=1028
Hi Benny,
Do you have any idea regard the issue of this?
Please let me know in case of anything unclean or not solid enough.
From my investigation, the pjsip_dlg_add_usage() will overwrite
dlgsub_head once there incoming multiple SUBSCRIBES.
Please correct me in case of my misunderstand.
Thanks!
From: eric_wanga@hotmail.com
To: pjsip@lists.pjsip.org
Date: Fri, 15 Jan 2010 08:33:43 +0800
Subject: Re: [pjsip] Multiple subscribes in a dialog question.
Hi Benny,
It's me again. Provide some more detail flow that I encountered.
I believe that REFER and KPML are register as Evtsub module to PJSIP core.
Please let me know in case of my miss tracing.
c. User transfer the call
evsub0x1003ae8 UAC subscription created, using dialog dlg0x10039eb4
When the REFER UAC created, we'll get the following log.
dlg0x10039eb4 Module mod-evsub already registered as dialog usage, updating the data 0x100xxx
And the dlgsub_head will be overwrited later by
dlg->mod_data[mod->id] = mod_data;
Please have a look for the flow and let me know anything I lost.
Thanks!
Best Regards!
Champion Wang 01/15/2010
Windows Live:幫您向好友通知您在網路上 的最新動向。
用部落格分享照片、影音、趣味小工具和最愛清單,盡情秀出你自己 — Windows Live Spaces
http://home.spaces.live.com/?showUnauth=1&lc=1028
2010/1/19 Wang Eric eric_wanga@hotmail.com:
Hi Benny,
Do you have any idea regard the issue of this?
Please let me know in case of anything unclean or not solid enough.
From my investigation, the pjsip_dlg_add_usage() will overwrite
dlgsub_head once there incoming multiple SUBSCRIBES.
Hi Wang,
I think you're right! Sorry I didn't see this sooner.
Please find attached a patch which hopefully should fix this. It's a
bit difficult for me to test it here, it will be great if you could
try it out and see if it works.
Thanks
Benny
Hi Benny,
It's OK. Actually the patch is perfect for the scenario I mention before.
I've tested your patch on field already.
Appreciate your help and you have do me a great favor indeed.
Best Regards!
Champion Wang Jan 21, 2010
Please find attached a patch which hopefully should fix this. It's a
bit difficult for me to test it here, it will be great if you could
try it out and see if it works.
Thanks
Benny
嶄新的 Windows 7:簡化您的日常工作。找出適合您的電腦。
http://windows.microsoft.com/shop
2010/1/21 Wang Eric eric_wanga@hotmail.com:
Hi Benny,
It's OK. Actually the patch is perfect for the scenario I mention before.
I've tested your patch on field already.
Appreciate your help and you have do me a great favor indeed.
Thanks for letting me know. I've committed it to the latest SVN and
added this: http://trac.pjsip.org/repos/ticket/1029
Cheers
Benny