[asterisk-dev] Snom missed call / completed elsewhere

Gunnar Schaller linux at nowin.de
Wed Jun 6 01:09:12 MST 2007

Hello list,
I have some Snom phones in a call-group (dialing them together in one
dial-command). However all phones other than the one who answered the
call are recording a missed call. It would be fine to only record a
missed call in the case nobody answered. 
The Snom phones are working as described in RFC 3326:
See also the knowledge base at the Snom website:
Googling around I found a patch from Olle:
Cause I'm using Asterisk 1.2.17 I backported this patch for testing.
That was not difficult. Now the problem: There is no p->owner in
function transmit_request in chan_sip.c at the moment creating the
needed Cancel (with the additional "Reason:" line). As I understand it
p->owner is pointing to an ast_channel. Is the channel structure 
destroyed before calling transmit_request?
The AST_FLAG_ANSWERD_ELSEWHERE is set correctly.
Can someone please help?

Gunnar Schaller

static int transmit_request(struct sip_pvt *p, int sipmethod, int seqno, int reliable, int newbranch)
   struct sip_request resp;

   reqprep(&resp, p, sipmethod, seqno, newbranch);

   if (sipmethod == SIP_CANCEL && p->owner && ast_test_flag(p->owner, AST_FLAG_ANSWERED_ELSEWHERE))
     add_header(&resp, "Reason:", "SIP;cause=200;text=\"Call completed elsewhere\"");

   add_header_contentLength(&resp, 0);
   return send_request(p, &resp, reliable, seqno ? seqno : p->ocseq);

More information about the asterisk-dev mailing list