Summary:ASTERISK-02458: SIP NOTIFY returned during Supervised Transfer not according to RFC
Reporter:anxer (anxer)Labels:
Date Opened:2004-09-24 08:04:28Date Closed:2004-10-08 20:37:36
Versions:Frequency of
Environment:Attachments:( 0) patch.tar.gz
( 1) traces101.gz
Description:According to RFC 3515 (Page 6)
"......The NOTIFY mechanism defined in [2] MUST be used to inform the agent sending the REFER of the status of the reference.  The dialog identifiers (To, From, and Call-ID) of each NOTIFY must match those of the REFER as they would if the REFER had been a SUBSCRIBE request.
Each NOTIFY MUST contain an Event header field with a value of refer and possibly an id parameter (see Section 2.4.6).
Each NOTIFY MUST contain a body of type "message/sipfrag" [3].
This is not the case for the current 1.0.0 implementation. I traced with ethereal the traces but the Notify doesn't contain this information.


Comments:By: Mark Spencer (markster) 2004-09-25 18:42:38

Can you provide a dump of what Asterisk is sending and what you feel it *should* be sending, within the context of the entire transaction?

By: anxer (anxer) 2004-09-27 08:04:16

For the moment I don't have the dump since I'm away from the lab. I will send it tomorrow morning (GRtime) with the ethereal trace.

I also discovered a problem with the comparison...and I had to make a change (check the output of diff-u), do you think that this is the problem? My fault?
I checked the implementation of the function sending the NOTIFY but it seems to be not with accordance with the draft. My plan is to create a new function called something like sent_supervised_notify (for test in the start) in order to send what it must send.

[root@ios channels]# diff -u chan_sip_old.c chan_sip.c
--- chan_sip_old.c      2004-09-24 17:00:04.000000000 +0300
+++ chan_sip.c  2004-09-27 17:46:41.000000000 +0300
@@ -5081,7 +5081,6 @@
       if (!ast_strlen_zero(tmp5)) {
               /* This is a supervised transfer */
               ast_log(LOG_DEBUG,"Assigning Replace-Call-ID Info %s to REPLACE_
               strncpy(p->refer_to, "", sizeof(p->refer_to) - 1);
               strncpy(p->referred_by, "", sizeof(p->referred_by) - 1);
               strncpy(p->refer_contact, "", sizeof(p->refer_contact) - 1);
@@ -5090,7 +5089,7 @@
               /* Search interfaces and find the match */
               p2 = iflist;
               while(p2) {
-                       if (!strcmp(p2->callid, tmp5)) {
+                       if (!strcmp(p2->callid, p->callid)) {
                               /* Go ahead and lock it (and its owner) before r
eturning */
                               if (p2->owner) {


By: anxer (anxer) 2004-09-29 07:25:52

Hi I uploaded on a gzipped file, the source for chan_sip.c plus the older chan_sip_old.c (based on version 1.0.0) and the diff output.

In brief I added two new functions in order to send the NOTIFY and BYE according to RFC after the notify. The problem was that it was sending the NOTIFY and the BYE with empty headers on specific cases.

I'm still checking it so it is not a closed issue, mainly I'm trying to solve the case for the supervised transfer so for sure more source will be sent to the list.

Please inform me if this is the correct procedure for submitting code, since I'm a newbie ;-)

By: Mark Spencer (markster) 2004-09-29 09:42:26

Please, as I said in my first message, can you provide a dump of what Asterisk is sending and what you feel it should be sending *within the context of the entire SIP dialog or transaction*.  Thanks.

By: Brian West (bkw918) 2004-10-03 11:40:09

Can you please provide what mark is asking for?


By: anxer (anxer) 2004-10-06 13:48:04

Sorry guys for the delayed response I was out of my office the last week. Tomorrow morning I will attach a document with my thoughts and the traces.

Again sorry for the delayed response.


By: Mark Spencer (markster) 2004-10-07 14:51:26

Please update to latest CVS first, I think there were some problems which should now be fixed.

By: anxer (anxer) 2004-10-08 06:23:22

Hi markster, I downloaded the CVS files but I had problems with the builds. I'm resolving the issue but it might take me a while in the meantime please find attached the traces with 1.0.1. I will try to build the CVS but I don't know how much time it will take since it seems that I miss some headers? I wonder why!

By: Mark Spencer (markster) 2004-10-08 14:12:02

I believe this bug to be fixed, but you can reopen it if you continue to see the problem in cvs head (not the stable branch, which probably hasn't been updated yet)