Open disolaterX opened 3 months ago
That channel ID is a real mess, and while you are escaping it for URL usage, I suspect it is still going to have invalid characters from Asterisk's point of view.
There's a reason we have the rid
package in this library: to construct resource IDs.
newChannelKey := ari.NewKey(ari.ChannelKey, rid.New(rid.Channel))
Then, if you really need to know the timestamp of that, you can get it back with:
ts, err := rid.Timestamp(newChannelKey.ID)
But that will give you a nice, completely valid channel ID with no special characters.
Oh, I think you're trying to pass the new, non-existent channel key into Originate as the first argument. The first argument to Originate is a related channel, from which ari can determine which Asterisk node to schedule it and from which Asterisk can determine how to most advantageously configure the new channel to work with it (such as avoiding transcoding).
See the comment on the Originate
function: https://pkg.go.dev/github.com/CyCoreSystems/ari#Channel
If you don't have a related channel, just pass nil
as the first argument.
here endpoint value is
the same work in dial() in extension but how to achive same where I want to call this
su_15@10.140.0.10
it exist on kamilio(edited for formatting/readability)