# Sending parameters when using IMediaStreamNameAliasProvider

**URL:** https://community.wowza.com/t/sending-parameters-when-using-imediastreamnamealiasprovider/48845
**Category:** Wowza Developer Dojo
**Created:** [May 26, 2017, 9:20am UTC](https://community.wowza.com/t/sending-parameters-when-using-imediastreamnamealiasprovider/48845 "2017-05-26T09:20:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Will\_Neale1](https://avatars.discourse-cdn.com/v4/letter/w/65b543/32.png) [@Will\_Neale1](https://community.wowza.com/u/Will_Neale1)
#### Post date: [May 26, 2017, 9:20am UTC](https://community.wowza.com/t/sending-parameters-when-using-imediastreamnamealiasprovider/48845/1 "2017-05-26T09:20:34Z")

</div>

I have PlaybackCDN class which is returning the URL from another Wowza server. As you can see I send the token in the URL, but when the play method is called I receive just the stream name, without any token. How can I send the parameters?

```auto
 public class PlaybackCDN extends CDNBase implements IMediaStreamNameAliasProvider{

	private static WMSLogger log = WMSLoggerFactory.getLogger(null);

	

	public void onAppStart(IApplicationInstance appInstance) {

		appStart(appInstance);

		appInstance.setStreamNameAliasProvider(this);

	}

	

	@Override

	public String resolvePlayAlias(IApplicationInstance arg0, String arg1) {

		log.error("In resolvePlayAlias: " + arg1);

		StreamParams params = getParamsFromQuery(arg1);

		

		try {

			streamSource = validatePlaybackURL(params);

		} catch (Exception e) {

			log.error("Error calling the API to get CDN info for" + params.getStreamName() );

			log.error(e.toString());

		}

		

		String sourceUrl = "wowz://" + streamSource.getPlaybackHostname() + ":" + streamSource.getPlaybackPort() + "/" + streamSource.getPlaybackApplicationName() + "?token=" + streamSource.getToken() + "/" + streamSource.getStreamName();

		log.info("resolve source url: "+ sourceUrl);

		

		return sourceUrl;

	}

	@Override

	public String resolveStreamAlias(IApplicationInstance arg0, String arg1) {

		log.error("In resolveStreamAlias: " + arg1);

	

		String sourceUrl = "wowz://" + streamSource.getPlaybackHostname() + ":" + streamSource.getPlaybackPort() + "/" + streamSource.getPlaybackApplicationName() + "?token=" + streamSource.getToken() + "/" + streamSource.getStreamName();

		log.info("resolve source url: "+ sourceUrl);

		

		return sourceUrl;

	}

}

```

---

<div class="post-metadata">

### Author: ![Andy\_Engberson](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/andy_engberson/32/392_2.png) [@Andy\_Engberson](https://community.wowza.com/u/Andy_Engberson)
#### Post date: [June 19, 2017, 2:50am UTC](https://community.wowza.com/t/sending-parameters-when-using-imediastreamnamealiasprovider/48845/2 "2017-06-19T02:50:39Z")

</div>

Hello,

It looks like this question was discussed in a ticket with support.

I am posting the latest suggestion from our developers.

“The best way to add token querystring parameters in your resolvePlayAlias method is to url encode or base64 encode the parameters in the stream name, and then decode them. You will need to ensure that you encode the `?` and `&` characters.”

I hope that helped to resolved the issue.

Regards,

Andy E.
