[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:
http://www.ietf.org/rfc/rfc3326.txt
See also the knowledge base at the Snom website:
http://kb.snom.com/kb/index.php?View=entry&CategoryID=35&EntryID=72
Googling around I found a patch from Olle:
http://lists.digium.com/pipermail/svn-commits/2007-May/023893.html
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?


Thanks,
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);
   add_blank_header(&resp);
   return send_request(p, &resp, reliable, seqno ? seqno : p->ocseq);
}



More information about the asterisk-dev mailing list