Hi.

I'm trying to deal with a problem regarding putting a call on hold and then 
later resuming it.  I am using chan_sip throughout, and Asterisk 16.

I have two scenarios:

First (works):

1. An inbound call arrives, the dialplan does not Answer() it.

2. The dialplan performs a Dial() to an external number, and when that gets 
answered, Asterisk automatically bridges the two channels together.  The 
Dial() command includes an F() parameter to call a subroutine when the call 
ends.

3. In this case I get channel names such as SIP/Trunkname-00002ab6 and 
SIP/Trunkname-00002ab7

4. I can then put those channels on hold using the ChannelRedirect() command.

5. I can later resume the conversation (join the channels back together) with 
the Bridge() command.


Second (doesn't work):

1. An Originate command (AMI) is used to tell Asterisk to Dial() out to an 
external number, and the call gets answered.

2. The dialplan then Dial()s out to a second external number, and when that is 
answered, Asterisk automatically bridges the channels together.  The second 
Dial() command also contains an F() parameter to call a subroutine when the 
call ends.

3. In this case I get channel names such as Local/number@context-00000ce9;2 
for the first call and SIP/Trunkname-00002b52 for the second call.

4. When I then put those channels on hold using the ChannelRedirect() command, 
the calls are placed on hold, and then the F() parameter hangup handler is 
immediately called and the calls end.


The main thing which is puzzling me about this is that I see examples of both 
Local/number@context-00000ce9;1 and Local/number@context-00000ce9;2 during the 
processing of the calls.

What is the significance of the number following the semi-colon?

I also see in verbose logging output:

[2022-09-07 09:37:57.310706] pbx VERBOSE[29148]: dial.c:598 in handle_frame: 
Local/number@context-00000ce9;1 answered

[2022-09-07 09:37:57.310792] pbx VERBOSE[29155][C-00001265]: 
bridge_channel.c:2252 in bridge_channel_internal_push_full: Channel 
SIP/Trunkname-00002b55 joined 'simple_bridge' basic-bridge <7e260e93-
abd4-48ea-96f1-33601165dba2>

[2022-09-07 09:37:57.310937] pbx VERBOSE[29149][C-00001265]: 
bridge_channel.c:2252 in bridge_channel_internal_push_full: Channel 
Local/number@context-00000ce9;2 joined 'simple_bridge' basic-bridge <7e260e93-
abd4-48ea-96f1-33601165dba2>


So, when the channel Local/number@context-00000ce9;1 gets answered, the result 
is to bridge the channels Local/number@context-00000ce9;2 and 
SIP/Trunkname-00002b55


So, is Local/number@context-00000ce9;1 some sort of "controlling channel" and 
I should be using this as the parameter to the ChannelRedirect() command, or 
is Local/number@context-00000ce9;2 the "real channel" which is bridged to the 
other call, in which case why does the hangup handler get called when I use 
ChannelRedirect() on this?

Maybe I should only be using Local/number@context-00000ce9 with no semicolon 
suffix in the ChannelRedirect()?


Any advice / guidance / explanation / pointers to documentation welcome :)


Thanks,

-- 
These clients are often infected by viruses or other malware and need to be 
fixed.  If not, the user at that client needs to be fixed...

 - Henrik Nordstrom, on Squid users' mailing list

                                                   Please reply to the list;
                                                         please *don't* CC me.

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
      https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to