Question

I am trying to upgrade to the latest version of AsterNet from an old copy of Asterisk.Net. We used to originate calls with AsteriskManager.OriginateCall(), which returned a Call object. That call object had a UniqueId and ChannelName.

Now I'm originating calls with SendAction() and sending it an OriginateAction. So my first question is: is that the right way to do it? Because in the result I get, the UniqueId is null and it doesn't have a ChannelName. I thought channel name might be in an attribute, but Attributes is null, too.

So how do I get the channel name and unique id of a call I have just originated?

Was it helpful?

Solution

Here is how I did it: I created an OriginateAction. In the OriginateAction I set Asynch to true. Then I sent it with SendEventGeneratingAction() with a timeout. I check that the ResponseEvents I get back is not null, that responseEvents.Events.Count > 0, and that responseEvents.Events[0] is OriginateResponseEvent. responseEvents.Events[0] then has all the information I need.

OTHER TIPS

Please consult Action Originate page. Also check source code of you library.

After triggering originate, you get event OriginateResponse which have actoion id info. After that it will spawn more events(depend of version) which give your more info based on actionid.

Other solution is send to originate some variables, after that use in dialplay UserEvent command to return all info you need.

PS. Create dialling core without experience in asterisk is very bad idea, becuase it WILL have issues under load. Use already writed cores or hire expert.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top