Summary:ASTERISK-09374: Group function in Asterisk 1.4.4 fails on Local channels, it didn't in Asterisk 1.4.3
Reporter:Ramon Peek-Fares (ramonpeek)Labels:
Date Opened:2007-05-03 08:21:24Date Closed:2007-07-11 19:58:50
Versions:Frequency of
Environment:Attachments:( 0) extensions.conf
Description:I use the Local channels a lot in combination with the Group function.
What I want is to set a group variable on the incoming call-leg and another on the outgoing call-leg. There are several reasons for doing this in this manner instead of using the call-limit feature, but I will not go into that here...
The dialplan listed under "Steps to Reproduce" is a simple dialplan which can reproduce the fault.
It should create two group variables per call when dialing either extension 900 or 901, this can be shown on the CLI by entering; group show channels.

In asterisk 1.4.3 it's shows correctly;

pbx*CLI> group show channels
Channel                    Group                 Category
SIP/200-08fcbd80           200                   OUTGOING-CALL-LEG
SIP/204-08faca48           204                   INCOMING-CALL-LEG

In asterisk 1.4.4 it only shows the incoming call-leg;

pbx*CLI> group show channels
Channel                    Group                 Category
SIP/204-09747ce8           204                   INCOMING-CALL-LEG

We can safely say it's not working correctly! ;-)

However in my more extensive production dialplan Asterisk actually crashes when I use the Group function like this on 1.4.4. When I only comment the "set(GROUP()=bla" commands, asterisk doesn't crash anymore.
I have not been able to reproduce this with the dialplan listed under "Steps to Reproduce" but thought I should mention this...
It might be related to bug: http://bugs.digium.com/view.php?id=9652

****** STEPS TO REPRODUCE ******

Use this dialplan;
exten = 900,1,Noop(900)
exten = 900,n,Set(GROUP(INCOMING-CALL-LEG)=${CALLERID(number)})
exten = 900,n,Dial(Local/200@local)

exten = 901,1,Noop(901)
exten = 901,n,Set(GROUP(INCOMING-CALL-LEG)=${CALLERID(number)})
exten = 901,n,Dial(Local/201@local)

exten = _X.,1,Noop(${EXTEN})
exten = _X.,n,Dial(SIP/${EXTEN},,M(localconnect^${EXTEN}))

exten = s,1,Noop(Macro localconnec called with argument: ${ARG1})
exten = s,n,Set(GROUP(OUTGOING-CALL-LEG)=${ARG1})
exten = s,n,NoOp(Call answered on channel: ${CHANNEL})
Comments:By: Joshua C. Colp (jcolp) 2007-05-03 10:45:51

I don't see the example dialplan here... can you clarify a bit more? Is it just a simple call comes in, group is set, call goes out through chan_local, group is set?

By: Ramon Peek-Fares (ramonpeek) 2007-05-03 12:51:37

You probably do not have "Advanced view" activated, then you will see the dialplan listed under "Steps To Reproduce" in bugtracker. ;-)

But you are almost right, a call in my example dialplan is ALWAYS placed to a Local channel, when this channel gets connected a macro is run using the M() option of the Dial Command. The Macro then sets the group() on the outbound call leg

I'll add the dialplan as a seperate file as well.
It seems more people use the simple view in the bugtracker and thus never see the field; "Steps to reproduce", it's probably best not to use this field.
Eventhough it's actually ment for this ;-)

By: Joshua C. Colp (jcolp) 2007-05-03 12:54:02

Out of curiosity why aren't you using the OUTBOUND_GROUP variable with Dial?

By: Ramon Peek-Fares (ramonpeek) 2007-05-03 12:59:18

Good question!

When I first started creating the dialplan there we're lots of trouble concerning the Group() function in Asterisk. Too actually achieve the function that I wanted I created this dialplan. Meanwhile OUTBOUND_GROUP should make it possible to achive the same goal, however during connect I currently do alot more then just setting the Group(). So I don't see any need in changing this in my production enviroment. Why change a good thing, huh?

By: Ramon Peek-Fares (ramonpeek) 2007-05-04 02:44:22

For your information;
After a goodnight sleep I realized another two reasons why I'm not using the OUTBOUND_GROUP variable;

- The OUTBOUND_GROUP variable is already set during ringing state, not on connect.

- When dialing multiple devices I only want to set the GROUP() depending on who picked up the call, not on all devices. This is not possible when using OUTBOUND_GROUP

So it I really need to use someting like my example dialplan to make things work.

By: Joshua C. Colp (jcolp) 2007-05-07 16:46:40

Fixed in 1.2 as of revision 63285, 1.4 as of revision 63286, and trunk as of revision 63287.