# Enabling star codes with Inbound calls going to a Group

**URL:** <https://wazo-platform.discourse.group/t/enabling-star-codes-with-inbound-calls-going-to-a-group/365>\
**Category:** Installation/Configuration\
**Created:** [May 2, 2020, 9:01pm UTC](https://wazo-platform.discourse.group/t/enabling-star-codes-with-inbound-calls-going-to-a-group/365 "2020-05-02T21:01:20Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ramblin](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/ramblin/32/34_2.png) [@Ramblin](https://wazo-platform.discourse.group/u/Ramblin)\
**Post date:** [May 2, 2020, 9:01pm UTC](https://wazo-platform.discourse.group/t/enabling-star-codes-with-inbound-calls-going-to-a-group/365/1 "2020-05-02T21:01:20Z")

</div>

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](https://wazo-platform.discourse.group/t/keystroke-softkey-setting-to-send-call-to-parking-lot/190/4) .

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?

---

<div class="post-metadata">

**Author:** ![quintana](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/quintana/32/916_2.png) [@quintana](https://wazo-platform.discourse.group/u/quintana)\
**Post date:** [May 3, 2020, 2:04am UTC](https://wazo-platform.discourse.group/t/enabling-star-codes-with-inbound-calls-going-to-a-group/365/2 "2020-05-03T02:04:00Z")

</div>

[https://github.com/wazo-platform/xivo-config/blob/master/dialplan/asterisk/extensions\_lib\_group.conf#L32](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.

---

<div class="post-metadata">

**Author:** ![Ramblin](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/ramblin/32/34_2.png) [@Ramblin](https://wazo-platform.discourse.group/u/Ramblin)\
**Post date:** [May 3, 2020, 12:09pm UTC](https://wazo-platform.discourse.group/t/enabling-star-codes-with-inbound-calls-going-to-a-group/365/3 "2020-05-03T12:09:13Z")

</div>

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

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?

---

<div class="post-metadata">

**Author:** ![quintana](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/quintana/32/916_2.png) [@quintana](https://wazo-platform.discourse.group/u/quintana)\
**Post date:** [May 3, 2020, 12:44pm UTC](https://wazo-platform.discourse.group/t/enabling-star-codes-with-inbound-calls-going-to-a-group/365/4 "2020-05-03T12:44:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Ramblin](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/ramblin/32/34_2.png) [@Ramblin](https://wazo-platform.discourse.group/u/Ramblin)\
**Post date:** [May 3, 2020, 12:54pm UTC](https://wazo-platform.discourse.group/t/enabling-star-codes-with-inbound-calls-going-to-a-group/365/5 "2020-05-03T12:54:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ramblin](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/ramblin/32/34_2.png) [@Ramblin](https://wazo-platform.discourse.group/u/Ramblin)\
**Post date:** [May 3, 2020, 1:42pm UTC](https://wazo-platform.discourse.group/t/enabling-star-codes-with-inbound-calls-going-to-a-group/365/6 "2020-05-03T13:42:02Z")

</div>

@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?

---

<div class="post-metadata">

**Author:** ![Ramblin](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/ramblin/32/34_2.png) [@Ramblin](https://wazo-platform.discourse.group/u/Ramblin)\
**Post date:** [May 3, 2020, 1:51pm UTC](https://wazo-platform.discourse.group/t/enabling-star-codes-with-inbound-calls-going-to-a-group/365/7 "2020-05-03T13:51:40Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![Ramblin](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/ramblin/32/34_2.png) [@Ramblin](https://wazo-platform.discourse.group/u/Ramblin)\
**Post date:** [May 3, 2020, 2:37pm UTC](https://wazo-platform.discourse.group/t/enabling-star-codes-with-inbound-calls-going-to-a-group/365/8 "2020-05-03T14:37:07Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Ramblin](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/ramblin/32/34_2.png) [@Ramblin](https://wazo-platform.discourse.group/u/Ramblin)\
**Post date:** [May 4, 2020, 8:28pm UTC](https://wazo-platform.discourse.group/t/enabling-star-codes-with-inbound-calls-going-to-a-group/365/9 "2020-05-04T20:28:51Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![Ramblin](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/ramblin/32/34_2.png) [@Ramblin](https://wazo-platform.discourse.group/u/Ramblin)\
**Post date:** [May 4, 2020, 11:15pm UTC](https://wazo-platform.discourse.group/t/enabling-star-codes-with-inbound-calls-going-to-a-group/365/10 "2020-05-04T23:15:15Z")

</div>

@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?

---

<div class="post-metadata">

**Author:** ![quintana](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/quintana/32/916_2.png) [@quintana](https://wazo-platform.discourse.group/u/quintana)\
**Post date:** [May 11, 2020, 11:20pm UTC](https://wazo-platform.discourse.group/t/enabling-star-codes-with-inbound-calls-going-to-a-group/365/12 "2020-05-11T23:20:14Z")

</div>

@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](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.

---

<div class="post-metadata">

**Author:** ![Ramblin](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/ramblin/32/34_2.png) [@Ramblin](https://wazo-platform.discourse.group/u/Ramblin)\
**Post date:** [May 12, 2020, 12:23pm UTC](https://wazo-platform.discourse.group/t/enabling-star-codes-with-inbound-calls-going-to-a-group/365/13 "2020-05-12T12:23:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![quintana](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/quintana/32/916_2.png) [@quintana](https://wazo-platform.discourse.group/u/quintana)\
**Post date:** [May 12, 2020, 12:52pm UTC](https://wazo-platform.discourse.group/t/enabling-star-codes-with-inbound-calls-going-to-a-group/365/14 "2020-05-12T12:52:11Z")

</div>

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.
