[asterisk-bugs] [Asterisk 0017097]: [patch] Pickup with Aastra phones: Unable to find subscription
Asterisk Bug Tracker
noreply at bugs.digium.com
Thu May 27 11:09:57 CDT 2010
A NOTE has been added to this issue.
======================================================================
https://issues.asterisk.org/view.php?id=17097
======================================================================
Reported By: ffossard
Assigned To: dvossel
======================================================================
Project: Asterisk
Issue ID: 17097
Category: Channels/chan_sip/Subscriptions
Reproducibility: always
Severity: major
Priority: normal
Status: feedback
Target Version: 1.6.2.9
Asterisk Version: 1.6.2.6
JIRA: SWP-1179
Regression: No
Reviewboard Link:
SVN Branch (only for SVN checkouts, not tarball releases): N/A
SVN Revision (number only!):
Request Review:
======================================================================
Date Submitted: 2010-03-26 06:14 CDT
Last Modified: 2010-05-27 11:09 CDT
======================================================================
Summary: [patch] Pickup with Aastra phones: Unable to find
subscription
Description:
Hello
With Asterisk 1.6.2, the directed pickup don't works with Aastra phones
(53/55/57/30/31i)
It works good with 1.4, 1.6.0, 1.6.1, but not with 1.6.2
The blf works good.
The pickup works good with "*8 + number".
When I press a blinking button, there is only that in CLI, and no pickup
on the phone:
NOTICE[5161]: chan_sip.c:19843 handle_request_invite: Unable to find
subscription with call-id: fb287af6461e248a
the "sip show subscriptions" command return the good call-id:
localhost*CLI> sip show subscriptions
Peer User Call ID Extension Last
state Type Mailbox Expiry
10.0.0.167 guillaume fb287af6461e248 746 at blf Idle
dialog-info+xml <none> 000360
2 active SIP subscription
Is the call-id truncated? (fb287af6461e248 => fb287af6461e248a )
I can "solve" the problem by replacing this two pieces of 1.6.2 chan_sip
by the same pièces of 1.6.1, this works but it's not a
solution:
1.6.2:
if ((state & AST_EXTENSION_RINGING) && sip_cfg.notifyringing) {
const char *local_display = p->exten;
char *local_target = mto;
/* There are some limitations to how this works. The primary one is that
the
callee must be dialing the same extension that is being monitored. Simply
dialing
the hint'd device is not sufficient. */
if (sip_cfg.notifycid) {
struct ast_channel *caller =
ast_channel_search_locked(find_calling_channel, p);
if (caller) {
int need = strlen(caller->cid.cid_num) + strlen(p->fromdomain) +
sizeof("sip:@");
local_target = alloca(need);
snprintf(local_target, need, "sip:%s@%s", caller->cid.cid_num,
p->fromdomain);
local_display = ast_strdupa(caller->cid.cid_name);
ast_channel_unlock(caller);
caller = NULL;
}
}
/* We create a fake call-id which the phone will send back in an INVITE
Replaces header which we can grab and do some magic with. */
ast_str_append(&tmp, 0,
"<dialog id=\"%s\" call-id=\"pickup-%s\" direction=\"recipient\">\n"
"<remote>\n"
/* See the limitations of this above. Luckily the phone seems to still
be
happy when these values are not correct. */
"<identity display=\"%s\">%s</identity>\n"
"<target uri=\"%s\"/>\n"
"</remote>\n"
"<local>\n"
"<identity>%s</identity>\n"
"<target uri=\"%s\"/>\n"
"</local>\n",
p->exten, p->callid, local_display, local_target, local_target, mto,
mto);
} else {
ast_str_append(&tmp, 0, "<dialog id=\"%s\">\n", p->exten);
}
1.6.1:
if ((state & AST_EXTENSION_RINGING) && global_notifyringing)
ast_str_append(&tmp, 0, "<dialog id=\"%s\" direction=\"recipient\">\n",
p->exten);
else
ast_str_append(&tmp, 0, "<dialog id=\"%s\">\n", p->exten);
1.6.2:
/* Try to find call that we are replacing.
If we have a Replaces header, we need to cancel that call if we succeed
with this call.
First we cheat a little and look for a magic call-id from phones that
support
dialog-info+xml so we can do technology independent pickup... */
if (strncmp(replace_id, "pickup-", 7) == 0) {
struct sip_pvt *subscription = NULL;
replace_id += 7; /* Worst case we are looking at \0 */
if ((subscription = get_sip_pvt_byid_locked(replace_id, NULL, NULL)) ==
NULL) {
ast_log(LOG_NOTICE, "Unable to find subscription with call-id: %s\n",
replace_id);
transmit_response_reliable(p, "481 Call Leg Does Not Exist (Replaces)",
req);
error = 1;
} else {
ast_log(LOG_NOTICE, "Trying to pick up %s@%s\n", subscription->exten,
subscription->context);
ast_copy_string(pickup.exten, subscription->exten,
sizeof(pickup.exten));
ast_copy_string(pickup.context, subscription->context,
sizeof(pickup.context));
sip_pvt_unlock(subscription);
if (subscription->owner) {
ast_channel_unlock(subscription->owner);
}
}
}
/* This locks both refer_call pvt and refer_call pvt's owner!!!*/
if (!error && ast_strlen_zero(pickup.exten) && (p->refer->refer_call =
get_sip_pvt_byid_locked(replace_id, totag, fromtag)) == NULL)
{
ast_log(LOG_NOTICE, "Supervised transfer attempted to replace
non-existent call id (%s)!\n", replace_id);
transmit_response_reliable(p, "481 Call Leg Does Not Exist (Replaces)",
req);
error = 1;
} else {
refer_locked = 1;
}
1.6.1:
/* Try to find call that we are replacing
If we have a Replaces header, we need to cancel that call if we succeed
with this call
*/
if ((p->refer->refer_call = get_sip_pvt_byid_locked(replace_id, totag,
fromtag)) == NULL) {
ast_log(LOG_NOTICE, "Supervised transfer attempted to replace
non-existent call id (%s)!\n", replace_id);
transmit_response_reliable(p, "481 Call Leg Does Not Exist (Replaces)",
req);
error = 1;
} else {
refer_locked = 1;
}
/* At this point, bot the pvt and the owner of the call to be replaced is
locked */
I've searched and found news things about pickup with asterisk 1.6.2:
http://www.mail-archive.com/asterisk-users@lists.digium.com/msg234379.html
http://lists.digium.com/pipermail/asterisk-users/2010-February/244771.html
http://www.asterisk.org/doxygen/asterisk1.6.2/chan__sip_8c.html (search
"Unable to find subscription with call-id" in the page)
Maybe not really a bug, but a significant change which blocks an essential
feature.
======================================================================
----------------------------------------------------------------------
(0122572) ffossard (reporter) - 2010-05-27 11:09
https://issues.asterisk.org/view.php?id=17097#c122572
----------------------------------------------------------------------
Probem solved for Aastra with last firmware 2.6 (may 2010) !
I reported this issue last month in aastra support.
Actually this work with Asterisk 1.6.2.7 (no patch), Aastra 53i with 2.6
firmware, and this config:
sip.conf
[general]
srvlookup=yes
context=internal
port=5060
bindaddr=0.0.0.0
language=fr
localnet=10.0.0.0/255.255.255.0
nat=no
bindport=5060
canreinvite=no
qualify=yes
notifyringing=yes
;notifycid=yes <=== this work with and without this.
notifyhold=yes
notifymimetype=application/simple-message-summary
allowsubscribe=yes
limitonpeers=yes
pedantic=yes
; template
[aastra](!)
type=friend
host=dynamic
nat=no
qualify=yes
canreinvite=no
disallow=all
allow=alaw
call-limit=10
subscribecontext=blf
context=internal
[tel1](aastra)
defaultuser=tel1
callerid=tel1 <101>
secret=secret
[tel2](aastra)
defaultuser=tel2
callerid=tel2 <102>
secret=secret
[tel3](aastra)
defaultuser=tel3
callerid=tel3 <103>
secret=secret
extensions.conf
[general]
[internal]
include => blf
include => pickup
exten => 101,1,Dial(SIP/tel1)
same => n,hangup
exten => 102,1,Dial(SIP/tel2)
same => n,hangup
exten => 103,1,Dial(SIP/tel3)
same => n,hangup
[blf]
exten => 101,hint,SIP/tel1
exten => 102,hint,SIP/tel2
exten => 103,hint,SIP/tel3
[pickup]
exten => _*8.,1,SET(GLOBAL(PICKUPMARK)=${EXTEN:2})
exten => _*8.,n,Pickup(${EXTEN:2}@PICKUPMARK)
exten => _*8.,n,Hangup
CLI:
-- SIP/tel2-0000001c is ringing
== Using SIP RTP CoS mark 5
== Extension Changed 101[blf] new state InUse for Notify User tel2
-- Executing [*8102 at internal:1] Set("SIP/tel1-0000001d",
"GLOBAL(PICKUPMARK)=102") in new stack
== Setting global variable 'PICKUPMARK' to '102'
== Extension Changed 101[blf] new state InUse for Notify User tel3
-- Executing [*8102 at internal:2] Pickup("SIP/tel1-0000001d",
"102 at PICKUPMARK") in new stack
== Extension Changed 101[blf] new state InUse for Notify User tel1
-- Executing [*8102 at internal:3] Hangup("SIP/tel1-0000001d<MASQ>", "") in
new stack
== Spawn extension (internal, *8102, 3) exited non-zero on
'SIP/tel1-0000001d<MASQ>'
-- SIP/tel1-0000001d answered SIP/tel3-0000001b
-- Packet2Packet bridging SIP/tel3-0000001b and SIP/tel1-0000001d
with old 2.5.3 firmware:
-- Called tel2
== Extension Changed 102[blf] new state Ringing for Notify User tel3
== Extension Changed 102[blf] new state Ringing for Notify User tel1
-- SIP/tel2-0000001a is ringing
-- SIP/tel2-0000001a is ringing
== Using SIP RTP CoS mark 5
[May 27 17:41:13] NOTICE[28522]: chan_sip.c:19868 handle_request_invite:
Unable to find subscription with call-id: c7a2a4957ae46e47
Issue History
Date Modified Username Field Change
======================================================================
2010-05-27 11:09 ffossard Note Added: 0122572
======================================================================
More information about the asterisk-bugs
mailing list