$('.sb-media-btn').click(function() {
var send_attachment_bkp = wp.media.editor.send.attachment;
var id = $(this).attr('rel-id');
wp.media.editor.send.attachment = function(props, attachment) {
$('#url_' + id).val(attachment.url);
wp.media.editor.send.attachment = send_attachment_bkp;
}
wp.media.editor.open($(this));
return false;
});