[asterisk-bugs] [JIRA] (ASTERISK-28241) Call pickup with chan_sip fails, if dialed from subroutine, but succeeds withing macro

Kevin Harwell (JIRA) noreply at issues.asterisk.org
Tue Jan 15 11:56:47 CST 2019


    [ https://issues.asterisk.org/jira/browse/ASTERISK-28241?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=245975#comment-245975 ] 

Kevin Harwell commented on ASTERISK-28241:
------------------------------------------

The behavior is different between the two. However, this is because the call pickup matches against the context and extension, and also against the macro context and macro extension. In the application macro case it sets the macro context/exten accordingly and is able to match. In the application gosub case those values on the channel are not set, so it won't match.

I'm going to open this as it sounds like a bug, but at the very least could use further investigation and for sure better documentation (if that's all the comes of this issue).

In the meantime you can use the PICKUPMARK variable and functionality in call pick up as a work around. If you want it to answer the outbound ringing channel though you'll need to use a pre-dial handler to set the variable on the outbound channel. For instance, the below example works when called by both the macro or gosub application:
{noformat}
[globals]
TECH=PJSIP

[macro-extension]
exten => predial_outbound,1,NoOp()
    same => n,Set(PICKUPMARK=${ARG1})
    same => n,Return()

exten => s,1,NoOp()
    same => n,Dial(${TECH}/${ARG1},30,b(macro-extension^predial_outbound^1(${ARG1})))
    same => n,Hangup()

[default]
exten => 101,1,NoOp()
    same => n,Macro(extension,${EXTEN})
    same => n,Hangup()

exten => 102,1,NoOp()
    same => n,GoSub(macro-extension,s,1(${EXTEN}))
    same => n,Hangup()

exten => 201,1,NoOp()
    same => n,Pickup(101 at PICKUPMARK)
    same => n,Hangup()

exten => 202,1,NoOp()
    same => n,Pickup(102 at PICKUPMARK)
    same => n,Hangup()
{noformat}

> Call pickup with chan_sip fails, if dialed from subroutine, but succeeds withing macro
> --------------------------------------------------------------------------------------
>
>                 Key: ASTERISK-28241
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-28241
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Applications/app_directed_pickup, Channels/chan_sip/Subscriptions
>    Affects Versions: 16.1.0, 16.1.1
>            Reporter: Hans-Peter Jansen
>            Severity: Minor
>
> if the extension is dialed from a subroutine, call pickup fails. It succeeds, if extension is dialed from a macro.
> Details:
> Since Asterisk 16, macros are deprecated. After rewriting my dialplan to 
> eliminate macros, call pickups were defective, which has gone unnoticed for 
> some time. Looking at my git logs (yes, I'm managing my asterisk config with 
> git), the only relevant change was moving from macros to subroutines. 
> Here are the relevant dialplan excerpts:
> {noformat}
> [extension]
> ; dial internal extension
> ; ${ARG1}: extension
> exten = start,1,NoOp()
>  same = n,Dial(${ARG1},30)
>  same = n,Hangup()
> [macro-extension]
> ; dial internal extension macro
> ; ${ARG1}: extensions to dial
> exten = s,1,NoOp()
>  same = n,Dial(${ARG1},30)
>  same = n,Hangup()
> [phones]
> ; OK:
> exten = 123,1,Macro(extension,${TEL123})
> [2019-01-12 16:37:12] NOTICE[5013][C-00000002]: app_directed_pickup.c:250 
> pickup_by_exten: SIP/00041323bbf7-00000001 pickup by SIP/00041323463e-00000002
> ; FAIL:
> exten = 123,1,GoSub(extension,start,1(${TEL123}))
> [2019-01-12 16:37:56] NOTICE[5096][C-00000002]: app_directed_pickup.c:365 
> pickup_exec: No target channel found for 123 at internal 
> {noformat}
> Any idea, what could affect this? It looks, like the subroutine Dial() call 
> disrupt the channel contexts somehow. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list