[Home]

Summary:ASTERISK-25649: Transfer application does not work with Local channels - documentation misleading
Reporter:Ivan Ullmann (iullmann)Labels:
Date Opened:2015-12-29 17:15:10.000-0600Date Closed:2017-12-18 07:43:14.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Applications/app_transfer Channels/chan_local Documentation
Versions:11.20.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:DevelopmentAttachments:( 0) extensions.conf
( 1) features.conf
( 2) full.asterisk-25649.txt
( 3) sip.conf
( 4) voicemail.conf
Description:When triggering exitcontext logic inside of the VoiceMail application, calls sent to the local channel cannot transfer.

Call Flow:
    1. Incoming call to Asterisk server via SIP
    2. Call is processed appropriately to VoiceMail application via a Dial function to a local channel
    3. Press 0
    4. Call triggers 'toSvcCenter' dialplan logic
    5. Transfer function triggered
    6. Extension exits non-zero on Local channel

{noformat}
 == Using SIP RTP TOS bits 184
 == Using SIP RTP CoS mark 5
   -- Executing [9999999999@sip:1] Wait("SIP/Asterisk_CLE-00000024", "1") in new stack
   -- Executing [9999999999@sip:2] Set("SIP/Asterisk_CLE-00000024", "SIP_CODEC=ulaw") in new stack
   -- Executing [9999999999@sip:3] Set("SIP/Asterisk_CLE-00000024", "GLOBAL(INITIAL_CHANNEL)=SIP/Asterisk_CLE-00000024") in new stack
 == Setting global variable 'INITIAL_CHANNEL' to 'SIP/Asterisk_CLE-00000024'
   -- Executing [9999999999@sip:4] Set("SIP/Asterisk_CLE-00000024", "GLOBAL(INCOMING_SIP_PEER)=10.93.118.12") in new stack
 == Setting global variable 'INCOMING_SIP_PEER' to '10.93.118.12'
   -- Executing [9999999999@sip:5] GotoIf("SIP/Asterisk_CLE-00000024", "0?internal:next1") in new stack
   -- Goto (sip,9999999999,14)
   -- Executing [9999999999@sip:14] GotoIf("SIP/Asterisk_CLE-00000024", "0?external:customer") in new stack
   -- Goto (sip,9999999999,17)
   -- Executing [9999999999@sip:17] Dial("SIP/Asterisk_CLE-00000024", "local/9999999999@Leave_VoiceMail/b,8,r") in new stack
   -- Called local/9999999999@Leave_VoiceMail/b
   -- Executing [9999999999@Leave_VoiceMail:1] VoiceMail("Local/9999999999@Leave_VoiceMail-00000004;2", "9999999999@GVMA_DN,su") in new stack
   -- Local/9999999999@Leave_VoiceMail-00000004;1 answered SIP/Asterisk_CLE-00000024
[Dec 29 18:06:42] NOTICE[19515][C-00000026]: chan_sip.c:7238 try_suggested_sip_codec: Changing codec to 'ulaw' for this call because of ${SIP_CODEC} variable
[Dec 29 18:06:42] NOTICE[19515][C-00000026]: chan_sip.c:7238 try_suggested_sip_codec: Changing codec to 'ulaw' for this call because of ${SIP_CODEC} variable
      > 0x189d30a0 -- Probation passed - setting RTP source address to 10.93.107.65:3794
   -- <Local/9999999999@Leave_VoiceMail-00000004;2> Playing '/var/spool/asterisk/voicemail/GVMA_DN/9999999999/unavail.slin' (language 'en')
   -- <Local/9999999999@Leave_VoiceMail-00000004;2> Playing 'transfer.ulaw' (language 'en')
   -- Executing [o@toSvcCenter:1] BackGround("Local/9999999999@Leave_VoiceMail-00000004;2", "one-moment-please") in new stack
   -- <Local/9999999999@Leave_VoiceMail-00000004;2> Playing 'one-moment-please.ulaw' (language 'en')
   -- Executing [o@toSvcCenter:2] Transfer("Local/9999999999@Leave_VoiceMail-00000004;2", "SIP/ToSvcCenter@10.93.118.12") in new stack
   -- Executing [o@toSvcCenter:3] Hangup("Local/9999999999@Leave_VoiceMail-00000004;2", "") in new stack
 == Spawn extension (toSvcCenter, o, 3) exited non-zero on 'Local/9999999999@Leave_VoiceMail-00000004;2'
 == Spawn extension (sip, 9999999999, 17) exited non-zero on 'SIP/Asterisk_CLE-00000024'
{noformat}

I am unable to perform a Transfer() back on the SIP/Asterisk_CLE-00000024 channel.  My call flow requires a SIP REFER in order to remove this server from call flow.  Dial() works, but the upstream server is expecting to produce a REFER to the originating SIP Server as well, and this results in calls being REFER'd back to Asterisk rather than upstream.
Comments:By: Asterisk Team (asteriskteam) 2015-12-29 17:15:11.915-0600

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Ivan Ullmann (iullmann) 2015-12-29 17:20:34.671-0600

Configuration files for use

By: Rusty Newton (rnewton) 2015-12-30 18:38:42.570-0600

I think I'm missing something here, or being dense.

How do you initiate the transfer and which channel initiates it?

I see the transfer sound byte being played. I'm presuming you are using a features.conf transfer?

Can you post a debug log.. I'll add a comment with the link.

By: Rusty Newton (rnewton) 2015-12-30 18:38:53.493-0600

We require additional debug to continue with triage of your issue. Please follow the instructions on the wiki [1] for how to collect debugging information from Asterisk. For expediency, where possible, attach the debug with a '.txt' file extension so that the debug will be usable for further analysis.

Thanks!

[1] https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information



By: Ivan Ullmann (iullmann) 2016-01-04 09:56:24.427-0600

Logs containing call flow for voicemail

By: Ivan Ullmann (iullmann) 2016-01-04 10:04:50.376-0600

Rusty,

You're not being dense.  I think my explanation doesn't have enough context.

Calls are incoming on the SIP channel from one of my SIP Servers (not Asterisk).  The problem I was experiencing is that sometimes my initiating SIP Server would not receive a 18X progress message or a 200 OK within a 15 second timeout.  To rectify this, I attempted to transfer the incoming SIP channel call to a local channel using the Dial() function.  This allowed me to set a timeout (See extensions.conf line 70).  The problem isn't that the local channel doesn't answer or function.  The problem is that if I press 0 for Operator, the Transfer() function (See line 52) does not send the call back to the SIP channel.  It sends the call to the local channel instead.

Example from the log:
[Jan  4 10:49:12] DEBUG[29631][C-00000001] pbx.c: Launching 'Transfer'
[Jan  4 10:49:12] VERBOSE[29631][C-00000001] pbx.c:     -- Executing [o@toSvcCenter:2] Transfer("Local/6022823054@Leave_VoiceMail-00000001;2", "SIP/ToSvcCenter@10.93.118.12") in new stack
[Jan  4 10:49:12] DEBUG[29631][C-00000001] pbx.c: Launching 'Hangup'
[Jan  4 10:49:12] VERBOSE[29631][C-00000001] pbx.c:     -- Executing [o@toSvcCenter:3] Hangup("Local/6022823054@Leave_VoiceMail-00000001;2", "") in new stack
[Jan  4 10:49:12] DEBUG[29631][C-00000001] channel.c: Soft-Hanging up channel 'Local/6022823054@Leave_VoiceMail-00000001;2'
[Jan  4 10:49:12] DEBUG[29631][C-00000001] pbx.c: Spawn extension (toSvcCenter,o,3) exited non-zero on 'Local/6022823054@Leave_VoiceMail-00000001;2'
[Jan  4 10:49:12] VERBOSE[29631][C-00000001] pbx.c:   == Spawn extension (toSvcCenter, o, 3) exited non-zero on 'Local/6022823054@Leave_VoiceMail-00000001;2'

I am not using a features.conf transfer to the best of my knowledge.  I don't have anything configured there to do so.  Additionally, I have had this operating previously.  It was once I added Dial() that it stopped performing the transfer.

Additionally, I have provided the features.conf file for your perusal.

Thank you,
-Ivan


By: Rusty Newton (rnewton) 2016-01-05 19:59:45.531-0600

I understand now. I'm not sure why the Local channel doesn't work with Transfer. It may be because the Local channel itself has two legs and the remote party to ;2 is ;1 (the suffixes used on the Local channels).

I tested with
{noformat}
[from_internal]
exten = 100,1,Dial(LOCAL/999@another_context/b,8,r)

[another_context]
exten = 999,1,Voicemail(1234)

[transfer_context]
exten = o,1,Transfer(SIP/BOB)
{noformat}

I saw the same behavior as you did. I'm not sure if this is a bug or not. Feels like one but I'll have a developer take a look. Based on documentation I think this is a bug.


As a work around - Is there a particular reason why you are using Transfer?

If you Dial the other SIP channel directly, once that end answers then the Local channel should optimize itself out of the way (leaving the two SIP channels bridged).



By: Rusty Newton (rnewton) 2016-01-05 20:30:22.590-0600

I talked with [~jcolp] Looks like the Local channel technology does not implement the necessary transfer callback. So,  Local channel technology will not work with the Transfer application.
{quote}
Requests the remote caller be transferred to a given destination. If TECH (SIP, IAX2, LOCAL etc) is used, only an incoming call with the same channel technology will be transferred. Note that for SIP, if you transfer before call is setup, a 302 redirect SIP message will be returned to the caller.
{quote}

The documentation pretty much says that you can use Local channel tech with the application. We should fix that at least.



By: Ivan Ullmann (iullmann) 2016-01-06 09:15:33.194-0600

Rusty,

That also doesn't match with documentation respecting the local channel for version 11.  From https://wiki.asterisk.org/wiki/display/AST/Local+Channel+Modifiers :

•'b' - This option causes the Local channel to return the actual channel that is behind it when queried. This is useful for transfer scenarios as the actual channel will be transferred, not the Local channel.
This option is available starting in the Asterisk 1.6.0 branch and was removed in Asterisk 12.

My call flow requires that I remove the Asterisk SIP Server from call flow (via REFER) so that the upstream SIP Server can also remove itself from call flow (via REFER as well).  This allows me to return the call to my routing SIP Server so that I can send it on to my service center (as the label implies).  So while I do agree that Dial() does work appropriately, it is not an appropriate mechanism for transfer based on my call flow needs.

Is this something where this functionality truly unsupportable, or is this something that will possibly be addressed and I should look for a new release at some point?  If this isn't something that can be done, is there another mechanism where I can intercept a request to apply the VoiceMail() application and add a timer so that I can produce an alternative action if it doesn't respond appropriately in a timeframe?

Thank you,
-Ivan


By: Ivan Ullmann (iullmann) 2016-01-15 11:18:10.909-0600

Rusty,

Was my previous line of thinking appropriate or am I just out of luck?

Thank you,
-Ivan

By: Joshua C. Colp (jcolp) 2017-12-18 06:39:33.478-0600

Updating documentation.

As for your comment - that change for chan_local was for externally initiated transfers, not for app_transfer. There's never been any support for app_transfer with chan_local from what I can tell and no real support for initiating a REFER from Asterisk when a Local channel is in the mix.

By: Friendly Automation (friendly-automation) 2017-12-18 07:43:15.568-0600

Change 7619 merged by George Joseph:
app_transfer: Remove LOCAL from documentation.

[https://gerrit.asterisk.org/7619|https://gerrit.asterisk.org/7619]

By: Friendly Automation (friendly-automation) 2017-12-18 07:43:17.229-0600

Change 7621 merged by George Joseph:
app_transfer: Remove LOCAL from documentation.

[https://gerrit.asterisk.org/7621|https://gerrit.asterisk.org/7621]

By: Friendly Automation (friendly-automation) 2017-12-18 07:43:18.891-0600

Change 7620 merged by George Joseph:
app_transfer: Remove LOCAL from documentation.

[https://gerrit.asterisk.org/7620|https://gerrit.asterisk.org/7620]