Enabling star codes with Inbound calls going to a Group

I need help figuring out how to enable use of a star-code to transfer an inbound call directed to a Group to a Parking Lot, once it has been answered by a User who is a member of that Group.

I was previously helped by @sduthil to add the tT Call Options to the DialPlan so I could use a star-code (I use blind transfer) to transfer a call I was on to the Parking Lot.

I tested the recommended solution and it worked so I documented it at Keystroke / Softkey setting to send call to Parking Lot .

A simple solution, (the best solutions are often elegantly simple), adding tT via the xivo-subrgbl-user global subroutine with

[xivo-subrgbl-user]
exten = s,1,NoOp(Enabling users to transfer calls using star-codes for Blind or Attended transfer)
same  = n,Set(XIVO_CALLOPTIONS=tT${XIVO_CALLOPTIONS})
same  = n,Return()

I have started this new post and will, when a solution is found, cross-post to that forum entry, but since that post was already marked as solved, I figured it would be best to start a new post.

Unfortunately, my testing at the time must have been limited to internal calls (User to User), or inbound calls going directly to a User, since I am now setting up a production system and discovered that when I try to send a call that came in from outside the system (a DID) and goes through a Group to a User, the solution does NOT work.

If I dial direct to a User, the solution works, but NOT if the call is answered by a Group and then sent to the members of that Group.

As I re-read the documentation, that does make sense.

The DialPlan variable I used to add the tT options to the call was XIVO_CALLOPTIONS and, according to the documentation, that variable is only available to the Agent, Outbound and User subroutines (which explains why it works with User-to-User calls or calls going directly to a User) so when I used the xivo-subrgbl-user global subroutine, those calls worked fine.

But the XIVO_CALLOPTIONS variable is NOT available to the xivo-subrgbl-group and even if I create a custom subroutine and add it to the Group subroutine field, it does not pick up the change to add tT to XIVO_CALLOPTIONS.

So, does anyone have an idea on how I can add the tT options to the DialPlan for calls answered by a Group so when a Group member answers the call, the Group member can use a star code to transfer the call to a Parking Lot?

https://github.com/wazo-platform/xivo-config/blob/master/dialplan/asterisk/extensions_lib_group.conf#L32 Check here the variables.
It’s simply XIVO_GROUPOPTIONS.

@quintana Thank you for the quick reply! Especially on a weekend. ( I think we both need to get a life … :slight_smile: )

I had tried XIVO_GROUPOPTIONS but after getting your reposne, I decided to try it again with a few more permutations.

But no luck.

I think the big issue, is that I don’t know where to put the code. Any suggestions?

For the User code that worked from the suggestion by @sduthil , I had put, into /etc/asterisk/extensions_extra.d/star-codes.conf

[xivo-subrgbl-user]
exten = s,1,NoOp(Enabling users to transfer calls using star-codes for Blind or Attended transfer)
same  = n,Set(XIVO_CALLOPTIONS=tT${XIVO_CALLOPTIONS})
same  = n,NoOp(Enabling online call recording so users can initiate call recording during a call)
same  = n,Set(XIVO_CALLOPTIONS=xX${XIVO_CALLOPTIONS})
same  = n,Set(XIVO_CALLRECORDFILE=)
same  = n,Return()

This caught the User-to-User and Incall-to-User (direct) calls

So my first attempt was to just add the XIVO_GROUPOPTIONS code to that with

[xivo-subrgbl-user]
exten = s,1,NoOp(Enabling users to transfer calls using star-codes for Blind or Attended transfer)
same  = n,Set(XIVO_CALLOPTIONS=tT${XIVO_CALLOPTIONS})
same  = n,Set(XIVO_GROUPOPTIONS=tT${XIVO_GROUPOPTIONS})
same  = n,NoOp(Enabling online call recording so users can initiate call recording during a call)
same  = n,Set(XIVO_CALLOPTIONS=xX${XIVO_CALLOPTIONS})
same  = n,Set(XIVO_GROUPOPTIONS=xX${XIVO_GROUPOPTIONS})
same  = n,Set(XIVO_CALLRECORDFILE=)
same  = n,Return()

However, the documentaiton on XIVO_GROUPOPTIONS says it is used when sending calls to a queue but I am not using a queue. I am creating a group and directing an incall DID to the a group so the Group members all get the call at the same time. I wonder if this is part of the issue?

To try different permuations of XIVO_GROUPOPTIONS, I added to /etc/asterisk/extensions_extra.d/star-codes.conf (at different iterations, NOT all at once) but none made any difference. I did a diaplan reload (asterisk -rx "dialplan reload) each time.

[xivo-subrgbl-group]
exten = s,1,NoOp(Enabling members of a Group to transfer calls using star-codes for Blind or Attended transfer)
same  = n,Set(XIVO_GROUPOPTIONS=tT${XIVO_GROUPOPTIONS})
same  = n,NoOp(Enabling online call recording so members of a Group can initiate call recording during a call)
same  = n,Set(XIVO_GROUPOPTIONS=xX${XIVO_GROUPOPTIONS})
same  = n,Set(XIVO_CALLRECORDFILE=)
same  = n,Return()

[xivo-global-subroutine]
~~~~~ Same content as above ~~~~~

[group]
~~~~~ Same content as above ~~~~~

I added to the Grup subroutine field a and linked it to my subroutine

[use-star-codes-with-groups]
~~~~~ Same content as above ~~~~~

So far, nothing working.

Any suggestions?

You need to check if the dialplan is executed by asterisk. It looks like good to me. I haven’t tested but give me an output of the asterisk cli.

@quintana Which version of the Dialplan looks good (Into which subroutine shuold I put the code?)

@quintana I I have used the final version of the permutationa above where I create my own subroutine and call it by putting the subroutine name into the Group Subroutine field.

My subroutine does get called in the DialPlan and it does update the XIVO_GROUPOPTIONS variable. The XIVO_GROUPOPTIONS originally had iC and when my subroutine was finished it had xXtTiC.

The DTMF signals were all recognized and passed through.

But there was no change.

The DTMF signals were played back but no affect on the status of the call; it was NOT parked.

Entering the exact DTMF codes (I have it on a softkey) worked fine when I directly dialed in to a User or for User-to-User calls.

I do not see an option to attach a file to the post so I do not know how much of the Asterisk CLI you’d like to see. What is your preference?

@quintana The code, when put into the xivo-subrgbl-group subroutine also worked.
By worked, I mean it changed the value of XIVO_GROUPOPTIONS to xXtTiC but it did NOT eanble Transfers when a group member picked up a call that came in through a Group.

am starting to think it may be becasue I am not sending the Group to a Queue. The documentation says the XIVO_GROUPOPTIONS is set before sending to a Queue but I am not sending to a Queue. I am using the Group to Ring All with the Group members directly.

Any chance that is the issue?

@quintana I just confirmed that it is NOT just the star-code to transfer calls. It is also the star-code to record calls (online).

I can transfer and record (online) calls using star codes if I dial user-to-user or if I direct dial into a user.

But I cannot either transfer or record (online) calls using star codes if the call is sent to a Group which Rings all the members and a member (user) picks up the call. At that point, the star codes do not do anything.

The XIVO_GROUPOPTIONS variable is being set in the DialPlan but it is having no effect.

Does this help in any way to think of a fix?

I did not anticipate the issue with Group calling so I actually put this system into production, having tested everything I could think of testing. So any guidance is appreciated.

If there is anything I can be doing to test/research, let me know. Remember, I am NOT at pro at this so give me explicit instructions and I can give it a shot.

@quintana

Now it is getting interesting.

The change to XIVO_GROUPOPTIONS worked for the r option but NOT for the tT or xX options when a call came in to a Group and was answered by a Group member.

All options, r t and x did work when a call came in directly to a user - using the same code in the xivo-subrbgl-user subroutine.

I added 3 things to the DialPlan using the xivo-subrgbl-group context:

  • t to allow transfers
  • xX to allow online recording
  • r to force use of ring not Music on Hold until after the celled party answered

I used the following code in a file called star-codes.conf in /etc/asterisk/extensions_extra.d (with proper permissions and reloading the DialPlan after each change):

[xivo-subrgbl-group]
exten = s,1,NoOp(Enabling members of a Group (Callee=t, NOT Caller=T) to transfer calls using star-codes for Blind or A$
same = n,Set(XIVO_GROUPOPTIONS=t${XIVO_GROUPOPTIONS})
same = n,NoOp(Forcing the system to generate ringing for calling parties until the call is answered = No MoH while awa$
same = n,Set(XIVO_GROUPOPTIONS=r${XIVO_GROUPOPTIONS})
same = n,NoOp(Enabling online call recording so members of a Group can initiate call recording during a call)
same = n,Set(XIVO_GROUPOPTIONS=xX${XIVO_GROUPOPTIONS})
same = n,Set(XIVO_CALLRECORDFILE=)
same = n,Return()

The t and x options did NOT work when a call came in via a Group, even though the value of XIVO_GROUPOPTIONS was xXrtiC after the subroutine above was accessed and iC before the above subroutine was accessed - as monitored by the Asterisk CLI.

The r option DID work for a call coming in via a Group; before adding r , the caller to the Group was getting MoH when they called; after adding r the caller heard ringing until after the call was answered.

The XIVO_GROUPOPTIONS is being recognized and changed within the DialPlan. I can see this in Asterisk CLI and it is proven by the fact that the r option is being reset and recognized. I also did a DumpChan() and saw that the XIVO_GROUPOPTIONS was set to xXrtiC.

So there is something somewhere else that is blocking/overriding the setting of the t and x options when a Group call is processed.

The block is NOT happening at the Trunk or User level since I can dial in using the trunk to the user directly and the t and x options are properly utilized via the XIVO_CALLOPTIONS variable to which I made the exact same changes as I did to the XIVO_GROUPOPTIONS variable.

Does this help with troubleshooting?

@Ramblin, i’m sorry, i’m currently so busy i haven’t checked anything about your use case… But i just take time to reproduce it and i found the issue. We are using the chan_local from Asterisk to dial to users from the queue. The main problem is, you add the feature to the application queue, but we have a dial after without any options. So the call is maintain by the dial and not the queue.

Check here https://github.com/wazo-platform/xivo-config/blob/master/dialplan/asterisk/extensions_lib_user.conf#L226

So if you want to have a result, you need to override this section.

To do that, you need to add a file in /etc/asterisk/extensions_extra.d/group.conf with

[xivo-subrgbl-group]
exten = s,1,NoOp(Enabling members of a Group to transfer calls using star-codes for Blind or Attended transfer)
same  = n,Set(_XIVO_GROUPOPTIONS=tT${XIVO_GROUPOPTIONS})
same  = n,NoOp(Enabling online call recording so members of a Group can initiate call recording during a call)
same  = n,Set(_XIVO_GROUPOPTIONS=xX${XIVO_GROUPOPTIONS})
same  = n,Set(XIVO_CALLRECORDFILE=)
same  = n,Return()

[usersharedlines]
; 32 [0-9a-f] is too long and - are ignored
exten = _[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f].,1,AGI(agi://${XIVO_AGID_IP}/get_user_interfaces,${EXTEN})
same  = n,Dial(${WAZO_USER_INTERFACES},,${XIVO_GROUPOPTIONS})
same  = n,Hangup

Make a dialplan reload.

And it works.

All is now good.

One twist added is that the Set( … commands used an underscore (_) before the name (see above) which had not perviously been done but was required to make this work. I think that treats the name as a RegEx so make sure to include the _ as shown.

Thanks to @quintana and the whole team for this

For the underscore before the variable it’s mandatory because we want to keep this variable on the dialplan after the Queue application is called.