Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Announce Channel in AsterNET not Available in ParkAction #228

Open
nirzaf opened this issue Feb 5, 2020 · 7 comments · May be fixed by #229
Open

Announce Channel in AsterNET not Available in ParkAction #228

nirzaf opened this issue Feb 5, 2020 · 7 comments · May be fixed by #229
Labels
bug A bug in the project that needs to be fixed. help wanted (easy) Looking for help with this, the issue should however be simple so anyone can help.

Comments

@nirzaf
Copy link

nirzaf commented Feb 5, 2020

We have up to 5 Parameters Available in Asterisk Check the link below for more details

https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+ManagerAction_Park

Action: Park
ActionID: <value>
Channel: <value>
[TimeoutChannel:] <value>
[AnnounceChannel:] <value>
[Timeout:] <value>
[Parkinglot:] <value>

but in AsterNET ParkAction has only 4 Parameters and [AnnounceChannel:] <value> is not available to provide,
http://asternet.github.io/AsterNET/html/M_AsterNET_Manager_Action_ParkAction__ctor_1.htm

Parameters

  • channel
    • Type: System.String
    • Set the Channel which should be parked
  • channel2
    • Type: System.String
    • Set the Channel where the Call will end up after the timeout is reached.
  • timeout
    • Type: System.String
    • Timeout in msec, after timeout is reached call will come back to channel2
  • parkinglot
    • Type: System.String
    • Set the Parking lot.

because of this issue when I park the call, person in the opponent side hears the parking announcement, Please help if someone knows how to hack this issue

@Deantwo
Copy link
Collaborator

Deantwo commented Feb 5, 2020

Looks like the Park action's parameters changed a lot.
Should be an easy fix code side.

But assuming you are using the NuGet package, you'll have to do a workaround to write the command manually. And I don't remember how to do that with AsterNET, but I assume it is possible.

@nirzaf
Copy link
Author

nirzaf commented Feb 6, 2020

I downloaded the source code and tried to modify it and rebuilt the nuget package locally, All the references are working except Event Handlers
image
Please refer the image above
Please help what could be the issue causing these errors, any idea?

nirzaf pushed a commit to nirzaf/AsterNET that referenced this issue Feb 6, 2020
Announce Channel in AsterNET not Available in ParkAction, fix for this issue AsterNET#228
@nirzaf
Copy link
Author

nirzaf commented Feb 6, 2020

I created an Additional Function Which will support to Add the "AnnounceChannel" Channel as Parameter, please review & merge if that helps, Thank you

@Deantwo
Copy link
Collaborator

Deantwo commented Feb 6, 2020

I downloaded the source code and tried to modify it and rebuilt the nuget package locally, All the references are working except Event Handlers

You downloaded the "master" branch I assume.

Why are you even newing event handlers?
Try just assigning the methods instead, let .Net do the event handlers.

_ami.NewChannel += NewChannel;
_ami.NewExten += ProcessChannel;
_ami.BridgeEnter += BridgeEvent;
_ami.NewState += NewState;

@Deantwo
Copy link
Collaborator

Deantwo commented Feb 6, 2020

I created and Additional Function Which will support to Add the "AnnounceChannel" Channel as Parameter, please review & merge if that helps, Thank you

You only created a constructor and you are attempting to assign to properties that don't exist.
You need to rename the Channel2 property to TimeoutChannel and add the AnnounceChannel property.

Feel free to make a pull request when you have it working.

Edit: Just saw your other commit too. Looks good. Create the pull request and I can review it better.

@Deantwo Deantwo added bug A bug in the project that needs to be fixed. help wanted (easy) Looking for help with this, the issue should however be simple so anyone can help. labels Feb 6, 2020
@Deantwo
Copy link
Collaborator

Deantwo commented Feb 6, 2020

I can see that ParkAction was changed between Asterisk v11 and v12.
I am not sure if we need to support the earlier version too, or how we would support both.

Anyway, make the pull request and we can review it better.

nirzaf pushed a commit to nirzaf/AsterNET that referenced this issue Feb 6, 2020
@Deantwo Deantwo linked a pull request Feb 6, 2020 that will close this issue
@nirzaf
Copy link
Author

nirzaf commented Feb 7, 2020

I found we had 2 methods with 4 string parameters,

public ParkAction(string channel, string channel2, string timeout, string parkinglot)
{
    Channel = channel;
    Channel2 = channel2;
    Timeout = timeout;
    Parkinglot = parkinglot;
}

And

public ParkAction(string callerChannel, string calleeChannel, string announceChannel, string timeout)
{
    Channel = callerChannel;
    TimeoutChannel = calleeChannel;
    AnnounceChannel = announceChannel;
    Timeout = timeout;
}

Since we can't have both methods together, I removed one with the Variable Name Channel2 since it is supporting older version, Is there any way to solve this, or is there any mistake in my understanding?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug in the project that needs to be fixed. help wanted (easy) Looking for help with this, the issue should however be simple so anyone can help.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants