[asterisk-users] Channel names with semicolons (sending again)

Antony Stone Antony.Stone at asterisk.open.source.it
Wed Sep 7 09:27:47 CDT 2022


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 at 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 at context-00000ce9;1 and Local/number at 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 at 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 at context-00000ce9;2 joined 'simple_bridge' basic-bridge <7e260e93-
abd4-48ea-96f1-33601165dba2>


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


So, is Local/number at 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 at 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 at 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.



More information about the asterisk-users mailing list